drivers/gpu/drm/i915/display/intel_fifo_underrun.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/i915/display/intel_fifo_underrun.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/i915/display/intel_fifo_underrun.c- Extension
.c- Size
- 18043 bytes
- Lines
- 586
- 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
linux/seq_buf.hdrm/drm_print.hintel_de.hintel_display_irq.hintel_display_regs.hintel_display_trace.hintel_display_types.hintel_fbc.hintel_fifo_underrun.hintel_pch_display.h
Detected Declarations
function filesfunction for_each_set_bitfunction read_underrun_dbg1function read_underrun_dbg2function read_underrun_dbg_pkgcfunction read_underrun_dbg_infofunction ivb_can_enable_err_intfunction for_each_pipefunction cpt_can_enable_serr_intfunction for_each_pipefunction i9xx_check_fifo_underrunsfunction i9xx_set_fifo_underrun_reportingfunction ilk_set_fifo_underrun_reportingfunction ivb_check_fifo_underrunsfunction ivb_set_fifo_underrun_reportingfunction bdw_set_fifo_underrun_reportingfunction ibx_set_fifo_underrun_reportingfunction cpt_check_pch_fifo_underrunsfunction cpt_set_fifo_underrun_reportingfunction __intel_set_cpu_fifo_underrun_reportingfunction intel_set_cpu_fifo_underrun_reportingfunction intel_set_pch_fifo_underrun_reportingfunction intel_cpu_fifo_underrun_irq_handlerfunction intel_pch_fifo_underrun_irq_handlerfunction intel_check_cpu_fifo_underrunsfunction for_each_intel_crtcfunction intel_check_pch_fifo_underrunsfunction for_each_intel_crtcfunction intel_init_fifo_underrun_reporting
Annotated Snippet
intel_de_read(display, GEN7_ERR_INT) & ERR_INT_FIFO_UNDERRUN(pipe)) {
drm_err(display->drm,
"uncleared fifo underrun on pipe %c\n",
pipe_name(pipe));
}
}
}
static void bdw_set_fifo_underrun_reporting(struct intel_display *display,
enum pipe pipe, bool enable)
{
if (enable)
bdw_enable_pipe_irq(display, pipe, GEN8_PIPE_FIFO_UNDERRUN);
else
bdw_disable_pipe_irq(display, pipe, GEN8_PIPE_FIFO_UNDERRUN);
}
static void ibx_set_fifo_underrun_reporting(struct intel_display *display,
enum pipe pch_transcoder,
bool enable)
{
u32 bit = (pch_transcoder == PIPE_A) ?
SDE_TRANSA_FIFO_UNDER : SDE_TRANSB_FIFO_UNDER;
if (enable)
ibx_enable_display_interrupt(display, bit);
else
ibx_disable_display_interrupt(display, bit);
}
static void cpt_check_pch_fifo_underruns(struct intel_crtc *crtc)
{
struct intel_display *display = to_intel_display(crtc);
enum pipe pch_transcoder = crtc->pipe;
u32 serr_int = intel_de_read(display, SERR_INT);
lockdep_assert_held(&display->irq.lock);
if ((serr_int & SERR_INT_TRANS_FIFO_UNDERRUN(pch_transcoder)) == 0)
return;
intel_de_write(display, SERR_INT,
SERR_INT_TRANS_FIFO_UNDERRUN(pch_transcoder));
intel_de_posting_read(display, SERR_INT);
trace_intel_pch_fifo_underrun(display, pch_transcoder);
drm_err(display->drm, "pch fifo underrun on pch transcoder %c\n",
pipe_name(pch_transcoder));
}
static void cpt_set_fifo_underrun_reporting(struct intel_display *display,
enum pipe pch_transcoder,
bool enable, bool old)
{
if (enable) {
intel_de_write(display, SERR_INT,
SERR_INT_TRANS_FIFO_UNDERRUN(pch_transcoder));
if (!cpt_can_enable_serr_int(display))
return;
ibx_enable_display_interrupt(display, SDE_ERROR_CPT);
} else {
ibx_disable_display_interrupt(display, SDE_ERROR_CPT);
if (old && intel_de_read(display, SERR_INT) &
SERR_INT_TRANS_FIFO_UNDERRUN(pch_transcoder)) {
drm_err(display->drm,
"uncleared pch fifo underrun on pch transcoder %c\n",
pipe_name(pch_transcoder));
}
}
}
static bool __intel_set_cpu_fifo_underrun_reporting(struct intel_display *display,
enum pipe pipe, bool enable)
{
struct intel_crtc *crtc = intel_crtc_for_pipe(display, pipe);
bool old;
lockdep_assert_held(&display->irq.lock);
old = !crtc->cpu_fifo_underrun_disabled;
crtc->cpu_fifo_underrun_disabled = !enable;
/*
* The debug bits get latched at the time of the FIFO underrun ISR bit
* getting set. That means that any non-zero debug bit that is read when
* handling a FIFO underrun interrupt has the potential to belong to
* another underrun event (past or future). To alleviate this problem,
Annotation
- Immediate include surface: `linux/seq_buf.h`, `drm/drm_print.h`, `intel_de.h`, `intel_display_irq.h`, `intel_display_regs.h`, `intel_display_trace.h`, `intel_display_types.h`, `intel_fbc.h`.
- Detected declarations: `function files`, `function for_each_set_bit`, `function read_underrun_dbg1`, `function read_underrun_dbg2`, `function read_underrun_dbg_pkgc`, `function read_underrun_dbg_info`, `function ivb_can_enable_err_int`, `function for_each_pipe`, `function cpt_can_enable_serr_int`, `function for_each_pipe`.
- 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.