Module: Mesa Branch: main Commit: f17d3a125126dd7e0f1c2072545976cec1eeb1c8 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=f17d3a125126dd7e0f1c2072545976cec1eeb1c8
Author: Sathishkumar S <[email protected]> Date: Wed Apr 20 16:23:06 2022 +0530 radeon/vcn: skip create and destroy message for jpeg JPEG does not require create and destroy codec messages. It is not firmware based, so these messages are redundant. Signed-off-by: Sathishkumar S <[email protected]> Reviewed-by: Leo Liu <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16160> --- src/gallium/drivers/radeonsi/radeon_vcn_dec.c | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/src/gallium/drivers/radeonsi/radeon_vcn_dec.c b/src/gallium/drivers/radeonsi/radeon_vcn_dec.c index fb3b90dc220..c42f6da660d 100755 --- a/src/gallium/drivers/radeonsi/radeon_vcn_dec.c +++ b/src/gallium/drivers/radeonsi/radeon_vcn_dec.c @@ -2276,11 +2276,12 @@ static void radeon_dec_destroy(struct pipe_video_codec *decoder) assert(decoder); - map_msg_fb_it_probs_buf(dec); - rvcn_dec_message_destroy(dec); - send_msg_buf(dec); - - flush(dec, 0); + if (dec->stream_type != RDECODE_CODEC_JPEG) { + map_msg_fb_it_probs_buf(dec); + rvcn_dec_message_destroy(dec); + send_msg_buf(dec); + flush(dec, 0); + } dec->ws->cs_destroy(&dec->cs); @@ -2638,12 +2639,14 @@ struct pipe_video_codec *radeon_create_decoder(struct pipe_context *context, goto error; } - map_msg_fb_it_probs_buf(dec); - rvcn_dec_message_create(dec); - send_msg_buf(dec); - r = flush(dec, 0); - if (r) - goto error; + if (dec->stream_type != RDECODE_CODEC_JPEG) { + map_msg_fb_it_probs_buf(dec); + rvcn_dec_message_create(dec); + send_msg_buf(dec); + r = flush(dec, 0); + if (r) + goto error; + } next_buffer(dec);
