[PATCH 7/8] drm/tegra: gem: Flush buffer objects upon allocation

Thierry Reding thierry.reding at gmail.com
Tue Dec 16 08:15:14 PST 2014


From: Thierry Reding <treding at nvidia.com>

Buffers obtained via shmem may still have associated cachelines. If they
aren't properly flushed they may cause framebuffer corruption if the
cache gets flushed after the application has drawn to it.

Signed-off-by: Thierry Reding <treding at nvidia.com>
---
 drivers/gpu/drm/tegra/gem.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/tegra/gem.c b/drivers/gpu/drm/tegra/gem.c
index da32086cbeaf..9a12adf708db 100644
--- a/drivers/gpu/drm/tegra/gem.c
+++ b/drivers/gpu/drm/tegra/gem.c
@@ -231,6 +231,8 @@ static int tegra_bo_get_pages(struct drm_device *drm, struct tegra_bo *bo,
 		return PTR_ERR(bo->sgt);
 	}
 
+	drm_clflush_sg(bo->sgt);
+
 	return 0;
 }
 
-- 
2.1.3



More information about the dri-devel mailing list