radeonsi/vcn: num bs_bufs must be proportional to num jpeg engines

using limited number of bs buffers constraints the simultaneous
use of all available jpeg engines especially when count is lesser than
that of the available engines. make sure the number of buffers
available are more than or equal to the number of jpeg engines on the asic.

Signed-off-by: Sathishkumar S <sathishkumar.sundararaju@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24240>
This commit is contained in:
Sathishkumar S
2023-07-20 10:21:22 +05:30
committed by Marge Bot
parent 47a9d01641
commit 0195e1204b
@@ -3115,7 +3115,14 @@ struct pipe_video_codec *radeon_create_decoder(struct pipe_context *context,
dec->h264_valid_poc_num[i] = (unsigned) -1;
}
dec->num_dec_bufs = NUM_BUFFERS;
if (dec->stream_type == RDECODE_CODEC_JPEG) {
if (sctx->vcn_ip_ver == VCN_4_0_3)
dec->num_dec_bufs = dec->njctx;
else
dec->num_dec_bufs = dec->njctx * NUM_BUFFERS;
} else
dec->num_dec_bufs = NUM_BUFFERS;
bs_buf_size = align(width * height / 32, 128);
dec->msg_fb_it_probs_buffers = (struct rvid_buffer *) CALLOC(dec->num_dec_bufs, sizeof(struct rvid_buffer));
dec->bs_buffers = (struct rvid_buffer *) CALLOC(dec->num_dec_bufs, sizeof(struct rvid_buffer));