From: Ashutosh Dixit <ashutosh.dixit@intel.com>
To: igt-dev@lists.freedesktop.org
Cc: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>
Subject: [PATCH i-g-t 3/5] tests/intel/xe_oa: Return hwe from same gt from oa_unit_engine()
Date: Tue, 25 Nov 2025 19:50:10 -0800 [thread overview]
Message-ID: <20251126035012.12967-4-ashutosh.dixit@intel.com> (raw)
In-Reply-To: <20251126035012.12967-1-ashutosh.dixit@intel.com>
For some tests (e.g. mmio trigger) a hwe (and exec_queue) is needed for
batch submissions, even when the OA unit does not have any attached
hwe's (e.g. OAM SAG). To enable such use cases, return a hwe from the same
gt when an OA unit has no attached engines.
Signed-off-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
---
tests/intel/xe_oa.c | 17 ++++++++++++++++-
1 file changed, 16 insertions(+), 1 deletion(-)
diff --git a/tests/intel/xe_oa.c b/tests/intel/xe_oa.c
index 9302d1c83a..c8475720c5 100644
--- a/tests/intel/xe_oa.c
+++ b/tests/intel/xe_oa.c
@@ -486,7 +486,22 @@ static u64 oa_format_fields(u64 name)
static const struct drm_xe_engine_class_instance *oa_unit_engine(const struct drm_xe_oa_unit *oau)
{
- return !oau ? NULL : oau->num_engines ? &oau->eci[random() % oau->num_engines] : NULL;
+ const struct drm_xe_engine_class_instance *hwe;
+
+ igt_assert(oau);
+
+ hwe = oau->num_engines ? &oau->eci[random() % oau->num_engines] : NULL;
+
+ /* If an OA unit has no hwe's, return a hwe from the same gt */
+ if (hwe || !(oau->capabilities & DRM_XE_OA_CAPS_OA_UNIT_GT_ID))
+ goto exit;
+
+ xe_for_each_engine(drm_fd, hwe)
+ if (hwe->gt_id == oau->gt_id)
+ break;
+ igt_assert(hwe);
+exit:
+ return hwe;
}
static int __first_and_num_oa_units(const struct drm_xe_oa_unit **oau)
--
2.48.1
next prev parent reply other threads:[~2025-11-26 3:50 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-26 3:50 [PATCH i-g-t 0/5] OA: Run MMIO trigger tests on all OA units Ashutosh Dixit
2025-11-26 3:50 ` [PATCH i-g-t 1/5] tests/intel/xe_oa: Drop oa-unit-exclusive-stream-exec-q Ashutosh Dixit
2025-12-02 21:32 ` Umesh Nerlige Ramappa
2025-11-26 3:50 ` [PATCH i-g-t 2/5] drm-uapi/xe: Sync with DRM_XE_OA_CAPS_OA_UNIT_GT_ID definition Ashutosh Dixit
2025-11-27 17:24 ` Kamil Konieczny
2025-11-26 3:50 ` Ashutosh Dixit [this message]
2025-11-26 3:50 ` [PATCH i-g-t 4/5] tests/intel/xe_oa: Run mmio-trigger tests on all OA units Ashutosh Dixit
2025-12-02 21:37 ` Umesh Nerlige Ramappa
2025-11-26 3:50 ` [PATCH i-g-t 5/5] tests/intel/xe_oa: Use separate oa unit variables for caps and iterator Ashutosh Dixit
2025-12-02 21:59 ` Umesh Nerlige Ramappa
2025-11-26 4:27 ` ✓ Xe.CI.BAT: success for OA: Run MMIO trigger tests on all OA units Patchwork
2025-11-26 4:41 ` ✓ i915.CI.BAT: " Patchwork
2025-11-26 7:27 ` ✗ Xe.CI.Full: failure " Patchwork
2025-11-26 15:01 ` ✗ i915.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=20251126035012.12967-4-ashutosh.dixit@intel.com \
--to=ashutosh.dixit@intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=umesh.nerlige.ramappa@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;
as well as URLs for NNTP newsgroup(s).