BACKPORT: radeon/vcn: Corrected vp9 ref associated data in case of target->codec is NULL

This patch fixes the case where less number of reference surfaces created and destoyed
on need basis. The problem comes when we are refereing old assoiciated data for newly
created target buffer with same address. Here old target buffer destroyed as that
surface is no more used as reference for next frames and when we create a new surface
for the next frame to process we will get the surfaceid and same target address
of destroyed surface.

When new surface/surface->buffer/target ,target->codec is null as we cleared when we
destroy this surface, but per ref_mapping logic, it was taking null associated data
i.e.0 as curr_ref_idx. Hence total reference mapping table goes wrong with wrong data.
Beacuse of this, we have seen corrupted vp9 decoded frames.

Signed-off-by: SureshGuttula <suresh.guttula@amd.corp-partner.google.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5452>
(cherry picked from commit 65d23e7fb1edea1f36d4f695b7e85f44c6b89232)

BUG=b:159725470
TEST= vp9 youtube video playback should work fine
      meet video call should show proper video.

Signed-off-by: Suresh Guttula <suresh.guttula@amd.com>
Change-Id: I9c0307eb38a27910160e544ff9961365c07c3cb8
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/mesa/+/2340258
Tested-by: Deepak Sharma <deepak.sharma@amd.com>
Reviewed-by: Drew Davenport <ddavenport@chromium.org>
Commit-Queue: Drew Davenport <ddavenport@chromium.org>
1 file changed