Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Dnyaneshwar Bhadane <dnyaneshwar.bhadane@Intel.com>
To: igt-dev@lists.freedesktop.org
Subject: Re: [PATCH i-g-t] lib/xe: Use proper GT lookup in xe_gt_get_tile_id()
Date: Tue, 1 Sep 2026 13:50:40 +0530	[thread overview]
Message-ID: <c23bbebb-ee27-4fb1-af8b-cef1dbf220c8@Intel.com> (raw)
In-Reply-To: <20260831-gtlookup_noncontig-v1-1-37f22a0cbb6b@intel.com>



On 01-Sep-26 1:53 AM, Matt Roper wrote:
> 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;
Hi Matt,

Could we use xe_get_tile() directly having assert on negative return?

Dnyaneshwar>   }
>   
>   /**
> 
> ---
> base-commit: d822caac6e3589c05fffb63fbfc89134b0f7ccb3
> change-id: 20260831-gtlookup_noncontig-13ef96a45b4f
> 
> Best regards,


  reply	other threads:[~2026-09-01  8:21 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c23bbebb-ee27-4fb1-af8b-cef1dbf220c8@Intel.com \
    --to=dnyaneshwar.bhadane@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox