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

Author: Ruijing Dong <[email protected]>
Date:   Fri Mar  5 10:39:51 2021 -0500

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

Signed-off-by: Ruijing Dong <[email protected]>
Reviewed-by: Leo Liu <[email protected]>
Reviewed-by: Boyuan Zhang <[email protected]>
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;

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to