[Mesa-dev] [PATCH 2/3] st/va: move YUV content to deinterlaced buffer when reallocated for encoder

Leo Liu leo.liu at amd.com
Thu Aug 24 15:11:38 UTC 2017


v2: use deinterlace common function

Signed-off-by: Leo Liu <leo.liu at amd.com>
---
 src/gallium/state_trackers/va/picture.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/gallium/state_trackers/va/picture.c b/src/gallium/state_trackers/va/picture.c
index 47e63d3b30..9282dabc63 100644
--- a/src/gallium/state_trackers/va/picture.c
+++ b/src/gallium/state_trackers/va/picture.c
@@ -627,7 +627,7 @@ vlVaEndPicture(VADriverContextP ctx, VAContextID context_id)
 
    if (surf->buffer->interlaced != interlaced) {
       surf->templat.interlaced = screen->get_video_param(screen, context->decoder->profile,
-                                                         PIPE_VIDEO_ENTRYPOINT_BITSTREAM,
+                                                         context->decoder->entrypoint,
                                                          PIPE_VIDEO_CAP_PREFERS_INTERLACED);
       realloc = true;
    }
@@ -657,13 +657,17 @@ vlVaEndPicture(VADriverContextP ctx, VAContextID context_id)
    }
 
    if (realloc) {
-      surf->buffer->destroy(surf->buffer);
+      struct pipe_video_buffer *old_buf = surf->buffer;
 
       if (vlVaHandleSurfaceAllocate(ctx, surf, &surf->templat) != VA_STATUS_SUCCESS) {
          mtx_unlock(&drv->mutex);
          return VA_STATUS_ERROR_ALLOCATION_FAILED;
       }
 
+      if (context->decoder->entrypoint == PIPE_VIDEO_ENTRYPOINT_ENCODE)
+         vl_compositor_yuv_deint(&drv->cstate, &drv->compositor, old_buf, surf->buffer);
+
+      old_buf->destroy(old_buf);
       context->target = surf->buffer;
    }
 
-- 
2.11.0



More information about the mesa-dev mailing list