diff options
author | Boyuan Zhang <[email protected]> | 2017-11-07 16:21:21 -0500 |
---|---|---|
committer | Leo Liu <[email protected]> | 2017-11-17 12:25:47 -0500 |
commit | 3c53fbbc87e716f16212b7c64b963bd8a329cea2 (patch) | |
tree | 21e243c347145190ca144d6faab023e32bb2e694 /src/gallium | |
parent | bc9644460df595788b1784a84dbe4fa33b17668d (diff) |
radeon/vcn: add encode get feedback
Add implementation for get_feedback interface for vcn encode.
Signed-off-by: Boyuan Zhang <[email protected]>
Acked-by: Christian König <[email protected]>
Diffstat (limited to 'src/gallium')
-rw-r--r-- | src/gallium/drivers/radeon/radeon_vcn_enc.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/gallium/drivers/radeon/radeon_vcn_enc.c b/src/gallium/drivers/radeon/radeon_vcn_enc.c index 219f8706f50..de485cf05e5 100644 --- a/src/gallium/drivers/radeon/radeon_vcn_enc.c +++ b/src/gallium/drivers/radeon/radeon_vcn_enc.c @@ -200,7 +200,20 @@ static void radeon_enc_destroy(struct pipe_video_codec *encoder) static void radeon_enc_get_feedback(struct pipe_video_codec *encoder, void *feedback, unsigned *size) { - /* TODO*/ + struct radeon_encoder *enc = (struct radeon_encoder*)encoder; + struct rvid_buffer *fb = feedback; + + if (size) { + uint32_t *ptr = enc->ws->buffer_map(fb->res->buf, enc->cs, PIPE_TRANSFER_READ_WRITE); + if (ptr[1]) + *size = ptr[6]; + else + *size = 0; + enc->ws->buffer_unmap(fb->res->buf); + } + + si_vid_destroy_buffer(fb); + FREE(fb); } struct pipe_video_codec *radeon_create_encoder(struct pipe_context *context, |