From 7848d214729a366eca937a63ec8ea025988203d2 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Tue, 27 Jan 2015 09:38:34 +0000 Subject: [PATCH] igt/gem_tiled_wc: Use correct offsets A last moment "tidification" in commit 5e9fac54918e424d928bc15b90e4c65d4cfdd356 Author: Chris Wilson Date: Thu Jan 22 07:52:09 2015 +0000 igt/gem_tiled_wc: Fix! Finish! wreaked havoc again. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=88816 Signed-off-by: Chris Wilson --- tests/gem_tiled_wc.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/gem_tiled_wc.c b/tests/gem_tiled_wc.c index 15e7fa5a..f7053781 100644 --- a/tests/gem_tiled_wc.c +++ b/tests/gem_tiled_wc.c @@ -175,7 +175,6 @@ igt_simple_main first_page = offset & ~(PAGE_SIZE-1); last_page = (offset + len + PAGE_SIZE) & ~(PAGE_SIZE-1); - offset -= first_page; linear = gem_mmap__wc(fd, handle, first_page, last_page - first_page, PROT_READ); igt_assert(linear); @@ -226,7 +225,7 @@ igt_simple_main igt_debug("Checking offset %d swizzled %s -> %d\n", j, swizzle_str, swizzled_offset); expected_val = calculate_expected(swizzled_offset); - found_val = linear[j / 4]; + found_val = linear[(j - first_page)/ 4]; igt_assert_f(expected_val == found_val, "Bad read [%d]: %d instead of %d at 0x%08x " "for read from 0x%08x to 0x%08x, swizzle=%s\n",