From: Jani Nikula <jani.nikula@linux.intel.com>
To: Krzysztof Karas <krzysztof.karas@intel.com>,
intel-gfx@lists.freedesktop.org
Cc: dri-devel@lists.freedesktop.org,
Andi Shyti <andi.shyti@linux.intel.com>,
Janusz Krzysztofik <janusz.krzysztofik@linux.intel.com>,
Sebastian Brzezinka <sebastian.brzezinka@intel.com>,
Krzysztof Niemiec <krzysztof.niemiec@intel.com>,
Krzysztof Karas <krzysztof.karas@intel.com>,
Andi Shyti <andi.shyti@kernel.org>
Subject: Re: [PATCH v4 2/7] drm/i915: Add i915_* printer macros
Date: Fri, 25 Sep 2026 13:47:39 +0300 [thread overview]
Message-ID: <344886121db0900dd7c22b3807ee75632f230f3d@intel.com> (raw)
In-Reply-To: <20260924120147.1305127-3-krzysztof.karas@intel.com>
On Thu, 24 Sep 2026, Krzysztof Karas <krzysztof.karas@intel.com> wrote:
> Add i915_* family of printer macros, following existing example
> of gt_* and xe_* prints.
Frankly, I don't want *any* of this.
The drm_* macros are already a bunch of wrappers around dev_*
macros. IMO this is just too much, just to avoid writing &i915->drm.
(And yes, I dislike what's been done in xe too.)
BR,
Jani.
>
> Suggested-by: Andi Shyti <andi.shyti@kernel.org>
> Signed-off-by: Krzysztof Karas <krzysztof.karas@intel.com>
> ---
> drivers/gpu/drm/i915/i915_printk.h | 53 ++++++++++++++++++++++++++++++
> 1 file changed, 53 insertions(+)
> create mode 100644 drivers/gpu/drm/i915/i915_printk.h
>
> diff --git a/drivers/gpu/drm/i915/i915_printk.h b/drivers/gpu/drm/i915/i915_printk.h
> new file mode 100644
> index 000000000000..5bbbe604cae8
> --- /dev/null
> +++ b/drivers/gpu/drm/i915/i915_printk.h
> @@ -0,0 +1,53 @@
> +/* SPDX-License-Identifier: MIT */
> +/*
> + * Copyright © 2026 Intel Corporation
> + */
> +
> +#ifndef _I915_PRINTK_H_
> +#define _I915_PRINTK_H_
> +
> +#include <drm/drm_print.h>
> +
> +#define i915_printk(_i915, _level, _fmt, ...) \
> + drm_##_level(&(_i915)->drm, _fmt, ## __VA_ARGS__)
> +
> +#define i915_err(_i915, _fmt, ...) \
> + i915_printk((_i915), err, _fmt, ##__VA_ARGS__)
> +
> +#define i915_err_once(_i915, _fmt, ...) \
> + i915_printk((_i915), err_once, _fmt, ##__VA_ARGS__)
> +
> +#define i915_err_ratelimited(_i915, _fmt, ...) \
> + i915_printk((_i915), err_ratelimited, _fmt, ##__VA_ARGS__)
> +
> +#define i915_warn(_i915, _fmt, ...) \
> + i915_printk((_i915), warn, _fmt, ##__VA_ARGS__)
> +
> +#define i915_notice(_i915, _fmt, ...) \
> + i915_printk((_i915), notice, _fmt, ##__VA_ARGS__)
> +
> +#define i915_info(_i915, _fmt, ...) \
> + i915_printk((_i915), info, _fmt, ##__VA_ARGS__)
> +
> +#define i915_dbg(_i915, _fmt, ...) \
> + i915_printk((_i915), dbg, _fmt, ##__VA_ARGS__)
> +
> +#define i915_dbg_ratelimited(_i915, _fmt, ...) \
> + i915_printk((_i915), dbg_ratelimited, _fmt, ##__VA_ARGS__)
> +
> +#define i915_WARN_type(_i915, _type, _condition, _fmt, ...) \
> + drm_WARN##_type(&(_i915)->drm, _condition, _fmt, ## __VA_ARGS__)
> +
> +#define i915_WARN(_i915, _condition, _fmt, ...) \
> + i915_WARN_type((_i915), _condition, __I915_PRINTK_FMT((_i915), _fmt, ## __VA_ARGS__))
> +
> +#define i915_WARN_ONCE(_i915, _condition, _fmt, ...) \
> + i915_WARN_type((_i915), _ONCE, _condition, __I915_PRINTK_FMT((_i915), _fmt, ## __VA_ARGS__))
> +
> +#define i915_WARN_ON(_i915, _condition) \
> + i915_WARN((_i915), _condition, "%s(%s)", "WARN_ON", __stringify(_condition))
> +
> +#define i915_WARN_ON_ONCE(_i915, _condition) \
> + i915_WARN_ONCE((_i915), _condition, "%s(%s)", "WARN_ON_ONCE", __stringify(_condition))
> +
> +#endif
--
Jani Nikula, Intel
next prev parent reply other threads:[~2026-09-25 10:47 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-24 12:01 [PATCH v4 0/7] drm/i915/selftests: Modernize printing in i915 selftests Krzysztof Karas
2026-09-24 12:01 ` [PATCH v4 1/7] drm/i915/selftests: Use gt_*/drm_* prints in core selftests Krzysztof Karas
2026-09-24 12:01 ` [PATCH v4 2/7] drm/i915: Add i915_* printer macros Krzysztof Karas
2026-09-24 13:58 ` Sebastian Brzezinka
2026-09-25 10:47 ` Jani Nikula [this message]
2026-09-29 12:00 ` Krzysztof Karas
2026-09-24 12:01 ` [PATCH v4 3/7] drm/i915/selftests: Use gt_*/i915_* prints in selftest helpers Krzysztof Karas
2026-09-24 12:01 ` [PATCH v4 4/7] drm/i915/gt/selftests: Use gt_* prints in aggregated gt selftests Krzysztof Karas
2026-09-24 12:01 ` [PATCH v4 5/7] drm/i915/gt/selftests: Use gt_* prints in gt standalone tests Krzysztof Karas
2026-09-24 12:01 ` [PATCH v4 6/7] drm/i915/gt/selftests: Use gt_* prints in gt selftest helpers Krzysztof Karas
2026-09-24 12:01 ` [PATCH v4 7/7] drm/i915/selftests: Use i915_* prints in i915_selftest.c Krzysztof Karas
2026-09-25 10:51 ` Jani Nikula
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=344886121db0900dd7c22b3807ee75632f230f3d@intel.com \
--to=jani.nikula@linux.intel.com \
--cc=andi.shyti@kernel.org \
--cc=andi.shyti@linux.intel.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=janusz.krzysztofik@linux.intel.com \
--cc=krzysztof.karas@intel.com \
--cc=krzysztof.niemiec@intel.com \
--cc=sebastian.brzezinka@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