drivers/gpu/drm/i915/gt/intel_ring_submission.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/i915/gt/intel_ring_submission.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/i915/gt/intel_ring_submission.c- Extension
.c- Size
- 38813 bytes
- Lines
- 1460
- 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
drm/drm_cache.hdrm/intel/intel_gmd_interrupt_regs.hdrm/intel/intel_gmd_misc_regs.hgem/i915_gem_internal.hgen2_engine_cs.hgen6_engine_cs.hgen6_ppgtt.hgen7_renderclear.hi915_drv.hi915_irq.hi915_mitigations.hi915_reg.hi915_wait_util.hintel_breadcrumbs.hintel_context.hintel_engine_heartbeat.hintel_engine_pm.hintel_engine_regs.hintel_gt.hintel_gt_irq.hintel_gt_print.hintel_gt_regs.hintel_reset.hintel_ring.hshmem_utils.hselftest_ring_submission.c
Detected Declarations
function set_hwstamfunction set_hws_pgafunction ring_setup_phys_status_pagefunction set_hwspfunction flush_cs_tlbfunction ring_setup_status_pagefunction pp_dirfunction set_pp_dirfunction stop_ringfunction xcs_resumefunction RING_CTLfunction sanitize_hwspfunction xcs_sanitizefunction reset_preparefunction wait_for_atomicfunction reset_rewindfunction reset_finishfunction i9xx_submit_requestfunction __ring_context_finifunction ring_context_destroyfunction ring_context_init_default_statefunction ring_context_pre_pinfunction __context_unpin_ppgttfunction ring_context_unpinfunction alloc_context_vmafunction ring_context_allocfunction ring_context_pinfunction ring_context_resetfunction ring_context_revokefunction ring_context_cancel_requestfunction load_pd_dirfunction mi_set_contextfunction for_each_enginefunction for_each_enginefunction remap_l3_slicefunction remap_l3function switch_mmfunction clear_residualsfunction switch_contextfunction ring_request_allocfunction gen6_bsd_submit_requestfunction i9xx_set_default_submissionfunction gen6_bsd_set_default_submissionfunction ring_releasefunction irq_handlerfunction setup_irqfunction add_to_enginefunction remove_from_engine
Annotated Snippet
switch (engine->id) {
/*
* No more rings exist on Gen7. Default case is only to shut up
* gcc switch check warning.
*/
default:
GEM_BUG_ON(engine->id);
fallthrough;
case RCS0:
hwsp = RENDER_HWS_PGA_GEN7;
break;
case BCS0:
hwsp = BLT_HWS_PGA_GEN7;
break;
case VCS0:
hwsp = BSD_HWS_PGA_GEN7;
break;
case VECS0:
hwsp = VEBOX_HWS_PGA_GEN7;
break;
}
} else if (GRAPHICS_VER(engine->i915) == 6) {
hwsp = RING_HWS_PGA_GEN6(engine->mmio_base);
} else {
hwsp = RING_HWS_PGA(engine->mmio_base);
}
intel_uncore_write_fw(engine->uncore, hwsp, offset);
intel_uncore_posting_read_fw(engine->uncore, hwsp);
}
static void flush_cs_tlb(struct intel_engine_cs *engine)
{
if (!IS_GRAPHICS_VER(engine->i915, 6, 7))
return;
/* ring should be idle before issuing a sync flush*/
if ((ENGINE_READ(engine, RING_MI_MODE) & MODE_IDLE) == 0)
drm_warn(&engine->i915->drm, "%s not idle before sync flush!\n",
engine->name);
ENGINE_WRITE_FW(engine, RING_INSTPM,
REG_MASKED_FIELD_ENABLE(INSTPM_TLB_INVALIDATE | INSTPM_SYNC_FLUSH));
if (__intel_wait_for_register_fw(engine->uncore,
RING_INSTPM(engine->mmio_base),
INSTPM_SYNC_FLUSH, 0,
2000, 0, NULL))
ENGINE_TRACE(engine,
"wait for SyncFlush to complete for TLB invalidation timed out\n");
}
static void ring_setup_status_page(struct intel_engine_cs *engine)
{
set_hwsp(engine, i915_ggtt_offset(engine->status_page.vma));
set_hwstam(engine, ~0u);
flush_cs_tlb(engine);
}
static struct i915_address_space *vm_alias(struct i915_address_space *vm)
{
if (i915_is_ggtt(vm))
vm = &i915_vm_to_ggtt(vm)->alias->vm;
return vm;
}
static u32 pp_dir(struct i915_address_space *vm)
{
return to_gen6_ppgtt(i915_vm_to_ppgtt(vm))->pp_dir;
}
static void set_pp_dir(struct intel_engine_cs *engine)
{
struct i915_address_space *vm = vm_alias(engine->gt->vm);
if (!vm)
return;
ENGINE_WRITE_FW(engine, RING_PP_DIR_DCLV, PP_DIR_DCLV_2G);
ENGINE_WRITE_FW(engine, RING_PP_DIR_BASE, pp_dir(vm));
if (GRAPHICS_VER(engine->i915) >= 7) {
ENGINE_WRITE_FW(engine,
RING_MODE_GEN7,
REG_MASKED_FIELD_ENABLE(GFX_PPGTT_ENABLE));
}
}
static bool stop_ring(struct intel_engine_cs *engine)
Annotation
- Immediate include surface: `drm/drm_cache.h`, `drm/intel/intel_gmd_interrupt_regs.h`, `drm/intel/intel_gmd_misc_regs.h`, `gem/i915_gem_internal.h`, `gen2_engine_cs.h`, `gen6_engine_cs.h`, `gen6_ppgtt.h`, `gen7_renderclear.h`.
- Detected declarations: `function set_hwstam`, `function set_hws_pga`, `function ring_setup_phys_status_page`, `function set_hwsp`, `function flush_cs_tlb`, `function ring_setup_status_page`, `function pp_dir`, `function set_pp_dir`, `function stop_ring`, `function xcs_resume`.
- 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.