Skip to content

va: add VA_SURFACE_ATTRIB_USAGE_HINT_VA_INTERNAL - #896

Open
XinfengZhang wants to merge 1 commit into
intel:masterfrom
XinfengZhang:surface_opt
Open

XinfengZhang wants to merge 1 commit into
intel:masterfrom
XinfengZhang:surface_opt

Conversation

@XinfengZhang

@XinfengZhang XinfengZhang commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

The absence of VA_SURFACE_ATTRIB_USAGE_HINT_EXPORT does not tell a driver
whether an application intends to keep a surface within the VA driver.

Add VA_SURFACE_ATTRIB_USAGE_HINT_VA_INTERNAL so applications can promise
not to share a surface with external components or export it. This allows
the driver to choose a memory layout that is not shareable outside of the
VA driver.

Applications must set the flag only when driver support is known. Older
drivers are not required to ignore unknown usage-hint bits, and successful
surface creation alone does not establish that the flag was honored.

Drivers supporting the flag must reject combinations with DISPLAY or
EXPORT using VA_STATUS_ERROR_INVALID_PARAMETER. Exporting such a surface,
including as a DMA-BUF, must return VA_STATUS_ERROR_INVALID_SURFACE.

Validation: git diff HEAD^ HEAD --check passed.

@HeJunyan

Copy link
Copy Markdown
Contributor

So this kind of surface can not be exported as DMA buffer?

@XinfengZhang
XinfengZhang marked this pull request as ready for review October 22, 2026 02:29
@XinfengZhang
XinfengZhang force-pushed the surface_opt branch 2 times, most recently from 43eff89 to b2f40a9 Compare October 22, 2026 05:25
@XinfengZhang
XinfengZhang requested a review from xhaihao November 27, 2026 06:50
@xhaihao

xhaihao commented Nov 30, 2026

Copy link
Copy Markdown
Contributor

Could we clarify whether applications may pass VA_SURFACE_ATTRIB_USAGE_HINT_PRIVATE to older drivers, or should only set it when driver support is known? The existing API does not require drivers to ignore unknown usage-hint bits, and successful surface creation does not tell the application whether the hint was honored.

@xhaihao

xhaihao commented Nov 30, 2026

Copy link
Copy Markdown
Contributor

BTW could we choose a name that better reflects the intent of this flag? VA_SURFACE_ATTRIB_USAGE_HINT_PRIVATE alone doesn't make it clear that the application is promising to keep the surface internal to the VA driver, so the driver has more flexibility in choosing the memory layout

The absence of VA_SURFACE_ATTRIB_USAGE_HINT_EXPORT does not tell a driver
whether an application intends to keep a surface within the VA driver.

Add VA_SURFACE_ATTRIB_USAGE_HINT_VA_INTERNAL so applications can promise
not to share a surface with external components or export it. This allows
the driver to choose a memory layout that is not shareable outside of the
VA driver.

Applications must set the flag only when driver support is known. Older
drivers are not required to ignore unknown usage-hint bits, and successful
surface creation alone does not establish that the flag was honored.

Drivers supporting the flag must reject combinations with DISPLAY or
EXPORT using VA_STATUS_ERROR_INVALID_PARAMETER. Exporting such a surface,
including as a DMA-BUF, must return VA_STATUS_ERROR_INVALID_SURFACE.

Signed-off-by: Carl.Zhang <carl.zhang@intel.com>
@XinfengZhang XinfengZhang changed the title va: add VA_SURFACE_ATTRIB_USAGE_HINT_PRIVATE va: add VA_SURFACE_ATTRIB_USAGE_HINT_VA_INTERNAL Nov 30, 2026
@XinfengZhang

Copy link
Copy Markdown
Contributor Author

So this kind of surface can not be exported as DMA buffer?

correct.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants