From: Matt Roper <matthew.d.roper@intel.com>
To: Rodrigo Vivi <rodrigo.vivi@intel.com>
Cc: <intel-xe@lists.freedesktop.org>,
Carl Zhang <carl.zhang@intel.com>, "Tony Ye" <tony.ye@intel.com>,
Matthew Brost <matthew.brost@intel.com>,
Matthew Auld <matthew.auld@intel.com>,
Gustavo Sousa <gustavo.sousa@intel.com>
Subject: Re: [PATCH] drm/xe: Order video decode engines even physical instances first
Date: Fri, 4 Dec 2026 12:19:59 -0800 [thread overview]
Message-ID: <20261204201959.GR6134@mdroper-desk1> (raw)
In-Reply-To: <20261204190130.937235-2-rodrigo.vivi@intel.com>
On Fri, Dec 04, 2026 at 02:01:31PM -0500, Rodrigo Vivi wrote:
> Video decode engines share some units in pairs (VCS0/VCS1, VCS2/VCS3,
> ...), and only engines from different pairs can decode the same frame
> together. GuC requires the engines of a parallel exec queue to be
> logically contiguous, but logical instances are assigned in physical
> order. So on a part with VCS0, VCS1 and VCS2, the valid pair VCS0+VCS2
> can't be used, and the logically contiguous VCS0+VCS1 is not useful.
What is the basis for this requirement statement? Is there a bspec
reference?
Is this actually talking about SCMIs (aka media slices) and saying that
multi_lrc execution requires that each engine involved in parallel
execution be from a different SCMI? If so, then I don't think this
patch using "pairs" is going to be correct as general logic; some
platforms/sku's have 1 potential engine per SCMI (so we really should go
0, 1, 2, ...), others have 2 potential engines per SCMI, etc. so
assuming "pairs" would only be correct for some platforms and not
others. Also, this patch doesn't seem to be doing anything with the
VECS engines which also have different 1-per-SCMI, 2-per-SCMI, etc.
grouping configurations depending on platform/SKU (but not necessarily
the same group sizes as the VCS).
Assuming my guess is correct that what we're really worried about are
SCMIs, it seems like what we should really be doing is tracking
"max_vd_per_scmi" and "max_ve_per_scmi" in the media IP descriptor, and
then using those values to figure out the proper ordering of logical
IDs. E.g., if a future platform potentially has 3 VDs per SCMI, then
you'd presumably want your order to go 0, 3, 1, 4, 2, 5 instead, right?
There are several other places in the code where we need to switch over
to such SCMI-based grouping anyway, so it would be good to confirm
whether this is just another instance of the same thing.
Matt
>
> Number the even physical instances first, then the odd ones, like i915
> does (setup_logical_ids()) and like Windows. With VCS0/1/2, logical
> 0/1/2 map to physical 0/2/1, so both logical pairs are on different
> units.
>
> This changes the logical numbering of video decode engines on some parts,
> but the logical order was never part of the uAPI and already changes with
> fusing. On DG2 it also restores the order i915 always used there.
>
> Cc: Carl Zhang <carl.zhang@intel.com>
> Cc: Tony Ye <tony.ye@intel.com>
> Cc: Matthew Brost <matthew.brost@intel.com>
> Cc: Matthew Auld <matthew.auld@intel.com>
> Cc: Matt Roper <matthew.d.roper@intel.com>
> Cc: Gustavo Sousa <gustavo.sousa@intel.com>
> Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
> ---
> drivers/gpu/drm/xe/xe_hw_engine.c | 26 ++++++++++++++++++++++++++
> 1 file changed, 26 insertions(+)
>
> diff --git a/drivers/gpu/drm/xe/xe_hw_engine.c b/drivers/gpu/drm/xe/xe_hw_engine.c
> index 959661ecb1a2..010e87cf5f4d 100644
> --- a/drivers/gpu/drm/xe/xe_hw_engine.c
> +++ b/drivers/gpu/drm/xe/xe_hw_engine.c
> @@ -742,6 +742,27 @@ static int hw_engine_init(struct xe_gt *gt, struct xe_hw_engine *hwe,
> return err;
> }
>
> +/*
> + * Video decode engines share some units in pairs (VCS0/VCS1, VCS2/VCS3, ...),
> + * and only engines from different pairs can work together on the same frame.
> + * GuC requires the engines of a parallel exec queue to be logically
> + * contiguous, so number the even physical instances first, then the odd ones.
> + * This way logically adjacent engines are on different pairs.
> + */
> +static void hw_engine_setup_vcs_logical_order(struct xe_gt *gt)
> +{
> + static const u8 order[] = { 0, 2, 4, 6, 1, 3, 5, 7 };
> + int logical_instance = 0;
> + int i;
> +
> + for (i = 0; i < ARRAY_SIZE(order); i++) {
> + struct xe_hw_engine *hwe = >->hw_engines[XE_HW_ENGINE_VCS0 + order[i]];
> +
> + if (xe_hw_engine_is_valid(hwe))
> + hwe->logical_instance = logical_instance++;
> + }
> +}
> +
> static int hw_engine_setup_logical_and_paging_mapping(struct xe_gt *gt)
> {
> struct xe_device *xe = gt_to_xe(gt);
> @@ -799,6 +820,11 @@ static int hw_engine_setup_logical_and_paging_mapping(struct xe_gt *gt)
> for (class = 0; class < XE_ENGINE_CLASS_MAX; ++class) {
> int logical_instance = 0;
>
> + if (class == XE_ENGINE_CLASS_VIDEO_DECODE) {
> + hw_engine_setup_vcs_logical_order(gt);
> + continue;
> + }
> +
> for_each_hw_engine(hwe, gt, id) {
> if (hwe->class == class) {
> hwe->logical_instance = logical_instance++;
> --
> 2.56.0
>
--
Matt Roper
Graphics Software Engineer
Linux GPU Platform Enablement
Intel Corporation
next prev parent reply other threads:[~2026-12-04 20:20 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-04 19:01 [PATCH] drm/xe: Order video decode engines even physical instances first Rodrigo Vivi
2026-12-04 19:12 ` ✓ CI.KUnit: success for " Patchwork
2026-12-04 19:27 ` [PATCH] " sashiko-bot
2026-12-04 19:41 ` Summers, Stuart
2026-12-04 19:48 ` ✓ Xe.CI.BAT: success for " Patchwork
2026-12-04 20:19 ` Matt Roper [this message]
2026-12-05 18:54 ` ✗ Xe.CI.FULL: failure " 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=20261204201959.GR6134@mdroper-desk1 \
--to=matthew.d.roper@intel.com \
--cc=carl.zhang@intel.com \
--cc=gustavo.sousa@intel.com \
--cc=intel-xe@lists.freedesktop.org \
--cc=matthew.auld@intel.com \
--cc=matthew.brost@intel.com \
--cc=rodrigo.vivi@intel.com \
--cc=tony.ye@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.