radeonsi/vcn : update enc->dpb ref_use for index 0
authorSureshGuttula <suresh.guttula@amd.corp-partner.google.com>
Fri, 27 May 2022 11:00:52 +0000 (16:30 +0530)
committerMarge Bot <emma+marge@anholt.net>
Sat, 28 May 2022 15:52:53 +0000 (15:52 +0000)
Currently dpb_enc referneces not updated properly when index 0, as
we are skipping clearing that ref.

This patch will fix this for index 0. So that when ever we set
non_referenced flag, that is not used as ref and not pushed to DPB.
This is helping in SVC encoding.

Signed-off-by: SureshGuttula <suresh.guttula@amd.com>
Reviewed-by: Thong Thai <thong.thai@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16745>

src/gallium/drivers/radeonsi/radeon_vcn_enc_1_2.c

index d279f8c..f0bd7fc 100644 (file)
@@ -1348,7 +1348,7 @@ static int get_picture_storage(struct radeon_encoder *enc)
          oldest_idx = i;
       }
 
-   if (oldest_idx > 0)
+   if (oldest_idx >= 0)
       enc->dpb[oldest_idx].in_use = FALSE;
 
    return oldest_idx;