drivers/gpu/drm/v3d/v3d_irq.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/v3d/v3d_irq.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/v3d/v3d_irq.c- Extension
.c- Size
- 9016 bytes
- Lines
- 349
- 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/platform_device.hlinux/sched/clock.hdrm/drm_print.hv3d_drv.hv3d_regs.hv3d_trace.h
Detected Declarations
function v3d_overflow_mem_workfunction v3d_irq_signal_fencefunction v3d_irqfunction v3d_hub_irqfunction v3d_irq_initfunction v3d_irq_enablefunction v3d_irq_disablefunction v3d_irq_reset
Annotated Snippet
if (v3d->ver >= V3D_GEN_71) {
size_t i;
axi_id = axi_id & 0x7F;
for (i = 0; i < ARRAY_SIZE(v3d71_axi_ids); i++) {
if (axi_id >= v3d71_axi_ids[i].begin &&
axi_id < v3d71_axi_ids[i].end) {
client = v3d71_axi_ids[i].client;
break;
}
}
} else if (v3d->ver >= V3D_GEN_41) {
size_t i;
axi_id = axi_id & 0xFF;
for (i = 0; i < ARRAY_SIZE(v3d41_axi_ids); i++) {
if (axi_id >= v3d41_axi_ids[i].begin &&
axi_id < v3d41_axi_ids[i].end) {
client = v3d41_axi_ids[i].client;
break;
}
}
}
drm_dbg(&v3d->drm, "MMU error from client %s (0x%x) at 0x%llx%s%s%s\n",
client, axi_id, (long long)vio_addr,
((intsts & V3D_HUB_INT_MMU_WRV) ?
", write violation" : ""),
((intsts & V3D_HUB_INT_MMU_PTI) ?
", pte invalid" : ""),
((intsts & V3D_HUB_INT_MMU_CAP) ?
", cap exceeded" : ""));
status = IRQ_HANDLED;
}
if (v3d->ver >= V3D_GEN_71 && (intsts & V3D_V7_HUB_INT_GMPV)) {
drm_err(&v3d->drm, "GMP Violation\n");
status = IRQ_HANDLED;
}
return status;
}
int
v3d_irq_init(struct v3d_dev *v3d)
{
int irq, ret;
INIT_WORK(&v3d->overflow_mem_work, v3d_overflow_mem_work);
irq = platform_get_irq_optional(v3d_to_pdev(v3d), 1);
if (irq == -EPROBE_DEFER)
return irq;
if (irq > 0) {
v3d->irq[V3D_CORE_IRQ] = irq;
ret = devm_request_irq(v3d->drm.dev, v3d->irq[V3D_CORE_IRQ],
v3d_irq, IRQF_SHARED,
"v3d_core0", v3d);
if (ret)
goto fail;
irq = platform_get_irq(v3d_to_pdev(v3d), 0);
if (irq < 0)
return irq;
v3d->irq[V3D_HUB_IRQ] = irq;
ret = devm_request_irq(v3d->drm.dev, v3d->irq[V3D_HUB_IRQ],
v3d_hub_irq, IRQF_SHARED,
"v3d_hub", v3d);
if (ret)
goto fail;
} else {
v3d->single_irq_line = true;
irq = platform_get_irq(v3d_to_pdev(v3d), 0);
if (irq < 0)
return irq;
v3d->irq[V3D_CORE_IRQ] = irq;
ret = devm_request_irq(v3d->drm.dev, v3d->irq[V3D_CORE_IRQ],
v3d_irq, IRQF_SHARED,
"v3d", v3d);
if (ret)
goto fail;
}
return 0;
fail:
Annotation
- Immediate include surface: `linux/platform_device.h`, `linux/sched/clock.h`, `drm/drm_print.h`, `v3d_drv.h`, `v3d_regs.h`, `v3d_trace.h`.
- Detected declarations: `function v3d_overflow_mem_work`, `function v3d_irq_signal_fence`, `function v3d_irq`, `function v3d_hub_irq`, `function v3d_irq_init`, `function v3d_irq_enable`, `function v3d_irq_disable`, `function v3d_irq_reset`.
- 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.