radeon/vcn: reuse the dpb buffers when with the same size.
To avoid allocate/deallocate frequently. Signed-off-by: Leo Liu <leo.liu@amd.com> Reviewed-by: James Zhu <James.Zhu@amd.com> Reviewed-by: Boyuan Zhang <Boyuan.Zhang@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12610>
This commit is contained in:
parent
2bdc0bb324
commit
6a0cadd8ec
|
@ -1358,8 +1358,12 @@ static unsigned rvcn_dec_dynamic_dpb_t2_message(struct radeon_decoder *dec, rvcn
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (i == dec->ref_codec.ref_size) {
|
if (i == dec->ref_codec.ref_size) {
|
||||||
list_del(&d->list);
|
if (d->dpb.res->b.b.width0 * d->dpb.res->b.b.height0 != size) {
|
||||||
list_addtail(&d->list, &dec->dpb_unref_list);
|
list_del(&d->list);
|
||||||
|
list_addtail(&d->list, &dec->dpb_unref_list);
|
||||||
|
} else {
|
||||||
|
d->index = 0x7f;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1371,11 +1375,9 @@ static unsigned rvcn_dec_dynamic_dpb_t2_message(struct radeon_decoder *dec, rvcn
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!dpb) {
|
if (!dpb) {
|
||||||
list_for_each_entry_safe(struct rvcn_dec_dynamic_dpb_t2, d, &dec->dpb_unref_list, list) {
|
list_for_each_entry_safe(struct rvcn_dec_dynamic_dpb_t2, d, &dec->dpb_ref_list, list) {
|
||||||
if (d->dpb.res->b.b.width0 * d->dpb.res->b.b.height0 == size) {
|
if (d->index == 0x7f) {
|
||||||
d->index = dec->ref_codec.index;
|
d->index = dec->ref_codec.index;
|
||||||
list_del(&d->list);
|
|
||||||
list_addtail(&d->list, &dec->dpb_ref_list);
|
|
||||||
dpb = d;
|
dpb = d;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue