drivers/gpu/drm/xe/xe_irq.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/xe/xe_irq.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/xe/xe_irq.c- Extension
.c- Size
- 26721 bytes
- Lines
- 1054
- 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
xe_irq.hlinux/sched/clock.hdrm/drm_managed.hdisplay/xe_display.hregs/xe_irq_regs.hxe_device.hxe_drv.hxe_gsc_proxy.hxe_gt.hxe_guc.hxe_hw_engine.hxe_hw_error.hxe_i2c.hxe_memirq.hxe_mert.hxe_mmio.hxe_pxp.hxe_sriov.hxe_sysctrl.hxe_tile.h
Detected Declarations
enum xe_irq_msix_staticfunction assert_iir_is_zerofunction unmask_and_enablefunction mask_and_disablefunction xelp_intr_disablefunction gu_misc_irq_ackfunction xelp_intr_enablefunction xe_irq_enable_hwefunction gt_engine_identityfunction gt_other_irq_handlerfunction gt_irq_handlerfunction for_each_set_bitfunction xelp_irq_handlerfunction dg1_intr_disablefunction dg1_intr_enablefunction dg1_irq_handlerfunction for_each_tilefunction interruptsfunction gt_irq_resetfunction xelp_irq_resetfunction dg1_irq_resetfunction dg1_irq_reset_mstrfunction vf_irq_resetfunction for_each_tilefunction xe_irq_resetfunction for_each_tilefunction vf_irq_postinstallfunction xe_irq_postinstallfunction vf_mem_irq_handlerfunction xe_irq_handlerfunction xe_irq_msi_request_irqsfunction xe_irq_msi_freefunction irq_uninstallfunction xe_irq_initfunction xe_irq_installfunction xe_irq_msi_synchronize_irqfunction xe_irq_suspendfunction xe_irq_resumefunction xe_irq_msix_initfunction xe_irq_msix_default_hwe_handlerfunction for_each_tilefunction for_each_gtfunction xe_irq_msix_alloc_vectorfunction xe_irq_msix_release_vectorfunction xe_irq_msix_request_irq_internalfunction xe_irq_msix_request_irqfunction xe_irq_msix_free_irqfunction xe_irq_msix_request_irqs
Annotated Snippet
if (GRAPHICS_VERx100(xe) >= 3511 && !xe_device_has_msix(xe)) {
rcs_mask |= GT_COMPUTE_WALKER_INTERRUPT;
ccs_mask |= GT_COMPUTE_WALKER_INTERRUPT;
}
} else {
common_mask = GT_MI_USER_INTERRUPT |
GT_CS_MASTER_ERROR_INTERRUPT |
GT_CONTEXT_SWITCH_INTERRUPT |
GT_WAIT_SEMAPHORE_INTERRUPT;
}
rcs_mask |= common_mask;
bcs_mask |= common_mask;
vcs_mask |= common_mask;
vecs_mask |= common_mask;
ccs_mask |= common_mask;
if (xe_gt_is_main_type(gt)) {
/*
* For enabling the interrupts, the information about fused off
* engines doesn't matter much, but this also allows to check if
* the engine is available architecturally in the platform
*/
u32 ccs_fuse_mask = xe_hw_engine_mask_per_class(gt, XE_ENGINE_CLASS_COMPUTE);
u32 bcs_fuse_mask = xe_hw_engine_mask_per_class(gt, XE_ENGINE_CLASS_COPY);
/* Enable interrupts for each engine class */
xe_mmio_write32(mmio, RENDER_COPY_INTR_ENABLE,
REG_FIELD_PREP(ENGINE1_MASK, rcs_mask) |
REG_FIELD_PREP(ENGINE0_MASK, bcs_mask));
if (ccs_fuse_mask)
xe_mmio_write32(mmio, CCS_RSVD_INTR_ENABLE,
REG_FIELD_PREP(ENGINE1_MASK, ccs_mask));
/* Unmask interrupts for each engine instance */
val = ~REG_FIELD_PREP(ENGINE1_MASK, rcs_mask);
xe_mmio_write32(mmio, RCS0_RSVD_INTR_MASK, val);
val = ~REG_FIELD_PREP(ENGINE1_MASK, bcs_mask);
xe_mmio_write32(mmio, BCS_RSVD_INTR_MASK, val);
val = ~(REG_FIELD_PREP(ENGINE1_MASK, bcs_mask) |
REG_FIELD_PREP(ENGINE0_MASK, bcs_mask));
if (bcs_fuse_mask & (BIT(1)|BIT(2)))
xe_mmio_write32(mmio, XEHPC_BCS1_BCS2_INTR_MASK, val);
if (bcs_fuse_mask & (BIT(3)|BIT(4)))
xe_mmio_write32(mmio, XEHPC_BCS3_BCS4_INTR_MASK, val);
if (bcs_fuse_mask & (BIT(5)|BIT(6)))
xe_mmio_write32(mmio, XEHPC_BCS5_BCS6_INTR_MASK, val);
if (bcs_fuse_mask & (BIT(7)|BIT(8)))
xe_mmio_write32(mmio, XEHPC_BCS7_BCS8_INTR_MASK, val);
val = ~(REG_FIELD_PREP(ENGINE1_MASK, ccs_mask) |
REG_FIELD_PREP(ENGINE0_MASK, ccs_mask));
if (ccs_fuse_mask & (BIT(0)|BIT(1)))
xe_mmio_write32(mmio, CCS0_CCS1_INTR_MASK, val);
if (ccs_fuse_mask & (BIT(2)|BIT(3)))
xe_mmio_write32(mmio, CCS2_CCS3_INTR_MASK, val);
}
if (xe_gt_is_media_type(gt) || MEDIA_VER(xe) < 13) {
u32 vcs_fuse_mask = xe_hw_engine_mask_per_class(gt, XE_ENGINE_CLASS_VIDEO_DECODE);
u32 vecs_fuse_mask = xe_hw_engine_mask_per_class(gt, XE_ENGINE_CLASS_VIDEO_ENHANCE);
u32 other_fuse_mask = xe_hw_engine_mask_per_class(gt, XE_ENGINE_CLASS_OTHER);
/* Enable interrupts for each engine class */
xe_mmio_write32(mmio, VCS_VECS_INTR_ENABLE,
REG_FIELD_PREP(ENGINE1_MASK, vcs_mask) |
REG_FIELD_PREP(ENGINE0_MASK, vecs_mask));
/* Unmask interrupts for each engine instance */
val = ~(REG_FIELD_PREP(ENGINE1_MASK, vcs_mask) |
REG_FIELD_PREP(ENGINE0_MASK, vcs_mask));
if (vcs_fuse_mask & (BIT(0) | BIT(1)))
xe_mmio_write32(mmio, VCS0_VCS1_INTR_MASK, val);
if (vcs_fuse_mask & (BIT(2) | BIT(3)))
xe_mmio_write32(mmio, VCS2_VCS3_INTR_MASK, val);
if (vcs_fuse_mask & (BIT(4) | BIT(5)))
xe_mmio_write32(mmio, VCS4_VCS5_INTR_MASK, val);
if (vcs_fuse_mask & (BIT(6) | BIT(7)))
xe_mmio_write32(mmio, VCS6_VCS7_INTR_MASK, val);
val = ~(REG_FIELD_PREP(ENGINE1_MASK, vecs_mask) |
REG_FIELD_PREP(ENGINE0_MASK, vecs_mask));
if (vecs_fuse_mask & (BIT(0) | BIT(1)))
xe_mmio_write32(mmio, VECS0_VECS1_INTR_MASK, val);
if (vecs_fuse_mask & (BIT(2) | BIT(3)))
xe_mmio_write32(mmio, VECS2_VECS3_INTR_MASK, val);
/*
* the heci2 interrupt is enabled via the same register as the
Annotation
- Immediate include surface: `xe_irq.h`, `linux/sched/clock.h`, `drm/drm_managed.h`, `display/xe_display.h`, `regs/xe_irq_regs.h`, `xe_device.h`, `xe_drv.h`, `xe_gsc_proxy.h`.
- Detected declarations: `enum xe_irq_msix_static`, `function assert_iir_is_zero`, `function unmask_and_enable`, `function mask_and_disable`, `function xelp_intr_disable`, `function gu_misc_irq_ack`, `function xelp_intr_enable`, `function xe_irq_enable_hwe`, `function gt_engine_identity`, `function gt_other_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.