drivers/gpu/drm/etnaviv/etnaviv_gpu.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/etnaviv/etnaviv_gpu.c- Extension
.c- Size
- 55041 bytes
- Lines
- 2046
- 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
linux/clk.hlinux/component.hlinux/delay.hlinux/dma-fence.hlinux/dma-mapping.hlinux/mod_devicetable.hlinux/module.hlinux/platform_device.hlinux/pm_runtime.hlinux/regulator/consumer.hlinux/reset.hlinux/thermal.hdrm/drm_print.hetnaviv_cmdbuf.hetnaviv_dump.hetnaviv_flop_reset.hetnaviv_gpu.hetnaviv_gem.hetnaviv_mmu.hetnaviv_perfmon.hetnaviv_sched.hcommon.xml.hstate.xml.hstate_hi.xml.hcmdstream.xml.h
Detected Declarations
struct dma_debugstruct etnaviv_fencefunction etnaviv_gpu_get_paramfunction etnaviv_gpu_reset_deassertfunction etnaviv_is_model_revfunction etnaviv_hw_specsfunction etnaviv_hw_identifyfunction etnaviv_gpu_load_clockfunction etnaviv_gpu_update_clockfunction etnaviv_hw_resetfunction etnaviv_gpu_enable_mlcgfunction etnaviv_gpu_start_fefunction etnaviv_gpu_start_fe_idleloopfunction etnaviv_gpu_setup_pulse_eaterfunction etnaviv_gpu_hw_initfunction etnaviv_gpu_initfunction verify_dmafunction etnaviv_gpu_debugfsfunction etnaviv_fence_signaledfunction etnaviv_fence_releasefunction fence_afterfunction event_allocfunction event_freefunction etnaviv_gpu_wait_fence_interruptiblefunction etnaviv_gpu_wait_obj_inactivefunction sync_point_perfmon_samplefunction sync_point_perfmon_sample_prefunction sync_point_perfmon_sample_postfunction sync_point_workerfunction etnaviv_gpu_recover_hangfunction dump_mmu_faultfunction irq_handlerfunction etnaviv_gpu_clk_enablefunction etnaviv_gpu_clk_disablefunction etnaviv_gpu_wait_idlefunction etnaviv_gpu_hw_suspendfunction etnaviv_gpu_hw_resumefunction etnaviv_gpu_cooling_get_max_statefunction etnaviv_gpu_cooling_get_cur_statefunction etnaviv_gpu_cooling_set_cur_statefunction etnaviv_gpu_bindfunction etnaviv_gpu_unbindfunction etnaviv_gpu_platform_probefunction etnaviv_gpu_platform_removefunction etnaviv_gpu_rpm_suspendfunction etnaviv_gpu_rpm_resume
Annotated Snippet
struct dma_debug {
u32 address[2];
u32 state[2];
};
static void verify_dma(struct etnaviv_gpu *gpu, struct dma_debug *debug)
{
u32 i;
debug->address[0] = gpu_read(gpu, VIVS_FE_DMA_ADDRESS);
debug->state[0] = gpu_read(gpu, VIVS_FE_DMA_DEBUG_STATE);
for (i = 0; i < 500; i++) {
debug->address[1] = gpu_read(gpu, VIVS_FE_DMA_ADDRESS);
debug->state[1] = gpu_read(gpu, VIVS_FE_DMA_DEBUG_STATE);
if (debug->address[0] != debug->address[1])
break;
if (debug->state[0] != debug->state[1])
break;
}
}
int etnaviv_gpu_debugfs(struct etnaviv_gpu *gpu, struct seq_file *m)
{
struct dma_debug debug;
u32 dma_lo, dma_hi, axi, idle;
int ret;
seq_printf(m, "%s Status:\n", dev_name(gpu->dev));
ret = pm_runtime_get_sync(gpu->dev);
if (ret < 0)
goto pm_put;
dma_lo = gpu_read(gpu, VIVS_FE_DMA_LOW);
dma_hi = gpu_read(gpu, VIVS_FE_DMA_HIGH);
axi = gpu_read(gpu, VIVS_HI_AXI_STATUS);
idle = gpu_read(gpu, VIVS_HI_IDLE_STATE);
verify_dma(gpu, &debug);
seq_puts(m, "\tidentity\n");
seq_printf(m, "\t model: 0x%x\n", gpu->identity.model);
seq_printf(m, "\t revision: 0x%x\n", gpu->identity.revision);
seq_printf(m, "\t product_id: 0x%x\n", gpu->identity.product_id);
seq_printf(m, "\t customer_id: 0x%x\n", gpu->identity.customer_id);
seq_printf(m, "\t eco_id: 0x%x\n", gpu->identity.eco_id);
seq_puts(m, "\tfeatures\n");
seq_printf(m, "\t major_features: 0x%08x\n",
gpu->identity.features);
seq_printf(m, "\t minor_features0: 0x%08x\n",
gpu->identity.minor_features0);
seq_printf(m, "\t minor_features1: 0x%08x\n",
gpu->identity.minor_features1);
seq_printf(m, "\t minor_features2: 0x%08x\n",
gpu->identity.minor_features2);
seq_printf(m, "\t minor_features3: 0x%08x\n",
gpu->identity.minor_features3);
seq_printf(m, "\t minor_features4: 0x%08x\n",
gpu->identity.minor_features4);
seq_printf(m, "\t minor_features5: 0x%08x\n",
gpu->identity.minor_features5);
seq_printf(m, "\t minor_features6: 0x%08x\n",
gpu->identity.minor_features6);
seq_printf(m, "\t minor_features7: 0x%08x\n",
gpu->identity.minor_features7);
seq_printf(m, "\t minor_features8: 0x%08x\n",
gpu->identity.minor_features8);
seq_printf(m, "\t minor_features9: 0x%08x\n",
gpu->identity.minor_features9);
seq_printf(m, "\t minor_features10: 0x%08x\n",
gpu->identity.minor_features10);
seq_printf(m, "\t minor_features11: 0x%08x\n",
gpu->identity.minor_features11);
seq_puts(m, "\tspecs\n");
seq_printf(m, "\t stream_count: %d\n",
gpu->identity.stream_count);
seq_printf(m, "\t register_max: %d\n",
gpu->identity.register_max);
seq_printf(m, "\t thread_count: %d\n",
gpu->identity.thread_count);
seq_printf(m, "\t vertex_cache_size: %d\n",
gpu->identity.vertex_cache_size);
seq_printf(m, "\t shader_core_count: %d\n",
gpu->identity.shader_core_count);
seq_printf(m, "\t nn_core_count: %d\n",
Annotation
- Immediate include surface: `linux/clk.h`, `linux/component.h`, `linux/delay.h`, `linux/dma-fence.h`, `linux/dma-mapping.h`, `linux/mod_devicetable.h`, `linux/module.h`, `linux/platform_device.h`.
- Detected declarations: `struct dma_debug`, `struct etnaviv_fence`, `function etnaviv_gpu_get_param`, `function etnaviv_gpu_reset_deassert`, `function etnaviv_is_model_rev`, `function etnaviv_hw_specs`, `function etnaviv_hw_identify`, `function etnaviv_gpu_load_clock`, `function etnaviv_gpu_update_clock`, `function etnaviv_hw_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.