From 910b81f73df567db236dbf90dbcc3d71ba1e931f Mon Sep 17 00:00:00 2001 From: David Rosca Date: Thu, 24 Oct 2024 13:27:58 +0200 Subject: [PATCH] frontends/va: Stop reallocating to prefered format in EndPicture This was needed because of the issue with using NV12 regardless of RT format that was fixed in previous commit. There was a special case for AV1, because AV1 Profile 0 supports both 8 and 10 bit, but this is also not needed anymore. Reviewed-by: Leo Liu Part-of: --- src/gallium/frontends/va/picture.c | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/src/gallium/frontends/va/picture.c b/src/gallium/frontends/va/picture.c index ec964356578..3aa01a358fc 100644 --- a/src/gallium/frontends/va/picture.c +++ b/src/gallium/frontends/va/picture.c @@ -1136,7 +1136,6 @@ vlVaEndPicture(VADriverContextP ctx, VAContextID context_id) bool supported; bool realloc = false; bool apply_av1_fg = false; - enum pipe_format format; struct pipe_video_buffer **out_target; int output_id; @@ -1198,17 +1197,6 @@ vlVaEndPicture(VADriverContextP ctx, VAContextID context_id) realloc = true; } - format = screen->get_video_param(screen, context->decoder->profile, - context->decoder->entrypoint, - PIPE_VIDEO_CAP_PREFERED_FORMAT); - - if (surf->buffer->buffer_format != format && - surf->buffer->buffer_format == PIPE_FORMAT_NV12) { - /* check originally as NV12 only */ - surf->templat.buffer_format = format; - realloc = true; - } - if (u_reduce_video_profile(context->templat.profile) == PIPE_VIDEO_FORMAT_JPEG) { if (surf->buffer->buffer_format == PIPE_FORMAT_NV12 && context->mjpeg.sampling_factor != MJPEG_SAMPLING_FACTOR_NV12) { @@ -1253,15 +1241,6 @@ vlVaEndPicture(VADriverContextP ctx, VAContextID context_id) realloc = true; } - if (u_reduce_video_profile(context->templat.profile) == PIPE_VIDEO_FORMAT_AV1 && - surf->buffer->buffer_format == PIPE_FORMAT_NV12 && - context->decoder->entrypoint == PIPE_VIDEO_ENTRYPOINT_BITSTREAM) { - if (context->desc.av1.picture_parameter.bit_depth_idx == 1) { - surf->templat.buffer_format = PIPE_FORMAT_P010; - realloc = true; - } - } - if (realloc) { struct pipe_video_buffer *old_buf = surf->buffer;