diff options
| author | Michal Wajdeczko <michal.wajdeczko@intel.com> | 2026-07-08 00:08:04 +0200 |
|---|---|---|
| committer | Michal Wajdeczko <michal.wajdeczko@intel.com> | 2026-07-11 16:15:20 +0200 |
| commit | 961826fbcd79133033bc6a90bcf7cb1bb907a250 (patch) | |
| tree | 3321c3c29f9cfd4d1859b671f5fff762cbff968e | |
| parent | 2245d3d1a674d3f6ecf0a5967a9ff475fe3df9a2 (diff) | |
drm/xe/guc: Prepare to print group KLVs
Some future KLVs will be encoded as a group of nested KLVs. Prepare
our KLV printer function to handle such KLVs. List of known group
keys will be updated later, for now just prepare it for testing.
Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
Reviewed-by: MichaĆ Winiarski <michal.winiarski@intel.com>
Link: https://patch.msgid.link/20260707220816.677-3-michal.wajdeczko@intel.com
| -rw-r--r-- | drivers/gpu/drm/xe/xe_guc_klv_helpers.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/gpu/drm/xe/xe_guc_klv_helpers.c b/drivers/gpu/drm/xe/xe_guc_klv_helpers.c index 073b35957790..d0663c226e87 100644 --- a/drivers/gpu/drm/xe/xe_guc_klv_helpers.c +++ b/drivers/gpu/drm/xe/xe_guc_klv_helpers.c @@ -4,6 +4,7 @@ */ #include <linux/bitfield.h> +#include <kunit/static_stub.h> #include <drm/drm_print.h> #include "abi/guc_klvs_abi.h" @@ -12,6 +13,12 @@ #define make_u64(hi, lo) ((u64)((u64)(u32)(hi) << 32 | (u32)(lo))) +static bool is_group_key(u16 key) +{ + KUNIT_STATIC_STUB_REDIRECT(is_group_key, key); + return false; +} + /** * xe_guc_klv_key_to_string - Convert KLV key into friendly name. * @key: the `GuC KLV`_ key @@ -91,6 +98,17 @@ void xe_guc_klv_print_one(u16 key, u16 len, const u32 *value, struct drm_printer { const char *name = xe_guc_klv_key_to_string(key); + if (is_group_key(key)) { + struct drm_printer gp = drm_line_printer(p, name, 0); + + drm_printf(p, "{ key %#06x : group %u dwords } # %s\n", + key, len, name); + + /* print group recursively */ + xe_guc_klv_print(value, len, &gp); + return; + } + switch (len) { case 0: drm_printf(p, "{ key %#06x : no value } # %s\n", key, name); |
