Mesa (master): radeon/vcn: release si buffer for encoding at the end.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Mar 30 15:47:01 UTC 2021


Module: Mesa
Branch: master
Commit: eaf197605e34e8563b99caa83c9cb3990901a60a
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=eaf197605e34e8563b99caa83c9cb3990901a60a

Author: Ruijing Dong <Ruijing.Dong at amd.com>
Date:   Fri Mar  5 10:39:51 2021 -0500

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

Signed-off-by: Ruijing Dong <Ruijing.Dong at amd.com>
Reviewed-by: Leo Liu <leo.liu at amd.com>
Reviewed-by: Boyuan Zhang <Boyuan.Zhang at amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9882>

---

 src/gallium/drivers/radeon/radeon_vcn_enc.c | 9 +++++----
 1 file 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;



More information about the mesa-commit mailing list