drivers/gpu/drm/panfrost/panfrost_device.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/panfrost/panfrost_device.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/panfrost/panfrost_device.c- Extension
.c- Size
- 14480 bytes
- Lines
- 567
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/clk.hlinux/reset.hlinux/platform_device.hlinux/pm_domain.hlinux/pm_runtime.hlinux/regulator/consumer.hpanfrost_device.hpanfrost_devfreq.hpanfrost_features.hpanfrost_gem.hpanfrost_issues.hpanfrost_gpu.hpanfrost_job.hpanfrost_mmu.hpanfrost_perfcnt.h
Detected Declarations
struct panfrost_exception_infofunction panfrost_reset_initfunction panfrost_reset_finifunction panfrost_clk_initfunction panfrost_clk_finifunction panfrost_regulator_initfunction panfrost_regulator_finifunction panfrost_pm_domain_finifunction panfrost_pm_domain_initfunction panfrost_device_initfunction panfrost_device_finifunction panfrost_exception_needs_resetfunction panfrost_device_resetfunction panfrost_device_runtime_resumefunction panfrost_device_runtime_suspendfunction panfrost_device_resumefunction panfrost_device_suspend
Annotated Snippet
struct panfrost_exception_info {
const char *name;
};
static const struct panfrost_exception_info panfrost_exception_infos[] = {
PANFROST_EXCEPTION(OK),
PANFROST_EXCEPTION(DONE),
PANFROST_EXCEPTION(INTERRUPTED),
PANFROST_EXCEPTION(STOPPED),
PANFROST_EXCEPTION(TERMINATED),
PANFROST_EXCEPTION(KABOOM),
PANFROST_EXCEPTION(EUREKA),
PANFROST_EXCEPTION(ACTIVE),
PANFROST_EXCEPTION(JOB_CONFIG_FAULT),
PANFROST_EXCEPTION(JOB_POWER_FAULT),
PANFROST_EXCEPTION(JOB_READ_FAULT),
PANFROST_EXCEPTION(JOB_WRITE_FAULT),
PANFROST_EXCEPTION(JOB_AFFINITY_FAULT),
PANFROST_EXCEPTION(JOB_BUS_FAULT),
PANFROST_EXCEPTION(INSTR_INVALID_PC),
PANFROST_EXCEPTION(INSTR_INVALID_ENC),
PANFROST_EXCEPTION(INSTR_TYPE_MISMATCH),
PANFROST_EXCEPTION(INSTR_OPERAND_FAULT),
PANFROST_EXCEPTION(INSTR_TLS_FAULT),
PANFROST_EXCEPTION(INSTR_BARRIER_FAULT),
PANFROST_EXCEPTION(INSTR_ALIGN_FAULT),
PANFROST_EXCEPTION(DATA_INVALID_FAULT),
PANFROST_EXCEPTION(TILE_RANGE_FAULT),
PANFROST_EXCEPTION(ADDR_RANGE_FAULT),
PANFROST_EXCEPTION(IMPRECISE_FAULT),
PANFROST_EXCEPTION(OOM),
PANFROST_EXCEPTION(OOM_AFBC),
PANFROST_EXCEPTION(UNKNOWN),
PANFROST_EXCEPTION(DELAYED_BUS_FAULT),
PANFROST_EXCEPTION(GPU_SHAREABILITY_FAULT),
PANFROST_EXCEPTION(SYS_SHAREABILITY_FAULT),
PANFROST_EXCEPTION(GPU_CACHEABILITY_FAULT),
PANFROST_EXCEPTION(TRANSLATION_FAULT_0),
PANFROST_EXCEPTION(TRANSLATION_FAULT_1),
PANFROST_EXCEPTION(TRANSLATION_FAULT_2),
PANFROST_EXCEPTION(TRANSLATION_FAULT_3),
PANFROST_EXCEPTION(TRANSLATION_FAULT_4),
PANFROST_EXCEPTION(TRANSLATION_FAULT_IDENTITY),
PANFROST_EXCEPTION(PERM_FAULT_0),
PANFROST_EXCEPTION(PERM_FAULT_1),
PANFROST_EXCEPTION(PERM_FAULT_2),
PANFROST_EXCEPTION(PERM_FAULT_3),
PANFROST_EXCEPTION(TRANSTAB_BUS_FAULT_0),
PANFROST_EXCEPTION(TRANSTAB_BUS_FAULT_1),
PANFROST_EXCEPTION(TRANSTAB_BUS_FAULT_2),
PANFROST_EXCEPTION(TRANSTAB_BUS_FAULT_3),
PANFROST_EXCEPTION(ACCESS_FLAG_0),
PANFROST_EXCEPTION(ACCESS_FLAG_1),
PANFROST_EXCEPTION(ACCESS_FLAG_2),
PANFROST_EXCEPTION(ACCESS_FLAG_3),
PANFROST_EXCEPTION(ADDR_SIZE_FAULT_IN0),
PANFROST_EXCEPTION(ADDR_SIZE_FAULT_IN1),
PANFROST_EXCEPTION(ADDR_SIZE_FAULT_IN2),
PANFROST_EXCEPTION(ADDR_SIZE_FAULT_IN3),
PANFROST_EXCEPTION(ADDR_SIZE_FAULT_OUT0),
PANFROST_EXCEPTION(ADDR_SIZE_FAULT_OUT1),
PANFROST_EXCEPTION(ADDR_SIZE_FAULT_OUT2),
PANFROST_EXCEPTION(ADDR_SIZE_FAULT_OUT3),
PANFROST_EXCEPTION(MEM_ATTR_FAULT_0),
PANFROST_EXCEPTION(MEM_ATTR_FAULT_1),
PANFROST_EXCEPTION(MEM_ATTR_FAULT_2),
PANFROST_EXCEPTION(MEM_ATTR_FAULT_3),
PANFROST_EXCEPTION(MEM_ATTR_NONCACHE_0),
PANFROST_EXCEPTION(MEM_ATTR_NONCACHE_1),
PANFROST_EXCEPTION(MEM_ATTR_NONCACHE_2),
PANFROST_EXCEPTION(MEM_ATTR_NONCACHE_3),
};
const char *panfrost_exception_name(u32 exception_code)
{
if (WARN_ON(exception_code >= ARRAY_SIZE(panfrost_exception_infos) ||
!panfrost_exception_infos[exception_code].name))
return "Unknown exception type";
return panfrost_exception_infos[exception_code].name;
}
bool panfrost_exception_needs_reset(const struct panfrost_device *pfdev,
u32 exception_code)
{
/* If an occlusion query write causes a bus fault on affected GPUs,
* future fragment jobs may hang. Reset to workaround.
*/
if (exception_code == DRM_PANFROST_EXCEPTION_JOB_BUS_FAULT)
return panfrost_has_hw_issue(pfdev, HW_ISSUE_TTRX_3076);
Annotation
- Immediate include surface: `linux/clk.h`, `linux/reset.h`, `linux/platform_device.h`, `linux/pm_domain.h`, `linux/pm_runtime.h`, `linux/regulator/consumer.h`, `panfrost_device.h`, `panfrost_devfreq.h`.
- Detected declarations: `struct panfrost_exception_info`, `function panfrost_reset_init`, `function panfrost_reset_fini`, `function panfrost_clk_init`, `function panfrost_clk_fini`, `function panfrost_regulator_init`, `function panfrost_regulator_fini`, `function panfrost_pm_domain_fini`, `function panfrost_pm_domain_init`, `function panfrost_device_init`.
- 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.
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.