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>
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));