radeonsi/vcn: optimize bitstream buffer resize logic
authorSajeesh Sidharthan <sajeesh.sidharthan@amd.com>
Wed, 5 Apr 2023 08:58:59 +0000 (14:28 +0530)
committerMarge Bot <emma+marge@anholt.net>
Fri, 7 Apr 2023 02:31:24 +0000 (02:31 +0000)
commitab3507691adee7f3542875e5fd1106f18e2e2f91
tree5becb1437e26d035e1990a6d45463c057db6f8c0
parentd1b569d26f879fd606c666692db73ef5dfe43043
radeonsi/vcn: optimize bitstream buffer resize logic

bitstream buffer is unmapped, resized and mapped again if new size
is greater than the current bitstream buffer size. This will be done
for each input buffer. This patch will avoid that and do resize
only once irrespective of number of input buffers. With the new logic,
total size is calculated first and call unmap, resize and map only once.

Signed-off-by: Sajeesh Sidharthan <sajeesh.sidharthan@amd.com>
Reviewed-by: Boyuan Zhang <Boyuan.Zhang@amd.com>
Reviewed-by: Veerabadhran Gopalakrishnan <Veerabadhran.Gopalakrishnan@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22308>
src/gallium/drivers/radeonsi/radeon_vcn_dec.c