[Mesa-dev] [PATCH 14/18] radeon/vcn: add encode destroy

boyuan.zhang at amd.com boyuan.zhang at amd.com
Tue Nov 7 21:59:09 UTC 2017


From: Boyuan Zhang <boyuan.zhang at amd.com>

Signed-off-by: Boyuan Zhang <boyuan.zhang at amd.com>
---
 src/gallium/drivers/radeon/radeon_vcn_enc.c | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/src/gallium/drivers/radeon/radeon_vcn_enc.c b/src/gallium/drivers/radeon/radeon_vcn_enc.c
index a21deb1..0cb8e87 100644
--- a/src/gallium/drivers/radeon/radeon_vcn_enc.c
+++ b/src/gallium/drivers/radeon/radeon_vcn_enc.c
@@ -180,7 +180,21 @@ static void radeon_enc_end_frame(struct pipe_video_codec *encoder,
 
 static void radeon_enc_destroy(struct pipe_video_codec *encoder)
 {
-	/* TODO*/
+	struct radeon_encoder *enc = (struct radeon_encoder*)encoder;
+
+	if (enc->stream_handle) {
+		struct rvid_buffer fb;
+		enc->need_feedback = false;
+		si_vid_create_buffer(enc->screen, &fb, 512, PIPE_USAGE_STAGING);
+		enc->fb = &fb;
+		enc->destroy(enc);
+		flush(enc);
+		si_vid_destroy_buffer(&fb);
+	}
+
+	si_vid_destroy_buffer(&enc->cpb);
+	enc->ws->cs_destroy(enc->cs);
+	FREE(enc);
 }
 
 static void radeon_enc_get_feedback(struct pipe_video_codec *encoder,
-- 
2.7.4



More information about the mesa-dev mailing list