From b3cb911efff7ac463d652febc7318719dce0ebb0 Mon Sep 17 00:00:00 2001 From: David Rosca Date: Tue, 12 Nov 2024 11:19:52 +0100 Subject: [PATCH] frontends/va: Use compositor blit with different number of planes This fixes Y8_U8_V8_444_UNORM -> NV12 conversion for example. Cc: mesa-stable Reviewed-by: Leo Liu (cherry picked from commit 217d70fc38aaa6a20dd866d9d1f0c3d3f87a9255) Part-of: --- .pick_status.json | 2 +- src/gallium/frontends/va/postproc.c | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index bd1fcca09f0..f42a63e2398 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -84,7 +84,7 @@ "description": "frontends/va: Use compositor blit with different number of planes", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null, "notes": null diff --git a/src/gallium/frontends/va/postproc.c b/src/gallium/frontends/va/postproc.c index 69977c7f466..713e404be49 100644 --- a/src/gallium/frontends/va/postproc.c +++ b/src/gallium/frontends/va/postproc.c @@ -347,7 +347,10 @@ static VAStatus vlVaPostProcBlit(vlVaDriver *drv, vlVaContext *context, struct u_rect dst_rect; bool scale = false; bool grab = false; - unsigned i; + unsigned i, src_num_planes, dst_num_planes; + + src_num_planes = util_format_get_num_planes(src->buffer_format); + dst_num_planes = util_format_get_num_planes(dst->buffer_format); if ((src->buffer_format == PIPE_FORMAT_B8G8R8X8_UNORM || src->buffer_format == PIPE_FORMAT_B8G8R8A8_UNORM || @@ -408,7 +411,9 @@ static VAStatus vlVaPostProcBlit(vlVaDriver *drv, vlVaContext *context, if (src->buffer_format == PIPE_FORMAT_YUYV || src->buffer_format == PIPE_FORMAT_UYVY || src->buffer_format == PIPE_FORMAT_YV12 || - src->buffer_format == PIPE_FORMAT_IYUV) { + src->buffer_format == PIPE_FORMAT_IYUV || + (src->interlaced == dst->interlaced && + src_num_planes != dst_num_planes)) { vl_compositor_yuv_deint_full(&drv->cstate, &drv->compositor, src, dst, &src_rect, &dst_rect, VL_COMPOSITOR_NONE);