From 81be8b3c2f2785932b63d4b82ee33cc3d6ac2765 Mon Sep 17 00:00:00 2001 From: Pierre-Eric Pelloux-Prayer Date: Tue, 27 Oct 2020 21:13:40 +0100 Subject: [PATCH] va/picture: make sure destination buffer is protected if needed Reviewed-by: Boyuan Zhang Part-of: --- src/gallium/frontends/va/picture.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/gallium/frontends/va/picture.c b/src/gallium/frontends/va/picture.c index c358bc2..b470666 100644 --- a/src/gallium/frontends/va/picture.c +++ b/src/gallium/frontends/va/picture.c @@ -702,6 +702,15 @@ vlVaEndPicture(VADriverContextP ctx, VAContextID context_id) } } + if ((surf->templat.bind & PIPE_BIND_PROTECTED) != context->desc.base.protected_playback) { + if (context->desc.base.protected_playback) { + surf->templat.bind |= PIPE_BIND_PROTECTED; + } + else + surf->templat.bind &= ~PIPE_BIND_PROTECTED; + realloc = true; + } + if (realloc) { struct pipe_video_buffer *old_buf = surf->buffer; -- 2.7.4