From: Niranjana Vishwanathapura <niranjana.vishwanathapura@intel.com>
To: Xin Wang <x.wang@intel.com>
Cc: <intel-xe@lists.freedesktop.org>
Subject: Re: [PATCH v3] drm/xe: improve readability of debugfs info engine output
Date: Mon, 30 Mar 2026 20:29:46 -0700 [thread overview]
Message-ID: <acs_d0N23eOVtwTI@nvishwa1-desk> (raw)
In-Reply-To: <20260331002944.601231-1-x.wang@intel.com>
On Mon, Mar 30, 2026 at 05:29:44PM -0700, Xin Wang wrote:
>Improve the readability of the info debugfs output by replacing
>raw numeric engine masks with human-readable engine and class
>names.
>
>Also expose multi_lrc_engine_classes in the info output and print
>per-GT engine capability data in a form that is easier to inspect
>manually and simpler for userspace tests to consume.
>
>This avoids requiring userspace to duplicate kernel mask decoding
>logic when validating engine capabilities.
>
>Signed-off-by: Xin Wang <x.wang@intel.com>
>---
> drivers/gpu/drm/xe/xe_debugfs.c | 44 ++++++++++++++++++++++++++++++---
> 1 file changed, 40 insertions(+), 4 deletions(-)
>
>diff --git a/drivers/gpu/drm/xe/xe_debugfs.c b/drivers/gpu/drm/xe/xe_debugfs.c
>index 844cfafe1ec7..9d1c388054e4 100644
>--- a/drivers/gpu/drm/xe/xe_debugfs.c
>+++ b/drivers/gpu/drm/xe/xe_debugfs.c
>@@ -15,9 +15,11 @@
> #include "xe_bo.h"
> #include "xe_device.h"
> #include "xe_force_wake.h"
>+#include "xe_gt.h"
> #include "xe_gt_debugfs.h"
> #include "xe_gt_printk.h"
> #include "xe_guc_ads.h"
>+#include "xe_hw_engine.h"
> #include "xe_mmio.h"
> #include "xe_pm.h"
> #include "xe_psmi.h"
>@@ -61,6 +63,37 @@ static struct xe_device *node_to_xe(struct drm_info_node *node)
> return to_xe_device(node->minor->dev);
> }
>
>+static void print_engine_class_mask(struct drm_printer *p, const char *label, u8 mask)
>+{
>+ drm_printf(p, "%s", label);
>+ if (mask) {
>+ for (enum xe_engine_class ec = 0; ec < XE_ENGINE_CLASS_MAX; ec++) {
If there is one usecase, there will probably many that follow :)
Can make make this a macro 'for_each_hw_engine_class()'?
>+ if (mask & BIT(ec))
>+ drm_printf(p, " %s", xe_hw_engine_class_to_str(ec));
>+ }
>+ } else {
>+ drm_printf(p, " none");
>+ }
>+ drm_printf(p, "\n");
>+}
>+
>+static void print_engine_mask(struct drm_printer *p, const char *label,
>+ struct xe_gt *gt, u64 mask)
>+{
>+ struct xe_hw_engine *hwe;
>+ enum xe_hw_engine_id id;
>+
>+ drm_printf(p, "%s", label);
>+ if (mask) {
>+ for_each_hw_engine(hwe, gt, id)
>+ if (mask & BIT_ULL(id))
>+ drm_printf(p, " %s", hwe->name);
>+ } else {
>+ drm_printf(p, " none");
>+ }
>+ drm_printf(p, "\n");
>+}
>+
> static int info(struct seq_file *m, void *data)
> {
> struct xe_device *xe = node_to_xe(m->private);
>@@ -88,13 +121,16 @@ static int info(struct seq_file *m, void *data)
> drm_printf(&p, "has_flat_ccs %s\n", str_yes_no(xe->info.has_flat_ccs));
> drm_printf(&p, "has_usm %s\n", str_yes_no(xe->info.has_usm));
> drm_printf(&p, "skip_guc_pc %s\n", str_yes_no(xe->info.skip_guc_pc));
>+ print_engine_class_mask(&p, "multi_lrc_engine_classes", xe->info.multi_lrc_mask);
May be add this as a separate patch.
> for_each_gt(gt, xe, id) {
>+ char label[40];
>+
> drm_printf(&p, "gt%d force wake %d\n", id,
> xe_force_wake_ref(gt_to_fw(gt), XE_FW_GT));
>- drm_printf(&p, "gt%d engine_mask 0x%llx\n", id,
>- gt->info.engine_mask);
>- drm_printf(&p, "gt%d multi_queue_engine_class_mask 0x%x\n", id,
>- gt->info.multi_queue_engine_class_mask);
>+ snprintf(label, sizeof(label), "gt%d engines", id);
>+ print_engine_mask(&p, label, gt, gt->info.engine_mask);
>+ snprintf(label, sizeof(label), "gt%d multi_queue_engine_classes", id);
>+ print_engine_class_mask(&p, label, gt->info.multi_queue_engine_class_mask);
Do we need to pass the label? We can probably just print that here? I am fine with passing also.
I am bit concerned about it breaking the ABI. I did not see IGT code relying on these masks,
but it is better to check with maintainers also.
Other than these, patch looks good to me.
Reviewed-by: Niranjana Vishwanathapura <niranjana.vishwanathapura@intel.com>
Niranjana
> }
>
> return 0;
>--
>2.43.0
>
next prev parent reply other threads:[~2026-03-31 3:29 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-24 21:23 [PATCH] drm/xe: expose multi_lrc_mask in debugfs info Xin Wang
2026-03-24 21:29 ` ✓ CI.KUnit: success for " Patchwork
2026-03-24 22:04 ` ✓ Xe.CI.BAT: " Patchwork
2026-03-25 10:40 ` ✓ Xe.CI.FULL: " Patchwork
2026-03-30 17:09 ` [PATCH v2] drm/xe: expose multi_lrc_engine_classes " Xin Wang
2026-04-01 21:08 ` Matt Roper
2026-03-30 17:16 ` ✓ CI.KUnit: success for drm/xe: expose multi_lrc_mask in debugfs info (rev2) Patchwork
2026-03-30 17:53 ` ✓ Xe.CI.BAT: " Patchwork
2026-03-30 20:49 ` ✓ Xe.CI.FULL: " Patchwork
2026-03-31 0:29 ` [PATCH v3] drm/xe: improve readability of debugfs info engine output Xin Wang
2026-03-31 3:29 ` Niranjana Vishwanathapura [this message]
2026-03-31 0:43 ` ✓ CI.KUnit: success for drm/xe: expose multi_lrc_mask in debugfs info (rev3) Patchwork
2026-03-31 1:29 ` ✓ Xe.CI.BAT: " Patchwork
2026-03-31 5:56 ` ✗ Xe.CI.FULL: failure " Patchwork
2026-04-01 21:26 ` [PATCH v4 0/2] drm/xe: expose multi_lrc_mask in debugfs info Xin Wang
2026-04-01 21:26 ` [PATCH v4 1/2] drm/xe: improve readability of debugfs engine info output Xin Wang
2026-04-01 22:29 ` Matt Roper
2026-04-01 21:26 ` [PATCH v4 2/2] drm/xe: expose multi-lrc engine classes in debugfs info Xin Wang
2026-04-01 22:33 ` Matt Roper
2026-04-01 21:33 ` ✓ CI.KUnit: success for drm/xe: expose multi_lrc_mask in debugfs info (rev4) Patchwork
2026-04-01 22:10 ` ✓ Xe.CI.BAT: " Patchwork
2026-04-02 5:16 ` ✓ Xe.CI.FULL: " Patchwork
2026-04-02 16:29 ` [PATCH v5 0/2] drm/xe: expose multi_lrc_mask in debugfs info Xin Wang
2026-04-02 16:29 ` [PATCH v5 1/2] drm/xe: improve readability of debugfs engine info output Xin Wang
2026-04-02 16:29 ` [PATCH v5 2/2] drm/xe: expose multi-lrc engine classes in debugfs info Xin Wang
2026-04-02 16:49 ` ✓ CI.KUnit: success for drm/xe: expose multi_lrc_mask in debugfs info (rev5) Patchwork
2026-04-02 17:45 ` ✓ Xe.CI.BAT: " 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=acs_d0N23eOVtwTI@nvishwa1-desk \
--to=niranjana.vishwanathapura@intel.com \
--cc=intel-xe@lists.freedesktop.org \
--cc=x.wang@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