From: Ashutosh Dixit <ashutosh.dixit@intel.com>
To: intel-xe@lists.freedesktop.org
Subject: [PATCH 1/4] drm/xe/oa: Refactor oa_unit_supports_oa_format
Date: Thu, 30 Apr 2026 09:14:56 -0700 [thread overview]
Message-ID: <20260430161459.2892545-2-ashutosh.dixit@intel.com> (raw)
In-Reply-To: <20260430161459.2892545-1-ashutosh.dixit@intel.com>
Minor refactor of oa_unit_supports_oa_format to implement Wa_14026746987.
Signed-off-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
---
drivers/gpu/drm/xe/xe_oa.c | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/drivers/gpu/drm/xe/xe_oa.c b/drivers/gpu/drm/xe/xe_oa.c
index 5de5bf19240a2..b767dccfc4fc7 100644
--- a/drivers/gpu/drm/xe/xe_oa.c
+++ b/drivers/gpu/drm/xe/xe_oa.c
@@ -1934,16 +1934,18 @@ static u64 oa_exponent_to_ns(struct xe_gt *gt, int exponent)
return div_u64(nom + den - 1, den);
}
-static bool oa_unit_supports_oa_format(struct xe_oa_open_param *param, int type)
+static bool oa_unit_supports_oa_format(struct xe_oa *oa, struct xe_oa_open_param *param)
{
+ const struct xe_oa_format *f = &oa->oa_formats[param->oa_format];
+
switch (param->oa_unit->type) {
case DRM_XE_OA_UNIT_TYPE_OAG:
- return type == DRM_XE_OA_FMT_TYPE_OAG || type == DRM_XE_OA_FMT_TYPE_OAR ||
- type == DRM_XE_OA_FMT_TYPE_OAC || type == DRM_XE_OA_FMT_TYPE_PEC;
+ return f->type == DRM_XE_OA_FMT_TYPE_OAG || f->type == DRM_XE_OA_FMT_TYPE_OAR ||
+ f->type == DRM_XE_OA_FMT_TYPE_OAC || f->type == DRM_XE_OA_FMT_TYPE_PEC;
case DRM_XE_OA_UNIT_TYPE_OAM:
case DRM_XE_OA_UNIT_TYPE_OAM_SAG:
case DRM_XE_OA_UNIT_TYPE_MERT:
- return type == DRM_XE_OA_FMT_TYPE_OAM || type == DRM_XE_OA_FMT_TYPE_OAM_MPEC;
+ return f->type == DRM_XE_OA_FMT_TYPE_OAM || f->type == DRM_XE_OA_FMT_TYPE_OAM_MPEC;
default:
return false;
}
@@ -2083,8 +2085,7 @@ int xe_oa_stream_open_ioctl(struct drm_device *dev, u64 data, struct drm_file *f
goto err_exec_q;
f = &oa->oa_formats[param.oa_format];
- if (!param.oa_format || !f->size ||
- !oa_unit_supports_oa_format(¶m, f->type)) {
+ if (!param.oa_format || !f->size || !oa_unit_supports_oa_format(oa, ¶m)) {
drm_dbg(&oa->xe->drm, "Invalid OA format %d type %d size %d for class %d\n",
param.oa_format, f->type, f->size, param.hwe->class);
ret = -EINVAL;
--
2.54.0
next prev parent reply other threads:[~2026-04-30 16:15 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-30 16:14 [PATCH 0/4] More MERTOA WA's Ashutosh Dixit
2026-04-30 16:14 ` Ashutosh Dixit [this message]
2026-04-30 16:14 ` [PATCH 2/4] drm/xe/oa: MERTOA Wa_14026746987 Ashutosh Dixit
2026-04-30 16:14 ` [PATCH 3/4] drm/xe/oa: Add val arg to xe_oa_is_valid_config_reg Ashutosh Dixit
2026-04-30 16:14 ` [PATCH 4/4] drm/xe/oa: MERTOA Wa_14026779378 Ashutosh Dixit
2026-04-30 17:21 ` ✓ CI.KUnit: success for More MERTOA WA's Patchwork
2026-04-30 18:16 ` ✓ Xe.CI.BAT: " Patchwork
2026-05-01 5:06 ` ✗ 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=20260430161459.2892545-2-ashutosh.dixit@intel.com \
--to=ashutosh.dixit@intel.com \
--cc=intel-xe@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