Skip to content

enable memory location query and set #601

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion va/va.h
Original file line number Diff line number Diff line change
Expand Up @@ -1675,6 +1675,17 @@ typedef enum {
* when importing an existing buffer.
*/
VASurfaceAttribDRMFormatModifiers,
/** \brief surface region/location (int read/write)
* read: when read the value by vaQuerySurfaceAttributes or vaGetSurfaceAttributes
* the bit0 represent the system memory existence and could be used by backend driver for given profile
* bit 1 represent the local memory existence and could be used by backend driver for given profile.
*
* write: when call vaCreateSurfaces, the attribute could be used to specify the memory location
* if bit0 is 1, it will be allocated on system memory, if bit1 is 1, it will be allocated on local memory
* could not set both bit0 and bit1 to same value, if so, backend driver will allocate the surface ignoring
* this hint.
*/
VASurfaceAttribValueMemoryRegion,
/** \brief Number of surface attributes. */
VASurfaceAttribCount
} VASurfaceAttribType;
Expand Down Expand Up @@ -4626,9 +4637,16 @@ typedef struct _VAImage {
* Only entry_bytes characters of the string are used.
*/
int8_t component_order[4];
/*
* Image flags , app could retrieve surface informations by this flag after calling vaDeriveImage
* the flags could include the memory location/region etc.
* bit0: whether the flags is valid, 0 invalid, 1 valid
* bit1: memory location 0 system memeory, 1 local memory.
*/
uint32_t flags;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we introduce some bit masks to help users understand what's going on?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we really need add this "flags" member in VAImage, since we can query memory region info through surfaceattributes (e.g., surface_attrib.value.value.i) ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the problem is we could not get surfaceattributes for one dedicate surface


/** \brief Reserved bytes for future use, must be zero */
uint32_t va_reserved[VA_PADDING_LOW];
uint32_t va_reserved[VA_PADDING_LOW - 1];
} VAImage;

/** Get maximum number of image formats supported by the implementation */
Expand Down