drivers/gpu/drm/xe/xe_guc_klv_helpers.h
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/xe/xe_guc_klv_helpers.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/xe/xe_guc_klv_helpers.h- Extension
.h- Size
- 1755 bytes
- Lines
- 65
- Domain
- Driver Families
- Bucket
- drivers/gpu
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/args.hlinux/types.h
Detected Declarations
struct drm_printer
Annotated Snippet
#ifndef _XE_GUC_KLV_HELPERS_H_
#define _XE_GUC_KLV_HELPERS_H_
#include <linux/args.h>
#include <linux/types.h>
struct drm_printer;
const char *xe_guc_klv_key_to_string(u16 key);
void xe_guc_klv_print(const u32 *klvs, u32 num_dwords, struct drm_printer *p);
int xe_guc_klv_count(const u32 *klvs, u32 num_dwords);
/**
* PREP_GUC_KLV - Prepare KLV header value based on provided key and len.
* @key: KLV key
* @len: KLV length
*
* Return: value of the KLV header (u32).
*/
#define PREP_GUC_KLV(key, len) \
(FIELD_PREP(GUC_KLV_0_KEY, (key)) | \
FIELD_PREP(GUC_KLV_0_LEN, (len)))
/**
* PREP_GUC_KLV_CONST - Prepare KLV header value based on const key and len.
* @key: const KLV key
* @len: const KLV length
*
* Return: value of the KLV header (u32).
*/
#define PREP_GUC_KLV_CONST(key, len) \
(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
*
* Combine separate KEY and LEN definitions of the KLV identified by the TAG.
*
* Return: value of the KLV header (u32).
*/
#define PREP_GUC_KLV_TAG(TAG) \
PREP_GUC_KLV_CONST(MAKE_GUC_KLV_KEY(TAG), MAKE_GUC_KLV_LEN(TAG))
#endif
Annotation
- Immediate include surface: `linux/args.h`, `linux/types.h`.
- Detected declarations: `struct drm_printer`.
- Atlas domain: Driver Families / drivers/gpu.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.