From: Gustavo Sousa <gustavo.sousa@intel.com>
To: Michal Wajdeczko <michal.wajdeczko@intel.com>,
<intel-xe@lists.freedesktop.org>
Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
Subject: Re: [PATCH 2/2] drm/xe/tests: Fix subplatform selection
Date: Wed, 9 Sep 2026 16:13:35 -0300 [thread overview]
Message-ID: <87ik4ejl0g.fsf@intel.com> (raw)
In-Reply-To: <20260905200157.3164-3-michal.wajdeczko@intel.com>
Michal Wajdeczko <michal.wajdeczko@intel.com> writes:
> If a test does not specify subplatform details about the fake device
> it wants to create, our helper may select a sentinel of the subplatform
> descriptors list instead of the first available subplatform.
>
> Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
> ---
> Cc: Gustavo Sousa <gustavo.sousa@intel.com>
> ---
> drivers/gpu/drm/xe/tests/xe_pci.c | 12 +++++++++++-
> 1 file changed, 11 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/xe/tests/xe_pci.c b/drivers/gpu/drm/xe/tests/xe_pci.c
> index a82cab7a2b86..8ab4270cf5d8 100644
> --- a/drivers/gpu/drm/xe/tests/xe_pci.c
> +++ b/drivers/gpu/drm/xe/tests/xe_pci.c
> @@ -364,13 +364,23 @@ int xe_pci_fake_device_init(struct xe_device *xe)
> if (!ent->device)
> return -ENODEV;
>
> + if (data->subplatform == XE_SUBPLATFORM_NONE) {
> + subplatform_desc = NULL;
> + goto done;
> + }
> +
> + if (data->subplatform == XE_SUBPLATFORM_UNINITIALIZED) {
I guess here as well, subplatform_desc will be either NULL or the first
one, but if we add a comment in patch #1, I think we don't need to
repeat ourselves.
Reviewed-by: Gustavo Sousa <gustavo.sousa@intel.com>
On a side note, orthogonal to this patch: I wonder if it is okay to match
no subplatform when the device descriptor defines a list of
subplatforms. The current behavior is that find_subplatform() returns
NULL and doesn't complain.
--
Gustavo Sousa
> + subplatform_desc = desc->subplatforms;
> + goto done;
> + }
> +
> for (subplatform_desc = desc->subplatforms;
> subplatform_desc && subplatform_desc->subplatform;
> subplatform_desc++)
> if (subplatform_desc->subplatform == data->subplatform)
> break;
>
> - if (data->subplatform != XE_SUBPLATFORM_NONE && !subplatform_desc)
> + if (!subplatform_desc || !subplatform_desc->subplatform)
> return -ENODEV;
>
> done:
> --
> 2.47.1
next prev parent reply other threads:[~2026-09-09 19:13 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-05 20:01 [PATCH 0/2] drm/xe/tests: Fix subplatform selection Michal Wajdeczko
2026-09-05 20:01 ` [PATCH 1/2] drm/xe/tests: Fix default " Michal Wajdeczko
2026-09-09 19:04 ` Gustavo Sousa
2026-09-09 19:22 ` Michal Wajdeczko
2026-09-05 20:01 ` [PATCH 2/2] drm/xe/tests: Fix " Michal Wajdeczko
2026-09-09 19:13 ` Gustavo Sousa [this message]
2026-09-09 19:35 ` Michal Wajdeczko
2026-09-05 20:10 ` ✓ CI.KUnit: success for " Patchwork
2026-09-05 20:53 ` ✓ Xe.CI.BAT: " Patchwork
2026-09-05 21:52 ` ✓ Xe.CI.FULL: " 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=87ik4ejl0g.fsf@intel.com \
--to=gustavo.sousa@intel.com \
--cc=intel-xe@lists.freedesktop.org \
--cc=michal.wajdeczko@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox