drivers/gpu/drm/i915/gt/uc/intel_guc_capture.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/i915/gt/uc/intel_guc_capture.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/i915/gt/uc/intel_guc_capture.c- Extension
.c- Size
- 51397 bytes
- Lines
- 1655
- 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_print.hgt/intel_engine_regs.hgt/intel_gt.hgt/intel_gt_mcr.hgt/intel_gt_regs.hgt/intel_lrc.hguc_capture_fwif.hintel_guc_capture.hintel_guc_fwif.hintel_guc_print.hi915_drv.hi915_gpu_error.hi915_irq.hi915_memcpy.hi915_reg.h
Detected Declarations
struct __ext_steer_regfunction guc_capture_get_one_listfunction guc_capture_get_one_ext_listfunction guc_capture_free_extlistsfunction __fill_ext_regfunction __alloc_ext_regsfunction guc_capture_alloc_steered_listsfunction guc_capture_get_device_reglistfunction __stringify_typefunction __stringify_engclassfunction guc_capture_list_initfunction guc_cap_list_num_regsfunction guc_capture_getlistsizefunction intel_guc_capture_getlistsizefunction intel_guc_capture_getlistfunction intel_guc_capture_getnullheaderfunction guc_capture_output_min_size_estfunction typesfunction check_guc_capture_sizefunction dumpsfunction guc_capture_buf_cnt_to_endfunction guc_capture_log_remove_dwfunction guc_capture_data_extractedfunction guc_capture_log_get_group_hdrfunction guc_capture_log_get_data_hdrfunction guc_capture_log_get_registerfunction guc_capture_delete_one_nodefunction guc_capture_delete_prealloc_nodesfunction guc_capture_add_node_to_listfunction guc_capture_add_node_to_outlistfunction guc_capture_add_node_to_cachelistfunction guc_capture_init_nodefunction guc_capture_get_prealloc_nodefunction list_for_each_entry_safefunction list_for_each_entry_safefunction guc_capture_alloc_one_nodefunction guc_capture_clone_nodefunction __guc_capture_create_prealloc_nodesfunction guc_get_max_reglist_countfunction guc_capture_create_prealloc_nodesfunction guc_capture_extract_reglistsfunction registersfunction __guc_capture_flushlog_completefunction __guc_capture_process_outputfunction guc_capture_reg_to_strfunction intel_guc_capture_print_engine_nodefunction guc_capture_find_ecodefunction intel_guc_capture_free_node
Annotated Snippet
struct __ext_steer_reg {
const char *name;
i915_mcr_reg_t reg;
};
static const struct __ext_steer_reg gen8_extregs[] = {
{"GEN8_SAMPLER_INSTDONE", GEN8_SAMPLER_INSTDONE},
{"GEN8_ROW_INSTDONE", GEN8_ROW_INSTDONE}
};
static const struct __ext_steer_reg xehpg_extregs[] = {
{"XEHPG_INSTDONE_GEOM_SVG", XEHPG_INSTDONE_GEOM_SVG}
};
static void __fill_ext_reg(struct __guc_mmio_reg_descr *ext,
const struct __ext_steer_reg *extlist,
int slice_id, int subslice_id)
{
ext->reg = _MMIO(i915_mmio_reg_offset(extlist->reg));
ext->flags = FIELD_PREP(GUC_REGSET_STEERING_GROUP, slice_id);
ext->flags |= FIELD_PREP(GUC_REGSET_STEERING_INSTANCE, subslice_id);
ext->regname = extlist->name;
}
static int
__alloc_ext_regs(struct __guc_mmio_reg_descr_group *newlist,
const struct __guc_mmio_reg_descr_group *rootlist, int num_regs)
{
struct __guc_mmio_reg_descr *list;
list = kzalloc_objs(struct __guc_mmio_reg_descr, num_regs);
if (!list)
return -ENOMEM;
newlist->extlist = list;
newlist->num_regs = num_regs;
newlist->owner = rootlist->owner;
newlist->engine = rootlist->engine;
newlist->type = rootlist->type;
return 0;
}
static void
guc_capture_alloc_steered_lists(struct intel_guc *guc,
const struct __guc_mmio_reg_descr_group *lists)
{
struct intel_gt *gt = guc_to_gt(guc);
int slice, subslice, iter, i, num_steer_regs, num_tot_regs = 0;
const struct __guc_mmio_reg_descr_group *list;
struct __guc_mmio_reg_descr_group *extlists;
struct __guc_mmio_reg_descr *extarray;
bool has_xehpg_extregs;
/* steered registers currently only exist for the render-class */
list = guc_capture_get_one_list(lists, GUC_CAPTURE_LIST_INDEX_PF,
GUC_CAPTURE_LIST_TYPE_ENGINE_CLASS,
GUC_CAPTURE_LIST_CLASS_RENDER_COMPUTE);
/* skip if extlists was previously allocated */
if (!list || guc->capture->extlists)
return;
has_xehpg_extregs = GRAPHICS_VER_FULL(gt->i915) >= IP_VER(12, 55);
num_steer_regs = ARRAY_SIZE(gen8_extregs);
if (has_xehpg_extregs)
num_steer_regs += ARRAY_SIZE(xehpg_extregs);
for_each_ss_steering(iter, gt, slice, subslice)
num_tot_regs += num_steer_regs;
if (!num_tot_regs)
return;
/* allocate an extra for an end marker */
extlists = kzalloc_objs(struct __guc_mmio_reg_descr_group, 2);
if (!extlists)
return;
if (__alloc_ext_regs(&extlists[0], list, num_tot_regs)) {
kfree(extlists);
return;
}
extarray = extlists[0].extlist;
for_each_ss_steering(iter, gt, slice, subslice) {
for (i = 0; i < ARRAY_SIZE(gen8_extregs); ++i) {
__fill_ext_reg(extarray, &gen8_extregs[i], slice, subslice);
++extarray;
}
Annotation
- Immediate include surface: `linux/types.h`, `drm/drm_print.h`, `gt/intel_engine_regs.h`, `gt/intel_gt.h`, `gt/intel_gt_mcr.h`, `gt/intel_gt_regs.h`, `gt/intel_lrc.h`, `guc_capture_fwif.h`.
- Detected declarations: `struct __ext_steer_reg`, `function guc_capture_get_one_list`, `function guc_capture_get_one_ext_list`, `function guc_capture_free_extlists`, `function __fill_ext_reg`, `function __alloc_ext_regs`, `function guc_capture_alloc_steered_lists`, `function guc_capture_get_device_reglist`, `function __stringify_type`, `function __stringify_engclass`.
- 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.