drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c- Extension
.c- Size
- 56419 bytes
- Lines
- 2086
- 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.
- 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/ascii85.hmsm_gem.ha6xx_gpu.ha6xx_gmu.ha6xx_gpu_state.ha6xx_gmu.xml.hadreno_gen7_0_0_snapshot.hadreno_gen7_2_0_snapshot.hadreno_gen7_9_0_snapshot.h
Detected Declarations
struct a6xx_gpu_state_objstruct a6xx_gpu_statestruct a6xx_crashdumperstruct a6xx_state_memobjfunction CRASHDUMP_WRITEfunction CRASHDUMP_READfunction CRASHDUMP_FINIfunction a6xx_crashdumper_initfunction a6xx_crashdumper_runfunction debugbus_readfunction cx_debugbus_readfunction vbif_debugbus_readfunction a6xx_get_vbif_debugbus_blockfunction a6xx_get_debugbus_blockfunction a6xx_get_cx_debugbus_blockfunction a6xx_get_debugbus_blocksfunction a7xx_get_debugbus_blocksfunction a6xx_get_debugbusfunction a6xx_get_dbgahb_clusterfunction a7xx_get_dbgahb_clusterfunction a6xx_get_dbgahb_clustersfunction a7xx_get_dbgahb_clustersfunction a6xx_get_clusterfunction a7xx_get_clusterfunction a6xx_get_clustersfunction a7xx_get_clustersfunction a6xx_get_shader_blockfunction a7xx_get_shader_blockfunction a6xx_get_shadersfunction a7xx_get_shadersfunction a6xx_get_crashdumper_hlsq_registersfunction a6xx_get_crashdumper_registersfunction a7xx_get_crashdumper_registersfunction a6xx_get_ahb_gpu_registersfunction a7xx_get_ahb_gpu_registersfunction a7xx_get_ahb_gpu_reglistfunction _a6xx_get_gmu_registersfunction a6xx_get_gmu_registersfunction a6xx_snapshot_gmu_hfi_historyfunction a6xx_get_registersfunction a7xx_get_registersfunction a7xx_get_post_crashdumper_registersfunction a6xx_get_cp_roq_sizefunction a7xx_get_cp_roq_sizefunction a6xx_get_indexed_regsfunction a6xx_get_indexed_registersfunction a7xx_get_indexed_registersfunction a6xx_gpu_state_destroy
Annotated Snippet
struct a6xx_gpu_state_obj {
const void *handle;
u32 *data;
u32 count; /* optional, used when count potentially read from hw */
};
struct a6xx_gpu_state {
struct msm_gpu_state base;
struct a6xx_gpu_state_obj *gmu_registers;
int nr_gmu_registers;
struct a6xx_gpu_state_obj *registers;
int nr_registers;
struct a6xx_gpu_state_obj *shaders;
int nr_shaders;
struct a6xx_gpu_state_obj *clusters;
int nr_clusters;
struct a6xx_gpu_state_obj *dbgahb_clusters;
int nr_dbgahb_clusters;
struct a6xx_gpu_state_obj *indexed_regs;
int nr_indexed_regs;
struct a6xx_gpu_state_obj *debugbus;
int nr_debugbus;
struct a6xx_gpu_state_obj *vbif_debugbus;
struct a6xx_gpu_state_obj *cx_debugbus;
int nr_cx_debugbus;
struct msm_gpu_state_bo *gmu_log;
struct msm_gpu_state_bo *gmu_hfi;
struct msm_gpu_state_bo *gmu_debug;
s32 hfi_queue_history[HFI_MAX_QUEUES][HFI_HISTORY_SZ];
struct list_head objs;
bool gpu_initialized;
};
static inline int CRASHDUMP_WRITE(u64 *in, u32 reg, u32 val)
{
in[0] = val;
in[1] = (((u64) reg) << 44 | (1 << 21) | 1);
return 2;
}
static inline int CRASHDUMP_READ(u64 *in, u32 reg, u32 dwords, u64 target)
{
in[0] = target;
in[1] = (((u64) reg) << 44 | dwords);
return 2;
}
static inline int CRASHDUMP_FINI(u64 *in)
{
in[0] = 0;
in[1] = 0;
return 2;
}
struct a6xx_crashdumper {
void *ptr;
struct drm_gem_object *bo;
u64 iova;
};
struct a6xx_state_memobj {
struct list_head node;
unsigned long long data[];
};
static void *state_kcalloc(struct a6xx_gpu_state *a6xx_state, int nr, size_t objsize)
{
struct a6xx_state_memobj *obj =
kvzalloc((nr * objsize) + sizeof(*obj), GFP_KERNEL);
if (!obj)
return NULL;
list_add_tail(&obj->node, &a6xx_state->objs);
Annotation
- Immediate include surface: `linux/ascii85.h`, `msm_gem.h`, `a6xx_gpu.h`, `a6xx_gmu.h`, `a6xx_gpu_state.h`, `a6xx_gmu.xml.h`, `adreno_gen7_0_0_snapshot.h`, `adreno_gen7_2_0_snapshot.h`.
- Detected declarations: `struct a6xx_gpu_state_obj`, `struct a6xx_gpu_state`, `struct a6xx_crashdumper`, `struct a6xx_state_memobj`, `function CRASHDUMP_WRITE`, `function CRASHDUMP_READ`, `function CRASHDUMP_FINI`, `function a6xx_crashdumper_init`, `function a6xx_crashdumper_run`, `function debugbus_read`.
- Atlas domain: Driver Families / drivers/gpu.
- Implementation status: source implementation candidate.
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.