[PATCH i-g-t] xe_eudebug_online: Add default threads_per_eu value for platforms without hwconfig.

Dominik Grzegorzek dominik.grzegorzek at intel.com
Fri Dec 13 09:23:39 UTC 2024


There are hardware platforms which are not supporting
hwconfig table, for example ADLS. Since [1] queried number of threads per eu
can be NULL, accept it and use 8 as default.

Signed-off-by: Dominik Grzegorzek <dominik.grzegorzek at intel.com>

[1] https://patchwork.freedesktop.org/series/142282/

---
 tests/intel/xe_eudebug_online.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/tests/intel/xe_eudebug_online.c b/tests/intel/xe_eudebug_online.c
index bf53b44ce..8fdd071a5 100644
--- a/tests/intel/xe_eudebug_online.c
+++ b/tests/intel/xe_eudebug_online.c
@@ -1155,7 +1155,7 @@ static int query_attention_bitmask_size(int fd, int gt)
 {
 	uint32_t thread_count_len;
 	uint32_t *thread_count_ptr;
-	uint32_t thread_count;
+	uint32_t threads_per_eu = 8;
 	struct drm_xe_query_topology_mask *c_dss = NULL, *g_dss = NULL, *eu_per_dss = NULL;
 	struct drm_xe_query_topology_mask *topology;
 	struct drm_xe_device_query query = {
@@ -1169,9 +1169,10 @@ static int query_attention_bitmask_size(int fd, int gt)
 
 	thread_count_ptr = xe_hwconfig_lookup_value(fd, INTEL_HWCONFIG_NUM_THREADS_PER_EU,
 						    &thread_count_len);
-	igt_assert(thread_count_ptr);
-	igt_assert(thread_count_len == 1);
-	thread_count = *thread_count_ptr;
+	if (thread_count_ptr) {
+		igt_assert(thread_count_len == 1);
+		threads_per_eu = *thread_count_ptr;
+	}
 
 	igt_assert_eq(igt_ioctl(fd, DRM_IOCTL_XE_DEVICE_QUERY, &query), 0);
 	igt_assert_neq(query.size, 0);
@@ -1222,7 +1223,7 @@ static int query_attention_bitmask_size(int fd, int gt)
 	free(any_dss);
 	free(topology);
 
-	return eus * DIV_ROUND_UP(thread_count, 8);
+	return eus * DIV_ROUND_UP(threads_per_eu, 8);
 }
 
 static struct drm_xe_eudebug_event_exec_queue *
-- 
2.34.1



More information about the igt-dev mailing list