summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBoyuan Zhang <[email protected]>2017-11-07 16:20:53 -0500
committerLeo Liu <[email protected]>2017-11-17 12:25:47 -0500
commitbc9644460df595788b1784a84dbe4fa33b17668d (patch)
tree63d6fac1a3f694afa7c5074e8d2c6744fc544351
parent3f83c24366a83083fa2db4d957a168fdc6df7c92 (diff)
radeon/vcn: add encode destroy
Add implementation for destroy interface for vcn encode. Signed-off-by: Boyuan Zhang <[email protected]> Acked-by: Christian König <[email protected]>
-rw-r--r--src/gallium/drivers/radeon/radeon_vcn_enc.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/gallium/drivers/radeon/radeon_vcn_enc.c b/src/gallium/drivers/radeon/radeon_vcn_enc.c
index 05e7e836246..219f8706f50 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,