igt-dev.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [Intel-gfx] [PATCH i-g-t] igt/gem_mmap_gtt: Check for known incoherency before testing
@ 2018-07-20  8:07 Chris Wilson
  2018-07-20  8:44 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Chris Wilson @ 2018-07-20  8:07 UTC (permalink / raw)
  To: intel-gfx; +Cc: igt-dev

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@chris-wilson.co.uk>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
---
 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@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-07-20 15:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-07-20  8:07 [Intel-gfx] [PATCH i-g-t] igt/gem_mmap_gtt: Check for known incoherency before testing Chris Wilson
2018-07-20  8:44 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2018-07-20 10:39 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2018-07-20 15:39 ` [Intel-gfx] [igt-dev] [PATCH i-g-t] " Tvrtko Ursulin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).