All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH i-g-t v2] tests/xe_compute: Don't require ccs_mode on every GT
@ 2024-03-27 23:47 Matt Roper
  2024-03-28  0:30 ` ✓ CI.xeBAT: success for tests/xe_compute: Don't require ccs_mode on every GT (rev2) Patchwork
  2024-03-28  2:05 ` [PATCH i-g-t v2] tests/xe_compute: Don't require ccs_mode on every GT Gustavo Sousa
  0 siblings, 2 replies; 3+ messages in thread
From: Matt Roper @ 2024-03-27 23:47 UTC (permalink / raw)
  To: igt-dev; +Cc: matthew.d.roper, Niranjana Vishwanathapura, Gustavo Sousa

On platforms with standalone media, we expect some GTs to have CCS
engines (meaning ccs_mode can be tested if there's more than one CCS),
but the media GT will never have any CCS engines and will never expose
ccs_mode.  Move the igt_require() out of the loop so that we don't
declare the whole test a skip upon encountering the media GT when the
test already executed successfully on the primary GT.

v2:
 - Make the same fix for the compute_kernel subtest, not just the basic
   subtest.  (Gustavo)
 - Treat get_num_cslices()'s return value as a bool rather than an
   integer for clarity.

Cc: Niranjana Vishwanathapura <niranjana.vishwanathapura@intel.com>
Cc: Gustavo Sousa <gustavo.sousa@intel.com>
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
---
 tests/intel/xe_compute.c | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/tests/intel/xe_compute.c b/tests/intel/xe_compute.c
index e773e798a..ac6351276 100644
--- a/tests/intel/xe_compute.c
+++ b/tests/intel/xe_compute.c
@@ -51,11 +51,13 @@ test_ccs_mode(int num_gt)
 {
 	struct drm_xe_engine_class_instance *hwe;
 	u32 gt, m, ccs_mode, vm, q, num_slices;
-	int fd, gt_fd;
+	int fd, gt_fd, num_gt_with_ccs_mode = 0;
 
 	for (gt = 0; gt < num_gt; gt++) {
-		igt_require(get_num_cslices(gt, &num_slices));
+		if (!get_num_cslices(gt, &num_slices))
+			continue;
 
+		num_gt_with_ccs_mode++;
 		gt_fd = gt_sysfs_open(gt);
 		igt_assert(igt_sysfs_printf(gt_fd, "ccs_mode", "%u", 0) < 0);
 		for (m = 1; m <= num_slices; m++) {
@@ -105,6 +107,8 @@ test_ccs_mode(int num_gt)
 
 		close(gt_fd);
 	}
+
+	igt_require(num_gt_with_ccs_mode > 0);
 }
 
 /**
@@ -118,11 +122,13 @@ test_compute_kernel_with_ccs_mode(int num_gt)
 {
 	struct drm_xe_engine_class_instance *hwe;
 	u32 gt, m, num_slices;
-	int fd, gt_fd;
+	int fd, gt_fd, num_gt_with_ccs_mode = 0;
 
 	for (gt = 0; gt < num_gt; gt++) {
-		igt_require(get_num_cslices(gt, &num_slices));
+		if (!get_num_cslices(gt, &num_slices))
+			continue;
 
+		num_gt_with_ccs_mode++;
 		gt_fd = gt_sysfs_open(gt);
 		for (m = 1; m <= num_slices; m++) {
 			if (num_slices % m)
@@ -150,6 +156,8 @@ test_compute_kernel_with_ccs_mode(int num_gt)
 
 		close(gt_fd);
 	}
+
+	igt_require(num_gt_with_ccs_mode > 0);
 }
 
 /**
-- 
2.43.0


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

end of thread, other threads:[~2024-03-28  2:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-27 23:47 [PATCH i-g-t v2] tests/xe_compute: Don't require ccs_mode on every GT Matt Roper
2024-03-28  0:30 ` ✓ CI.xeBAT: success for tests/xe_compute: Don't require ccs_mode on every GT (rev2) Patchwork
2024-03-28  2:05 ` [PATCH i-g-t v2] tests/xe_compute: Don't require ccs_mode on every GT Gustavo Sousa

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.