Mesa (main): radeon/vcn: calc_dpb_size should be based on dpb_type

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Jun 30 14:33:55 UTC 2021


Module: Mesa
Branch: main
Commit: 52602452abd1b1d543161d4407afcf1812427ad7
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=52602452abd1b1d543161d4407afcf1812427ad7

Author: SureshGuttula <suresh.guttula at amd.corp-partner.google.com>
Date:   Tue Jun 29 10:59:14 2021 +0530

radeon/vcn: calc_dpb_size should be based on dpb_type

This patch will fix the dpb size calculated for each dpb_type.
Current implementaion always calculating based on DPB_MAX_RES.To fix
this dpb_type should be decided before calc_dpb_size.

Signed-off-by: SureshGuttula <suresh.guttula at amd.corp-partner.google.com>
Reviewed-by: Leo Liu <leo.liu at amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11633>

---

 src/gallium/drivers/radeon/radeon_vcn_dec.c | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/src/gallium/drivers/radeon/radeon_vcn_dec.c b/src/gallium/drivers/radeon/radeon_vcn_dec.c
index 454b79800a7..ee6ff99fd5a 100644
--- a/src/gallium/drivers/radeon/radeon_vcn_dec.c
+++ b/src/gallium/drivers/radeon/radeon_vcn_dec.c
@@ -2421,6 +2421,14 @@ struct pipe_video_codec *radeon_create_decoder(struct pipe_context *context,
       }
    }
 
+   if (sctx->family >= CHIP_SIENNA_CICHLID &&
+       (stream_type == RDECODE_CODEC_VP9 || stream_type == RDECODE_CODEC_AV1))
+      dec->dpb_type = DPB_DYNAMIC_TIER_2;
+   else if (sctx->family <= CHIP_NAVI14 && stream_type == RDECODE_CODEC_VP9)
+      dec->dpb_type = DPB_DYNAMIC_TIER_1;
+   else
+      dec->dpb_type = DPB_MAX_RES;
+
    dec->db_alignment = (((struct si_screen *)dec->screen)->info.family >= CHIP_RENOIR &&
                    dec->base.width > 32 && (dec->stream_type == RDECODE_CODEC_VP9 ||
                    dec->stream_type == RDECODE_CODEC_AV1 ||
@@ -2487,13 +2495,6 @@ struct pipe_video_codec *radeon_create_decoder(struct pipe_context *context,
    else
       dec->send_cmd = send_cmd_dec;
 
-   if (sctx->family >= CHIP_SIENNA_CICHLID &&
-       (stream_type == RDECODE_CODEC_VP9 || stream_type == RDECODE_CODEC_AV1))
-      dec->dpb_type = DPB_DYNAMIC_TIER_2;
-   else if (sctx->family <= CHIP_NAVI14 && stream_type == RDECODE_CODEC_VP9)
-      dec->dpb_type = DPB_DYNAMIC_TIER_1;
-   else
-      dec->dpb_type = DPB_MAX_RES;
 
    if (dec->dpb_type == DPB_DYNAMIC_TIER_2) {
       list_inithead(&dec->dpb_ref_list);



More information about the mesa-commit mailing list