drivers/gpu/drm/i915/gt/uc/intel_guc.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/i915/gt/uc/intel_guc.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/i915/gt/uc/intel_guc.c- Extension
.c- Size
- 27352 bytes
- Lines
- 979
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
gem/i915_gem_lmem.hgt/intel_gt.hgt/intel_gt_irq.hgt/intel_gt_pm_irq.hgt/intel_gt_regs.hi915_drv.hi915_irq.hi915_reg.hi915_wait_util.hintel_guc.hintel_guc_ads.hintel_guc_capture.hintel_guc_print.hintel_guc_slpc.hintel_guc_submission.h
Detected Declarations
function GuCfunction guc_send_regfunction intel_guc_init_send_regsfunction gen9_reset_guc_interruptsfunction gen9_enable_guc_interruptsfunction gen9_disable_guc_interruptsfunction __gen11_reset_guc_interruptsfunction gen11_reset_guc_interruptsfunction gen11_enable_guc_interruptsfunction gen11_disable_guc_interruptsfunction guc_dead_worker_funcfunction intel_guc_init_earlyfunction intel_guc_init_latefunction guc_ctl_debug_flagsfunction guc_ctl_feature_flagsfunction guc_ctl_log_params_flagsfunction guc_ctl_ads_flagsfunction guc_ctl_wa_flagsfunction guc_ctl_devidfunction guc_init_paramsfunction intel_guc_write_paramsfunction intel_guc_dump_time_infofunction intel_guc_initfunction intel_guc_finifunction intel_guc_send_mmiofunction intel_guc_crash_process_msgfunction intel_guc_to_host_process_recv_msgfunction intel_guc_auth_hucfunction intel_guc_suspendfunction intel_guc_resumefunction intel_guc_allocate_vmafunction intel_guc_allocate_and_map_vmafunction __guc_action_self_cfgfunction __guc_self_cfgfunction intel_guc_self_cfg32function intel_guc_self_cfg64function intel_guc_load_statusfunction with_intel_runtime_pmfunction intel_guc_write_barrier
Annotated Snippet
if (gt->type == GT_MEDIA) {
guc->notify_reg = MEDIA_GUC_HOST_INTERRUPT;
guc->send_regs.base = i915_mmio_reg_offset(MEDIA_SOFT_SCRATCH(0));
} else {
guc->notify_reg = GEN11_GUC_HOST_INTERRUPT;
guc->send_regs.base = i915_mmio_reg_offset(GEN11_SOFT_SCRATCH(0));
}
guc->send_regs.count = GEN11_SOFT_SCRATCH_COUNT;
} else {
guc->notify_reg = GUC_SEND_INTERRUPT;
guc->interrupts.reset = gen9_reset_guc_interrupts;
guc->interrupts.enable = gen9_enable_guc_interrupts;
guc->interrupts.disable = gen9_disable_guc_interrupts;
guc->send_regs.base = i915_mmio_reg_offset(SOFT_SCRATCH(0));
guc->send_regs.count = GUC_MAX_MMIO_MSG_LEN;
BUILD_BUG_ON(GUC_MAX_MMIO_MSG_LEN > SOFT_SCRATCH_COUNT);
}
intel_guc_enable_msg(guc, INTEL_GUC_RECV_MSG_EXCEPTION |
INTEL_GUC_RECV_MSG_CRASH_DUMP_POSTED);
}
void intel_guc_init_late(struct intel_guc *guc)
{
intel_guc_ads_init_late(guc);
}
static u32 guc_ctl_debug_flags(struct intel_guc *guc)
{
u32 level = intel_guc_log_get_level(&guc->log);
u32 flags = 0;
if (!GUC_LOG_LEVEL_IS_VERBOSE(level))
flags |= GUC_LOG_DISABLED;
else
flags |= GUC_LOG_LEVEL_TO_VERBOSITY(level) <<
GUC_LOG_VERBOSITY_SHIFT;
return flags;
}
static u32 guc_ctl_feature_flags(struct intel_guc *guc)
{
struct intel_gt *gt = guc_to_gt(guc);
u32 flags = 0;
/*
* Enable PXP GuC autoteardown flow.
* NB: MTL does things differently.
*/
if (HAS_PXP(gt->i915) && !IS_METEORLAKE(gt->i915))
flags |= GUC_CTL_ENABLE_GUC_PXP_CTL;
if (!intel_guc_submission_is_used(guc))
flags |= GUC_CTL_DISABLE_SCHEDULER;
if (intel_guc_slpc_is_used(guc))
flags |= GUC_CTL_ENABLE_SLPC;
return flags;
}
static u32 guc_ctl_log_params_flags(struct intel_guc *guc)
{
struct intel_guc_log *log = &guc->log;
u32 offset, flags;
GEM_BUG_ON(!log->sizes_initialised);
offset = intel_guc_ggtt_offset(guc, log->vma) >> PAGE_SHIFT;
flags = GUC_LOG_VALID |
GUC_LOG_NOTIFY_ON_HALF_FULL |
log->sizes[GUC_LOG_SECTIONS_DEBUG].flag |
log->sizes[GUC_LOG_SECTIONS_CAPTURE].flag |
(log->sizes[GUC_LOG_SECTIONS_CRASH].count << GUC_LOG_CRASH_SHIFT) |
(log->sizes[GUC_LOG_SECTIONS_DEBUG].count << GUC_LOG_DEBUG_SHIFT) |
(log->sizes[GUC_LOG_SECTIONS_CAPTURE].count << GUC_LOG_CAPTURE_SHIFT) |
(offset << GUC_LOG_BUF_ADDR_SHIFT);
return flags;
}
static u32 guc_ctl_ads_flags(struct intel_guc *guc)
{
u32 ads = intel_guc_ggtt_offset(guc, guc->ads_vma) >> PAGE_SHIFT;
u32 flags = ads << GUC_ADS_ADDR_SHIFT;
Annotation
- Immediate include surface: `gem/i915_gem_lmem.h`, `gt/intel_gt.h`, `gt/intel_gt_irq.h`, `gt/intel_gt_pm_irq.h`, `gt/intel_gt_regs.h`, `i915_drv.h`, `i915_irq.h`, `i915_reg.h`.
- Detected declarations: `function GuC`, `function guc_send_reg`, `function intel_guc_init_send_regs`, `function gen9_reset_guc_interrupts`, `function gen9_enable_guc_interrupts`, `function gen9_disable_guc_interrupts`, `function __gen11_reset_guc_interrupts`, `function gen11_reset_guc_interrupts`, `function gen11_enable_guc_interrupts`, `function gen11_disable_guc_interrupts`.
- Atlas domain: Driver Families / drivers/gpu.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.