pub type VADRMPRIMESurfaceDescriptor = _VADRMPRIMESurfaceDescriptor;Expand description
\brief External buffer descriptor for a DRM PRIME surface.
For export, call vaExportSurfaceHandle() with mem_type set to VA_SURFACE_ATTRIB_MEM_TYPE_DRM_PRIME_2 and pass a pointer to an instance of this structure to fill. If VA_EXPORT_SURFACE_SEPARATE_LAYERS is specified on export, each layer will contain exactly one plane. For example, an NV12 surface will be exported as two layers, one of DRM_FORMAT_R8 and one of DRM_FORMAT_GR88. If VA_EXPORT_SURFACE_COMPOSED_LAYERS is specified on export, there will be exactly one layer.
For import, call vaCreateSurfaces() with the MemoryType attribute set to VA_SURFACE_ATTRIB_MEM_TYPE_DRM_PRIME_2 and the ExternalBufferDescriptor attribute set to point to an array of num_surfaces instances of this structure. The number of planes which need to be provided for a given layer is dependent on both the format and the format modifier used for the objects containing it. For example, the format DRM_FORMAT_RGBA normally requires one plane, but with the format modifier I915_FORMAT_MOD_Y_TILED_CCS it requires two planes - the first being the main data plane and the second containing the color control surface. Note that a given driver may only support a subset of possible representations of a particular format. For example, it may only support NV12 surfaces when they are contained within a single DRM object, and therefore fail to create such surfaces if the two planes are in different DRM objects. Note that backend driver will retrieve the resource represent by fd, and a valid surface ID is generated. Backend driver will not close the file descriptor. Application should handle the release of the fd. releasing the fd will not impact the existence of the surface.
Aliased Type§
#[repr(C)]pub struct VADRMPRIMESurfaceDescriptor {
pub fourcc: u32,
pub width: u32,
pub height: u32,
pub num_objects: u32,
pub objects: [_VADRMPRIMESurfaceDescriptor__bindgen_ty_1; 4],
pub num_layers: u32,
pub layers: [_VADRMPRIMESurfaceDescriptor__bindgen_ty_2; 4],
}Fields§
§fourcc: u32Pixel format fourcc of the whole surface (VA_FOURCC_*).
width: u32Width of the surface in pixels.
height: u32Height of the surface in pixels.
num_objects: u32Number of distinct DRM objects making up the surface.
objects: [_VADRMPRIMESurfaceDescriptor__bindgen_ty_1; 4]§num_layers: u32Number of layers making up the surface.
layers: [_VADRMPRIMESurfaceDescriptor__bindgen_ty_2; 4]