drivers/gpu/drm/i915/i915_irq.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/i915/i915_irq.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/i915/i915_irq.c- Extension
.c- Size
- 34479 bytes
- Lines
- 1209
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/slab.hlinux/sysrq.hdrm/drm_drv.hdrm/drm_print.hdrm/intel/display_parent_interface.hdrm/intel/intel_gmd_interrupt_regs.hdisplay/intel_display_irq.hgt/intel_breadcrumbs.hgt/intel_gt.hgt/intel_gt_irq.hgt/intel_gt_pm_irq.hgt/intel_gt_regs.hgt/intel_rps.hi915_driver.hi915_drv.hi915_irq.hi915_reg.h
Detected Declarations
function filesfunction gen2_irq_resetfunction gen2_assert_iir_is_zerofunction gen2_irq_initfunction gen2_error_resetfunction gen2_error_initfunction ivb_parity_workfunction valleyview_irq_handlerfunction cherryview_irq_handlerfunction ilk_irq_handlerfunction gen8_master_intr_disablefunction gen8_master_intr_enablefunction gen8_irq_handlerfunction gen11_master_intr_disablefunction gen11_master_intr_enablefunction gen11_irq_handlerfunction dg1_master_intr_disablefunction dg1_master_intr_enablefunction dg1_irq_handlerfunction ilk_irq_resetfunction valleyview_irq_resetfunction gen8_irq_resetfunction gen11_irq_resetfunction dg1_irq_resetfunction cherryview_irq_resetfunction ilk_irq_postinstallfunction valleyview_irq_postinstallfunction gen8_irq_postinstallfunction gen11_irq_postinstallfunction dg1_irq_postinstallfunction cherryview_irq_postinstallfunction i9xx_error_maskfunction i9xx_error_irq_ackfunction i9xx_error_irq_handlerfunction i915_irq_resetfunction i915_irq_postinstallfunction i915_irq_handlerfunction i965_irq_resetfunction i965_error_maskfunction i965_irq_postinstallfunction i965_irq_handlerfunction intel_irq_initfunction intel_irq_finifunction intel_irq_handlerfunction intel_irq_resetfunction intel_irq_postinstallfunction intel_irq_installfunction intel_irq_uninstall
Annotated Snippet
if (pm_iir) {
raw_reg_write(regs, GEN6_PMIIR, pm_iir);
gen6_rps_irq_handler(&to_gt(i915)->rps, pm_iir);
ret = IRQ_HANDLED;
}
}
/* Re-enable master and south interrupts */
ilk_display_irq_master_enable(display, de_ier, sde_ier);
pmu_irq_stats(i915, ret);
/* IRQs are synced during runtime_suspend, we don't require a wakeref */
enable_rpm_wakeref_asserts(&i915->runtime_pm);
return ret;
}
static inline u32 gen8_master_intr_disable(void __iomem * const regs)
{
raw_reg_write(regs, GEN8_MASTER_IRQ, 0);
/*
* Now with master disabled, get a sample of level indications
* for this interrupt. Indications will be cleared on related acks.
* New indications can and will light up during processing,
* and will generate new interrupt after enabling master.
*/
return raw_reg_read(regs, GEN8_MASTER_IRQ);
}
static inline void gen8_master_intr_enable(void __iomem * const regs)
{
raw_reg_write(regs, GEN8_MASTER_IRQ, GEN8_MASTER_IRQ_CONTROL);
}
static irqreturn_t gen8_irq_handler(int irq, void *arg)
{
struct drm_i915_private *dev_priv = arg;
struct intel_display *display = dev_priv->display;
void __iomem * const regs = intel_uncore_regs(&dev_priv->uncore);
u32 master_ctl;
if (!intel_irqs_enabled(dev_priv))
return IRQ_NONE;
master_ctl = gen8_master_intr_disable(regs);
if (!master_ctl) {
gen8_master_intr_enable(regs);
return IRQ_NONE;
}
/* Find, queue (onto bottom-halves), then clear each source */
gen8_gt_irq_handler(to_gt(dev_priv), master_ctl);
/* IRQs are synced during runtime_suspend, we don't require a wakeref */
if (master_ctl & ~GEN8_GT_IRQS) {
const struct intel_display_irq_state state = {
.master_ctl = master_ctl,
};
disable_rpm_wakeref_asserts(&dev_priv->runtime_pm);
intel_display_irq_handler(display, &state);
enable_rpm_wakeref_asserts(&dev_priv->runtime_pm);
}
gen8_master_intr_enable(regs);
pmu_irq_stats(dev_priv, IRQ_HANDLED);
return IRQ_HANDLED;
}
static inline u32 gen11_master_intr_disable(void __iomem * const regs)
{
raw_reg_write(regs, GEN11_GFX_MSTR_IRQ, 0);
/*
* Now with master disabled, get a sample of level indications
* for this interrupt. Indications will be cleared on related acks.
* New indications can and will light up during processing,
* and will generate new interrupt after enabling master.
*/
return raw_reg_read(regs, GEN11_GFX_MSTR_IRQ);
}
static inline void gen11_master_intr_enable(void __iomem * const regs)
{
raw_reg_write(regs, GEN11_GFX_MSTR_IRQ, GEN11_MASTER_IRQ);
}
Annotation
- Immediate include surface: `linux/slab.h`, `linux/sysrq.h`, `drm/drm_drv.h`, `drm/drm_print.h`, `drm/intel/display_parent_interface.h`, `drm/intel/intel_gmd_interrupt_regs.h`, `display/intel_display_irq.h`, `gt/intel_breadcrumbs.h`.
- Detected declarations: `function files`, `function gen2_irq_reset`, `function gen2_assert_iir_is_zero`, `function gen2_irq_init`, `function gen2_error_reset`, `function gen2_error_init`, `function ivb_parity_work`, `function valleyview_irq_handler`, `function cherryview_irq_handler`, `function ilk_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.