[i-g-t,3/6] lib/igt_dummyload: use gem_mmap__cpu and gem_mmap__wc when applicable

Submitted by Kalamarz, Lukasz on Jan. 9, 2019, 5:40 p.m.

Details

Message ID 20190109174057.16835-3-lukasz.kalamarz@intel.com
State Accepted
Commit ef9665ceb9dd6385bd8971284f00ba4e5b6add73
Headers show
Series "Series without cover letter" ( rev: 1 ) in IGT

Not browsing as part of any series.

Commit Message

Kalamarz, Lukasz Jan. 9, 2019, 5:40 p.m.
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.

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

Patch hide | download patch | download mbox

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