From: Xin Wang <x.wang@intel.com>
To: intel-xe@lists.freedesktop.org
Cc: Xin Wang <x.wang@intel.com>,
Matt Roper <matthew.d.roper@intel.com>,
Brian Nguyen <brian3.nguyen@intel.com>
Subject: [PATCH v2] drm/xe: use entry_dump callbacks for xe2+ PAT dumps
Date: Fri, 30 Jan 2026 00:21:47 +0000 [thread overview]
Message-ID: <20260130002147.2215241-1-x.wang@intel.com> (raw)
Move xe2+ PAT entry printing into the entry_dump op so platform
specific logic stays localized, simplifying future maintenance.
v2:
- Do not null xe->pat.ops for VFs.
- Skip PAT init and dump on VFs (-EOPNOTSUPP), avoiding NULL ops use.
Cc: Matt Roper <matthew.d.roper@intel.com>
Suggested-by: Brian Nguyen <brian3.nguyen@intel.com>
Signed-off-by: Xin Wang <x.wang@intel.com>
---
drivers/gpu/drm/xe/xe_pat.c | 30 ++++++++++++++----------------
1 file changed, 14 insertions(+), 16 deletions(-)
diff --git a/drivers/gpu/drm/xe/xe_pat.c b/drivers/gpu/drm/xe/xe_pat.c
index 14d0dce5190a..f69ce7bda477 100644
--- a/drivers/gpu/drm/xe/xe_pat.c
+++ b/drivers/gpu/drm/xe/xe_pat.c
@@ -88,6 +88,8 @@ struct xe_pat_ops {
void (*program_media)(struct xe_gt *gt, const struct xe_pat_table_entry table[],
int n_entries);
int (*dump)(struct xe_gt *gt, struct drm_printer *p);
+ void (*entry_dump)(struct drm_printer *p, const char *label, u32 pat, bool rsvd);
+
};
static const struct xe_pat_table_entry xelp_pat_table[] = {
@@ -480,6 +482,7 @@ static const struct xe_pat_ops xe2_pat_ops = {
.program_graphics = program_pat_mcr,
.program_media = program_pat,
.dump = xe2_dump,
+ .entry_dump = xe2_pat_entry_dump,
};
static int xe3p_xpc_dump(struct xe_gt *gt, struct drm_printer *p)
@@ -518,6 +521,7 @@ static const struct xe_pat_ops xe3p_xpc_pat_ops = {
.program_graphics = program_pat_mcr,
.program_media = program_pat,
.dump = xe3p_xpc_dump,
+ .entry_dump = xe3p_xpc_pat_entry_dump,
};
void xe_pat_init_early(struct xe_device *xe)
@@ -600,20 +604,17 @@ void xe_pat_init_early(struct xe_device *xe)
GRAPHICS_VER(xe), GRAPHICS_VERx100(xe) % 100);
}
- /* VFs can't program nor dump PAT settings */
- if (IS_SRIOV_VF(xe))
- xe->pat.ops = NULL;
-
- xe_assert(xe, !xe->pat.ops || xe->pat.ops->dump);
- xe_assert(xe, !xe->pat.ops || xe->pat.ops->program_graphics);
- xe_assert(xe, !xe->pat.ops || MEDIA_VER(xe) < 13 || xe->pat.ops->program_media);
+ xe_assert(xe, xe->pat.ops->dump);
+ xe_assert(xe, xe->pat.ops->program_graphics);
+ xe_assert(xe, MEDIA_VER(xe) < 13 || xe->pat.ops->program_media);
+ xe_assert(xe, GRAPHICS_VER(xe) < 20 || xe->pat.ops->entry_dump);
}
void xe_pat_init(struct xe_gt *gt)
{
struct xe_device *xe = gt_to_xe(gt);
- if (!xe->pat.ops)
+ if (IS_SRIOV_VF(xe))
return;
if (xe_gt_is_media_type(gt))
@@ -633,7 +634,7 @@ int xe_pat_dump(struct xe_gt *gt, struct drm_printer *p)
{
struct xe_device *xe = gt_to_xe(gt);
- if (!xe->pat.ops)
+ if (IS_SRIOV_VF(xe))
return -EOPNOTSUPP;
return xe->pat.ops->dump(gt, p);
@@ -658,12 +659,9 @@ int xe_pat_dump_sw_config(struct xe_gt *gt, struct drm_printer *p)
for (u32 i = 0; i < xe->pat.n_entries; i++) {
u32 pat = xe->pat.table[i].value;
- if (GRAPHICS_VERx100(xe) == 3511) {
- xe_pat_index_label(label, sizeof(label), i);
- xe3p_xpc_pat_entry_dump(p, label, pat, !xe->pat.table[i].valid);
- } else if (GRAPHICS_VER(xe) == 30 || GRAPHICS_VER(xe) == 20) {
+ if (GRAPHICS_VERx100(xe) >= 20) {
xe_pat_index_label(label, sizeof(label), i);
- xe2_pat_entry_dump(p, label, pat, !xe->pat.table[i].valid);
+ xe->pat.ops->entry_dump(p, label, pat, !xe->pat.table[i].valid);
} else if (xe->info.platform == XE_METEORLAKE) {
xelpg_pat_entry_dump(p, i, pat);
} else if (xe->info.platform == XE_PVC) {
@@ -679,14 +677,14 @@ int xe_pat_dump_sw_config(struct xe_gt *gt, struct drm_printer *p)
u32 pat = xe->pat.pat_pta->value;
drm_printf(p, "Page Table Access:\n");
- xe2_pat_entry_dump(p, "PTA_MODE", pat, false);
+ xe->pat.ops->entry_dump(p, "PTA_MODE", pat, false);
}
if (xe->pat.pat_ats) {
u32 pat = xe->pat.pat_ats->value;
drm_printf(p, "PCIe ATS/PASID:\n");
- xe2_pat_entry_dump(p, "PAT_ATS ", pat, false);
+ xe->pat.ops->entry_dump(p, "PAT_ATS ", pat, false);
}
drm_printf(p, "Cache Level:\n");
--
2.43.0
next reply other threads:[~2026-01-30 0:21 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-30 0:21 Xin Wang [this message]
2026-01-30 1:21 ` ✓ CI.KUnit: success for drm/xe: use entry_dump callbacks for xe2+ PAT dumps (rev2) Patchwork
2026-01-30 2:22 ` ✗ Xe.CI.BAT: 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=20260130002147.2215241-1-x.wang@intel.com \
--to=x.wang@intel.com \
--cc=brian3.nguyen@intel.com \
--cc=intel-xe@lists.freedesktop.org \
--cc=matthew.d.roper@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