frontends/va/picture:Fix wrong reallocation even surface is protected

This patch will avoid reallocation,if surface is already protected.
Fixing the comparision logic of boolean value(true \ flase) with
PIPE_BIND_PROTECTED.

Fixes: 81be8b3c2f ("va/picture: make sure destination buffer is protected if needed")

Signed-off-by: SureshGuttula <suresh.guttula@amd.corp-partner.google.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10916>
This commit is contained in:
SureshGuttula 2021-05-17 14:22:48 +05:30 committed by Marge Bot
parent 1272c2e052
commit 0236b8a5de

View file

@ -698,7 +698,7 @@ vlVaEndPicture(VADriverContextP ctx, VAContextID context_id)
}
}
if ((surf->templat.bind & PIPE_BIND_PROTECTED) != context->desc.base.protected_playback) {
if ((bool)(surf->templat.bind & PIPE_BIND_PROTECTED) != context->desc.base.protected_playback) {
if (context->desc.base.protected_playback) {
surf->templat.bind |= PIPE_BIND_PROTECTED;
}