summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/va/buffer.c
diff options
context:
space:
mode:
authorBoyuan Zhang <[email protected]>2016-07-21 19:40:18 -0400
committerChristian König <[email protected]>2016-07-25 13:39:52 +0200
commit85d807f2e04eb4f096fa619bc61c65cdcef446c8 (patch)
treed04dd1bf67658764c37e8daf9126ba052af4546f /src/gallium/state_trackers/va/buffer.c
parent10c1cc47a6adba9ea83d4df5c154c07f95ac3a40 (diff)
st/va: add functions for VAAPI encode
Add necessary functions/changes for VAAPI encoding to buffer and picture. These changes will allow driver to handle all Vaapi encode related operations. This patch doesn't change the Vaapi decode behaviour. Signed-off-by: Boyuan Zhang <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers/va/buffer.c')
-rw-r--r--src/gallium/state_trackers/va/buffer.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/gallium/state_trackers/va/buffer.c b/src/gallium/state_trackers/va/buffer.c
index 7d3167b2ce2..dfcebbe4bd5 100644
--- a/src/gallium/state_trackers/va/buffer.c
+++ b/src/gallium/state_trackers/va/buffer.c
@@ -133,6 +133,12 @@ vlVaMapBuffer(VADriverContextP ctx, VABufferID buf_id, void **pbuff)
if (!buf->derived_surface.transfer || !*pbuff)
return VA_STATUS_ERROR_INVALID_BUFFER;
+ if (buf->type == VAEncCodedBufferType) {
+ ((VACodedBufferSegment*)buf->data)->buf = *pbuff;
+ ((VACodedBufferSegment*)buf->data)->size = buf->coded_size;
+ ((VACodedBufferSegment*)buf->data)->next = NULL;
+ *pbuff = buf->data;
+ }
} else {
pipe_mutex_unlock(drv->mutex);
*pbuff = buf->data;