drivers/gpu/drm/xe/xe_guc_capture.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/xe/xe_guc_capture.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/xe/xe_guc_capture.c- Extension
.c- Size
- 64684 bytes
- Lines
- 2043
- 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.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/types.hdrm/drm_managed.hdrm/drm_print.habi/guc_actions_abi.habi/guc_capture_abi.habi/guc_log_abi.hregs/xe_engine_regs.hregs/xe_gt_regs.hxe_bo_types.hxe_device.hxe_exec_queue_types.hxe_gt.hxe_gt_mcr.hxe_gt_printk.hxe_guc.hxe_guc_capture.hxe_guc_capture_types.hxe_guc_ct.hxe_guc_exec_queue_types.hxe_guc_log.hxe_guc_submit_types.hxe_guc_submit.hxe_hw_engine_types.hxe_hw_engine.hxe_lrc.hxe_macros.hxe_map.hxe_mmio.hxe_sched_job.h
Detected Declarations
struct __guc_capture_bufstatestruct __guc_capture_parsed_outputstruct gcap_reg_list_infostruct __guc_capture_ads_cachestruct xe_guc_state_capturestruct __ext_steer_regfunction guc_capture_get_device_reglistfunction guc_capture_get_one_listfunction xe_guc_capture_get_reg_desc_listfunction __fill_ext_regfunction __alloc_ext_regsfunction guc_capture_get_steer_reg_numfunction guc_capture_alloc_steered_listsfunction guc_capture_list_initfunction guc_cap_list_num_regsfunction guc_capture_getlistsizefunction xe_guc_capture_getlistsizefunction xe_guc_capture_getlistfunction xe_guc_capture_getnullheaderfunction xe_guc_capture_ads_input_worst_sizefunction guc_capture_output_size_estfunction typesfunction check_guc_capture_sizefunction guc_capture_add_node_to_listfunction guc_capture_add_node_to_outlistfunction guc_capture_add_node_to_cachelistfunction guc_capture_free_outlist_nodefunction guc_capture_remove_stale_matches_from_listfunction list_for_each_entry_safefunction guc_capture_init_nodefunction dumpsfunction guc_capture_buf_cnt_to_endfunction guc_capture_log_remove_bytesfunction guc_capture_log_get_group_hdrfunction guc_capture_log_get_data_hdrfunction guc_capture_log_get_registerfunction guc_capture_get_prealloc_nodefunction list_for_each_entry_safefunction list_for_each_entry_safe_reversefunction guc_capture_clone_nodefunction guc_capture_extract_reglistsfunction registersfunction __guc_capture_flushlog_completefunction __guc_capture_process_outputfunction xe_guc_capture_processfunction guc_capture_alloc_one_nodefunction __guc_capture_create_prealloc_nodesfunction guc_get_max_reglist_count
Annotated Snippet
struct __guc_capture_bufstate {
u32 size;
u32 data_offset;
u32 rd;
u32 wr;
};
/*
* struct __guc_capture_parsed_output - extracted error capture node
*
* A single unit of extracted error-capture output data grouped together
* at an engine-instance level. We keep these nodes in a linked list.
* See cachelist and outlist below.
*/
struct __guc_capture_parsed_output {
/*
* A single set of 3 capture lists: a global-list
* an engine-class-list and an engine-instance list.
* outlist in __guc_capture_parsed_output will keep
* a linked list of these nodes that will eventually
* be detached from outlist and attached into to
* xe_codedump in response to a context reset
*/
struct list_head link;
bool is_partial;
u32 eng_class;
u32 eng_inst;
u32 guc_id;
u32 lrca;
u32 type;
bool locked;
enum xe_hw_engine_snapshot_source_id source;
struct gcap_reg_list_info {
u32 vfid;
u32 num_regs;
struct guc_mmio_reg *regs;
} reginfo[GUC_STATE_CAPTURE_TYPE_MAX];
#define GCAP_PARSED_REGLIST_INDEX_GLOBAL BIT(GUC_STATE_CAPTURE_TYPE_GLOBAL)
#define GCAP_PARSED_REGLIST_INDEX_ENGCLASS BIT(GUC_STATE_CAPTURE_TYPE_ENGINE_CLASS)
};
/*
* Define all device tables of GuC error capture register lists
* NOTE:
* For engine-registers, GuC only needs the register offsets
* from the engine-mmio-base
*
* 64 bit registers need 2 entries for low 32 bit register and high 32 bit
* register, for example:
* Register data_type flags mask Register name
* { XXX_REG_LO(0), REG_64BIT_LOW_DW, 0, 0, NULL},
* { XXX_REG_HI(0), REG_64BIT_HI_DW,, 0, 0, "XXX_REG"},
* 1. data_type: Indicate is hi/low 32 bit for a 64 bit register
* A 64 bit register define requires 2 consecutive entries,
* with low dword first and hi dword the second.
* 2. Register name: null for incompleted define
* 3. Incorrect order will trigger XE_WARN.
*/
#define COMMON_XELP_BASE_GLOBAL \
{ FORCEWAKE_GT, REG_32BIT, 0, 0, 0, "FORCEWAKE_GT"}
#define COMMON_BASE_ENGINE_INSTANCE \
{ RING_HWSTAM(0), REG_32BIT, 0, 0, 0, "HWSTAM"}, \
{ RING_HWS_PGA(0), REG_32BIT, 0, 0, 0, "RING_HWS_PGA"}, \
{ RING_HEAD(0), REG_32BIT, 0, 0, 0, "RING_HEAD"}, \
{ RING_TAIL(0), REG_32BIT, 0, 0, 0, "RING_TAIL"}, \
{ RING_CTL(0), REG_32BIT, 0, 0, 0, "RING_CTL"}, \
{ RING_MI_MODE(0), REG_32BIT, 0, 0, 0, "RING_MI_MODE"}, \
{ GFX_MODE(0), REG_32BIT, 0, 0, 0, "GFX_MODE"}, \
{ RING_ESR(0), REG_32BIT, 0, 0, 0, "RING_ESR"}, \
{ RING_EMR(0), REG_32BIT, 0, 0, 0, "RING_EMR"}, \
{ RING_EIR(0), REG_32BIT, 0, 0, 0, "RING_EIR"}, \
{ RING_IMR(0), REG_32BIT, 0, 0, 0, "RING_IMR"}, \
{ RING_IPEHR(0), REG_32BIT, 0, 0, 0, "IPEHR"}, \
{ RING_INSTDONE(0), REG_32BIT, 0, 0, 0, "RING_INSTDONE"}, \
{ INDIRECT_RING_STATE(0), REG_32BIT, 0, 0, 0, "INDIRECT_RING_STATE"}, \
{ RING_CURRENT_LRCA(0), REG_32BIT, 0, 0, 0, "CURRENT_LRCA"}, \
{ RING_ACTHD(0), REG_64BIT_LOW_DW, 0, 0, 0, NULL}, \
{ RING_ACTHD_UDW(0), REG_64BIT_HI_DW, 0, 0, 0, "ACTHD"}, \
{ RING_BBADDR(0), REG_64BIT_LOW_DW, 0, 0, 0, NULL}, \
{ RING_BBADDR_UDW(0), REG_64BIT_HI_DW, 0, 0, 0, "RING_BBADDR"}, \
{ RING_START(0), REG_64BIT_LOW_DW, 0, 0, 0, NULL}, \
{ RING_START_UDW(0), REG_64BIT_HI_DW, 0, 0, 0, "RING_START"}, \
{ RING_DMA_FADD(0), REG_64BIT_LOW_DW, 0, 0, 0, NULL}, \
{ RING_DMA_FADD_UDW(0), REG_64BIT_HI_DW, 0, 0, 0, "RING_DMA_FADD"}, \
{ RING_EXECLIST_STATUS_LO(0), REG_64BIT_LOW_DW, 0, 0, 0, NULL}, \
{ RING_EXECLIST_STATUS_HI(0), REG_64BIT_HI_DW, 0, 0, 0, "RING_EXECLIST_STATUS"}, \
{ RING_EXECLIST_SQ_CONTENTS_LO(0), REG_64BIT_LOW_DW, 0, 0, 0, NULL}, \
{ RING_EXECLIST_SQ_CONTENTS_HI(0), REG_64BIT_HI_DW, 0, 0, 0, "RING_EXECLIST_SQ_CONTENTS"}
Annotation
- Immediate include surface: `linux/types.h`, `drm/drm_managed.h`, `drm/drm_print.h`, `abi/guc_actions_abi.h`, `abi/guc_capture_abi.h`, `abi/guc_log_abi.h`, `regs/xe_engine_regs.h`, `regs/xe_gt_regs.h`.
- Detected declarations: `struct __guc_capture_bufstate`, `struct __guc_capture_parsed_output`, `struct gcap_reg_list_info`, `struct __guc_capture_ads_cache`, `struct xe_guc_state_capture`, `struct __ext_steer_reg`, `function guc_capture_get_device_reglist`, `function guc_capture_get_one_list`, `function xe_guc_capture_get_reg_desc_list`, `function __fill_ext_reg`.
- 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.