From: "Purkait, Soham" <soham.purkait@intel.com>
To: Sk Anirban <sk.anirban@intel.com>, <intel-xe@lists.freedesktop.org>
Cc: <anshuman.gupta@intel.com>, <badal.nilawar@intel.com>,
<riana.tauro@intel.com>, <karthik.poosa@intel.com>,
<raag.jadav@intel.com>, <mallesh.koujalagi@intel.com>,
<vinay.belgaumkar@intel.com>
Subject: Re: [PATCH] drm/xe/debugfs: Expose per-engine idle status
Date: Wed, 17 Jun 2026 13:59:11 +0530 [thread overview]
Message-ID: <66254e2c-fa6a-4068-ae59-824dedcb9ff5@intel.com> (raw)
In-Reply-To: <20260609195149.616010-2-sk.anirban@intel.com>
[-- Attachment #1: Type: text/plain, Size: 3170 bytes --]
Hi Airban,
On 10-06-2026 01:21, Sk Anirban wrote:
> Add a GT debugfs entry that iterates over engines and reports
> whether each engine is active or idle. This can help debug C6
> issues by identifying engines that may be preventing the GT
> from going idle.
>
> Signed-off-by: Sk Anirban<sk.anirban@intel.com>
> ---
> drivers/gpu/drm/xe/xe_gt_debugfs.c | 31 +++++++++++++++++++++++++++++-
> 1 file changed, 30 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/xe/xe_gt_debugfs.c b/drivers/gpu/drm/xe/xe_gt_debugfs.c
> index f45306308cd6..d404467146d1 100644
> --- a/drivers/gpu/drm/xe/xe_gt_debugfs.c
> +++ b/drivers/gpu/drm/xe/xe_gt_debugfs.c
> @@ -10,6 +10,8 @@
> #include <drm/drm_debugfs.h>
> #include <drm/drm_managed.h>
>
> +#include "regs/xe_engine_regs.h"
> +
> #include "xe_device.h"
> #include "xe_force_wake.h"
> #include "xe_gt.h" @@ -115,8 +117,10 @@ static int hw_engines(struct xe_gt *gt, struct
> drm_printer *p) enum xe_hw_engine_id id; CLASS(xe_force_wake,
> fw_ref)(gt_to_fw(gt), XE_FORCEWAKE_ALL); - if
> (!xe_force_wake_ref_has_domain(fw_ref.domains, XE_FORCEWAKE_ALL)) + if
> (!xe_force_wake_ref_has_domain(fw_ref.domains, XE_FORCEWAKE_ALL)) { +
> drm_printf(p, "ERROR: Could not acquire forcewake\n");
> return -ETIMEDOUT;
> + }
>
> for_each_hw_engine(hwe, gt, id)
> xe_hw_engine_print(hwe, p);
> @@ -124,6 +128,30 @@ static int hw_engines(struct xe_gt *gt, struct drm_printer *p)
> return 0;
> }
>
> +static bool hw_engine_is_active(struct xe_hw_engine *hwe)
Should it be renamed as is_ring_empty or something similar ? Why the
active ticks are nor being checked to evaluate the busyness ?
> +{
> + u32 head = xe_hw_engine_mmio_read32(hwe, RING_HEAD(0));
> + u32 tail = xe_hw_engine_mmio_read32(hwe, RING_TAIL(0));
> +
> + return (head & HEAD_ADDR) != (tail & TAIL_ADDR);
> +}
> +
> +static int hw_engine_status(struct xe_gt *gt, struct drm_printer *p)
> +{
> + struct xe_hw_engine *hwe;
> + enum xe_hw_engine_id id;
> +
> + CLASS(xe_force_wake, fw_ref)(gt_to_fw(gt), XE_FORCEWAKE_ALL);
> + if (!xe_force_wake_ref_has_domain(fw_ref.domains, XE_FORCEWAKE_ALL))
It silently returns -ETIMEDOUT on failure. Better, a reason could be
emitted as done for hw_engine().
Thanks, Soham
> + return -ETIMEDOUT;
> +
> + for_each_hw_engine(hwe, gt, id)
> + drm_printf(p, "%s: %s\n", hwe->name,
> + hw_engine_is_active(hwe) ? "active" : "idle");
> +
> + return 0;
> +}
> +
> static int steering(struct xe_gt *gt, struct drm_printer *p)
> {
> xe_gt_mcr_steering_dump(gt, p);
> @@ -240,6 +268,7 @@ static const struct drm_info_list vf_safe_debugfs_list[] = {
> /* everything else should be added here */
> static const struct drm_info_list pf_only_debugfs_list[] = {
> { "hw_engines", .show = xe_gt_debugfs_show_with_rpm, .data = hw_engines },
> + { "hw_engine_status", .show = xe_gt_debugfs_show_with_rpm, .data = hw_engine_status },
> { "mocs", .show = xe_gt_debugfs_show_with_rpm, .data = xe_mocs_dump },
> { "pat", .show = xe_gt_debugfs_show_with_rpm, .data = xe_pat_dump },
> { "powergate_info", .show = xe_gt_debugfs_show_with_rpm, .data = xe_gt_idle_pg_print },
[-- Attachment #2: Type: text/html, Size: 4376 bytes --]
next prev parent reply other threads:[~2026-06-17 8:29 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-09 19:51 [PATCH] drm/xe/debugfs: Expose per-engine idle status Sk Anirban
2026-06-09 20:04 ` ✓ CI.KUnit: success for " Patchwork
2026-06-09 21:00 ` ✓ Xe.CI.BAT: " Patchwork
2026-06-10 10:56 ` ✓ Xe.CI.FULL: " Patchwork
2026-06-17 8:29 ` Purkait, Soham [this message]
-- strict thread matches above, loose matches on Subject: below --
2026-07-16 15:06 [PATCH] " Sk Anirban
2026-07-23 19:43 Sk Anirban
2026-08-28 23:30 ` Belgaumkar, Vinay
2026-09-01 15:12 ` Anirban, Sk
2026-09-01 21:26 ` Belgaumkar, Vinay
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=66254e2c-fa6a-4068-ae59-824dedcb9ff5@intel.com \
--to=soham.purkait@intel.com \
--cc=anshuman.gupta@intel.com \
--cc=badal.nilawar@intel.com \
--cc=intel-xe@lists.freedesktop.org \
--cc=karthik.poosa@intel.com \
--cc=mallesh.koujalagi@intel.com \
--cc=raag.jadav@intel.com \
--cc=riana.tauro@intel.com \
--cc=sk.anirban@intel.com \
--cc=vinay.belgaumkar@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.