frontends/va: Stop reallocating from progressive to interlaced in EndPicture

No driver should be hitting this path anymore.

Reviewed-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32089>
This commit is contained in:
David Rosca 2024-10-24 15:47:52 +02:00 committed by Marge Bot
parent 910b81f73d
commit 63fd685b31

View File

@ -1133,7 +1133,6 @@ vlVaEndPicture(VADriverContextP ctx, VAContextID context_id)
vlVaSurface *surf; vlVaSurface *surf;
void *feedback = NULL; void *feedback = NULL;
struct pipe_screen *screen; struct pipe_screen *screen;
bool supported;
bool realloc = false; bool realloc = false;
bool apply_av1_fg = false; bool apply_av1_fg = false;
struct pipe_video_buffer **out_target; struct pipe_video_buffer **out_target;
@ -1183,19 +1182,6 @@ vlVaEndPicture(VADriverContextP ctx, VAContextID context_id)
context->mpeg4.frame_num++; context->mpeg4.frame_num++;
screen = context->decoder->context->screen; screen = context->decoder->context->screen;
supported = screen->get_video_param(screen, context->decoder->profile,
context->decoder->entrypoint,
surf->buffer->interlaced ?
PIPE_VIDEO_CAP_SUPPORTS_INTERLACED :
PIPE_VIDEO_CAP_SUPPORTS_PROGRESSIVE);
if (!supported) {
surf->templat.interlaced = screen->get_video_param(screen,
context->decoder->profile,
context->decoder->entrypoint,
PIPE_VIDEO_CAP_PREFERS_INTERLACED);
realloc = true;
}
if (u_reduce_video_profile(context->templat.profile) == PIPE_VIDEO_FORMAT_JPEG) { if (u_reduce_video_profile(context->templat.profile) == PIPE_VIDEO_FORMAT_JPEG) {
if (surf->buffer->buffer_format == PIPE_FORMAT_NV12 && if (surf->buffer->buffer_format == PIPE_FORMAT_NV12 &&
@ -1249,24 +1235,6 @@ vlVaEndPicture(VADriverContextP ctx, VAContextID context_id)
return VA_STATUS_ERROR_ALLOCATION_FAILED; return VA_STATUS_ERROR_ALLOCATION_FAILED;
} }
if (context->decoder->entrypoint == PIPE_VIDEO_ENTRYPOINT_ENCODE) {
if (old_buf->interlaced) {
struct u_rect src_rect, dst_rect;
dst_rect.x0 = src_rect.x0 = 0;
dst_rect.y0 = src_rect.y0 = 0;
dst_rect.x1 = src_rect.x1 = surf->templat.width;
dst_rect.y1 = src_rect.y1 = surf->templat.height;
vl_compositor_yuv_deint_full(&drv->cstate, &drv->compositor,
old_buf, surf->buffer,
&src_rect, &dst_rect, VL_COMPOSITOR_WEAVE);
} else {
/* Can't convert from progressive to interlaced yet */
mtx_unlock(&drv->mutex);
return VA_STATUS_ERROR_INVALID_SURFACE;
}
}
old_buf->destroy(old_buf); old_buf->destroy(old_buf);
*out_target = surf->buffer; *out_target = surf->buffer;
} }