Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH i-g-t] lib/xe: Use proper GT lookup in xe_gt_get_tile_id()
@ 2026-08-31 20:23 Matt Roper
  2026-09-01  8:20 ` Dnyaneshwar Bhadane
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Matt Roper @ 2026-08-31 20:23 UTC (permalink / raw)
  To: igt-dev; +Cc: Matt Roper

xe_gt_get_tile_id() should lookup the GT record associated with a GT ID
via drm_xe_get_gt() rather than directly indexing into gt_list[].  The
ID may not always match the array index on future platforms if we ever
have cases where GT IDs are non-contiguous.

Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
---
 lib/xe/xe_query.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/lib/xe/xe_query.c b/lib/xe/xe_query.c
index 68e60ddc7..0b309be03 100644
--- a/lib/xe/xe_query.c
+++ b/lib/xe/xe_query.c
@@ -1070,14 +1070,16 @@ bool xe_is_main_gt(int fd, int gt)
  */
 uint16_t xe_gt_get_tile_id(int fd, int gt)
 {
+	const struct drm_xe_gt *gt_data;
 	struct xe_device *xe_dev;
 
 	xe_dev = find_in_cache(fd);
-
 	igt_assert(xe_dev);
-	igt_assert(gt < xe_number_gt(fd));
 
-	return xe_dev->gt_list->gt_list[gt].tile_id;
+	gt_data = drm_xe_get_gt(xe_dev, gt);
+	igt_assert(gt_data);
+
+	return gt_data->tile_id;
 }
 
 /**

---
base-commit: d822caac6e3589c05fffb63fbfc89134b0f7ccb3
change-id: 20260831-gtlookup_noncontig-13ef96a45b4f

Best regards,
-- 
Matt Roper
Graphics Software Engineer
Linux GPU Platform Enablement
Intel Corporation


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

end of thread, other threads:[~2026-09-02  8:45 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-31 20:23 [PATCH i-g-t] lib/xe: Use proper GT lookup in xe_gt_get_tile_id() Matt Roper
2026-09-01  8:20 ` Dnyaneshwar Bhadane
2026-09-01 20:57 ` ✓ i915.CI.BAT: success for " Patchwork
2026-09-01 21:07 ` ✓ Xe.CI.BAT: " Patchwork
2026-09-02  8:42 ` ✗ i915.CI.Full: failure " Patchwork
2026-09-02  8:45 ` ✓ Xe.CI.FULL: success " Patchwork

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