STRUCT PVR_DEVICE(9)
๐ NAME ๐
struct pvr_device โ the powervr-specific wrapper for &struct drm_device โจ (yes bestie, this is the struct pvr_device(9) page straight out of the Kernel API Manual, and we're gonna get through it together ๐ซถ)
๐ธ SYNOPSIS ๐ธ
okay so here's the whole struct, and ngl it's giving main character energy with this many members โ but don't panic, we go through every single one below:
struct pvr_device {
struct drm_device base;
struct pvr_gpu_id gpu_id;
struct pvr_device_features features;
struct pvr_device_quirks quirks;
struct pvr_device_enhancements enhancements;
struct pvr_fw_version fw_version;
const struct pvr_device_data *device_data;
struct resource *regs_resource;
void __iomem *regs;
struct clk *core_clk;
struct clk *sys_clk;
struct clk *mem_clk;
struct pvr_device_power {
struct dev_pm_domain_list *domains;
struct device_link **domain_links;
} power;
struct reset_control *reset;
struct pwrseq_desc *pwrseq;
int irq;
struct pvr_ccb fwccb;
struct pvr_vm_context *kernel_vm_ctx;
struct pvr_fw_device fw_dev;
u32 stream_musthave_quirks[PVR_STREAM_TYPE_MAX][PVR_STREAM_EXTHDR_TYPE_MAX];
atomic_t mmu_flush_cache_flags;
struct xarray ctx_ids;
struct xarray free_list_ids;
struct xarray job_ids;
struct {
struct list_head active;
struct list_head idle;
struct mutex lock;
} queues;
struct {
struct delayed_work work;
u32 old_kccb_cmds_executed;
u32 kccb_stall_count;
} watchdog;
struct {
struct pvr_ccb ccb;
wait_queue_head_t rtn_q;
struct pvr_fw_object *rtn_obj;
u32 *rtn;
u32 slot_count;
u32 reserved_count;
struct list_head waiters;
struct {
u64 id;
atomic_t seqno;
spinlock_t lock;
} fence_ctx;
} kccb;
bool lost;
struct rw_semaphore reset_sem;
struct workqueue_struct *sched_wq;
spinlock_t ctx_list_lock;
bool has_safety_events;
};
๐ Members ๐
baseโ the underlyingstruct drm_device. ๐
๐จ Do not touch this member directly, bestie โ call from_pvr_device instead. iykyk.
gpu_idโ GPU ID, detected at runtime. ๐featuresโ hardware feature info.
๐ Do not access this member directly โ use thePVR_HAS_FEATUREorPVR_FEATURE_VALUEmacros instead.
quirksโ hardware quirk info.
๐ Do not access this directly โ use PVR_HAS_QUIRK instead.
enhancementsโ hardware enhancement info.
๐ Do not access this directly โ use PVR_HAS_ENHANCEMENT instead.
fw_versionโ firmware version, detected at runtime. ๐งdevice_dataโ pointer to platform-specific data.regs_resourceโ the resource representing the device control registers.regsโ the device control registers themselves. These get mapped into memory when the device is initialized, and that mapped location is exactly where this pointer points. ๐core_clkโ the general core clock. This is the primary clock used by the entire GPU core. ๐sys_clkโ an optional system bus clock. Some platforms use this to give the SoC Interface (SOCIF) an independent clock. If it's present, it needs to be enabled/disabled together withcore_clkโ they're a package deal fr fr. ๐ซถmem_clkโ an optional memory clock. Some platforms use this to give the Memory Interface (MEMIF) an independent clock. If it's present, it also needs to be enabled/disabled together withcore_clk. โจpowerโ optional power domain devices. On platforms where the GPU has more than one power domain, they live here indomains, along with the links between them indomain_links. And heads up: the size ofdomain_linksis one less thanstruct dev_pm_domain_list->num_pdsindomains. ๐งฎresetโ an optional reset line. Some platforms use this to provide a reset line that needs to be de-asserted after the power-up procedure. It would also need to be asserted after the power-down procedure. โกpwrseqโ pointer to a power sequencer, if one is used.irqโ the IRQ number. ๐fwccbโ the firmware CCB.kernel_vm_ctxโ the virtual memory context used for kernel mappings. This is used for mappings in the firmware address region when a META firmware processor is in use. ๐ง When a MIPS firmware processor is in use, this will beNULL. ๐fw_devโ firmware-related data.stream_musthave_quirksโ bit array of "must-have" quirks for stream commands.mmu_flush_cache_flagsโ records which MMU caches require flushing before the next job gets submitted. ๐งนctx_idsโ array of contexts belonging to this device. The array members are of typestruct pvr_context *. This array is used to allocate IDs used by the firmware. ๐free_list_idsโ array of free lists belonging to this device. The array members are of typestruct pvr_free_list *. This array is used to allocate IDs used by the firmware. ๐job_idsโ array of jobs belonging to this device. The array members are of typestruct pvr_job *.queuesโ queue-related fields. ๐queues.activeโ the active queue list.queues.idleโ the idle queue list.
watchdogโ watchdog for communications with firmware. ๐watchdog.workโ work item for the watchdog callback.watchdog.old_kccb_cmds_executedโ KCCB command execution count at the last watchdog poll.watchdog.kccb_stall_countโ number of watchdog polls KCCB has been stalled for.
kccbโ circular buffer for communications with firmware. ๐kccb.ccbโ the kernel CCB.kccb.rtn_qโ waitqueue for KCCB command return waiters.kccb.rtn_objโ object representing KCCB return slots.kccb.rtnโ pointer to the CPU mapping of the KCCB return slots. Must be accessed byREAD_ONCE/WRITE_ONCE. โ ๏ธkccb.slot_countโ total number of KCCB slots available.kccb.waitersโ list of KCCB slot waiters.kccb.fence_ctxโ the KCCB fence context.kccb.fence_ctx.lockโ lock used to synchronize access to fences allocated by this context.
lostโtrueif the device has been lost. ๐ญ This variable is set if the device has become irretrievably unavailable โ like, say, if the firmware processor has stopped responding and can't be revived via a hard reset. Gone gone.reset_semโ the reset semaphore. GPU reset code will lock this for writing. Any code that submits commands to the firmware that isn't in an IRQ handler or on the scheduler workqueue must lock this for reading.
๐จ Once this has been successfully locked,pvr_dev->lost_must_ be checked, and-EIOmust be returned if it is set. no cap, this one is not optional.
sched_wqโ workqueue for schedulers.ctx_list_lockโ lock to be held when accessing the context list instruct pvr_file.has_safety_eventsโ whether this device can raise safety events. ๐ฆบ
๐ฆ SEE ALSO ๐ฆ
Go check out the kernel file ./drivers/gpu/drm/imagination/pvr_device.h, plus all these icons:
struct pvr_gpu_id(9)struct pvr_fw_version(9)struct pvr_device_data(9)struct pvr_file(9)PVR_HAS_FEATURE(9)PVR_FEATURE_VALUE(9)PVR_HAS_QUIRK(9)PVR_HAS_ENHANCEMENT(9)PVR_PACKED_BVNC(9)pvr_gpu_id_to_packed_bvnc(9)PVR_CR_FIELD_GET(9)pvr_cr_read32(9)pvr_cr_read64(9)pvr_cr_write32(9)pvr_cr_write64(9)pvr_cr_poll_reg32(9)pvr_cr_poll_reg64(9)pvr_round_up_to_cacheline_size(9)IOCTL validation helpers(9)pvr_ioctl_union_padding_check(9)PVR_STATIC_ASSERT_64BIT_ALIGNED(9)PVR_IOCTL_UNION_PADDING_CHECK(9)
and that's the whole vibe check, bestie โ you ate that ๐
โจ this page lives in ./drivers/gpu/drm/imagination, dated October 2026, and it's forever gonna be struct pvr_device(9) in the Kernel API Manual. mwah ๐๐ฆ๐
๐ฆ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms