[PATCH v2 4/5] tests/amdgpu: execute cs_nops userq tests only if supported

Sunil Khatri sunil.khatri at amd.com
Tue Apr 29 10:36:52 UTC 2025


check the ip supported for userqueues before executing
any cs_nops userqueues test cases.

Cc: Prosyak, Vitaly <Vitaly.Prosyak at amd.com>
Cc: Jesse Zhang <jesse.zhang at amd.com>
Signed-off-by: Sunil Khatri <sunil.khatri at amd.com>
---
 tests/amdgpu/amd_cs_nop.c | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/tests/amdgpu/amd_cs_nop.c b/tests/amdgpu/amd_cs_nop.c
index 67bb0419d..160c4f026 100644
--- a/tests/amdgpu/amd_cs_nop.c
+++ b/tests/amdgpu/amd_cs_nop.c
@@ -169,6 +169,7 @@ igt_main
 	}, *e;
 	int fd = -1;
 	bool arr_cap[AMD_IP_MAX] = {0};
+	bool userq_arr_cap[AMD_IP_MAX] = {0};
 
 	igt_fixture {
 		uint32_t major, minor;
@@ -182,6 +183,7 @@ igt_main
 		err = amdgpu_cs_ctx_create(device, &context);
 		igt_assert_eq(err, 0);
 		asic_rings_readness(device, 1, arr_cap);
+		asic_userq_readiness(device, userq_arr_cap);
 	}
 
 	for (p = phase; p->name; p++) {
@@ -198,18 +200,11 @@ igt_main
 	}
 
 #ifdef AMDGPU_USERQ_ENABLED
-	/*
-	 * TODO: Add a programmatic check to determine which IPs (gfx, compute, sdma)
-	 * are present for the user-mode queue and execute the test accordingly.
-	 */
-	arr_cap[AMDGPU_HW_IP_GFX] = 1;
-	arr_cap[AMDGPU_HW_IP_COMPUTE] = 1;
-
 	for (p = phase; p->name; p++) {
 		for (e = engines; e->name; e++) {
 			igt_describe("Stressful-and-multiple-cs-of-nop-operations-using-multiple-processes-with-the-same-GPU-context-UMQ");
 			igt_subtest_with_dynamic_f("cs-nops-with-%s-%s0-with-UQ-Submission", p->name, e->name) {
-				if (arr_cap[e->ip_type]) {
+				if (userq_arr_cap[e->ip_type]) {
 					igt_dynamic_f("cs-nop-with-%s-%s0-with-UQ-Submission", p->name, e->name)
 					nop_cs(device, context, e->name, e->ip_type, 0, 20,
 					       p->flags, 1);
-- 
2.43.0



More information about the igt-dev mailing list