drivers/gpu/drm/i915/gt/gen8_engine_cs.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/i915/gt/gen8_engine_cs.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/i915/gt/gen8_engine_cs.c- Extension
.c- Size
- 22879 bytes
- Lines
- 856
- 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
drm/drm_print.hgen8_engine_cs.hintel_engine_regs.hintel_gpu_commands.hintel_gt.hintel_lrc.hintel_ring.h
Detected Declarations
function gen8_emit_flush_rcsfunction gen8_emit_flush_xcsfunction gen11_emit_flush_rcsfunction preparser_disablefunction gen12_get_aux_inv_regfunction gen12_needs_ccs_aux_invfunction mtl_dummy_pipe_controlfunction gen12_emit_flush_rcsfunction gen12_emit_flush_xcsfunction preempt_addressfunction hwsp_offsetfunction gen8_emit_init_breadcrumbfunction __xehp_emit_bb_startfunction xehp_emit_bb_start_noarbfunction xehp_emit_bb_startfunction gen8_emit_bb_start_noarbfunction gen8_emit_bb_startfunction assert_request_validfunction gen8_emit_fini_breadcrumb_tailfunction reloc_gpufunction hold_switchout_semaphore_offsetfunction gen12_emit_fini_breadcrumb_tail
Annotated Snippet
IS_DG2(rq->i915)) {
u32 *cs;
/* dummy PIPE_CONTROL + depth flush */
cs = intel_ring_begin(rq, 6);
if (IS_ERR(cs))
return PTR_ERR(cs);
cs = gen12_emit_pipe_control(cs,
0,
PIPE_CONTROL_DEPTH_CACHE_FLUSH,
LRC_PPHWSP_SCRATCH_ADDR);
intel_ring_advance(rq, cs);
}
return 0;
}
int gen12_emit_flush_rcs(struct i915_request *rq, u32 mode)
{
struct intel_engine_cs *engine = rq->engine;
/*
* On Aux CCS platforms the invalidation of the Aux
* table requires quiescing memory traffic beforehand
*/
if (mode & EMIT_FLUSH || gen12_needs_ccs_aux_inv(engine)) {
u32 bit_group_0 = 0;
u32 bit_group_1 = 0;
int err;
u32 *cs;
err = mtl_dummy_pipe_control(rq);
if (err)
return err;
bit_group_0 |= PIPE_CONTROL0_HDC_PIPELINE_FLUSH;
/*
* When required, in MTL and beyond platforms we
* need to set the CCS_FLUSH bit in the pipe control
*/
if (GRAPHICS_VER_FULL(rq->i915) >= IP_VER(12, 70))
bit_group_0 |= PIPE_CONTROL_CCS_FLUSH;
/*
* L3 fabric flush is needed for AUX CCS invalidation
* which happens as part of pipe-control so we can
* ignore PIPE_CONTROL_FLUSH_L3. Also PIPE_CONTROL_FLUSH_L3
* deals with Protected Memory which is not needed for
* AUX CCS invalidation and lead to unwanted side effects.
*/
if ((mode & EMIT_FLUSH) &&
GRAPHICS_VER_FULL(rq->i915) < IP_VER(12, 70))
bit_group_1 |= PIPE_CONTROL_FLUSH_L3;
bit_group_1 |= PIPE_CONTROL_TILE_CACHE_FLUSH;
bit_group_1 |= PIPE_CONTROL_RENDER_TARGET_CACHE_FLUSH;
bit_group_1 |= PIPE_CONTROL_DEPTH_CACHE_FLUSH;
/* Wa_1409600907:tgl,adl-p */
bit_group_1 |= PIPE_CONTROL_DEPTH_STALL;
bit_group_1 |= PIPE_CONTROL_DC_FLUSH_ENABLE;
bit_group_1 |= PIPE_CONTROL_FLUSH_ENABLE;
bit_group_1 |= PIPE_CONTROL_STORE_DATA_INDEX;
bit_group_1 |= PIPE_CONTROL_QW_WRITE;
bit_group_1 |= PIPE_CONTROL_CS_STALL;
if (!HAS_3D_PIPELINE(engine->i915))
bit_group_1 &= ~PIPE_CONTROL_3D_ARCH_FLAGS;
else if (engine->class == COMPUTE_CLASS)
bit_group_1 &= ~PIPE_CONTROL_3D_ENGINE_FLAGS;
cs = intel_ring_begin(rq, 6);
if (IS_ERR(cs))
return PTR_ERR(cs);
cs = gen12_emit_pipe_control(cs, bit_group_0, bit_group_1,
LRC_PPHWSP_SCRATCH_ADDR);
intel_ring_advance(rq, cs);
}
if (mode & EMIT_INVALIDATE) {
u32 flags = 0;
u32 *cs, count;
int err;
err = mtl_dummy_pipe_control(rq);
if (err)
return err;
Annotation
- Immediate include surface: `drm/drm_print.h`, `gen8_engine_cs.h`, `intel_engine_regs.h`, `intel_gpu_commands.h`, `intel_gt.h`, `intel_lrc.h`, `intel_ring.h`.
- Detected declarations: `function gen8_emit_flush_rcs`, `function gen8_emit_flush_xcs`, `function gen11_emit_flush_rcs`, `function preparser_disable`, `function gen12_get_aux_inv_reg`, `function gen12_needs_ccs_aux_inv`, `function mtl_dummy_pipe_control`, `function gen12_emit_flush_rcs`, `function gen12_emit_flush_xcs`, `function preempt_address`.
- 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.