Check bit depth and reallocate p010 buffer if it's 10 bits.
Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Boyuan Zhang <Boyuan.Zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12307>
realloc = true;
}
+ if (u_reduce_video_profile(context->templat.profile) == PIPE_VIDEO_FORMAT_AV1 &&
+ surf->buffer->buffer_format == PIPE_FORMAT_NV12) {
+ 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;