drivers/gpu/drm/i915/display/intel_dsb.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/i915/display/intel_dsb.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/i915/display/intel_dsb.c- Extension
.c- Size
- 32641 bytes
- Lines
- 1126
- 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.
- 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/iopoll.hdrm/drm_print.hdrm/drm_vblank.hdrm/intel/display_parent_interface.hintel_crtc.hintel_de.hintel_display_regs.hintel_display_rpm.hintel_display_types.hintel_dsb.hintel_dsb_regs.hintel_psr.hintel_vblank.hintel_vrr.hskl_watermark.h
Detected Declarations
struct intel_dsbfunction DSBfunction dsb_buffer_writefunction dsb_buffer_readfunction dsb_buffer_fillfunction dsb_buffer_cleanupfunction dsb_buffer_flush_mapfunction pre_commit_is_vrr_activefunction dsb_vtotalfunction dsb_dewake_scanline_startfunction dsb_dewake_scanline_endfunction dsb_scanline_to_hwfunction dsb_chickenfunction assert_dsb_has_roomfunction assert_dsb_tail_is_alignedfunction intel_dsb_dumpfunction is_dsb_busyfunction intel_dsb_sizefunction intel_dsb_headfunction intel_dsb_tailfunction intel_dsb_ins_alignfunction intel_dsb_emitfunction intel_dsb_prev_ins_is_writefunction intel_dsb_prev_ins_is_indexed_writefunction intel_dsb_reg_write_indexedfunction intel_dsb_reg_writefunction intel_dsb_mask_to_byte_enfunction intel_dsb_reg_write_maskedfunction intel_dsb_noopfunction intel_dsb_nonpost_startfunction intel_dsb_nonpost_endfunction intel_dsb_interruptfunction intel_dsb_wait_usecfunction intel_dsb_wait_vblanksfunction intel_dsb_emit_wait_dslfunction intel_dsb_wait_dslfunction assert_dsl_okfunction intel_dsb_wait_scanline_infunction intel_dsb_wait_scanline_outfunction intel_dsb_pollfunction intel_dsb_align_tailfunction intel_dsb_gosub_alignfunction intel_dsb_gosubfunction intel_dsb_gosub_finishfunction intel_dsb_finishfunction dsb_error_int_statusfunction dsb_error_int_enfunction intel_dsb_noarm_exec_time_us
Annotated Snippet
struct intel_dsb {
enum intel_dsb_id id;
struct intel_dsb_buffer *dsb_buf;
struct intel_crtc *crtc;
/*
* maximum number of dwords the buffer will hold.
*/
unsigned int size;
/*
* free_pos will point the first free dword and
* help in calculating tail of command buffer.
*/
unsigned int free_pos;
/*
* Previously emitted DSB instruction. Used to
* identify/adjust the instruction for indexed
* register writes.
*/
u32 ins[2];
/*
* Start of the previously emitted DSB instruction.
* Used to adjust the instruction for indexed
* register writes.
*/
unsigned int ins_start_offset;
u32 chicken;
int hw_dewake_scanline;
};
/**
* DOC: DSB
*
* A DSB (Display State Buffer) is a queue of MMIO instructions in the memory
* which can be offloaded to DSB HW in Display Controller. DSB HW is a DMA
* engine that can be programmed to download the DSB from memory.
* It allows driver to batch submit display HW programming. This helps to
* reduce loading time and CPU activity, thereby making the context switch
* faster. DSB Support added from Gen12 Intel graphics based platform.
*
* DSB's can access only the pipe, plane, and transcoder Data Island Packet
* registers.
*
* DSB HW can support only register writes (both indexed and direct MMIO
* writes). There are no registers reads possible with DSB HW engine.
*/
/*
* DSB buffer parent interface calls are here instead of intel_parent.[ch]
* because they're not used outside of intel_dsb.c.
*/
static u32 dsb_buffer_ggtt_offset(struct intel_dsb *dsb)
{
struct intel_display *display = to_intel_display(dsb->crtc);
return display->parent->dsb->ggtt_offset(dsb->dsb_buf);
}
static void dsb_buffer_write(struct intel_dsb *dsb, u32 idx, u32 val)
{
struct intel_display *display = to_intel_display(dsb->crtc);
display->parent->dsb->write(dsb->dsb_buf, idx, val);
}
static u32 dsb_buffer_read(struct intel_dsb *dsb, u32 idx)
{
struct intel_display *display = to_intel_display(dsb->crtc);
return display->parent->dsb->read(dsb->dsb_buf, idx);
}
static void dsb_buffer_fill(struct intel_dsb *dsb, u32 idx, u32 val, size_t size)
{
struct intel_display *display = to_intel_display(dsb->crtc);
display->parent->dsb->fill(dsb->dsb_buf, idx, val, size);
}
static struct intel_dsb_buffer *dsb_buffer_create(struct intel_display *display, size_t size)
{
return display->parent->dsb->create(display->drm, size);
}
static void dsb_buffer_cleanup(struct intel_dsb *dsb)
Annotation
- Immediate include surface: `linux/iopoll.h`, `drm/drm_print.h`, `drm/drm_vblank.h`, `drm/intel/display_parent_interface.h`, `intel_crtc.h`, `intel_de.h`, `intel_display_regs.h`, `intel_display_rpm.h`.
- Detected declarations: `struct intel_dsb`, `function DSB`, `function dsb_buffer_write`, `function dsb_buffer_read`, `function dsb_buffer_fill`, `function dsb_buffer_cleanup`, `function dsb_buffer_flush_map`, `function pre_commit_is_vrr_active`, `function dsb_vtotal`, `function dsb_dewake_scanline_start`.
- 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.