radeon/vcn: release si buffer for encoding at the end.

Signed-off-by: Ruijing Dong <Ruijing.Dong@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Boyuan Zhang <Boyuan.Zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9882>
This commit is contained in:
Ruijing Dong 2021-03-05 10:39:51 -05:00 committed by Marge Bot
parent 89a04a54c4
commit eaf197605e
1 changed files with 5 additions and 4 deletions

View File

@ -349,6 +349,11 @@ static void radeon_enc_destroy(struct pipe_video_codec *encoder)
enc->fb = &fb;
enc->destroy(enc);
flush(enc);
if (enc->si) {
si_vid_destroy_buffer(enc->si);
FREE(enc->si);
enc->si = NULL;
}
si_vid_destroy_buffer(&fb);
}
@ -413,10 +418,6 @@ struct pipe_video_codec *radeon_create_encoder(struct pipe_context *context,
goto error;
}
struct rvid_buffer si;
si_vid_create_buffer(enc->screen, &si, 128 * 1024, PIPE_USAGE_STAGING);
enc->si = &si;
templat.buffer_format = PIPE_FORMAT_NV12;
if (enc->base.profile == PIPE_VIDEO_PROFILE_HEVC_MAIN_10)
templat.buffer_format = PIPE_FORMAT_P010;