How qualcomm-linux/kgsl works
KGSL is the Linux kernel driver layer that enables userspace graphics and compute on Qualcomm Adreno GPUs. The main workflow is userspace issuing device operations and command submissions; KGSL manages device state and draw objects, while Adreno-specific code schedules and submits work to the GPU. Supporting branches manage GPU memory and power, communicate with the GMU, and expose debugging and profiling information. README statements support the broad capabilities; source excerpts are partial, so detailed runtime links not demonstrated there are omitted.
Main entry points: kgsl.c KGSL device core · adreno.c Adreno device · msm_kgsl.h KGSL UAPI · adreno_hwsched.c Command scheduler
Components 22
Userspace interface
- KGSL UAPI
include/uapi/linux/msm_kgsl.h
KGSL core
- KGSL device core
kgsl.c - Device model
kgsl_device.h - Draw objects
kgsl_drawobj.c - KGSL interfaces
kgsl.h
Adreno execution
- Adreno device
adreno.c - Adreno interfaces
adreno.h - GPU models
adreno-gpulist.h - Command scheduler
adreno_hwsched.c - Gen8 HFI
adreno_gen8_hwsched_hfi.c - PM4 packets
adreno_pm4types.h - Command parser
adreno_cp_parser.c
Resources and power
- GPU memory
kgsl_sharedmem.c - GPU address translation
kgsl_mmu.h - Power control
kgsl_pwrctrl.c - GMU core
kgsl_gmu_core.h
Diagnostics and profiling
- Debug interfaces
kgsl_debugfs.h - GPU snapshots
kgsl_snapshot.c - Profiling
adreno_profile.h - Event log
kgsl_eventlog.h - Trace events
kgsl_trace.h
Other components
- Graphics applications
Connections 21
- Graphics applications → KGSL UAPI: uses
- KGSL UAPI → KGSL device core: requests operations
- KGSL device core → Draw objects: creates submissions
kgsl.c - KGSL device core → Device model: uses device state
kgsl.c - KGSL device core → KGSL interfaces: uses interfaces
kgsl.c - KGSL device core → Adreno device: supports GPU operations
kgsl.c - Adreno device → Adreno interfaces: uses interfaces
adreno.c - Adreno device → GPU models: selects GPU models
adreno.c - Adreno device → Command scheduler: queues recovery work
adreno.c - Command scheduler → Gen8 HFI: dispatches commands
- Adreno device → PM4 packets: uses packet definitions
adreno.c - Command parser → PM4 packets: parses packets
adreno_cp_parser.c - KGSL device core → GPU memory: manages GPU memory
- GPU memory → GPU address translation: uses address translation
- KGSL device core → Power control: manages GPU power
- Adreno device → GMU core: uses GMU services
adreno.c - KGSL device core → Debug interfaces: provides debugging
kgsl.c - Adreno device → GPU snapshots: captures GPU state
- Adreno device → Profiling: provides profiling
- KGSL device core → Event log: records events
kgsl.c - Adreno device → Trace events: emits GPU traces
adreno.c