Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH] tests/xe_huc_copy: Handle multiple GTs
@ 2023-10-05 10:32 Daniele Ceraolo Spurio
  2023-10-05 14:28 ` [igt-dev] ✓ CI.xeBAT: success for " Patchwork
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Daniele Ceraolo Spurio @ 2023-10-05 10:32 UTC (permalink / raw)
  To: igt-dev

The test currently only looks for video engines on GT0, which is a
problem because newer platforms (like MTL) have their video engines on
the media GT. ALso, it is technically possible to have 1 HuC per-GT,
though we don't currently have any platform that supports this.
To handle the media GT use-case and to future proof against multiple
HuCs, we can just loop and repeat the test on any GT that has video
engines.

Signed-off-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
---
 tests/intel/xe_huc_copy.c | 26 ++++++++++++++++++++++----
 1 file changed, 22 insertions(+), 4 deletions(-)

diff --git a/tests/intel/xe_huc_copy.c b/tests/intel/xe_huc_copy.c
index c9891a729..1c1b9d72c 100644
--- a/tests/intel/xe_huc_copy.c
+++ b/tests/intel/xe_huc_copy.c
@@ -104,9 +104,9 @@ gen12_create_batch_huc_copy(uint32_t *batch,
  */
 
 static void
-test_huc_copy(int fd)
+__test_huc_copy(int fd, uint32_t vm, struct drm_xe_engine_class_instance *hwe)
 {
-	uint32_t vm, exec_queue;
+	uint32_t exec_queue;
 	char *dinput;
 	struct drm_xe_sync sync = { 0 };
 
@@ -117,8 +117,7 @@ test_huc_copy(int fd)
 		{ .addr = ADDR_BATCH, .size = SIZE_BATCH }, // batch
 	};
 
-	vm = xe_vm_create(fd, DRM_XE_VM_CREATE_ASYNC_BIND_OPS, 0);
-	exec_queue = xe_exec_queue_create_class(fd, vm, DRM_XE_ENGINE_CLASS_VIDEO_DECODE);
+	exec_queue = xe_exec_queue_create(fd, vm, hwe, 0);
 	sync.flags = DRM_XE_SYNC_SYNCOBJ | DRM_XE_SYNC_SIGNAL;
 	sync.handle = syncobj_create(fd, 0);
 
@@ -148,6 +147,25 @@ test_huc_copy(int fd)
 
 	syncobj_destroy(fd, sync.handle);
 	xe_exec_queue_destroy(fd, exec_queue);
+}
+
+static void
+test_huc_copy(int fd)
+{
+	struct drm_xe_engine_class_instance *hwe;
+	uint32_t vm;
+	uint32_t tested_gts = 0;
+
+	vm = xe_vm_create(fd, DRM_XE_VM_CREATE_ASYNC_BIND_OPS, 0);
+
+	xe_for_each_hw_engine(fd, hwe) {
+		if (hwe->engine_class == DRM_XE_ENGINE_CLASS_VIDEO_DECODE &&
+		    !(tested_gts & BIT(hwe->gt_id))) {
+			tested_gts |= BIT(hwe->gt_id);
+			__test_huc_copy(fd, vm, hwe);
+		}
+	}
+
 	xe_vm_destroy(fd, vm);
 }
 
-- 
2.41.0

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

end of thread, other threads:[~2023-10-06 10:43 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-05 10:32 [igt-dev] [PATCH] tests/xe_huc_copy: Handle multiple GTs Daniele Ceraolo Spurio
2023-10-05 14:28 ` [igt-dev] ✓ CI.xeBAT: success for " Patchwork
2023-10-05 14:29 ` [igt-dev] ✓ Fi.CI.BAT: " Patchwork
2023-10-05 20:09 ` [igt-dev] [PATCH] " Kamil Konieczny
2023-10-06 10:43   ` Daniele Ceraolo Spurio
2023-10-06  3:49 ` [igt-dev] ✗ Fi.CI.IGT: failure for " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox