[PATCH i-g-t] igt/gem_mmap_gtt: Check for known incoherency before testing

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



We test map_gtt coherency (whether or not a write via the mmap_gtt is
immediately visible in the backing storage to a read via mmap_cpu) but
we know that several platforms are inherently incorrect and require some
form of hammer to workaround internal delays. These platforms break our
ABI guarantees and so we report the change in ABI via a driver getparam.

If we know the platform doesn't meet the ABI guarantee, skip the test.
If it is meant to work, test!

Signed-off-by: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx>
Cc: Joonas Lahtinen <joonas.lahtinen@xxxxxxxxxxxxxxx>
---
 tests/gem_mmap_gtt.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/tests/gem_mmap_gtt.c b/tests/gem_mmap_gtt.c
index c8a0bedec..f63535556 100644
--- a/tests/gem_mmap_gtt.c
+++ b/tests/gem_mmap_gtt.c
@@ -309,6 +309,18 @@ test_write_gtt(int fd)
 	munmap(src, OBJECT_SIZE);
 }
 
+static bool is_coherent(int i915)
+{
+	int val = 1; /* by default, we assume GTT is coherent, hence the test */
+	struct drm_i915_getparam gp = {
+		gp.param = 52, /* GTT_COHERENT */
+		gp.value = &val,
+	};
+
+	ioctl(i915, DRM_IOCTL_I915_GETPARAM, &gp);
+	return val;
+}
+
 static void
 test_coherency(int fd)
 {
@@ -316,6 +328,7 @@ test_coherency(int fd)
 	uint32_t *gtt, *cpu;
 	int i;
 
+	igt_require(is_coherent(fd));
 	igt_require(igt_setup_clflush());
 
 	handle = gem_create(fd, OBJECT_SIZE);
-- 
2.18.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux