mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-07 21:40:20 +01:00
st/va: reallocate surface when interlaced
Signed-off-by: Leo Liu <leo.liu@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com>
This commit is contained in:
parent
fceb52a230
commit
c4061bb5fa
1 changed files with 22 additions and 0 deletions
|
|
@ -589,6 +589,8 @@ vlVaEndPicture(VADriverContextP ctx, VAContextID context_id)
|
|||
vlVaBuffer *coded_buf;
|
||||
vlVaSurface *surf;
|
||||
void *feedback;
|
||||
struct pipe_screen *screen;
|
||||
bool interlaced;
|
||||
|
||||
if (!ctx)
|
||||
return VA_STATUS_ERROR_INVALID_CONTEXT;
|
||||
|
|
@ -615,6 +617,26 @@ vlVaEndPicture(VADriverContextP ctx, VAContextID context_id)
|
|||
surf = handle_table_get(drv->htab, context->target_id);
|
||||
context->mpeg4.frame_num++;
|
||||
|
||||
screen = context->decoder->context->screen;
|
||||
interlaced = screen->get_video_param(screen, context->decoder->profile,
|
||||
PIPE_VIDEO_ENTRYPOINT_BITSTREAM,
|
||||
PIPE_VIDEO_CAP_SUPPORTS_INTERLACED);
|
||||
|
||||
if (surf->buffer->interlaced != interlaced) {
|
||||
surf->templat.interlaced = screen->get_video_param(screen, context->decoder->profile,
|
||||
PIPE_VIDEO_ENTRYPOINT_BITSTREAM,
|
||||
PIPE_VIDEO_CAP_PREFERS_INTERLACED);
|
||||
|
||||
surf->buffer->destroy(surf->buffer);
|
||||
|
||||
if (vlVaHandleSurfaceAllocate(ctx, surf, &surf->templat) != VA_STATUS_SUCCESS) {
|
||||
mtx_unlock(&drv->mutex);
|
||||
return VA_STATUS_ERROR_ALLOCATION_FAILED;
|
||||
}
|
||||
|
||||
context->target = surf->buffer;
|
||||
}
|
||||
|
||||
if (context->decoder->entrypoint == PIPE_VIDEO_ENTRYPOINT_ENCODE) {
|
||||
coded_buf = context->coded_buf;
|
||||
getEncParamPreset(context);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue