UAPI¶
The sources associated with this section can be found inpvr_drm.h.
The PowerVR IOCTL argument structs have a few limitations in place, inaddition to the standard kernel restrictions:
All members must be type-aligned.
The overall
structmustbe padded to 64-bit alignment.Explicit padding is almost always required. This takes the form of
_padding_[x]members of sufficient size to pad to the next power-of-twoalignment, where [x] is the offset into thestructinhexadecimal. Arraysare never used for alignment. Padding fields must be zeroed; this isalways checked.Unions may only appear as the last member of a struct.
Individual
unionmembersmay grow in the future. The space between theend of aunionmemberand the end of its containingunionisconsidered“implicit padding” and must be zeroed. This is always checked.
In addition to the IOCTL argument structs, the PowerVR UAPI makes use ofDEV_QUERY argument structs. These are used to fetch information about thedevice and runtime. These structs are subject to the same rules set outabove.
OBJECT ARRAYS¶
- structdrm_pvr_obj_array¶
Container used to pass arrays of objects
Definition:
struct drm_pvr_obj_array { __u32 stride; __u32 count; __u64 array;};Members
strideStride of object struct. Used for versioning.
countNumber of objects in the array.
arrayUser pointer to an array of objects.
Description
It is not unusual to have to extend objects to pass new parameters, and the DRMioctl infrastructure is supporting that by padding ioctl arguments with zeroswhen the data passed by userspace is smaller than thestructdefined in thedrm_ioctl_desc, thus keeping things backward compatible. This type is justapplying the same concepts to indirect objects passed through arrays referencedfrom the main ioctl arguments structure: the stride basically defines the sizeof the object passed by userspace, which allows the kernel driver to pad withzeros when it’s smaller than the size of the object it expects.
UseDRM_PVR_OBJ_ARRAY() to fill object array fields, unless youhave a very good reason not to.
- DRM_PVR_OBJ_ARRAY¶
DRM_PVR_OBJ_ARRAY(cnt,ptr)
Helper macro for filling
structdrm_pvr_obj_array.
Parameters
cntNumber of elements pointed to pyptr.
ptrPointer to start of a C array.
Return
Literal of typestructdrm_pvr_obj_array.
IOCTLS¶
- PVR_IOCTL¶
PVR_IOCTL(_ioctl,_mode,_data)
Build a PowerVR IOCTL number
Parameters
_ioctlAn incrementing id for this IOCTL. Added to
DRM_COMMAND_BASE._modeMust be one of
DRM_IOR,DRM_IOWorDRM_IOWR._dataThe type of the args
structpassedby this IOCTL.
Description
Thestructreferred to by_data must have adrm_pvr_ioctl_ prefix and an_argssuffix. They are therefore omitted from_data.
This should only be used to build the constants described below; it shouldnever be used to call an IOCTL directly.
Return
An IOCTL number to be passed to ioctl() from userspace.
DEV_QUERY¶
- enumdrm_pvr_dev_query¶
For use with
drm_pvr_ioctl_dev_query_args.typeto indicate the type of the receiving container.
Constants
DRM_PVR_DEV_QUERY_GPU_INFO_GETThe dev query args contain a pointerto
structdrm_pvr_dev_query_gpu_info.DRM_PVR_DEV_QUERY_RUNTIME_INFO_GETThe dev query args contain apointer to
structdrm_pvr_dev_query_runtime_info.DRM_PVR_DEV_QUERY_QUIRKS_GETThe dev query args contain a pointerto
structdrm_pvr_dev_query_quirks.DRM_PVR_DEV_QUERY_ENHANCEMENTS_GETThe dev query args contain apointer to
structdrm_pvr_dev_query_enhancements.DRM_PVR_DEV_QUERY_HEAP_INFO_GETThe dev query args contain apointer to
structdrm_pvr_dev_query_heap_info.DRM_PVR_DEV_QUERY_STATIC_DATA_AREAS_GETThe dev query args containa pointer to
structdrm_pvr_dev_query_static_data_areas.
Description
Append only. Do not reorder.
- structdrm_pvr_ioctl_dev_query_args¶
Arguments for
DRM_IOCTL_PVR_DEV_QUERY.
Definition:
struct drm_pvr_ioctl_dev_query_args { __u32 type; __u32 size; __u64 pointer;};Members
typeType of query and output struct. See
enumdrm_pvr_dev_query.sizeSize of the receiving struct, seetype.
After a successful call this will be updated to the written bytelength.Can also be used to get the minimum byte length (seepointer).This allows additional fields to be appended to the structs infuture.
pointerPointer to structtype.
Must be large enough to containsize bytes.If pointer is NULL, the expected size will be returned in thesizefield, but no other data will be written.
- structdrm_pvr_dev_query_gpu_info¶
Container used to fetch information about the graphics processor.
Definition:
struct drm_pvr_dev_query_gpu_info { __u64 gpu_id; __u32 num_phantoms; __u32 _padding_c;};Members
gpu_idGPU identifier.
For all currently supported GPUs this is the BVNC encoded as a 64-bitvalue as follows:
63..48
47..32
31..16
15..0
B
V
N
C
num_phantomsNumber of Phantoms present.
_padding_cReserved. This field must be zeroed.
Description
When fetching this typestructdrm_pvr_ioctl_dev_query_args.type must be settoDRM_PVR_DEV_QUERY_GPU_INFO_GET.
- structdrm_pvr_dev_query_runtime_info¶
Container used to fetch information about the graphics runtime.
Definition:
struct drm_pvr_dev_query_runtime_info { __u64 free_list_min_pages; __u64 free_list_max_pages; __u32 common_store_alloc_region_size; __u32 common_store_partition_space_size; __u32 max_coeffs; __u32 cdm_max_local_mem_size_regs;};Members
free_list_min_pagesMinimum allowed free list size,in PM physical pages.
free_list_max_pagesMaximum allowed free list size,in PM physical pages.
common_store_alloc_region_sizeSize of the AllocationRegion within the Common Store used for coefficient and sharedregisters, in dwords.
common_store_partition_space_sizeSize of thePartition Space within the Common Store for output buffers, indwords.
max_coeffsMaximum coefficients, in dwords.
cdm_max_local_mem_size_regsMaximum amount of localmemory available to a compute kernel, in dwords.
Description
When fetching this typestructdrm_pvr_ioctl_dev_query_args.type must be settoDRM_PVR_DEV_QUERY_RUNTIME_INFO_GET.
- structdrm_pvr_dev_query_quirks¶
Container used to fetch information about hardware fixes for which the device may require support in the user mode driver.
Definition:
struct drm_pvr_dev_query_quirks { __u64 quirks; __u16 count; __u16 musthave_count; __u32 _padding_c;};Members
quirksA userspace address for the hardware quirks __u32 array.
The firstmusthave_count items in the list are quirks that theclient must support for this device. If userspace does not supportall these quirks then functionality is not guaranteed and clientinitialisation must fail.The remaining quirks in the list affect userspace and the kernel orfirmware. They are disabled by default and require userspace toopt-in. The opt-in mechanism depends on the quirk.
countLength ofquirks (number of __u32).
musthave_countThe number of entries inquirks that aremandatory, starting at index 0.
_padding_cReserved. This field must be zeroed.
Description
When fetching this typestructdrm_pvr_ioctl_dev_query_args.type must be settoDRM_PVR_DEV_QUERY_QUIRKS_GET.
- structdrm_pvr_dev_query_enhancements¶
Container used to fetch information about optional enhancements supported by the device that require support in the user mode driver.
Definition:
struct drm_pvr_dev_query_enhancements { __u64 enhancements; __u16 count; __u16 _padding_a; __u32 _padding_c;};Members
enhancementsA userspace address for the hardware enhancements__u32 array.
These enhancements affect userspace and the kernel or firmware. Theyare disabled by default and require userspace to opt-in. The opt-inmechanism depends on the enhancement.
countLength ofenhancements (number of __u32).
_padding_aReserved. This field must be zeroed.
_padding_cReserved. This field must be zeroed.
Description
When fetching this typestructdrm_pvr_ioctl_dev_query_args.type must be settoDRM_PVR_DEV_ENHANCEMENTS_GET.
- enumdrm_pvr_heap_id¶
Array index for heap info data returned by
DRM_PVR_DEV_QUERY_HEAP_INFO_GET.
Constants
DRM_PVR_HEAP_GENERALGeneral purpose heap.
DRM_PVR_HEAP_PDS_CODE_DATAPDS code and data heap.
DRM_PVR_HEAP_USC_CODEUSC code heap.
DRM_PVR_HEAP_RGNHDRRegion header heap. Only used if GPU has BRN63142.
DRM_PVR_HEAP_VIS_TESTVisibility test heap.
DRM_PVR_HEAP_TRANSFER_FRAGTransfer fragment heap.
DRM_PVR_HEAP_COUNTThe number of heaps returned by
DRM_PVR_DEV_QUERY_HEAP_INFO_GET.More heaps may be added, so this also serves as the copy limit whensent by the caller.
Description
For compatibility reasons all indices will be present in the returned array,however some heaps may not be present. These are indicated wherestructdrm_pvr_heap.size is set to zero.
- structdrm_pvr_heap¶
Container holding information about a single heap.
Definition:
struct drm_pvr_heap { __u64 base; __u64 size; __u32 flags; __u32 page_size_log2;};Members
baseBase address of heap.
sizeSize of heap, in bytes. Will be 0 if the heap is not present.
flagsFlags for this heap. Currently always 0.
page_size_log2Log2 of page size.
Description
This will always be fetched as an array.
- structdrm_pvr_dev_query_heap_info¶
Container used to fetch information about heaps supported by the device driver.
Definition:
struct drm_pvr_dev_query_heap_info { struct drm_pvr_obj_array heaps;};Members
heapsArray of
structdrm_pvr_heap. If pointer is NULL, the countand stride will be updated with those known to the driver version, tofacilitate allocation by the caller.
Description
Please note all driver-supported heaps will be returned up toheaps.count.Some heaps will not be present in all devices, which will be indicated bystructdrm_pvr_heap.size being set to zero.
When fetching this typestructdrm_pvr_ioctl_dev_query_args.type must be settoDRM_PVR_DEV_QUERY_HEAP_INFO_GET.
- enumdrm_pvr_static_data_area_usage¶
Array index for static data area info returned by
DRM_PVR_DEV_QUERY_STATIC_DATA_AREAS_GET.
Constants
DRM_PVR_STATIC_DATA_AREA_EOTEnd of Tile PDS program code segment.
The End of Tile PDS task runs at completion of a tile during a fragment job, and isresponsible for emitting the tile to the Pixel Back End.
DRM_PVR_STATIC_DATA_AREA_FENCEMCU fence area, used during cache flush andinvalidation.
This must point to valid physical memory but the contents otherwise are not used.
DRM_PVR_STATIC_DATA_AREA_VDM_SYNCVDM sync program.
The VDM sync program is used to synchronise multiple areas of the GPU hardware.
DRM_PVR_STATIC_DATA_AREA_YUV_CSCYUV coefficients.
Area contains up to 16 slots with stride of 64 bytes. Each is a 3x4 matrix of u16 fixedpoint numbers, with 1 sign bit, 2 integer bits and 13 fractional bits.
The slots are :0 = VK_SAMPLER_YCBCR_MODEL_CONVERSION_RGB_IDENTITY_KHR1 = VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_IDENTITY_KHR (full range)2 = VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_IDENTITY_KHR (conformant range)3 = VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_709_KHR (full range)4 = VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_709_KHR (conformant range)5 = VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_601_KHR (full range)6 = VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_601_KHR (conformant range)7 = VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_2020_KHR (full range)8 = VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_2020_KHR (conformant range)9 = VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_601_KHR (conformant range, 10 bit)10 = VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_709_KHR (conformant range, 10 bit)11 = VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_2020_KHR (conformant range, 10 bit)14 = Identity (biased)15 = Identity
Description
For compatibility reasons all indices will be present in the returned array,however some areas may not be present. These are indicated wherestructdrm_pvr_static_data_area.size is set to zero.
- structdrm_pvr_static_data_area¶
Container holding information about a single static data area.
Definition:
struct drm_pvr_static_data_area { __u16 area_usage; __u16 location_heap_id; __u32 size; __u64 offset;};Members
area_usageUsage of static data area.See
enumdrm_pvr_static_data_area_usage.location_heap_idArray index of heap where this of static dataarea is located. This array is fetched using
DRM_PVR_DEV_QUERY_HEAP_INFO_GET.sizeSize of static data area. Not present if set to zero.
offsetOffset of static data area from start of heap.
Description
This will always be fetched as an array.
- structdrm_pvr_dev_query_static_data_areas¶
Container used to fetch information about the static data areas in heaps supported by the device driver.
Definition:
struct drm_pvr_dev_query_static_data_areas { struct drm_pvr_obj_array static_data_areas;};Members
static_data_areasArray of
structdrm_pvr_static_data_area. Ifpointer is NULL, the count and stride will be updated with thoseknown to the driver version, to facilitate allocation by the caller.
Description
Please note all driver-supported static data areas will be returned up tostatic_data_areas.count. Some will not be present for all devices which,will be indicated bystructdrm_pvr_static_data_area.size being set to zero.
Further, some heaps will not be present either. Seestructdrm_pvr_dev_query_heap_info.
When fetching this typestructdrm_pvr_ioctl_dev_query_args.type must be settoDRM_PVR_DEV_QUERY_STATIC_DATA_AREAS_GET.
CREATE_BO¶
- structdrm_pvr_ioctl_create_bo_args¶
Arguments for
DRM_IOCTL_PVR_CREATE_BO
Definition:
struct drm_pvr_ioctl_create_bo_args { __u64 size; __u32 handle; __u32 _padding_c; __u64 flags;};Members
size[IN] Size of buffer object to create. This must be page sizealigned.
handle[OUT] GEM handle of the new buffer object for use inuserspace.
_padding_cReserved. This field must be zeroed.
flags[IN] Options which will affect the behaviour of thiscreation operation and future mapping operations on the createdobject. This field must be a valid combination of
DRM_PVR_BO_*values, with all bits marked as reserved set to zero.
We use “device” to refer to the GPU here because of the ambiguity between CPU and GPU in somefonts.
- Device mapping options
- DRM_PVR_BO_BYPASS_DEVICE_CACHE:
Specify that device accesses to this memory will bypass thecache. This is used for buffers that will either be regularly updated by the CPU (eg freelists) or will be accessed only once and therefore isn’t worth caching (eg partial renderbuffers).By default, the device flushes its memory caches after every job, so this is not normallyrequired for coherency.
- DRM_PVR_BO_PM_FW_PROTECT:
Specify that only the Parameter Manager (PM) and/or firmwareprocessor should be allowed to access this memory when mapped to the device. It is notvalid to specify this flag with DRM_PVR_BO_ALLOW_CPU_USERSPACE_ACCESS.
- CPU mapping options
- DRM_PVR_BO_ALLOW_CPU_USERSPACE_ACCESS:
Allow userspace to map and access the contents of thismemory. It is not valid to specify this flag with DRM_PVR_BO_PM_FW_PROTECT.
GET_BO_MMAP_OFFSET¶
- structdrm_pvr_ioctl_get_bo_mmap_offset_args¶
Arguments for
DRM_IOCTL_PVR_GET_BO_MMAP_OFFSET
Definition:
struct drm_pvr_ioctl_get_bo_mmap_offset_args { __u32 handle; __u32 _padding_4; __u64 offset;};Members
handle[IN] GEM handle of the buffer object to be mapped.
_padding_4Reserved. This field must be zeroed.
offset[OUT] Fake offset to use in the real mmap call.
Description
Like other DRM drivers, the “mmap” IOCTL doesn’t actually map any memory.Instead, it allocates a fake offset which refers to the specified bufferobject. This offset can be used with a real mmap call on the DRM deviceitself.
CREATE_VM_CONTEXT and DESTROY_VM_CONTEXT¶
- structdrm_pvr_ioctl_create_vm_context_args¶
Arguments for
DRM_IOCTL_PVR_CREATE_VM_CONTEXT
Definition:
struct drm_pvr_ioctl_create_vm_context_args { __u32 handle; __u32 _padding_4;};Members
handle[OUT] Handle for new VM context.
_padding_4Reserved. This field must be zeroed.
- structdrm_pvr_ioctl_destroy_vm_context_args¶
Arguments for
DRM_IOCTL_PVR_DESTROY_VM_CONTEXT
Definition:
struct drm_pvr_ioctl_destroy_vm_context_args { __u32 handle; __u32 _padding_4;};Members
handle[IN] Handle for VM context to be destroyed.
_padding_4Reserved. This field must be zeroed.
VM_MAP and VM_UNMAP¶
The VM UAPI allows userspace to create buffer object mappings in GPU virtual address space.
The client is responsible for managing GPU address space. It should allocate mappings withinthe heaps returned byDRM_PVR_DEV_QUERY_HEAP_INFO_GET.
DRM_IOCTL_PVR_VM_MAP creates a new mapping. The client provides the target virtual address forthe mapping. Size and offset within the mapped buffer object can be specified, so the client canpartially map a buffer.
DRM_IOCTL_PVR_VM_UNMAP removes a mapping. The entire mapping will be removed from GPU addressspace only if the size of the mapping matches that known to the driver.
- structdrm_pvr_ioctl_vm_map_args¶
Arguments for
DRM_IOCTL_PVR_VM_MAP.
Definition:
struct drm_pvr_ioctl_vm_map_args { __u32 vm_context_handle; __u32 flags; __u64 device_addr; __u32 handle; __u32 _padding_14; __u64 offset; __u64 size;};Members
vm_context_handle[IN] Handle for VM context for this mapping toexist in.
flags[IN] Flags which affect this mapping. Currently always 0.
device_addr[IN] Requested device-virtual address for the mapping.This must be non-zero and aligned to the device page size for theheap containing the requested address. It is an error to specify anaddress which is not contained within one of the heaps returned by
DRM_PVR_DEV_QUERY_HEAP_INFO_GET.handle[IN] Handle of the target buffer object. This must be avalid handle returned by
DRM_IOCTL_PVR_CREATE_BO._padding_14Reserved. This field must be zeroed.
offset[IN] Offset into the target bo from which to begin themapping.
size[IN] Size of the requested mapping. Must be aligned tothe device page size for the heap containing the requested address,as well as the host page size. When added todevice_addr, theresult must not overflow the heap which containsdevice_addr (i.e.the range specified bydevice_addr andsize must be completelycontained within a single heap specified by
DRM_PVR_DEV_QUERY_HEAP_INFO_GET).
- structdrm_pvr_ioctl_vm_unmap_args¶
Arguments for
DRM_IOCTL_PVR_VM_UNMAP.
Definition:
struct drm_pvr_ioctl_vm_unmap_args { __u32 vm_context_handle; __u32 _padding_4; __u64 device_addr; __u64 size;};Members
vm_context_handle[IN] Handle for VM context that this mappingexists in.
_padding_4Reserved. This field must be zeroed.
device_addr[IN] Device-virtual address at the start of the targetmapping. This must be non-zero.
sizeSize in bytes of the target mapping. This must be non-zero.
CREATE_CONTEXT and DESTROY_CONTEXT¶
- structdrm_pvr_ioctl_create_context_args¶
Arguments for
DRM_IOCTL_PVR_CREATE_CONTEXT
Definition:
struct drm_pvr_ioctl_create_context_args { __u32 type; __u32 flags; __s32 priority; __u32 handle; __u64 static_context_state; __u32 static_context_state_len; __u32 vm_context_handle; __u64 callstack_addr;};Members
type[IN] Type of context to create.
This must be one of the values defined by
enumdrm_pvr_ctx_type.flags[IN] Flags for context.
priority[IN] Priority of new context.
This must be one of the values defined by
enumdrm_pvr_ctx_priority.handle[OUT] Handle for new context.
static_context_state[IN] Pointer to static context state stream.
static_context_state_len[IN] Length of static context state, in bytes.
vm_context_handle[IN] Handle for VM context that this context isassociated with.
callstack_addr[IN] Address for initial call stack pointer. Only validiftype is
DRM_PVR_CTX_TYPE_RENDER, otherwise must be 0.
- enumdrm_pvr_ctx_priority¶
Arguments for
drm_pvr_ioctl_create_context_args.priority
Constants
DRM_PVR_CTX_PRIORITY_LOWPriority below normal.
DRM_PVR_CTX_PRIORITY_NORMALNormal priority.
DRM_PVR_CTX_PRIORITY_HIGHPriority above normal.Note this requires
CAP_SYS_NICEorDRM_MASTER.
- enumdrm_pvr_ctx_type¶
Arguments for
structdrm_pvr_ioctl_create_context_args.type
Constants
DRM_PVR_CTX_TYPE_RENDERRender context.
DRM_PVR_CTX_TYPE_COMPUTECompute context.
DRM_PVR_CTX_TYPE_TRANSFER_FRAGTransfer context for fragment datamaster.
- structdrm_pvr_ioctl_destroy_context_args¶
Arguments for
DRM_IOCTL_PVR_DESTROY_CONTEXT
Definition:
struct drm_pvr_ioctl_destroy_context_args { __u32 handle; __u32 _padding_4;};Members
handle[IN] Handle for context to be destroyed.
_padding_4Reserved. This field must be zeroed.
CREATE_FREE_LIST and DESTROY_FREE_LIST¶
- structdrm_pvr_ioctl_create_free_list_args¶
Arguments for
DRM_IOCTL_PVR_CREATE_FREE_LIST
Definition:
struct drm_pvr_ioctl_create_free_list_args { __u64 free_list_gpu_addr; __u32 initial_num_pages; __u32 max_num_pages; __u32 grow_num_pages; __u32 grow_threshold; __u32 vm_context_handle; __u32 handle;};Members
free_list_gpu_addr[IN] Address of GPU mapping of buffer objectcontaining memory to be used by free list.
The mapped region of the buffer object must be at leastmax_num_pages *
sizeof(__u32).The buffer object must have been created with
DRM_PVR_BO_DEVICE_PM_FW_PROTECTset andDRM_PVR_BO_CPU_ALLOW_USERSPACE_ACCESSnot set.initial_num_pages[IN] Pages initially allocated to free list.
max_num_pages[IN] Maximum number of pages in free list.
grow_num_pages[IN] Pages to grow free list by per request.
grow_threshold[IN] Percentage of FL memory used that shouldtrigger a new grow request.
vm_context_handle[IN] Handle for VM context that the free list bufferobject is mapped in.
handle[OUT] Handle for created free list.
Description
Free list arguments have the following constraints :
max_num_pages must be greater than zero.
grow_threshold must be between 0 and 100.
grow_num_pages must be less than or equal to
max_num_pages.initial_num_pages,max_num_pages andgrow_num_pages must be multiplesof 4.
When
grow_num_pagesis 0,initial_num_pages must be equal tomax_num_pages.When
grow_num_pagesis non-zero,initial_num_pages must be less thanmax_num_pages.
- structdrm_pvr_ioctl_destroy_free_list_args¶
Arguments for
DRM_IOCTL_PVR_DESTROY_FREE_LIST
Definition:
struct drm_pvr_ioctl_destroy_free_list_args { __u32 handle; __u32 _padding_4;};Members
handle[IN] Handle for free list to be destroyed.
_padding_4Reserved. This field must be zeroed.
CREATE_HWRT_DATASET and DESTROY_HWRT_DATASET¶
- structdrm_pvr_ioctl_create_hwrt_dataset_args¶
Arguments for
DRM_IOCTL_PVR_CREATE_HWRT_DATASET
Definition:
struct drm_pvr_ioctl_create_hwrt_dataset_args { struct drm_pvr_create_hwrt_geom_data_args geom_data_args; struct drm_pvr_create_hwrt_rt_data_args rt_data_args[2]; __u32 free_list_handles[2]; __u32 width; __u32 height; __u32 samples; __u32 layers; __u32 isp_merge_lower_x; __u32 isp_merge_lower_y; __u32 isp_merge_scale_x; __u32 isp_merge_scale_y; __u32 isp_merge_upper_x; __u32 isp_merge_upper_y; __u32 region_header_size; __u32 handle;};Members
geom_data_args[IN] Geometry data arguments.
rt_data_args[IN] Array of render target arguments.
Each entry in this array represents a render target in a double bufferedsetup.
free_list_handles[IN] Array of free list handles.
free_list_handles[PVR_DRM_HWRT_FREE_LIST_LOCAL] must have initialsize of at least that reported by
drm_pvr_dev_query_runtime_info.free_list_min_pages.width[IN] Width in pixels.
height[IN] Height in pixels.
samples[IN] Number of samples.
layers[IN] Number of layers.
isp_merge_lower_x[IN] Lower X coefficient for triangle merging.
isp_merge_lower_y[IN] Lower Y coefficient for triangle merging.
isp_merge_scale_x[IN] Scale X coefficient for triangle merging.
isp_merge_scale_y[IN] Scale Y coefficient for triangle merging.
isp_merge_upper_x[IN] Upper X coefficient for triangle merging.
isp_merge_upper_y[IN] Upper Y coefficient for triangle merging.
region_header_size[IN] Size of region header array. This common field is used byboth render targets in this data set.
The units for this field differ depending on what version of the simple internalparameter format the device uses. If format 2 is in use then this is interpreted as thenumber of region headers. For other formats it is interpreted as the size in dwords.
handle[OUT] Handle for created HWRT dataset.
- structdrm_pvr_create_hwrt_geom_data_args¶
Geometry data arguments used for
structdrm_pvr_ioctl_create_hwrt_dataset_args.geom_data_args.
Definition:
struct drm_pvr_create_hwrt_geom_data_args { __u64 tpc_dev_addr; __u32 tpc_size; __u32 tpc_stride; __u64 vheap_table_dev_addr; __u64 rtc_dev_addr;};Members
tpc_dev_addr[IN] Tail pointer cache GPU virtual address.
tpc_size[IN] Size of TPC, in bytes.
tpc_stride[IN] Stride between layers in TPC, in pages
vheap_table_dev_addr[IN] VHEAP table GPU virtual address.
rtc_dev_addr[IN] Render Target Cache virtual address.
- structdrm_pvr_create_hwrt_rt_data_args¶
Render target arguments used for
structdrm_pvr_ioctl_create_hwrt_dataset_args.rt_data_args.
Definition:
struct drm_pvr_create_hwrt_rt_data_args { __u64 pm_mlist_dev_addr; __u64 macrotile_array_dev_addr; __u64 region_header_dev_addr;};Members
pm_mlist_dev_addr[IN] PM MLIST GPU virtual address.
macrotile_array_dev_addr[IN] Macrotile array GPU virtual address.
region_header_dev_addr[IN] Region header array GPU virtual address.
- structdrm_pvr_ioctl_destroy_hwrt_dataset_args¶
Arguments for
DRM_IOCTL_PVR_DESTROY_HWRT_DATASET
Definition:
struct drm_pvr_ioctl_destroy_hwrt_dataset_args { __u32 handle; __u32 _padding_4;};Members
handle[IN] Handle for HWRT dataset to be destroyed.
_padding_4Reserved. This field must be zeroed.
SUBMIT_JOBS¶
- DRM_PVR_SYNC_OP_HANDLE_TYPE_MASK¶
Handle type mask for the drm_pvr_sync_op::flags field.
- DRM_PVR_SYNC_OP_FLAG_HANDLE_TYPE_SYNCOBJ¶
Indicates the handle passed in drm_pvr_sync_op::handle is a syncobj handle.This is the default type.
- DRM_PVR_SYNC_OP_FLAG_HANDLE_TYPE_TIMELINE_SYNCOBJ¶
Indicates the handle passed in drm_pvr_sync_op::handle is a timeline syncobj handle.
- DRM_PVR_SYNC_OP_FLAG_SIGNAL¶
Signal operation requested. The out-fence bound to the job will be attached tothe syncobj whose handle is passed in drm_pvr_sync_op::handle.
- DRM_PVR_SYNC_OP_FLAG_WAIT¶
Wait operation requested. The job will wait for this particular syncobj or syncobjpoint to be signaled before being started.This is the default operation.
- structdrm_pvr_ioctl_submit_jobs_args¶
Arguments for
DRM_IOCTL_PVR_SUBMIT_JOB
Definition:
struct drm_pvr_ioctl_submit_jobs_args { struct drm_pvr_obj_array jobs;};Members
jobs[IN] Array of jobs to submit.
Description
If the syscall returns an error it is important to check the value ofjobs.count. This indicates the index intojobs.array where theerror occurred.
- DRM_PVR_SUBMIT_JOB_GEOM_CMD_FIRST¶
Indicates if this the first command to be issued for a render.
- DRM_PVR_SUBMIT_JOB_GEOM_CMD_LAST¶
Indicates if this the last command to be issued for a render.
- DRM_PVR_SUBMIT_JOB_GEOM_CMD_SINGLE_CORE¶
Forces to use single core in a multi core device.
- DRM_PVR_SUBMIT_JOB_GEOM_CMD_FLAGS_MASK¶
Logical OR of all the geometry cmd flags.
- DRM_PVR_SUBMIT_JOB_FRAG_CMD_SINGLE_CORE¶
Use single core in a multi core setup.
- DRM_PVR_SUBMIT_JOB_FRAG_CMD_DEPTHBUFFER¶
Indicates whether a depth buffer is present.
- DRM_PVR_SUBMIT_JOB_FRAG_CMD_STENCILBUFFER¶
Indicates whether a stencil buffer is present.
- DRM_PVR_SUBMIT_JOB_FRAG_CMD_PREVENT_CDM_OVERLAP¶
Disallow compute overlapped with this render.
- DRM_PVR_SUBMIT_JOB_FRAG_CMD_GET_VIS_RESULTS¶
Indicates whether this render produces visibility results.
- DRM_PVR_SUBMIT_JOB_FRAG_CMD_SCRATCHBUFFER¶
Indicates whether partial renders write to a scratch buffer instead ofthe final surface. It also forces the full screen copy expected to bepresent on the last render after all partial renders have completed.
- DRM_PVR_SUBMIT_JOB_FRAG_CMD_DISABLE_PIXELMERGE¶
Disable pixel merging for this render.
- DRM_PVR_SUBMIT_JOB_FRAG_CMD_FLAGS_MASK¶
Logical OR of all the fragment cmd flags.
- DRM_PVR_SUBMIT_JOB_COMPUTE_CMD_PREVENT_ALL_OVERLAP¶
Disallow other jobs overlapped with this compute.
- DRM_PVR_SUBMIT_JOB_COMPUTE_CMD_SINGLE_CORE¶
Forces to use single core in a multi core device.
- DRM_PVR_SUBMIT_JOB_COMPUTE_CMD_FLAGS_MASK¶
Logical OR of all the compute cmd flags.
- DRM_PVR_SUBMIT_JOB_TRANSFER_CMD_SINGLE_CORE¶
Forces job to use a single core in a multi core device.
- DRM_PVR_SUBMIT_JOB_TRANSFER_CMD_FLAGS_MASK¶
Logical OR of all the transfer cmd flags.
- structdrm_pvr_sync_op¶
Object describing a sync operation
Definition:
struct drm_pvr_sync_op { __u32 handle; __u32 flags; __u64 value;};Members
handleHandle of sync object.
flagsCombination of
DRM_PVR_SYNC_OP_FLAG_flags.valueTimeline value for this drm_syncobj. MBZ for a binary syncobj.
- enumdrm_pvr_job_type¶
Arguments for
structdrm_pvr_job.job_type
Constants
DRM_PVR_JOB_TYPE_GEOMETRYJob type is geometry.
DRM_PVR_JOB_TYPE_FRAGMENTJob type is fragment.
DRM_PVR_JOB_TYPE_COMPUTEJob type is compute.
DRM_PVR_JOB_TYPE_TRANSFER_FRAGJob type is a fragment transfer.
- structdrm_pvr_hwrt_data_ref¶
Reference HWRT data
Definition:
struct drm_pvr_hwrt_data_ref { __u32 set_handle; __u32 data_index;};Members
set_handleHWRT data set handle.
data_indexIndex of the HWRT data inside the data set.
- structdrm_pvr_job¶
Job arguments passed to the
DRM_IOCTL_PVR_SUBMIT_JOBSioctl
Definition:
struct drm_pvr_job { __u32 type; __u32 context_handle; __u32 flags; __u32 cmd_stream_len; __u64 cmd_stream; struct drm_pvr_obj_array sync_ops; struct drm_pvr_hwrt_data_ref hwrt;};Members
type[IN] Type of job being submitted
This must be one of the values defined by
enumdrm_pvr_job_type.context_handle[IN] Context handle.
Whenjob_type is
DRM_PVR_JOB_TYPE_RENDER,DRM_PVR_JOB_TYPE_COMPUTEorDRM_PVR_JOB_TYPE_TRANSFER_FRAG, this must be a valid handle returned byDRM_IOCTL_PVR_CREATE_CONTEXT. The type of context must be compatiblewith the type of job being submitted.Whenjob_type is
DRM_PVR_JOB_TYPE_NULL, this must be zero.flags[IN] Flags for command.
Those are job-dependent. See all
DRM_PVR_SUBMIT_JOB_*.cmd_stream_len[IN] Length of command stream, in bytes.
cmd_stream[IN] Pointer to command stream for command.
The command stream must be u64-aligned.
sync_ops[IN] Fragment sync operations.
hwrt[IN] HWRT data used by render jobs (geometry or fragment).
Must be zero for non-render jobs.
Internal notes¶
To validate the constraints imposed on IOCTL argument structs, a collectionof macros and helper functions exist inpvr_device.h.
Of the current helpers, it should only be necessary to callPVR_IOCTL_UNION_PADDING_CHECK() directly. This macro should be used once inevery code path which extracts aunionmember from astructpassed fromuserspace.
- boolpvr_ioctl_union_padding_check(void*instance,size_tunion_offset,size_tunion_size,size_tmember_size)¶
Validate that the implicit padding between the end of a
unionmemberand the end of theunionitselfis zeroed.
Parameters
void*instancePointer to the instance of the
structtovalidate.size_tunion_offsetOffset into the type ofinstance of the target union. Mustbe 64-bit aligned.
size_tunion_sizeSize of the target
unioninthe type ofinstance. Must be64-bit aligned.size_tmember_sizeSize of the target member in the target
unionspecifiedbyunion_offset andunion_size. It is assumed that the offset of the targetmember is zero relative tounion_offset. Must be 64-bit aligned.
Description
You probably want to usePVR_IOCTL_UNION_PADDING_CHECK() instead of callingthis function directly, since that macro abstracts away much of the setup,and also provides some static validation. See its docs for details.
Return
trueif every byte between the end of the used member of theunionandthe end of thatunioniszeroed, orfalseotherwise.
- PVR_STATIC_ASSERT_64BIT_ALIGNED¶
PVR_STATIC_ASSERT_64BIT_ALIGNED(static_expr_)
Inline assertion for 64-bit alignment.
Parameters
static_expr_Target expression to evaluate.
Description
Ifstatic_expr_ does not evaluate to a constant integer which would be a64-bit aligned address (i.e. a multiple of 8), compilation will fail.
Return
The value ofstatic_expr_.
- PVR_IOCTL_UNION_PADDING_CHECK¶
PVR_IOCTL_UNION_PADDING_CHECK(struct_instance_,union_,member_)
Validate that the implicit padding between the end of a
unionmemberand the end of theunionitselfis zeroed.
Parameters
struct_instance_An expression which evaluates to a pointer to a UAPI datastruct.
union_The name of the
unionmemberofstruct_instance_ to check. If theunionmemberis nested within the type ofstruct_instance_, this maycontain the member access operator (“.”).member_The name of the member ofunion_ to assess.
Description
This is a wrapper aroundpvr_ioctl_union_padding_check() which performsalignment checks and simplifies things for the caller.
Return
trueif every byte instruct_instance_ between the end ofmember_ andthe end ofunion_ is zeroed, orfalseotherwise.