All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH i-g-t] tests/gem_exec_basic: don't use gem_require_ring to check ring availability
@ 2016-01-29  9:21 daniele.ceraolospurio
  2016-01-29 10:58 ` Chris Wilson
  2016-02-01 14:24 ` [PATCH i-g-t] tests/gem_exec_params: test all valid execution flags daniele.ceraolospurio
  0 siblings, 2 replies; 8+ messages in thread
From: daniele.ceraolospurio @ 2016-01-29  9:21 UTC (permalink / raw)
  To: intel-gfx

From: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>

gem_require_ring will submit an execbuf using the provided flags and
skip the test if the ioctl fails. This test is however designed to catch
issues with the ioctl, so it should fail if the ioctl fails on a ring
that the HW possesses.

Instead of using gem_require_ring we can use the getparam ioctl. The new
checker has been added to the test file and not to the commmon library
because this test is the only special case where we want to not use
gem_has_ring

Cc: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
---
 tests/gem_exec_basic.c | 30 +++++++++++++++++++++++++++++-
 1 file changed, 29 insertions(+), 1 deletion(-)

diff --git a/tests/gem_exec_basic.c b/tests/gem_exec_basic.c
index 3f91b78..9a5de64 100644
--- a/tests/gem_exec_basic.c
+++ b/tests/gem_exec_basic.c
@@ -25,6 +25,30 @@
 
 IGT_TEST_DESCRIPTION("Basic sanity check of execbuf-ioctl rings.");
 
+static bool has_ring(int fd, unsigned ring)
+{
+	switch (ring & I915_EXEC_RING_MASK) {
+	case 0:
+	case I915_EXEC_RENDER:
+		return true;
+
+	case I915_EXEC_BSD:
+		if (ring & 3<<13)
+			return gem_has_bsd2(fd);
+		else
+			return gem_has_bsd(fd);
+
+	case I915_EXEC_BLT:
+		return gem_has_blt(fd);
+
+	case I915_EXEC_VEBOX:
+		return gem_has_vebox(fd);
+	}
+
+	igt_assert_f(0, "invalid exec flag 0x%x\n", ring);
+	return false;
+}
+
 static void noop(int fd, unsigned ring)
 {
 	uint32_t bbe = MI_BATCH_BUFFER_END;
@@ -32,7 +56,11 @@ static void noop(int fd, unsigned ring)
 	struct drm_i915_gem_exec_object2 exec;
 	int ret;
 
-	gem_require_ring(fd, ring);
+	/* we can't use gem_require_ring here because otherwise the test will
+	 * skip if there is a bug with the flags, but we want to fail in that
+	 * situation
+	 */
+	igt_require(has_ring(fd, ring));
 
 	memset(&exec, 0, sizeof(exec));
 	exec.handle = gem_create(fd, 4096);
-- 
1.9.1

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

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

end of thread, other threads:[~2016-02-10  8:16 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-29  9:21 [PATCH i-g-t] tests/gem_exec_basic: don't use gem_require_ring to check ring availability daniele.ceraolospurio
2016-01-29 10:58 ` Chris Wilson
2016-01-29 11:16   ` Daniele Ceraolo Spurio
2016-01-29 11:35     ` Chris Wilson
2016-01-29 11:58       ` Daniele Ceraolo Spurio
2016-01-29 12:11         ` Chris Wilson
2016-02-01 14:24 ` [PATCH i-g-t] tests/gem_exec_params: test all valid execution flags daniele.ceraolospurio
2016-02-10  8:16   ` Daniel Vetter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.