drivers/gpu/drm/i915/gt/intel_gt_irq.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/i915/gt/intel_gt_irq.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/i915/gt/intel_gt_irq.c- Extension
.c- Size
- 17149 bytes
- Lines
- 559
- 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/sched/clock.hdrm/intel/intel_gmd_interrupt_regs.hi915_drv.hi915_irq.hi915_reg.hintel_breadcrumbs.hintel_gt.hintel_gt_irq.hintel_gt_print.hintel_gt_regs.hintel_uncore.hintel_rps.hpxp/intel_pxp_irq.huc/intel_gsc_proxy.h
Detected Declarations
function guc_irq_handlerfunction gen11_gt_engine_identityfunction gen11_other_irq_handlerfunction gen11_gt_identity_handlerfunction gen11_gt_bank_handlerfunction for_each_set_bitfunction gen11_gt_irq_handlerfunction gen11_gt_reset_one_iirfunction gen11_gt_irq_resetfunction gen11_gt_irq_postinstallfunction gen5_gt_irq_handlerfunction gen7_parity_error_irq_handlerfunction gen6_gt_irq_handlerfunction gen8_gt_irq_handlerfunction gen8_gt_irq_resetfunction gen8_gt_irq_postinstallfunction gen5_gt_update_irqfunction gen5_gt_enable_irqfunction gen5_gt_disable_irqfunction gen5_gt_irq_resetfunction gen5_gt_irq_postinstall
Annotated Snippet
if (likely(iir)) {
intel_engine_cs_irq(gt->engine_class[RENDER_CLASS][0],
iir >> GEN8_RCS_IRQ_SHIFT);
intel_engine_cs_irq(gt->engine_class[COPY_ENGINE_CLASS][0],
iir >> GEN8_BCS_IRQ_SHIFT);
raw_reg_write(regs, GEN8_GT_IIR(0), iir);
}
}
if (master_ctl & (GEN8_GT_VCS0_IRQ | GEN8_GT_VCS1_IRQ)) {
iir = raw_reg_read(regs, GEN8_GT_IIR(1));
if (likely(iir)) {
intel_engine_cs_irq(gt->engine_class[VIDEO_DECODE_CLASS][0],
iir >> GEN8_VCS0_IRQ_SHIFT);
intel_engine_cs_irq(gt->engine_class[VIDEO_DECODE_CLASS][1],
iir >> GEN8_VCS1_IRQ_SHIFT);
raw_reg_write(regs, GEN8_GT_IIR(1), iir);
}
}
if (master_ctl & GEN8_GT_VECS_IRQ) {
iir = raw_reg_read(regs, GEN8_GT_IIR(3));
if (likely(iir)) {
intel_engine_cs_irq(gt->engine_class[VIDEO_ENHANCEMENT_CLASS][0],
iir >> GEN8_VECS_IRQ_SHIFT);
raw_reg_write(regs, GEN8_GT_IIR(3), iir);
}
}
if (master_ctl & (GEN8_GT_PM_IRQ | GEN8_GT_GUC_IRQ)) {
iir = raw_reg_read(regs, GEN8_GT_IIR(2));
if (likely(iir)) {
gen6_rps_irq_handler(>->rps, iir);
guc_irq_handler(gt_to_guc(gt), iir >> 16);
raw_reg_write(regs, GEN8_GT_IIR(2), iir);
}
}
}
void gen8_gt_irq_reset(struct intel_gt *gt)
{
struct intel_uncore *uncore = gt->uncore;
gen2_irq_reset(uncore, GEN8_GT_IRQ_REGS(0));
gen2_irq_reset(uncore, GEN8_GT_IRQ_REGS(1));
gen2_irq_reset(uncore, GEN8_GT_IRQ_REGS(2));
gen2_irq_reset(uncore, GEN8_GT_IRQ_REGS(3));
}
void gen8_gt_irq_postinstall(struct intel_gt *gt)
{
/* These are interrupts we'll toggle with the ring mask register */
const u32 irqs =
GT_CS_MASTER_ERROR_INTERRUPT |
GT_RENDER_USER_INTERRUPT |
GT_CONTEXT_SWITCH_INTERRUPT |
GT_WAIT_SEMAPHORE_INTERRUPT;
const u32 gt_interrupts[] = {
irqs << GEN8_RCS_IRQ_SHIFT | irqs << GEN8_BCS_IRQ_SHIFT,
irqs << GEN8_VCS0_IRQ_SHIFT | irqs << GEN8_VCS1_IRQ_SHIFT,
0,
irqs << GEN8_VECS_IRQ_SHIFT,
};
struct intel_uncore *uncore = gt->uncore;
gt->pm_ier = 0x0;
gt->pm_imr = ~gt->pm_ier;
gen2_irq_init(uncore, GEN8_GT_IRQ_REGS(0), ~gt_interrupts[0], gt_interrupts[0]);
gen2_irq_init(uncore, GEN8_GT_IRQ_REGS(1), ~gt_interrupts[1], gt_interrupts[1]);
/*
* RPS interrupts will get enabled/disabled on demand when RPS itself
* is enabled/disabled. Same will be the case for GuC interrupts.
*/
gen2_irq_init(uncore, GEN8_GT_IRQ_REGS(2), gt->pm_imr, gt->pm_ier);
gen2_irq_init(uncore, GEN8_GT_IRQ_REGS(3), ~gt_interrupts[3], gt_interrupts[3]);
}
static void gen5_gt_update_irq(struct intel_gt *gt,
u32 interrupt_mask,
u32 enabled_irq_mask)
{
lockdep_assert_held(gt->irq_lock);
GEM_BUG_ON(enabled_irq_mask & ~interrupt_mask);
gt->gt_imr &= ~interrupt_mask;
gt->gt_imr |= (~enabled_irq_mask & interrupt_mask);
intel_uncore_write(gt->uncore, GTIMR, gt->gt_imr);
}
Annotation
- Immediate include surface: `linux/sched/clock.h`, `drm/intel/intel_gmd_interrupt_regs.h`, `i915_drv.h`, `i915_irq.h`, `i915_reg.h`, `intel_breadcrumbs.h`, `intel_gt.h`, `intel_gt_irq.h`.
- Detected declarations: `function guc_irq_handler`, `function gen11_gt_engine_identity`, `function gen11_other_irq_handler`, `function gen11_gt_identity_handler`, `function gen11_gt_bank_handler`, `function for_each_set_bit`, `function gen11_gt_irq_handler`, `function gen11_gt_reset_one_iir`, `function gen11_gt_irq_reset`, `function gen11_gt_irq_postinstall`.
- 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.