diff options
author | Ruijing Dong <ruijing.dong@amd.com> | 2022-01-24 13:00:32 -0500 |
---|---|---|
committer | Marge Bot <emma+marge@anholt.net> | 2022-01-26 15:28:55 +0000 |
commit | 49e02d076dd19577ada144d3466d50c0749992fe (patch) | |
tree | 3a66d87c7f5a460b19229ebfac8487b376a1bd6d /src/gallium | |
parent | cf16368977cc82245aeb372f10710d9a8e213148 (diff) |
radeon/vcn: Updating render_pic_list for correction
In order to keep track of reference frame buffer address changing,
using past_ref to compare with render_pic_list, once the one in
past_ref is valid and if render_pic_list has that entry, it will
need to update it to the latest one in ref[i].
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5868
Signed-off-by: Ruijing Dong <ruijing.dong@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14646>
Diffstat (limited to 'src/gallium')
-rwxr-xr-x[-rw-r--r--] | src/gallium/drivers/radeon/radeon_vcn_dec.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/src/gallium/drivers/radeon/radeon_vcn_dec.c b/src/gallium/drivers/radeon/radeon_vcn_dec.c index 0c06566945a..1a5015f63cf 100644..100755 --- a/src/gallium/drivers/radeon/radeon_vcn_dec.c +++ b/src/gallium/drivers/radeon/radeon_vcn_dec.c @@ -69,6 +69,7 @@ static rvcn_dec_message_avc_t get_h264_msg(struct radeon_decoder *dec, struct pipe_h264_picture_desc *pic) { rvcn_dec_message_avc_t result; + struct h264_private *private; unsigned i, j, k; memset(&result, 0, sizeof(result)); @@ -165,6 +166,25 @@ static rvcn_dec_message_avc_t get_h264_msg(struct radeon_decoder *dec, goto end; } + private = pic->private; + for (i = 0; i < ARRAY_SIZE(private->past_ref); i++) { + for (k = 0; private->past_ref[i] && (k < ARRAY_SIZE(pic->ref)); k++) + if (pic->ref[k] && (private->past_ref[i] == pic->ref[k])) + break; + + for (j = 0; private->past_ref[i] + && (k == ARRAY_SIZE(pic->ref)) + && (j < ARRAY_SIZE(dec->render_pic_list)); j++) { + if (dec->render_pic_list[j] + && (dec->render_pic_list[j] == private->past_ref[i])) { + dec->render_pic_list[j] = pic->ref[i]; + vl_video_buffer_set_associated_data(pic->ref[i], &dec->base, + (void *)(uintptr_t)j, &radeon_dec_destroy_associated_data); + break; + } + } + } + for (i = 0; i < ARRAY_SIZE(dec->render_pic_list); i++) { for (j = 0; (pic->ref[j] != NULL) && (j < ARRAY_SIZE(dec->render_pic_list)); j++) { if (dec->render_pic_list[i] == pic->ref[j]) @@ -1453,7 +1473,7 @@ static unsigned rvcn_dec_dynamic_dpb_t2_message(struct radeon_decoder *dec, rvcn list_for_each_entry_safe(struct rvcn_dec_dynamic_dpb_t2, d, &dec->dpb_ref_list, list) { for (i = 0; i < dec->ref_codec.ref_size; ++i) { - if ((dec->ref_codec.ref_list[i] != 0x7f) && (d->index == (dec->ref_codec.ref_list[i] & 0x7f))) { + if (((dec->ref_codec.ref_list[i] & 0x7f) != 0x7f) && (d->index == (dec->ref_codec.ref_list[i] & 0x7f))) { if (!dummy) dummy = d; |