mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-20 07:20:10 +01:00
radeonsi/vcn: Fix creating context buffer on VCN5
VCN5 needs the context buffer for AV1 encode and when pre-encode
is enabled.
Replace the check for dpb slots (which is always 0 on VCN5) with
check for first encoded frame.
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/14186
Fixes: a0324576aa ("radeonsi/vcn: Stop using rvid_buffer")
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38072>
This commit is contained in:
parent
17355f716b
commit
00b8fad3d3
2 changed files with 6 additions and 1 deletions
|
|
@ -1565,7 +1565,7 @@ static void radeon_enc_begin_frame(struct pipe_video_codec *encoder,
|
|||
dpb_slots = 0;
|
||||
|
||||
radeon_vcn_enc_get_param(enc, picture);
|
||||
if (dpb_slots && !enc->dpb && setup_dpb(enc, dpb_slots)) {
|
||||
if (enc->first_frame && setup_dpb(enc, dpb_slots)) {
|
||||
enc->dpb = si_resource(pipe_buffer_create(enc->screen, 0, PIPE_USAGE_DEFAULT, enc->dpb_size));
|
||||
if (!enc->dpb) {
|
||||
RADEON_ENC_ERR("Can't create DPB buffer.\n");
|
||||
|
|
@ -1935,6 +1935,8 @@ static int radeon_enc_end_frame(struct pipe_video_codec *encoder, struct pipe_vi
|
|||
if (enc->error)
|
||||
return -1;
|
||||
|
||||
enc->first_frame = false;
|
||||
|
||||
return flush(enc, picture->flush_flags, picture->out_fence);
|
||||
}
|
||||
|
||||
|
|
@ -2201,6 +2203,8 @@ struct pipe_video_codec *radeon_create_encoder(struct pipe_context *context,
|
|||
radeon_enc_1_2_init(enc);
|
||||
}
|
||||
|
||||
enc->first_frame = true;
|
||||
|
||||
return &enc->base;
|
||||
|
||||
error:
|
||||
|
|
|
|||
|
|
@ -262,6 +262,7 @@ struct radeon_encoder {
|
|||
unsigned metadata_size;
|
||||
|
||||
bool error;
|
||||
bool first_frame;
|
||||
|
||||
enum {
|
||||
DPB_LEGACY = 0,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue