drivers/gpu/drm/panthor/panthor_device.h
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/panthor/panthor_device.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/panthor/panthor_device.h- Extension
.h- Size
- 22418 bytes
- Lines
- 702
- 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/atomic.hlinux/io-pgtable.hlinux/regulator/consumer.hlinux/pm_runtime.hlinux/sched.hlinux/spinlock.hdrm/drm_device.hdrm/drm_gem.hdrm/drm_mm.hdrm/gpu_scheduler.hdrm/panthor_drm.h
Detected Declarations
struct panthor_csfstruct panthor_csf_ctxstruct panthor_devicestruct panthor_gpustruct panthor_group_poolstruct panthor_heap_poolstruct panthor_hwstruct panthor_jobstruct panthor_mmustruct panthor_fwstruct panthor_perfcntstruct panthor_pwrstruct panthor_vmstruct panthor_vm_poolstruct panthor_soc_datastruct panthor_irqstruct panthor_devicestruct panthor_gpu_usagestruct panthor_fileenum panthor_device_pm_stateenum panthor_irq_stateenum panthor_device_profiling_flagsenum drm_panthor_exception_typefunction panthor_device_schedule_resetfunction panthor_device_reset_is_pendingfunction panthor_device_resume_and_getfunction panthor_exception_is_faultfunction gpu_writefunction gpu_readfunction gpu_read_relaxedfunction gpu_write64function gpu_read64function gpu_read64_relaxedfunction gpu_read64_counter
Annotated Snippet
struct panthor_soc_data {
/** @asn_hash_enable: True if GPU_L2_CONFIG_ASN_HASH_ENABLE must be set. */
bool asn_hash_enable;
/** @asn_hash: ASN_HASH values when asn_hash_enable is true. */
u32 asn_hash[3];
};
/**
* enum panthor_device_pm_state - PM state
*/
enum panthor_device_pm_state {
/** @PANTHOR_DEVICE_PM_STATE_SUSPENDED: Device is suspended. */
PANTHOR_DEVICE_PM_STATE_SUSPENDED = 0,
/** @PANTHOR_DEVICE_PM_STATE_RESUMING: Device is being resumed. */
PANTHOR_DEVICE_PM_STATE_RESUMING,
/** @PANTHOR_DEVICE_PM_STATE_ACTIVE: Device is active. */
PANTHOR_DEVICE_PM_STATE_ACTIVE,
/** @PANTHOR_DEVICE_PM_STATE_SUSPENDING: Device is being suspended. */
PANTHOR_DEVICE_PM_STATE_SUSPENDING,
};
enum panthor_irq_state {
/** @PANTHOR_IRQ_STATE_ACTIVE: IRQ is active and ready to process events. */
PANTHOR_IRQ_STATE_ACTIVE = 0,
/** @PANTHOR_IRQ_STATE_PROCESSING: IRQ is currently processing events. */
PANTHOR_IRQ_STATE_PROCESSING,
/** @PANTHOR_IRQ_STATE_SUSPENDED: IRQ is suspended. */
PANTHOR_IRQ_STATE_SUSPENDED,
/** @PANTHOR_IRQ_STATE_SUSPENDING: IRQ is being suspended. */
PANTHOR_IRQ_STATE_SUSPENDING,
};
/**
* struct panthor_irq - IRQ data
*
* Used to automate IRQ handling for the 3 different IRQs we have in this driver.
*/
struct panthor_irq {
/** @ptdev: Panthor device */
struct panthor_device *ptdev;
/** @iomem: CPU mapping of IRQ base address */
void __iomem *iomem;
/** @irq: IRQ number. */
int irq;
/** @mask: Values to write to xxx_INT_MASK if active. */
u32 mask;
/**
* @mask_lock: protects modifications to _INT_MASK and @mask.
*
* In paths where _INT_MASK is updated based on a state
* transition/check, it's crucial for the state update/check to be
* inside the locked section, otherwise it introduces a race window
* leading to potential _INT_MASK inconsistencies.
*/
spinlock_t mask_lock;
/** @state: one of &enum panthor_irq_state reflecting the current state. */
atomic_t state;
};
/**
* enum panthor_device_profiling_mode - Profiling state
*/
enum panthor_device_profiling_flags {
/** @PANTHOR_DEVICE_PROFILING_DISABLED: Profiling is disabled. */
PANTHOR_DEVICE_PROFILING_DISABLED = 0,
/** @PANTHOR_DEVICE_PROFILING_CYCLES: Sampling job cycles. */
PANTHOR_DEVICE_PROFILING_CYCLES = BIT(0),
/** @PANTHOR_DEVICE_PROFILING_TIMESTAMP: Sampling job timestamp. */
PANTHOR_DEVICE_PROFILING_TIMESTAMP = BIT(1),
/** @PANTHOR_DEVICE_PROFILING_ALL: Sampling everything. */
PANTHOR_DEVICE_PROFILING_ALL =
PANTHOR_DEVICE_PROFILING_CYCLES |
PANTHOR_DEVICE_PROFILING_TIMESTAMP,
};
/**
* struct panthor_device - Panthor device
*/
Annotation
- Immediate include surface: `linux/atomic.h`, `linux/io-pgtable.h`, `linux/regulator/consumer.h`, `linux/pm_runtime.h`, `linux/sched.h`, `linux/spinlock.h`, `drm/drm_device.h`, `drm/drm_gem.h`.
- Detected declarations: `struct panthor_csf`, `struct panthor_csf_ctx`, `struct panthor_device`, `struct panthor_gpu`, `struct panthor_group_pool`, `struct panthor_heap_pool`, `struct panthor_hw`, `struct panthor_job`, `struct panthor_mmu`, `struct panthor_fw`.
- 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.