diff mbox

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

Message ID 1418746515-24773-8-git-send-email-thierry.reding@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Thierry Reding Dec. 16, 2014, 4:15 p.m. UTC
From: Thierry Reding <treding@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@nvidia.com>
---
 drivers/gpu/drm/tegra/gem.c | 2 ++
 1 file changed, 2 insertions(+)
diff mbox

Patch

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;
 }