Skip to contentSkip to conversation

tests: Add tests for new exec flags to export two bsd rings

PATCH New Zhipeng Gong 1 participant 4 messages Dec 3, 2014 Library code

lore
Share & tools
lore
#0 lore raw

cover tests: Add tests for new exec flags to export two bsd rings

The Broadwell GT3 machine has two independent BSD rings that can be used to process the video commands. New execution flags are added to export the two rings to userspace so that userspace can specify the bsd ring.

The LOCAL_ flags could be removed when this patch is merged into libdrm and i-g-t depends on that new libdrm.
http://lists.freedesktop.org/archives/intel-gfx/2014-December/056569.html

Zhipeng Gong (3):
i-g-t: check whether kernel has dual bsd ring tests/gem_exec_params: check the invalid flags for dual bsd ring test/gem_dummy_reloc_loop: add tests for dual bsd ring

 lib/ioctl_wrappers.c         | 16 ++++++++++++++++
 lib/ioctl_wrappers.h         |  1 +
 tests/gem_dummy_reloc_loop.c | 18 ++++++++++++++++++
 tests/gem_exec_params.c      |  7 +++++++
 4 files changed, 42 insertions(+)
Signature · 6 lines
1.8.3.1

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#1 lore raw

PATCH 1/3 lib: check whether kernel has dual bsd ring

---
 lib/ioctl_wrappers.c | 16 ++++++++++++++++
 lib/ioctl_wrappers.h |  1 +
 2 files changed, 17 insertions(+)
lib/ioctl_wrappers.c +16 -0
index 56280b6..ad746e9 100644
@@ -771,6 +771,22 @@ bool gem_has_vebox(int fd)
 	return gem_has_enable_ring(fd,LOCAL_I915_PARAM_HAS_VEBOX);
 }
 
+#define LOCAL_I915_PARAM_HAS_BSD2 30
+/**
+ * gem_has_bsd2:
+ * @fd: open i915 drm file descriptor
+ *
+ * Feature test macro to query whether the BSD2 ring is available. This is simply
+ * a specific version of gem_has_enable_ring() for the BSD2 ring.
+ *
+ * Note that recent Bspec calls this the VCS ring for Video Command Submission.
+ *
+ * Returns: Whether the BSD ring is avaible or not.
+ */
+bool gem_has_bsd2(int fd)
+{
+	return gem_has_enable_ring(fd,LOCAL_I915_PARAM_HAS_BSD2);
+}
 /**
  * gem_available_aperture_size:
  * @fd: open i915 drm file descriptor
lib/ioctl_wrappers.h +1 -0
index d13408c..46b5c45 100644
@@ -84,6 +84,7 @@ bool gem_has_enable_ring(int fd,int param);
 bool gem_has_bsd(int fd);
 bool gem_has_blt(int fd);
 bool gem_has_vebox(int fd);
+bool gem_has_bsd2(int fd);
 bool gem_uses_aliasing_ppgtt(int fd);
 int gem_available_fences(int fd);
 uint64_t gem_available_aperture_size(int fd);
Signature · 6 lines
1.8.3.1

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#2 lore raw

PATCH 2/3 tests/gem_exec_params: check the invalid flags for dual bsd ring

In reply to Zhipeng Gong
---
 tests/gem_exec_params.c | 7 +++++++
 1 file changed, 7 insertions(+)
tests/gem_exec_params.c +7 -0
index f63eda9..ab19482 100644
@@ -45,6 +45,7 @@
 #include "igt_aux.h"
 
 #define LOCAL_I915_EXEC_VEBOX (4<<0)
+#define LOCAL_I915_EXEC_BSD_MASK (3<<13)
 
 struct drm_i915_gem_execbuffer2 execbuf;
 struct drm_i915_gem_exec_object2 gem_exec[1];
@@ -126,6 +127,12 @@ igt_main
 		RUN_FAIL(EINVAL);
 	}
 
+	igt_subtest("invalid-bsd-ring") {
+		igt_require(gem_has_bsd2(fd));
+		execbuf.flags = I915_EXEC_BSD | LOCAL_I915_EXEC_BSD_MASK;
+		RUN_FAIL(EINVAL);
+	}
+
 	igt_subtest("rel-constants-invalid-ring") {
 		igt_require(gem_has_bsd(fd));
 		execbuf.flags = I915_EXEC_BSD | I915_EXEC_CONSTANTS_ABSOLUTE;
Signature · 6 lines
1.8.3.1

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#3 lore raw

PATCH 3/3 test/gem_dummy_reloc_loop: add tests for dual bsd ring

In reply to Zhipeng Gong
---
 tests/gem_dummy_reloc_loop.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
tests/gem_dummy_reloc_loop.c +18 -0
index 7a97140..7a406f3 100644
@@ -43,6 +43,8 @@
 #include "intel_chipset.h"
 
 #define LOCAL_I915_EXEC_VEBOX (4<<0)
+#define LOCAL_I915_EXEC_BSD_RING1 (1<<13)
+#define LOCAL_I915_EXEC_BSD_RING2 (2<<13)
 
 static drm_intel_bufmgr *bufmgr;
 struct intel_batchbuffer *batch;
@@ -259,6 +261,22 @@ igt_main
 	}
 #endif
 
+	igt_subtest("bsd-ring1") {
+		igt_require(gem_has_bsd2(fd));
+		sleep(2);
+		igt_info("running dummy loop on bsd-ring1\n");
+		dummy_reloc_loop(I915_EXEC_BSD|LOCAL_I915_EXEC_BSD_RING1);
+		igt_info("dummy loop run on bsd-ring1 completed\n");
+	}
+
+	igt_subtest("bsd-ring2") {
+		igt_require(gem_has_bsd2(fd));
+		sleep(2);
+		igt_info("running dummy loop on bsd-ring2\n");
+		dummy_reloc_loop(I915_EXEC_BSD|LOCAL_I915_EXEC_BSD_RING2);
+		igt_info("dummy loop run on bsd-ring2 completed\n");
+	}
+
 	igt_subtest("mixed") {
 		if (num_rings > 1) {
 			sleep(2);
Signature · 6 lines
1.8.3.1

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx