Skip to content

Commit

Permalink
Introduce VASurfaceAttribDRMFormatModifiers
Browse files Browse the repository at this point in the history
This allows users to specify a list of modifiers when allocating a
new surface. The driver will pick a modifier from the list.

Closes: #502
  • Loading branch information
emersion committed Mar 4, 2021
1 parent 7a92a2b commit 6fc378b
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
5 changes: 5 additions & 0 deletions va/va.h
Original file line number Diff line number Diff line change
Expand Up @@ -1582,6 +1582,11 @@ typedef enum {
/** \brief Surface usage hint, gives the driver a hint of intended usage
* to optimize allocation (e.g. tiling) (int, read/write). */
VASurfaceAttribUsageHint,
/** \brief List of possible DRM format modifiers (pointer, write).
*
* The value must be a pointer to a VADRMFormatModifierList.
*/
VASurfaceAttribDRMFormatModifiers,
/** \brief Number of surface attributes. */
VASurfaceAttribCount
} VASurfaceAttribType;
Expand Down
15 changes: 15 additions & 0 deletions va/va_drmcommon.h
Original file line number Diff line number Diff line change
Expand Up @@ -154,5 +154,20 @@ typedef struct _VADRMPRIMESurfaceDescriptor {
} layers[4];
} VADRMPRIMESurfaceDescriptor;

/**
* \brief List of DRM format modifiers.
*
* To allocate surfaces with one of the modifiers specified in the array, call
* vaCreateSurfaces() with the VASurfaceAttribDRMFormatModifiers attribute set
* to point to an array of num_surfaces instances of this structure. The driver
* will select the optimal modifier in the list.
*/
typedef struct _VADRMFormatModifierList {
/** Number of modifiers. */
uint32_t num_modifiers;
/** Array of modifiers. */
uint64_t *modifiers;
} VADRMFormatModifierList;


#endif /* VA_DRM_COMMON_H */

0 comments on commit 6fc378b

Please sign in to comment.