Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Michal Wajdeczko <michal.wajdeczko@intel.com>
To: intel-xe@lists.freedesktop.org
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>,
	Matt Roper <matthew.d.roper@intel.com>
Subject: [PATCH v4 01/10] drm/xe: Add GT oriented drm_printers
Date: Fri, 15 Dec 2023 17:24:53 +0100	[thread overview]
Message-ID: <20231215162502.1879-2-michal.wajdeczko@intel.com> (raw)
In-Reply-To: <20231215162502.1879-1-michal.wajdeczko@intel.com>

Instead of using generic drm_err_printer() that just adds static
prefix, or drm_info_printer() that outputs only device name, add
new helpers that create dedicated drm_printers that use our GT
oriented xe_gt_err() and xe_gt_info() functions.

Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Cc: Matt Roper <matthew.d.roper@intel.com>
Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
---
 drivers/gpu/drm/xe/xe_gt_printk.h | 44 +++++++++++++++++++++++++++++++
 1 file changed, 44 insertions(+)

diff --git a/drivers/gpu/drm/xe/xe_gt_printk.h b/drivers/gpu/drm/xe/xe_gt_printk.h
index 5991bcadd47e..195f45b10c41 100644
--- a/drivers/gpu/drm/xe/xe_gt_printk.h
+++ b/drivers/gpu/drm/xe/xe_gt_printk.h
@@ -43,4 +43,48 @@
 #define xe_gt_WARN_ON_ONCE(_gt, _condition) \
 	xe_gt_WARN_ONCE((_gt), _condition, "%s(%s)", "gt_WARN_ON_ONCE", __stringify(_condition))
 
+static inline void __drm_printfn_xe_gt_err(struct drm_printer *p, struct va_format *vaf)
+{
+	struct xe_gt *gt = p->arg;
+
+	xe_gt_err(gt, "%pV", vaf);
+}
+
+static inline void __drm_printfn_xe_gt_info(struct drm_printer *p, struct va_format *vaf)
+{
+	struct xe_gt *gt = p->arg;
+
+	xe_gt_info(gt, "%pV", vaf);
+}
+
+/**
+ * xe_gt_err_printer - Construct a &drm_printer that outputs to xe_gt_err()
+ * @gt: the &xe_gt pointer to use in xe_gt_err()
+ *
+ * Return: The &drm_printer object.
+ */
+static inline struct drm_printer xe_gt_err_printer(struct xe_gt *gt)
+{
+	struct drm_printer p = {
+		.printfn = __drm_printfn_xe_gt_err,
+		.arg = gt,
+	};
+	return p;
+}
+
+/**
+ * xe_gt_info_printer - Construct a &drm_printer that outputs to xe_gt_info()
+ * @gt: the &xe_gt pointer to use in xe_gt_info()
+ *
+ * Return: The &drm_printer object.
+ */
+static inline struct drm_printer xe_gt_info_printer(struct xe_gt *gt)
+{
+	struct drm_printer p = {
+		.printfn = __drm_printfn_xe_gt_info,
+		.arg = gt,
+	};
+	return p;
+}
+
 #endif
-- 
2.25.1


  reply	other threads:[~2023-12-15 16:25 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-15 16:24 [PATCH v4 00/10] Introduce GuC Doorbells Manager Michal Wajdeczko
2023-12-15 16:24 ` Michal Wajdeczko [this message]
2023-12-15 21:48   ` [PATCH v4 01/10] drm/xe: Add GT oriented drm_printers Lucas De Marchi
2023-12-15 16:24 ` [PATCH v4 02/10] drm/xe: Report TLB timeout using GT oriented functions Michal Wajdeczko
2023-12-15 21:50   ` Lucas De Marchi
2023-12-15 16:24 ` [PATCH v4 03/10] drm/xe: Introduce GuC Doorbells Manager Michal Wajdeczko
2023-12-15 16:24 ` [PATCH v4 04/10] drm/xe/kunit: Set SR-IOV mode of the fake device Michal Wajdeczko
2023-12-15 16:24 ` [PATCH v4 05/10] drm/xe/kunit: Define helper functions to allocate fake xe device Michal Wajdeczko
2023-12-15 22:01   ` Lucas De Marchi
2023-12-15 16:24 ` [PATCH v4 06/10] drm/xe/kunit: Restore test->priv when done with " Michal Wajdeczko
2023-12-15 22:11   ` Lucas De Marchi
2023-12-16 12:11     ` Michal Wajdeczko
2023-12-15 16:24 ` [PATCH v4 07/10] drm/xe/kunit: Use xe kunit helper in RTP test Michal Wajdeczko
2023-12-15 22:05   ` Lucas De Marchi
2023-12-15 16:25 ` [PATCH v4 08/10] drm/xe/kunit: Use xe kunit helper in WA test Michal Wajdeczko
2023-12-15 22:06   ` Lucas De Marchi
2023-12-15 16:25 ` [PATCH v4 09/10] drm/xe/kunit: Enable CONFIG_LOCKDEP in tests Michal Wajdeczko
2023-12-15 22:06   ` Lucas De Marchi
2023-12-15 16:25 ` [PATCH v4 10/10] drm/xe/kunit: Add GuC Doorbells Manager tests Michal Wajdeczko
2023-12-15 17:53 ` ✓ CI.Patch_applied: success for Introduce GuC Doorbells Manager (rev4) Patchwork
2023-12-15 17:53 ` ✗ CI.checkpatch: warning " Patchwork
2023-12-15 17:55 ` ✓ CI.KUnit: success " Patchwork
2023-12-15 18:02 ` ✓ CI.Build: " Patchwork
2023-12-15 18:02 ` ✓ CI.Hooks: " Patchwork
2023-12-15 18:04 ` ✓ CI.checksparse: " Patchwork
2023-12-15 18:36 ` ✓ 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=20231215162502.1879-2-michal.wajdeczko@intel.com \
    --to=michal.wajdeczko@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=matthew.d.roper@intel.com \
    --cc=rodrigo.vivi@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