st/va/postproc: reallocate interlaced destination buffer
authorThong Thai <thong.thai@amd.com>
Fri, 28 Feb 2020 15:56:49 +0000 (10:56 -0500)
committerMarge Bot <eric+marge@anholt.net>
Tue, 3 Mar 2020 15:17:26 +0000 (15:17 +0000)
When the source buffer is progressive source, re-allocate the
destination buffer as progressive if it isn't already - otherwise
transcoding will fail.

Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/1418
Signed-off-by: Thong Thai <thong.thai@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4001>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4001>

src/gallium/state_trackers/va/postproc.c

index 83293c8343fd40d6c014644a4b91b68b0651ded2..1845883284468747cfe6132805e1df6d17b7c037 100644 (file)
@@ -130,9 +130,6 @@ static VAStatus vlVaPostProcBlit(vlVaDriver *drv, vlVaContext *context,
        !src->interlaced)
       grab = true;
 
-   if (src->interlaced != dst->interlaced && dst->interlaced && !grab)
-      return VA_STATUS_ERROR_INVALID_SURFACE;
-
    if ((src->width != dst->width || src->height != dst->height) &&
        (src->interlaced && dst->interlaced))
       scale = true;
@@ -141,7 +138,7 @@ static VAStatus vlVaPostProcBlit(vlVaDriver *drv, vlVaContext *context,
    if (!src_surfaces || !src_surfaces[0])
       return VA_STATUS_ERROR_INVALID_SURFACE;
 
-   if (scale || (grab && dst->interlaced)) {
+   if (scale || (src->interlaced != dst->interlaced && dst->interlaced)) {
       vlVaSurface *surf;
 
       surf = handle_table_get(drv->htab, context->target_id);