Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Michal Wajdeczko <michal.wajdeczko@intel.com>
To: intel-gfx@lists.freedesktop.org
Cc: dri-devel@lists.freedesktop.org
Subject: [Intel-gfx] [PATCH v3 1/8] drm/i915/guc: Add GuC oriented print macros
Date: Sat, 28 Jan 2023 20:59:00 +0100	[thread overview]
Message-ID: <20230128195907.1837-2-michal.wajdeczko@intel.com> (raw)
In-Reply-To: <20230128195907.1837-1-michal.wajdeczko@intel.com>

While we do have GT oriented print macros, add few more GuC
specific to have common look and feel across all messages
related to the GuC and to avoid chasing the gt pointer.

We will use these macros shortly in upcoming patches.

Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: John Harrison <John.C.Harrison@Intel.com>
Reviewed-by: John Harrison <John.C.Harrison@Intel.com>
---
 drivers/gpu/drm/i915/gt/uc/intel_guc_print.h | 48 ++++++++++++++++++++
 1 file changed, 48 insertions(+)
 create mode 100644 drivers/gpu/drm/i915/gt/uc/intel_guc_print.h

diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_print.h b/drivers/gpu/drm/i915/gt/uc/intel_guc_print.h
new file mode 100644
index 000000000000..e75989d4ba06
--- /dev/null
+++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_print.h
@@ -0,0 +1,48 @@
+/* SPDX-License-Identifier: MIT */
+/*
+ * Copyright © 2023 Intel Corporation
+ */
+
+#ifndef __INTEL_GUC_PRINT__
+#define __INTEL_GUC_PRINT__
+
+#include "gt/intel_gt.h"
+#include "gt/intel_gt_print.h"
+
+#define guc_printk(_guc, _level, _fmt, ...) \
+	gt_##_level(guc_to_gt(_guc), "GUC: " _fmt, ##__VA_ARGS__)
+
+#define guc_err(_guc, _fmt, ...) \
+	guc_printk((_guc), err, _fmt, ##__VA_ARGS__)
+
+#define guc_warn(_guc, _fmt, ...) \
+	guc_printk((_guc), warn, _fmt, ##__VA_ARGS__)
+
+#define guc_notice(_guc, _fmt, ...) \
+	guc_printk((_guc), notice, _fmt, ##__VA_ARGS__)
+
+#define guc_info(_guc, _fmt, ...) \
+	guc_printk((_guc), info, _fmt, ##__VA_ARGS__)
+
+#define guc_dbg(_guc, _fmt, ...) \
+	guc_printk((_guc), dbg, _fmt, ##__VA_ARGS__)
+
+#define guc_err_ratelimited(_guc, _fmt, ...) \
+	guc_printk((_guc), err_ratelimited, _fmt, ##__VA_ARGS__)
+
+#define guc_probe_error(_guc, _fmt, ...) \
+	guc_printk((_guc), probe_error, _fmt, ##__VA_ARGS__)
+
+#define guc_WARN(_guc, _cond, _fmt, ...) \
+	gt_WARN(guc_to_gt(_guc), _cond, "GUC: " _fmt, ##__VA_ARGS__)
+
+#define guc_WARN_ONCE(_guc, _cond, _fmt, ...) \
+	gt_WARN_ONCE(guc_to_gt(_guc), _cond, "GUC: " _fmt, ##__VA_ARGS__)
+
+#define guc_WARN_ON(_guc, _cond) \
+	gt_WARN(guc_to_gt(_guc), _cond, "%s(%s)", "guc_WARN_ON", __stringify(_cond))
+
+#define guc_WARN_ON_ONCE(_guc, _cond) \
+	gt_WARN_ONCE(guc_to_gt(_guc), _cond, "%s(%s)", "guc_WARN_ON_ONCE", __stringify(_cond))
+
+#endif /* __INTEL_GUC_PRINT__ */
-- 
2.25.1


  reply	other threads:[~2023-01-28 19:59 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-28 19:58 [Intel-gfx] [PATCH v3 0/8] GuC oriented print macros Michal Wajdeczko
2023-01-28 19:59 ` Michal Wajdeczko [this message]
2023-01-28 19:59 ` [Intel-gfx] [PATCH v3 2/8] drm/i915/guc: Update GuC messages in intel_guc.c Michal Wajdeczko
2023-01-28 19:59 ` [Intel-gfx] [PATCH v3 3/8] drm/i915/guc: Update GuC messages in intel_guc_ads.c Michal Wajdeczko
2023-01-28 19:59 ` [Intel-gfx] [PATCH v3 4/8] drm/i915/guc: Update GuC messages in intel_guc_ct.c Michal Wajdeczko
2023-01-28 19:59 ` [Intel-gfx] [PATCH v3 5/8] drm/i915/guc: Update GuC messages in intel_guc_fw.c Michal Wajdeczko
2023-01-28 19:59 ` [Intel-gfx] [PATCH v3 6/8] drm/i915/guc: Update GuC messages in intel_guc_log.c Michal Wajdeczko
2023-01-30 17:42   ` John Harrison
2023-01-28 19:59 ` [Intel-gfx] [PATCH v3 7/8] drm/i915/guc: Update GuC messages in intel_guc_submission.c Michal Wajdeczko
2023-01-28 19:59 ` [Intel-gfx] [PATCH v3 8/8] drm/i915/guc: Update GT/GuC messages in intel_uc.c Michal Wajdeczko
2023-01-30 17:45   ` John Harrison
2023-01-28 20:21 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for GuC oriented print macros (rev3) Patchwork
2023-01-28 20:48 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2023-01-28 22:11 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork
2023-01-31 12:25   ` Tvrtko Ursulin

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=20230128195907.1837-2-michal.wajdeczko@intel.com \
    --to=michal.wajdeczko@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    /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