diff options
author | Leo Liu <[email protected]> | 2017-08-28 22:59:56 -0400 |
---|---|---|
committer | Leo Liu <[email protected]> | 2017-09-07 13:32:36 -0400 |
commit | cadeb73f6bb5f33877f3bbd6536594f22e20d580 (patch) | |
tree | 6070ad5ea2f7df0be156a21738d82c1cfe039be7 /src/gallium/state_trackers/va | |
parent | 78ec7400c512b5d1d4a56ed32714c9ad555af003 (diff) |
st/va: reallocate the buffer if the layout isn't supported
So that it makes more clear for buffer reallocation based
on buffers layout for both decoder and encoder.
Signed-off-by: Leo Liu <[email protected]>
Reviewed-by: Christian König <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers/va')
-rw-r--r-- | src/gallium/state_trackers/va/picture.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/src/gallium/state_trackers/va/picture.c b/src/gallium/state_trackers/va/picture.c index 47e63d3b30c..ee099fad6ee 100644 --- a/src/gallium/state_trackers/va/picture.c +++ b/src/gallium/state_trackers/va/picture.c @@ -591,7 +591,7 @@ vlVaEndPicture(VADriverContextP ctx, VAContextID context_id) vlVaSurface *surf; void *feedback; struct pipe_screen *screen; - bool interlaced; + bool supported; bool realloc = false; enum pipe_format format; @@ -621,14 +621,17 @@ vlVaEndPicture(VADriverContextP ctx, VAContextID context_id) context->mpeg4.frame_num++; screen = context->decoder->context->screen; - interlaced = screen->get_video_param(screen, context->decoder->profile, - context->decoder->entrypoint, - 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); + supported = screen->get_video_param(screen, context->decoder->profile, + context->decoder->entrypoint, + surf->buffer->interlaced ? + PIPE_VIDEO_CAP_SUPPORTS_INTERLACED : + PIPE_VIDEO_CAP_SUPPORTS_PROGRESSIVE); + + if (!supported) { + surf->templat.interlaced = screen->get_video_param(screen, + context->decoder->profile, + context->decoder->entrypoint, + PIPE_VIDEO_CAP_PREFERS_INTERLACED); realloc = true; } |