tu: Implement fallback linear staging blit for CopyImage
[mesa.git] / src / gallium / state_trackers / va / postproc.c
index 661e3bf941471139cc255f079dc210ef2f55085b..1845883284468747cfe6132805e1df6d17b7c037 100644 (file)
@@ -97,9 +97,11 @@ static void vlVaGetBox(struct pipe_video_buffer *buf, unsigned idx,
    width = region->width;
    height = region->height;
 
-   vl_video_buffer_adjust_size(&x, &y, plane, buf->chroma_format,
+   vl_video_buffer_adjust_size(&x, &y, plane,
+                               pipe_format_to_chroma_format(buf->buffer_format),
                                buf->interlaced);
-   vl_video_buffer_adjust_size(&width, &height, plane, buf->chroma_format,
+   vl_video_buffer_adjust_size(&width, &height, plane,
+                               pipe_format_to_chroma_format(buf->buffer_format),
                                buf->interlaced);
 
    box->x = region->x < 0 ? -x : x;
@@ -128,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;
@@ -139,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);