summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/va/picture.c
diff options
context:
space:
mode:
authorLeo Liu <[email protected]>2017-08-15 12:58:59 -0400
committerLeo Liu <[email protected]>2017-08-21 10:09:09 -0400
commitc4061bb5fa1c15a77ded16f1de3a4bfa2df20384 (patch)
tree1555535f80703adb04f84bbd1fa8ca5805427e7e /src/gallium/state_trackers/va/picture.c
parentfceb52a23097e3762bedce730baea1913cfa58f3 (diff)
st/va: reallocate surface when interlaced
Signed-off-by: Leo Liu <[email protected]> Reviewed-by: Christian König <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers/va/picture.c')
-rw-r--r--src/gallium/state_trackers/va/picture.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/gallium/state_trackers/va/picture.c b/src/gallium/state_trackers/va/picture.c
index 62a30782aa3..732079139ea 100644
--- a/src/gallium/state_trackers/va/picture.c
+++ b/src/gallium/state_trackers/va/picture.c
@@ -589,6 +589,8 @@ vlVaEndPicture(VADriverContextP ctx, VAContextID context_id)
vlVaBuffer *coded_buf;
vlVaSurface *surf;
void *feedback;
+ struct pipe_screen *screen;
+ bool interlaced;
if (!ctx)
return VA_STATUS_ERROR_INVALID_CONTEXT;
@@ -615,6 +617,26 @@ vlVaEndPicture(VADriverContextP ctx, VAContextID context_id)
surf = handle_table_get(drv->htab, context->target_id);
context->mpeg4.frame_num++;
+ screen = context->decoder->context->screen;
+ interlaced = screen->get_video_param(screen, context->decoder->profile,
+ PIPE_VIDEO_ENTRYPOINT_BITSTREAM,
+ PIPE_VIDEO_CAP_SUPPORTS_INTERLACED);
+
+ if (surf->buffer->interlaced != interlaced) {
+ surf->templat.interlaced = screen->get_video_param(screen, context->decoder->profile,
+ PIPE_VIDEO_ENTRYPOINT_BITSTREAM,
+ PIPE_VIDEO_CAP_PREFERS_INTERLACED);
+
+ surf->buffer->destroy(surf->buffer);
+
+ if (vlVaHandleSurfaceAllocate(ctx, surf, &surf->templat) != VA_STATUS_SUCCESS) {
+ mtx_unlock(&drv->mutex);
+ return VA_STATUS_ERROR_ALLOCATION_FAILED;
+ }
+
+ context->target = surf->buffer;
+ }
+
if (context->decoder->entrypoint == PIPE_VIDEO_ENTRYPOINT_ENCODE) {
coded_buf = context->coded_buf;
getEncParamPreset(context);