intel-xe.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Michal Wajdeczko <michal.wajdeczko@intel.com>
To: intel-xe@lists.freedesktop.org
Subject: [PATCH v2 1/8] drm/xe/guc: Add more KLV helper macros
Date: Tue, 14 May 2024 21:00:08 +0200	[thread overview]
Message-ID: <20240514190015.2172-2-michal.wajdeczko@intel.com> (raw)
In-Reply-To: <20240514190015.2172-1-michal.wajdeczko@intel.com>

In upcoming patches we will want to generate some of the KLV keys
from other macros. Add MAKE_GUC_KLV_{KEY|LEN} macros for that and
make sure they will correctly expand provided TAG parameter. Also
fix PREP_GUC_KLV_TAG to also work correctly within other macros.

Reviewed-by: Piotr Piórkowski <piotr.piorkowski@intel.com>
Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
---
 drivers/gpu/drm/xe/xe_guc_klv_helpers.h | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/xe/xe_guc_klv_helpers.h b/drivers/gpu/drm/xe/xe_guc_klv_helpers.h
index b835e0ebe6db..c676d21c173b 100644
--- a/drivers/gpu/drm/xe/xe_guc_klv_helpers.h
+++ b/drivers/gpu/drm/xe/xe_guc_klv_helpers.h
@@ -6,6 +6,7 @@
 #ifndef _XE_GUC_KLV_HELPERS_H_
 #define _XE_GUC_KLV_HELPERS_H_
 
+#include <linux/args.h>
 #include <linux/types.h>
 
 struct drm_printer;
@@ -37,6 +38,18 @@ int xe_guc_klv_count(const u32 *klvs, u32 num_dwords);
 	(FIELD_PREP_CONST(GUC_KLV_0_KEY, (key)) | \
 	 FIELD_PREP_CONST(GUC_KLV_0_LEN, (len)))
 
+/**
+ * MAKE_GUC_KLV_KEY - Prepare KLV KEY name based on unique KLV definition tag.
+ * @TAG: unique tag of the KLV definition
+ */
+#define MAKE_GUC_KLV_KEY(TAG) CONCATENATE(CONCATENATE(GUC_KLV_, TAG), _KEY)
+
+/**
+ * MAKE_GUC_KLV_LEN - Prepare KLV LEN name based on unique KLV definition tag.
+ * @TAG: unique tag of the KLV definition
+ */
+#define MAKE_GUC_KLV_LEN(TAG) CONCATENATE(CONCATENATE(GUC_KLV_, TAG), _LEN)
+
 /**
  * PREP_GUC_KLV_TAG - Prepare KLV header value based on unique KLV definition tag.
  * @TAG: unique tag of the KLV definition
@@ -46,6 +59,6 @@ int xe_guc_klv_count(const u32 *klvs, u32 num_dwords);
  * Return: value of the KLV header (u32).
  */
 #define PREP_GUC_KLV_TAG(TAG) \
-	PREP_GUC_KLV_CONST(GUC_KLV_##TAG##_KEY, GUC_KLV_##TAG##_LEN)
+	PREP_GUC_KLV_CONST(MAKE_GUC_KLV_KEY(TAG), MAKE_GUC_KLV_LEN(TAG))
 
 #endif
-- 
2.43.0


  reply	other threads:[~2024-05-14 19:01 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-14 19:00 [PATCH v2 0/8] PF: Support for adverse events notifications Michal Wajdeczko
2024-05-14 19:00 ` Michal Wajdeczko [this message]
2024-05-14 19:00 ` [PATCH v2 2/8] drm/xe/guc: Introduce GuC KLV thresholds set Michal Wajdeczko
2024-05-16 14:23   ` Lucas De Marchi
2024-05-16 14:51     ` Michal Wajdeczko
2024-05-14 19:00 ` [PATCH v2 3/8] drm/xe/guc: Add support for threshold KLVs in to_string() helper Michal Wajdeczko
2024-05-14 19:00 ` [PATCH v2 4/8] drm/xe/pf: Introduce functions to configure VF thresholds Michal Wajdeczko
2024-05-14 19:00 ` [PATCH v2 5/8] drm/xe/pf: Allow configuration of VF thresholds over debugfs Michal Wajdeczko
2024-05-14 19:00 ` [PATCH v2 6/8] drm/xe/guc: Add GUC2PF_ADVERSE_EVENT to ABI Michal Wajdeczko
2024-05-14 19:00 ` [PATCH v2 7/8] drm/xe/pf: Track adverse events notifications from GuC Michal Wajdeczko
2024-05-14 19:00 ` [PATCH v2 8/8] drm/xe/pf: Expose PF monitor details via debugfs Michal Wajdeczko
2024-05-14 19:06 ` ✓ CI.Patch_applied: success for PF: Support for adverse events notifications (rev2) Patchwork
2024-05-14 19:06 ` ✗ CI.checkpatch: warning " Patchwork
2024-05-14 19:07 ` ✓ CI.KUnit: success " Patchwork
2024-05-14 19:19 ` ✓ CI.Build: " Patchwork
2024-05-14 19:21 ` ✓ CI.Hooks: " Patchwork
2024-05-14 19:23 ` ✓ CI.checksparse: " Patchwork
2024-05-14 19:45 ` ✓ CI.BAT: " Patchwork
2024-05-14 20:44 ` ✗ CI.FULL: failure " Patchwork
2024-05-15 11:54   ` 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=20240514190015.2172-2-michal.wajdeczko@intel.com \
    --to=michal.wajdeczko@intel.com \
    --cc=intel-xe@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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).