drivers/gpu/drm/xe/xe_guc_ads.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/xe/xe_guc_ads.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/xe/xe_guc_ads.c- Extension
.c- Size
- 30904 bytes
- Lines
- 1028
- 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
xe_guc_ads.hlinux/fault-inject.hdrm/drm_managed.hgenerated/xe_wa_oob.habi/guc_actions_abi.hregs/xe_engine_regs.hregs/xe_gt_regs.hregs/xe_guc_regs.hxe_bo.hxe_gt.hxe_gt_ccs_mode.hxe_gt_mcr.hxe_gt_printk.hxe_guc.hxe_guc_buf.hxe_guc_capture.hxe_guc_ct.hxe_hw_engine.hxe_lrc.hxe_map.hxe_mmio.hxe_wa.h
Detected Declarations
struct __guc_ads_blobfunction ads_to_gucfunction ads_to_gtfunction ads_to_xefunction ads_to_mapfunction guc_ads_regset_sizefunction guc_ads_golden_lrc_sizefunction guc_ads_waklv_sizefunction guc_ads_capture_sizefunction guc_ads_um_queues_sizefunction guc_ads_private_data_sizefunction guc_ads_regset_offsetfunction guc_ads_golden_lrc_offsetfunction guc_ads_waklv_offsetfunction guc_ads_capture_offsetfunction guc_ads_um_queues_offsetfunction guc_ads_private_data_offsetfunction guc_ads_sizefunction calculate_regset_sizefunction engine_enable_maskfunction calculate_golden_lrc_sizefunction guc_waklv_enablefunction guc_waklv_initfunction calculate_waklv_sizefunction xe_guc_ads_initfunction xe_guc_ads_init_post_hwconfigfunction guc_policies_initfunction fill_engine_enable_masksfunction guc_golden_lrc_populatefunction guc_mapping_table_init_invalidfunction guc_mapping_table_initfunction for_each_hw_enginefunction guc_get_capture_engine_maskfunction get_capture_listfunction guc_capture_prep_listsfunction guc_mmio_regset_write_onefunction guc_mmio_regset_writefunction guc_mmio_reg_state_initfunction for_each_hw_enginefunction guc_um_init_paramsfunction guc_doorbell_initfunction xe_guc_ads_populate_minimalfunction xe_guc_ads_populatefunction guc_golden_lrc_initfunction xe_guc_ads_populate_post_loadfunction guc_ads_action_update_policiesfunction xe_guc_ads_scheduler_policy_toggle_reset
Annotated Snippet
struct __guc_ads_blob {
struct guc_ads ads;
struct guc_policies policies;
struct guc_gt_system_info system_info;
struct guc_engine_usage engine_usage;
struct guc_um_init_params um_init_params;
/* From here on, location is dynamic! Refer to above diagram. */
struct guc_mmio_reg regset[];
} __packed;
#define ads_blob_read(ads_, field_) \
xe_map_rd_field(ads_to_xe(ads_), ads_to_map(ads_), 0, \
struct __guc_ads_blob, field_)
#define ads_blob_write(ads_, field_, val_) \
xe_map_wr_field(ads_to_xe(ads_), ads_to_map(ads_), 0, \
struct __guc_ads_blob, field_, val_)
#define info_map_write(xe_, map_, field_, val_) \
xe_map_wr_field(xe_, map_, 0, struct guc_gt_system_info, field_, val_)
#define info_map_read(xe_, map_, field_) \
xe_map_rd_field(xe_, map_, 0, struct guc_gt_system_info, field_)
static size_t guc_ads_regset_size(struct xe_guc_ads *ads)
{
struct xe_device *xe = ads_to_xe(ads);
xe_assert(xe, ads->regset_size);
return ads->regset_size;
}
static size_t guc_ads_golden_lrc_size(struct xe_guc_ads *ads)
{
return PAGE_ALIGN(ads->golden_lrc_size);
}
static u32 guc_ads_waklv_size(struct xe_guc_ads *ads)
{
return PAGE_ALIGN(ads->ads_waklv_size);
}
static size_t guc_ads_capture_size(struct xe_guc_ads *ads)
{
return PAGE_ALIGN(ads->capture_size);
}
static size_t guc_ads_um_queues_size(struct xe_guc_ads *ads)
{
struct xe_device *xe = ads_to_xe(ads);
if (!xe->info.has_usm)
return 0;
return GUC_UM_QUEUE_SIZE * GUC_UM_HW_QUEUE_MAX;
}
static size_t guc_ads_private_data_size(struct xe_guc_ads *ads)
{
return PAGE_ALIGN(ads_to_guc(ads)->fw.private_data_size);
}
static size_t guc_ads_regset_offset(struct xe_guc_ads *ads)
{
return offsetof(struct __guc_ads_blob, regset);
}
static size_t guc_ads_golden_lrc_offset(struct xe_guc_ads *ads)
{
size_t offset;
offset = guc_ads_regset_offset(ads) +
guc_ads_regset_size(ads);
return PAGE_ALIGN(offset);
}
static size_t guc_ads_waklv_offset(struct xe_guc_ads *ads)
{
u32 offset;
offset = guc_ads_golden_lrc_offset(ads) +
guc_ads_golden_lrc_size(ads);
return PAGE_ALIGN(offset);
}
static size_t guc_ads_capture_offset(struct xe_guc_ads *ads)
{
Annotation
- Immediate include surface: `xe_guc_ads.h`, `linux/fault-inject.h`, `drm/drm_managed.h`, `generated/xe_wa_oob.h`, `abi/guc_actions_abi.h`, `regs/xe_engine_regs.h`, `regs/xe_gt_regs.h`, `regs/xe_guc_regs.h`.
- Detected declarations: `struct __guc_ads_blob`, `function ads_to_guc`, `function ads_to_gt`, `function ads_to_xe`, `function ads_to_map`, `function guc_ads_regset_size`, `function guc_ads_golden_lrc_size`, `function guc_ads_waklv_size`, `function guc_ads_capture_size`, `function guc_ads_um_queues_size`.
- 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.