drivers/gpu/drm/i915/display/intel_display_irq.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/i915/display/intel_display_irq.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/i915/display/intel_display_irq.c- Extension
.c- Size
- 77395 bytes
- Lines
- 2669
- 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.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- 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
drm/drm_print.hdrm/drm_vblank.hdrm/intel/intel_gmd_interrupt_regs.hicl_dsi_regs.hintel_crtc.hintel_de.hintel_display_irq.hintel_display_regs.hintel_display_rpm.hintel_display_rps.hintel_display_trace.hintel_display_types.hintel_dmc.hintel_dp_aux.hintel_dsb.hintel_fdi_regs.hintel_fifo_underrun.hintel_gmbus.hintel_hotplug_irq.hintel_lpe_audio.hintel_parent.hintel_pipe_crc_regs.hintel_plane.hintel_pmdemand.hintel_psr.hintel_psr_regs.h
Detected Declarations
struct pipe_fault_handlerstruct intel_display_irq_funcsstruct intel_display_irq_snapshotfunction irq_resetfunction assert_iir_is_zerofunction irq_initfunction error_resetfunction error_initfunction handle_plane_faultfunction intel_pipe_fault_irq_handlerfunction intel_handle_vblankfunction ilk_update_display_irqfunction ilk_enable_display_irqfunction ilk_disable_display_irqfunction bdw_update_port_irqfunction bdw_update_pipe_irqfunction bdw_enable_pipe_irqfunction bdw_disable_pipe_irqfunction ibx_display_interrupt_updatefunction ibx_enable_display_interruptfunction ibx_disable_display_interruptfunction i915_pipestat_enable_maskfunction i915_enable_pipestatfunction i915_disable_pipestatfunction i915_has_legacy_blc_interruptfunction i915_enable_asle_pipestatfunction display_pipe_crc_irq_handlerfunction display_pipe_crc_irq_handlerfunction hsw_pipe_crc_irq_handlerfunction ivb_pipe_crc_irq_handlerfunction i9xx_pipe_crc_irq_handlerfunction i9xx_pipestat_irq_resetfunction for_each_pipefunction i9xx_pipestat_irq_ackfunction for_each_pipefunction i915_pipestat_irq_handlerfunction for_each_pipefunction i965_pipestat_irq_handlerfunction for_each_pipefunction valleyview_pipestat_irq_handlerfunction for_each_pipefunction ibx_irq_handlerfunction ivb_err_int_pipe_fault_maskfunction ivb_err_int_handlerfunction for_each_pipefunction cpt_serr_int_handlerfunction cpt_irq_handlerfunction ilk_gtt_fault_pipe_fault_mask
Annotated Snippet
struct pipe_fault_handler {
bool (*handle)(struct intel_crtc *crtc, enum plane_id plane_id);
u32 fault;
enum plane_id plane_id;
};
static bool handle_plane_fault(struct intel_crtc *crtc, enum plane_id plane_id)
{
struct intel_display *display = to_intel_display(crtc);
struct intel_plane_error error = {};
struct intel_plane *plane;
plane = intel_crtc_get_plane(crtc, plane_id);
if (!plane || !plane->capture_error)
return false;
plane->capture_error(crtc, plane, &error);
drm_err_ratelimited(display->drm,
"[CRTC:%d:%s][PLANE:%d:%s] fault (CTL=0x%x, SURF=0x%x, SURFLIVE=0x%x)\n",
crtc->base.base.id, crtc->base.name,
plane->base.base.id, plane->base.name,
error.ctl, error.surf, error.surflive);
return true;
}
static void intel_pipe_fault_irq_handler(struct intel_display *display,
const struct pipe_fault_handler *handlers,
enum pipe pipe, u32 fault_errors)
{
struct intel_crtc *crtc = intel_crtc_for_pipe(display, pipe);
const struct pipe_fault_handler *handler;
for (handler = handlers; handler && handler->fault; handler++) {
if ((fault_errors & handler->fault) == 0)
continue;
if (handler->handle(crtc, handler->plane_id))
fault_errors &= ~handler->fault;
}
WARN_ONCE(fault_errors, "[CRTC:%d:%s] unreported faults 0x%x\n",
crtc->base.base.id, crtc->base.name, fault_errors);
}
static void
intel_handle_vblank(struct intel_display *display, enum pipe pipe)
{
struct intel_crtc *crtc = intel_crtc_for_pipe(display, pipe);
drm_crtc_handle_vblank(&crtc->base);
}
/**
* ilk_update_display_irq - update DEIMR
* @display: display device
* @interrupt_mask: mask of interrupt bits to update
* @enabled_irq_mask: mask of interrupt bits to enable
*/
void ilk_update_display_irq(struct intel_display *display,
u32 interrupt_mask, u32 enabled_irq_mask)
{
u32 new_val;
lockdep_assert_held(&display->irq.lock);
drm_WARN_ON(display->drm, enabled_irq_mask & ~interrupt_mask);
new_val = display->irq.ilk_de_imr_mask;
new_val &= ~interrupt_mask;
new_val |= (~enabled_irq_mask & interrupt_mask);
if (new_val != display->irq.ilk_de_imr_mask &&
!drm_WARN_ON(display->drm, !intel_parent_irq_enabled(display))) {
display->irq.ilk_de_imr_mask = new_val;
intel_de_write(display, DEIMR, display->irq.ilk_de_imr_mask);
intel_de_posting_read(display, DEIMR);
}
}
void ilk_enable_display_irq(struct intel_display *display, u32 bits)
{
ilk_update_display_irq(display, bits, bits);
}
void ilk_disable_display_irq(struct intel_display *display, u32 bits)
{
ilk_update_display_irq(display, bits, 0);
}
Annotation
- Immediate include surface: `drm/drm_print.h`, `drm/drm_vblank.h`, `drm/intel/intel_gmd_interrupt_regs.h`, `icl_dsi_regs.h`, `intel_crtc.h`, `intel_de.h`, `intel_display_irq.h`, `intel_display_regs.h`.
- Detected declarations: `struct pipe_fault_handler`, `struct intel_display_irq_funcs`, `struct intel_display_irq_snapshot`, `function irq_reset`, `function assert_iir_is_zero`, `function irq_init`, `function error_reset`, `function error_init`, `function handle_plane_fault`, `function intel_pipe_fault_irq_handler`.
- 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.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.