All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Charles <daniel.charles@intel.com>
To: Xin Wang <x.wang@intel.com>, <igt-dev@lists.freedesktop.org>
Subject: Re: [v2,2/4] lib/xe: add xe_engine_class_supports_multi_lrc()
Date: Mon, 6 Apr 2026 15:32:15 -0700	[thread overview]
Message-ID: <ee4c3656-9831-4ac2-8a44-3a84cf754e8c@intel.com> (raw)
In-Reply-To: <20260403071322.366766-3-x.wang@intel.com>


On 4/3/2026 12:13 AM, Xin Wang wrote:
> Add xe_engine_class_supports_multi_lrc() to query whether an engine
> class supports multi-LRC submission.  When the kernel exposes the
> information via the debugfs info node it is used directly; otherwise
> fall back to a hardcoded default to keep compatibility with older KMD.
>
> Signed-off-by: Xin Wang <x.wang@intel.com>
> ---
>   lib/xe/xe_query.c | 30 ++++++++++++++++++++++++++++++
>   lib/xe/xe_query.h |  1 +
>   2 files changed, 31 insertions(+)
>
> diff --git a/lib/xe/xe_query.c b/lib/xe/xe_query.c
> index 441e95794..e13d5e143 100644
> --- a/lib/xe/xe_query.c
> +++ b/lib/xe/xe_query.c
> @@ -308,6 +308,36 @@ static struct xe_device *find_in_cache(int fd)
>   	return xe_dev;
>   }
>   
> +/**
> + * xe_engine_class_supports_multi_lrc:
> + * @fd: xe device fd
> + * @engine_class: engine class
> + *
> + * Returns true if multi LRC supported by engine class or false.
> + * Uses the kernel-reported bitmask from debugfs when available, otherwise
> + * falls back to the hardcoded per-class default.
> + */
> +bool xe_engine_class_supports_multi_lrc(int fd, uint32_t engine_class)
> +{
> +	struct xe_device *xe_dev = find_in_cache(fd);
> +
> +	if (xe_dev && xe_dev->multi_lrc_mask != UINT16_MAX)
> +		return !!(xe_dev->multi_lrc_mask & BIT(engine_class));
> +
> +	switch (engine_class) {
> +	case DRM_XE_ENGINE_CLASS_COPY:
> +	case DRM_XE_ENGINE_CLASS_COMPUTE:
> +	case DRM_XE_ENGINE_CLASS_RENDER:
> +		return false;
> +	case DRM_XE_ENGINE_CLASS_VIDEO_DECODE:
> +	case DRM_XE_ENGINE_CLASS_VIDEO_ENHANCE:
> +		return true;
> +	default:
> +		igt_warn("Engine class 0x%x unknown\n", engine_class);
> +		return false;
> +	}
> +}
> +
>   static void xe_device_free(struct xe_device *xe_dev)
>   {
>   	free(xe_dev->config);
> diff --git a/lib/xe/xe_query.h b/lib/xe/xe_query.h
> index f33562bda..5c26a3e88 100644
> --- a/lib/xe/xe_query.h
> +++ b/lib/xe/xe_query.h
> @@ -162,6 +162,7 @@ uint32_t xe_va_bits(int fd);
>   uint16_t xe_dev_id(int fd);
>   int xe_supports_faults(int fd);
>   bool xe_engine_class_supports_multi_queue(uint32_t engine_class);
> +bool xe_engine_class_supports_multi_lrc(int fd, uint32_t engine_class);
>   const char *xe_engine_class_string(uint32_t engine_class);
>   const char *xe_engine_class_short_string(uint32_t engine_class);
>   bool xe_has_engine_class(int fd, uint16_t engine_class);

Reviewed-by:Daniel Charles <daniel.charles@intel.com>


  reply	other threads:[~2026-04-06 22:32 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-03  7:13 [PATCH v2 0/4] lib/xe: query engine class capabilities from debugfs info Xin Wang
2026-04-03  7:13 ` [PATCH v2 1/4] lib/xe: cache engine class masks " Xin Wang
2026-04-06 22:25   ` [v2,1/4] " Daniel Charles
2026-04-03  7:13 ` [PATCH v2 2/4] lib/xe: add xe_engine_class_supports_multi_lrc() Xin Wang
2026-04-06 22:32   ` Daniel Charles [this message]
2026-04-03  7:13 ` [PATCH v2 3/4] lib/xe: use debugfs info to implement xe_engine_class_supports_multi_queue() Xin Wang
2026-04-06 22:34   ` [v2,3/4] " Daniel Charles
2026-04-03  7:13 ` [PATCH v2 4/4] tests/intel: skip or adjust tests for non-multi-LRC engine classes Xin Wang
2026-04-06 22:35   ` [v2,4/4] " Daniel Charles
2026-04-03  8:03 ` ✓ i915.CI.BAT: success for lib/xe: query engine class capabilities from debugfs info (rev2) Patchwork
2026-04-03  8:06 ` ✓ Xe.CI.BAT: " Patchwork
2026-04-03 13:37 ` ✓ Xe.CI.FULL: " Patchwork
2026-04-03 23:35 ` ✗ i915.CI.Full: failure " Patchwork
2026-04-08  2:15   ` Wang, X

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=ee4c3656-9831-4ac2-8a44-3a84cf754e8c@intel.com \
    --to=daniel.charles@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=x.wang@intel.com \
    /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 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.