[igt-dev] [PATCH i-g-t v2 2/4] lib/igt_dummyload: use gem_mmap__cpu and gem_mmap__wc when applicable

Lukasz Kalamarz lukasz.kalamarz at intel.com
Fri Jan 11 15:37:43 UTC 2019


We had some duplicates in code that are using direct call to
__gem_mmap__cpu or __gem_mmap__wc and then assert it result, which is what
gem_mmap__cpu and gem_mmap__wc is taking care for us.
v2: Rebased and reordered this patch in series

Signed-off-by: Lukasz Kalamarz <lukasz.kalamarz at intel.com>
Cc: Michal Winiarski <michal.winiarski at intel.com>
Cc: Katarzyna Dec <katarzyna.dec at intel.com>
Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio at intel.com>
Cc: Chris Wilson <chris at chris-wilson.co.uk>
---
 lib/igt_dummyload.c | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/lib/igt_dummyload.c b/lib/igt_dummyload.c
index 2027a4b7..982906f2 100644
--- a/lib/igt_dummyload.c
+++ b/lib/igt_dummyload.c
@@ -148,14 +148,13 @@ emit_recursive_batch(igt_spin_t *spin,
 
 		if (__gem_set_caching(fd, spin->poll_handle,
 				      I915_CACHING_CACHED) == 0)
-			spin->running = __gem_mmap__cpu(fd, spin->poll_handle,
-							0, 4096,
-							PROT_READ | PROT_WRITE);
+			spin->running = gem_mmap__cpu(fd, spin->poll_handle,
+						      0, 4096,
+						      PROT_READ | PROT_WRITE);
 		else
-			spin->running = __gem_mmap__wc(fd, spin->poll_handle,
-						       0, 4096,
-						       PROT_READ | PROT_WRITE);
-		igt_assert(spin->running);
+			spin->running = gem_mmap__wc(fd, spin->poll_handle,
+						     0, 4096,
+						     PROT_READ | PROT_WRITE);
 		igt_assert_eq(*spin->running, 0);
 
 		*batch++ = MI_STORE_DWORD_IMM | (gen < 6 ? 1 << 22 : 0);
-- 
2.17.2



More information about the igt-dev mailing list