summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuijing Dong <Ruijing.Dong@amd.com>2021-03-05 10:39:51 -0500
committerMarge Bot <eric+marge@anholt.net>2021-03-30 15:41:12 +0000
commiteaf197605e34e8563b99caa83c9cb3990901a60a (patch)
tree8bce6bb12e43ccf6ae4ae8d143987ac46f26837a
parent89a04a54c41b1ffd3f6699273bf1486afa37b96c (diff)
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>
-rw-r--r--src/gallium/drivers/radeon/radeon_vcn_enc.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/gallium/drivers/radeon/radeon_vcn_enc.c b/src/gallium/drivers/radeon/radeon_vcn_enc.c
index 0e7f68a20c9..309108b526a 100644
--- a/src/gallium/drivers/radeon/radeon_vcn_enc.c
+++ b/src/gallium/drivers/radeon/radeon_vcn_enc.c
@@ -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;