[igt-dev] [PATCH i-g-t 2/2] tests/i915/gem_exec_flush: Require mapapble aperture when needed

Antonio Argenziano antonio.argenziano at intel.com
Wed Jan 29 19:29:14 UTC 2020


The test goes through multiple mapping so require mappable aperture when
going through GTT. Also use any coherent mapping not just GTT.

Signed-off-by: Antonio Argenziano <antonio.argenziano at intel.com>
Cc: Chris Wilson <chris at chris-wilson.co.uk>
Cc: Vinay Belgaumkar <vinay.belgaumkar at intel.com>
---
 tests/i915/gem_exec_flush.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/tests/i915/gem_exec_flush.c b/tests/i915/gem_exec_flush.c
index 28708460..778bc18c 100644
--- a/tests/i915/gem_exec_flush.c
+++ b/tests/i915/gem_exec_flush.c
@@ -152,9 +152,10 @@ static void run(int fd, unsigned ring, int nchild, int timeout,
 			       I915_GEM_DOMAIN_WC,
 			       I915_GEM_DOMAIN_WC);
 
-		/* Prepara a mappable binding to prevent pread mighrating */
+		/* Prepare a mappable binding to prevent pread migrating */
 		if (!snoop) {
-			ptr = gem_mmap__gtt(fd, obj[0].handle, 4096, PROT_READ);
+			ptr = gem_mmap__device_coherent(fd, obj[0].handle, 0,
+							4096, PROT_READ);
 			igt_assert_eq_u32(ptr[0], 0xabcdabcd);
 			munmap(ptr, 4096);
 		}
@@ -357,6 +358,9 @@ static void batch(int fd, unsigned ring, int nchild, int timeout,
 {
 	const int gen = intel_gen(intel_get_drm_devid(fd));
 
+	if (mode == BATCH_GTT)
+		gem_require_mappable_ggtt(fd);
+
 	if (flags & CMDPARSER) {
 		int cmdparser = -1;
                 drm_i915_getparam_t gp;
-- 
2.21.0



More information about the igt-dev mailing list