mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 20:28:04 +02:00
frontends/va: Check if target buffer is supported in vlVaEndPicture
This is mainly to reject buffers allocated with modifiers not supported for given entrypoint. There is no interface to query supported modifiers for different formats and entrypoints in libva, so applications can import externally allocated buffers that may be unsupported with some entrypoints. Reviewed-by: Thong Thai <thong.thai@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29932>
This commit is contained in:
parent
a7469a9ffd
commit
2b93a918b3
1 changed files with 10 additions and 0 deletions
|
|
@ -1304,6 +1304,16 @@ vlVaEndPicture(VADriverContextP ctx, VAContextID context_id)
|
|||
}
|
||||
context->desc.base.input_full_range = surf->full_range;
|
||||
|
||||
if (screen->is_video_target_buffer_supported &&
|
||||
!screen->is_video_target_buffer_supported(screen,
|
||||
context->desc.base.output_format,
|
||||
context->target,
|
||||
context->decoder->profile,
|
||||
context->decoder->entrypoint)) {
|
||||
mtx_unlock(&drv->mutex);
|
||||
return VA_STATUS_ERROR_INVALID_SURFACE;
|
||||
}
|
||||
|
||||
int driver_metadata_support = drv->pipe->screen->get_video_param(drv->pipe->screen,
|
||||
context->decoder->profile,
|
||||
context->decoder->entrypoint,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue