UPSTREAM: frontend/va: Create decoder once the max_references is updated

Issue: When a video is decoded where the max_references is updated the
decoder keeps using same old value. This results into green patches and
decoding is not proper.

Root Cause: The max_references is updated only once when the instance is
created for the first time.

Fix: Added a check along with the context->decoder to check if the
context->templat.max_references has changed. If yes, then we go ahead
and create the decoder again.

BUG=b:220205184
TEST=HBO Max stream with ad and video. Play any video with different
max_references.

Reviewed-by: Leo Liu <leo.liu@amd.com>
Signed-off-by: Krunal Patel <krunalkumarmukeshkumar.patel@amd.corp-partner.google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15750>
(cherry picked from commit f21d6e18bc3f7fb9021b853544caf979bf87bc74)
Change-Id: If664545bcac8e745819965badec95e2d12e3f0a1
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/mesa/+/3578132
Reviewed-by: Sean Paul <seanpaul@chromium.org>
Reviewed-by: Jeffrey Kardatzke <jkardatzke@google.com>
Commit-Queue: Jeffrey Kardatzke <jkardatzke@google.com>
Tested-by: Jeffrey Kardatzke <jkardatzke@google.com>
Reviewed-by: Miguel Casas-Sanchez <mcasas@chromium.org>
1 file changed