summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGurchetan Singh <gurchetansingh@chromium.org>2017-09-19 15:10:58 -0700
committerchrome-bot <chrome-bot@chromium.org>2017-09-27 23:52:09 -0700
commit5af202315b9e595a007e74f67dbc0d521c2aa05d (patch)
treea58e1ccd546422136b361b6516a60bd917359b96
parent254dbb19c49fad4ab4f28b2d1f2982bd10bb7c0b (diff)
minigbm: i915: use I915_MMAP_WC in certain cases
The Zero Latency Ink app is scanned out while the buffer is being updated (by design). The buffer update is racy with the display, leading to artifacts. Calling clflush on the buffer, even only on the rectangle specified by gralloc (*lock), makes no difference. As a result, let's map the buffer as uncached when it's being scanned out (we do the same thing on ARM). Let's make sure not affect renderscript buffers, since certain renderscript CTS tests require caching. BUG=chromium:762324 TEST=no overlay artifacts while using Zero Latency Ink app on Eve. Change-Id: I6f79dc8e48deee441790f737aba79c7f79ca4cb9 Reviewed-on: https://chromium-review.googlesource.com/665390 Commit-Ready: Gurchetan Singh <gurchetansingh@chromium.org> Tested-by: Gurchetan Singh <gurchetansingh@chromium.org> Reviewed-by: David Reveman <reveman@chromium.org>
-rw-r--r--i915.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/i915.c b/i915.c
index a16050f..3f811d9 100644
--- a/i915.c
+++ b/i915.c
@@ -430,6 +430,9 @@ static void *i915_bo_map(struct bo *bo, struct map_info *data, size_t plane, int
struct drm_i915_gem_mmap gem_map;
memset(&gem_map, 0, sizeof(gem_map));
+ if ((bo->flags & BO_USE_SCANOUT) && !(bo->flags & BO_USE_RENDERSCRIPT))
+ gem_map.flags = I915_MMAP_WC;
+
gem_map.handle = bo->handles[0].u32;
gem_map.offset = 0;
gem_map.size = bo->total_size;