mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2026-09-22 09:34:56 +02:00
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
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user