Mesa (main): frontends/va: Reallocate p010 buffer for AV1 10 bits decode
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Fri Aug 13 14:19:59 UTC 2021
Module: Mesa
Branch: main
Commit: fa1bb477031f56ad0131b2122a8362d667711922
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=fa1bb477031f56ad0131b2122a8362d667711922
Author: Leo Liu <leo.liu at amd.com>
Date: Sat Aug 7 17:09:55 2021 -0400
frontends/va: Reallocate p010 buffer for AV1 10 bits decode
Check bit depth and reallocate p010 buffer if it's 10 bits.
Signed-off-by: Leo Liu <leo.liu at amd.com>
Reviewed-by: Boyuan Zhang <Boyuan.Zhang at amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12307>
---
src/gallium/frontends/va/picture.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/src/gallium/frontends/va/picture.c b/src/gallium/frontends/va/picture.c
index 6af7397e132..5a5792ea42f 100644
--- a/src/gallium/frontends/va/picture.c
+++ b/src/gallium/frontends/va/picture.c
@@ -741,6 +741,14 @@ 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) {
+ 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;
More information about the mesa-commit
mailing list