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 <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 13:27:58 +02:00 committed by Marge Bot
parent c8a893becd
commit 910b81f73d

View File

@ -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;