[Bug 92845] [BSW clflush] igt/gem_partial_pwrite_pread subtests fail

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Fri Nov 6 10:04:04 PST 2015


https://bugs.freedesktop.org/show_bug.cgi?id=92845

--- Comment #4 from Chris Wilson <chris at chris-wilson.co.uk> ---
For posterity:

diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 3adb163..3187e97 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -517,9 +517,15 @@ shmem_pread_fast(struct page *page, int shmem_page_offset,
int page_length,
                return -EINVAL;

        vaddr = kmap_atomic(page);
-       if (needs_clflush)
-               drm_clflush_virt_range(vaddr + shmem_page_offset,
-                                      page_length);
+       if (needs_clflush) {
+               unsigned long start = (unsigned long)vaddr + shmem_page_offset;
+               unsigned long end = start + page_length;
+
+               start = round_down(start, 256);
+               end = round_up(end, 256);
+
+               drm_clflush_virt_range((void *)start, end - start);
+       }

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are on the CC list for the bug.
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/intel-gfx-bugs/attachments/20151106/ae962122/attachment.html>


More information about the intel-gfx-bugs mailing list