From: Rodrigo Vivi <rodrigo.vivi@intel.com>
To: Michal Wajdeczko <michal.wajdeczko@intel.com>
Cc: <intel-xe@lists.freedesktop.org>
Subject: Re: [PATCH v2 3/5] drm/xe: Prepare format for GT-oriented messages in one place
Date: Wed, 10 Sep 2025 17:28:02 -0400 [thread overview]
Message-ID: <aMHtYothosjPjPXB@intel.com> (raw)
In-Reply-To: <20250909165941.31730-4-michal.wajdeczko@intel.com>
On Tue, Sep 09, 2025 at 06:59:37PM +0200, Michal Wajdeczko wrote:
> To avoid code duplication (and thus potential mistakes) and to
> allow easier changes (if needed) of the prefix format of the
> GT-oriented messages, prepare that prefix in dedicated macro.
>
> Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> ---
> v2: use uppercase for FMT macro (Rodrigo)
Thank you
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
> ---
> drivers/gpu/drm/xe/xe_gt_printk.h | 13 +++++++++----
> 1 file changed, 9 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/xe/xe_gt_printk.h b/drivers/gpu/drm/xe/xe_gt_printk.h
> index f2091c734aba..dcc45628cca9 100644
> --- a/drivers/gpu/drm/xe/xe_gt_printk.h
> +++ b/drivers/gpu/drm/xe/xe_gt_printk.h
> @@ -10,8 +10,10 @@
>
> #include "xe_gt_types.h"
>
> +#define __XE_GT_PRINTK_FMT(_gt, _fmt, _args...) "GT%u: " _fmt, (_gt)->info.id, ##_args
> +
> #define xe_gt_printk(_gt, _level, _fmt, ...) \
> - drm_##_level(>_to_xe(_gt)->drm, "GT%u: " _fmt, (_gt)->info.id, ##__VA_ARGS__)
> + drm_##_level(>_to_xe(_gt)->drm, __XE_GT_PRINTK_FMT((_gt), _fmt, ##__VA_ARGS__))
>
> #define xe_gt_err(_gt, _fmt, ...) \
> xe_gt_printk((_gt), err, _fmt, ##__VA_ARGS__)
> @@ -34,11 +36,14 @@
> #define xe_gt_dbg(_gt, _fmt, ...) \
> xe_gt_printk((_gt), dbg, _fmt, ##__VA_ARGS__)
>
> +#define xe_gt_WARN_type(_gt, _type, _condition, _fmt, ...) \
> + drm_WARN##_type(>_to_xe(_gt)->drm, _condition, _fmt, ## __VA_ARGS__)
> +
> #define xe_gt_WARN(_gt, _condition, _fmt, ...) \
> - drm_WARN(>_to_xe(_gt)->drm, _condition, "GT%u: " _fmt, (_gt)->info.id, ##__VA_ARGS__)
> + xe_gt_WARN_type((_gt),, _condition, __XE_GT_PRINTK_FMT((_gt), _fmt, ##__VA_ARGS__))
>
> #define xe_gt_WARN_ONCE(_gt, _condition, _fmt, ...) \
> - drm_WARN_ONCE(>_to_xe(_gt)->drm, _condition, "GT%u: " _fmt, (_gt)->info.id, ##__VA_ARGS__)
> + xe_gt_WARN_type((_gt), _ONCE, _condition, __XE_GT_PRINTK_FMT((_gt), _fmt, ##__VA_ARGS__))
>
> #define xe_gt_WARN_ON(_gt, _condition) \
> xe_gt_WARN((_gt), _condition, "%s(%s)", "WARN_ON", __stringify(_condition))
> @@ -72,7 +77,7 @@ static inline void __xe_gt_printfn_dbg(struct drm_printer *p, struct va_format *
> dbg = drm_dbg_printer(>_to_xe(gt)->drm, DRM_UT_DRIVER, NULL);
> dbg.origin = p->origin;
>
> - drm_printf(&dbg, "GT%u: %pV", gt->info.id, vaf);
> + drm_printf(&dbg, __XE_GT_PRINTK_FMT(gt, "%pV", vaf));
> }
>
> /**
> --
> 2.47.1
>
next prev parent reply other threads:[~2025-09-10 21:28 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-09 16:59 [PATCH v2 0/5] RFC: Add dedicated printk macros for tile and device Michal Wajdeczko
2025-09-09 16:59 ` [PATCH v2 1/5] drm/xe: Keep xe_gt_err() macro definitions together Michal Wajdeczko
2025-09-09 16:59 ` [PATCH v2 2/5] drm/xe: Drop "gt_" prefix from xe_gt_WARN() macros Michal Wajdeczko
2025-09-09 16:59 ` [PATCH v2 3/5] drm/xe: Prepare format for GT-oriented messages in one place Michal Wajdeczko
2025-09-10 21:28 ` Rodrigo Vivi [this message]
2025-09-11 3:49 ` Lucas De Marchi
2025-09-09 16:59 ` [PATCH v2 4/5] drm/xe: Add dedicated printk macros for tile and device Michal Wajdeczko
2025-09-10 21:28 ` Rodrigo Vivi
2025-09-11 3:51 ` Lucas De Marchi
2025-09-09 16:59 ` [PATCH v2 5/5] drm/xe: Use tile-oriented messages in GGTT code Michal Wajdeczko
2025-09-09 17:52 ` ✗ CI.checkpatch: warning for RFC: Add dedicated printk macros for tile and device (rev2) Patchwork
2025-09-09 17:53 ` ✓ CI.KUnit: success " Patchwork
2025-09-12 7:25 ` ✗ CI.checkpatch: warning for RFC: Add dedicated printk macros for tile and device (rev3) Patchwork
2025-09-12 7:26 ` ✓ CI.KUnit: success " Patchwork
2025-09-12 8:08 ` ✓ Xe.CI.BAT: " Patchwork
2025-09-12 9:58 ` ✗ Xe.CI.Full: failure " Patchwork
2025-09-12 10:18 ` 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=aMHtYothosjPjPXB@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.