From: Rodrigo Vivi <rodrigo.vivi@intel.com>
To: Michal Wajdeczko <michal.wajdeczko@intel.com>
Cc: <intel-xe@lists.freedesktop.org>
Subject: Re: [PATCH 5/5] drm/xe/debugfs: Update xe_pat_dump signature
Date: Mon, 29 Sep 2025 19:27:02 -0400 [thread overview]
Message-ID: <aNsVxtprooXpidGw@intel.com> (raw)
In-Reply-To: <20250923211613.193347-6-michal.wajdeczko@intel.com>
On Tue, Sep 23, 2025 at 11:16:13PM +0200, Michal Wajdeczko wrote:
> Our debugfs helper xe_gt_debugfs_show_with_rpm() expects print()
> functions to return int. New signature allows us to drop wrapper.
>
> While around, move kernel-doc closer to the function definition,
> as suggested in the doc-guide.
>
> Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
> ---
> drivers/gpu/drm/xe/xe_gt_debugfs.c | 8 +-----
> drivers/gpu/drm/xe/xe_pat.c | 40 +++++++++++++++++++-----------
> drivers/gpu/drm/xe/xe_pat.h | 7 +-----
> 3 files changed, 28 insertions(+), 27 deletions(-)
>
> diff --git a/drivers/gpu/drm/xe/xe_gt_debugfs.c b/drivers/gpu/drm/xe/xe_gt_debugfs.c
> index b0e6dafeeacc..e4fd632f43cf 100644
> --- a/drivers/gpu/drm/xe/xe_gt_debugfs.c
> +++ b/drivers/gpu/drm/xe/xe_gt_debugfs.c
> @@ -167,12 +167,6 @@ static int register_save_restore(struct xe_gt *gt, struct drm_printer *p)
> return 0;
> }
>
> -static int pat(struct xe_gt *gt, struct drm_printer *p)
> -{
> - xe_pat_dump(gt, p);
> - return 0;
> -}
> -
> static int rcs_default_lrc(struct xe_gt *gt, struct drm_printer *p)
> {
> xe_lrc_dump_default(p, gt, XE_ENGINE_CLASS_RENDER);
> @@ -232,7 +226,7 @@ static const struct drm_info_list vf_safe_debugfs_list[] = {
> static const struct drm_info_list pf_only_debugfs_list[] = {
> { "hw_engines", .show = xe_gt_debugfs_show_with_rpm, .data = hw_engines },
> { "mocs", .show = xe_gt_debugfs_show_with_rpm, .data = xe_mocs_dump },
> - { "pat", .show = xe_gt_debugfs_show_with_rpm, .data = pat },
> + { "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 },
> { "steering", .show = xe_gt_debugfs_show_with_rpm, .data = steering },
> };
> diff --git a/drivers/gpu/drm/xe/xe_pat.c b/drivers/gpu/drm/xe/xe_pat.c
> index 2e7cb99ae87a..6e48ff84ad0a 100644
> --- a/drivers/gpu/drm/xe/xe_pat.c
> +++ b/drivers/gpu/drm/xe/xe_pat.c
> @@ -57,7 +57,7 @@ struct xe_pat_ops {
> int n_entries);
> void (*program_media)(struct xe_gt *gt, const struct xe_pat_table_entry table[],
> int n_entries);
> - void (*dump)(struct xe_gt *gt, struct drm_printer *p);
> + int (*dump)(struct xe_gt *gt, struct drm_printer *p);
> };
>
> static const struct xe_pat_table_entry xelp_pat_table[] = {
> @@ -194,7 +194,7 @@ static void program_pat_mcr(struct xe_gt *gt, const struct xe_pat_table_entry ta
> xe_gt_mcr_multicast_write(gt, XE_REG_MCR(_PAT_PTA), xe->pat.pat_pta->value);
> }
>
> -static void xelp_dump(struct xe_gt *gt, struct drm_printer *p)
> +static int xelp_dump(struct xe_gt *gt, struct drm_printer *p)
> {
> struct xe_device *xe = gt_to_xe(gt);
> unsigned int fw_ref;
> @@ -202,7 +202,7 @@ static void xelp_dump(struct xe_gt *gt, struct drm_printer *p)
>
> fw_ref = xe_force_wake_get(gt_to_fw(gt), XE_FW_GT);
> if (!fw_ref)
> - return;
> + return -ETIMEDOUT;
>
> drm_printf(p, "PAT table:\n");
>
> @@ -215,6 +215,7 @@ static void xelp_dump(struct xe_gt *gt, struct drm_printer *p)
> }
>
> xe_force_wake_put(gt_to_fw(gt), fw_ref);
> + return 0;
> }
>
> static const struct xe_pat_ops xelp_pat_ops = {
> @@ -222,7 +223,7 @@ static const struct xe_pat_ops xelp_pat_ops = {
> .dump = xelp_dump,
> };
>
> -static void xehp_dump(struct xe_gt *gt, struct drm_printer *p)
> +static int xehp_dump(struct xe_gt *gt, struct drm_printer *p)
> {
> struct xe_device *xe = gt_to_xe(gt);
> unsigned int fw_ref;
> @@ -230,7 +231,7 @@ static void xehp_dump(struct xe_gt *gt, struct drm_printer *p)
>
> fw_ref = xe_force_wake_get(gt_to_fw(gt), XE_FW_GT);
> if (!fw_ref)
> - return;
> + return -ETIMEDOUT;
>
> drm_printf(p, "PAT table:\n");
>
> @@ -245,6 +246,7 @@ static void xehp_dump(struct xe_gt *gt, struct drm_printer *p)
> }
>
> xe_force_wake_put(gt_to_fw(gt), fw_ref);
> + return 0;
> }
>
> static const struct xe_pat_ops xehp_pat_ops = {
> @@ -252,7 +254,7 @@ static const struct xe_pat_ops xehp_pat_ops = {
> .dump = xehp_dump,
> };
>
> -static void xehpc_dump(struct xe_gt *gt, struct drm_printer *p)
> +static int xehpc_dump(struct xe_gt *gt, struct drm_printer *p)
> {
> struct xe_device *xe = gt_to_xe(gt);
> unsigned int fw_ref;
> @@ -260,7 +262,7 @@ static void xehpc_dump(struct xe_gt *gt, struct drm_printer *p)
>
> fw_ref = xe_force_wake_get(gt_to_fw(gt), XE_FW_GT);
> if (!fw_ref)
> - return;
> + return -ETIMEDOUT;
>
> drm_printf(p, "PAT table:\n");
>
> @@ -273,6 +275,7 @@ static void xehpc_dump(struct xe_gt *gt, struct drm_printer *p)
> }
>
> xe_force_wake_put(gt_to_fw(gt), fw_ref);
> + return 0;
> }
>
> static const struct xe_pat_ops xehpc_pat_ops = {
> @@ -280,7 +283,7 @@ static const struct xe_pat_ops xehpc_pat_ops = {
> .dump = xehpc_dump,
> };
>
> -static void xelpg_dump(struct xe_gt *gt, struct drm_printer *p)
> +static int xelpg_dump(struct xe_gt *gt, struct drm_printer *p)
> {
> struct xe_device *xe = gt_to_xe(gt);
> unsigned int fw_ref;
> @@ -288,7 +291,7 @@ static void xelpg_dump(struct xe_gt *gt, struct drm_printer *p)
>
> fw_ref = xe_force_wake_get(gt_to_fw(gt), XE_FW_GT);
> if (!fw_ref)
> - return;
> + return -ETIMEDOUT;
>
> drm_printf(p, "PAT table:\n");
>
> @@ -306,6 +309,7 @@ static void xelpg_dump(struct xe_gt *gt, struct drm_printer *p)
> }
>
> xe_force_wake_put(gt_to_fw(gt), fw_ref);
> + return 0;
> }
>
> /*
> @@ -318,7 +322,7 @@ static const struct xe_pat_ops xelpg_pat_ops = {
> .dump = xelpg_dump,
> };
>
> -static void xe2_dump(struct xe_gt *gt, struct drm_printer *p)
> +static int xe2_dump(struct xe_gt *gt, struct drm_printer *p)
> {
> struct xe_device *xe = gt_to_xe(gt);
> unsigned int fw_ref;
> @@ -327,7 +331,7 @@ static void xe2_dump(struct xe_gt *gt, struct drm_printer *p)
>
> fw_ref = xe_force_wake_get(gt_to_fw(gt), XE_FW_GT);
> if (!fw_ref)
> - return;
> + return -ETIMEDOUT;
>
> drm_printf(p, "PAT table:\n");
>
> @@ -367,6 +371,7 @@ static void xe2_dump(struct xe_gt *gt, struct drm_printer *p)
> pat);
>
> xe_force_wake_put(gt_to_fw(gt), fw_ref);
> + return 0;
> }
>
> static const struct xe_pat_ops xe2_pat_ops = {
> @@ -462,12 +467,19 @@ void xe_pat_init(struct xe_gt *gt)
> xe->pat.ops->program_graphics(gt, xe->pat.table, xe->pat.n_entries);
> }
>
> -void xe_pat_dump(struct xe_gt *gt, struct drm_printer *p)
> +/**
> + * xe_pat_dump() - Dump GT PAT table into a drm printer.
> + * @gt: the &xe_gt
> + * @p: the &drm_printer
> + *
> + * Return: 0 on success or a negative error code on failure.
> + */
> +int xe_pat_dump(struct xe_gt *gt, struct drm_printer *p)
> {
> struct xe_device *xe = gt_to_xe(gt);
>
> if (!xe->pat.ops)
> - return;
> + return -EOPNOTSUPP;
>
> - xe->pat.ops->dump(gt, p);
> + return xe->pat.ops->dump(gt, p);
> }
> diff --git a/drivers/gpu/drm/xe/xe_pat.h b/drivers/gpu/drm/xe/xe_pat.h
> index fa0dfbe525cd..268c9a899f56 100644
> --- a/drivers/gpu/drm/xe/xe_pat.h
> +++ b/drivers/gpu/drm/xe/xe_pat.h
> @@ -43,12 +43,7 @@ void xe_pat_init_early(struct xe_device *xe);
> */
> void xe_pat_init(struct xe_gt *gt);
>
> -/**
> - * xe_pat_dump - Dump PAT table
> - * @gt: GT structure
> - * @p: Printer to dump info to
> - */
> -void xe_pat_dump(struct xe_gt *gt, struct drm_printer *p);
> +int xe_pat_dump(struct xe_gt *gt, struct drm_printer *p);
>
> /**
> * xe_pat_index_get_coh_mode - Extract the coherency mode for the given
> --
> 2.47.1
>
next prev parent reply other threads:[~2025-09-29 23:27 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-23 21:16 [PATCH 0/5] drm/xe/debugfs: Avoid use of wrapper functions Michal Wajdeczko
2025-09-23 21:16 ` [PATCH 1/5] drm/xe/debugfs: Update xe_gt_topology_dump signature Michal Wajdeczko
2025-09-29 23:25 ` Rodrigo Vivi
2025-09-30 8:45 ` Jani Nikula
2025-09-30 10:17 ` Michal Wajdeczko
2025-09-30 11:43 ` Jani Nikula
2025-09-30 17:23 ` Raag Jadav
2025-09-30 17:46 ` Michal Wajdeczko
2025-10-01 15:35 ` Rodrigo Vivi
2025-09-23 21:16 ` [PATCH 2/5] drm/xe/debugfs: Update xe_wa_dump signature Michal Wajdeczko
2025-09-29 23:25 ` Rodrigo Vivi
2025-09-23 21:16 ` [PATCH 3/5] drm/xe/debugfs: Update xe_tuning_dump signature Michal Wajdeczko
2025-09-29 23:26 ` Rodrigo Vivi
2025-09-23 21:16 ` [PATCH 4/5] drm/xe/debugfs: Update xe_mocs_dump signature Michal Wajdeczko
2025-09-29 23:26 ` Rodrigo Vivi
2025-09-23 21:16 ` [PATCH 5/5] drm/xe/debugfs: Update xe_pat_dump signature Michal Wajdeczko
2025-09-29 23:27 ` Rodrigo Vivi [this message]
2025-09-23 21:23 ` ✓ CI.KUnit: success for drm/xe/debugfs: Avoid use of wrapper functions Patchwork
2025-09-23 22:22 ` ✓ Xe.CI.BAT: " Patchwork
2025-09-24 2:07 ` ✗ Xe.CI.Full: failure " Patchwork
2025-09-30 8:15 ` Michal Wajdeczko
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=aNsVxtprooXpidGw@intel.com \
--to=rodrigo.vivi@intel.com \
--cc=intel-xe@lists.freedesktop.org \
--cc=michal.wajdeczko@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.