Mesa (master): gallium: Fix VAAPI postproc blit
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Mon Dec 7 20:23:37 UTC 2020
Module: Mesa
Branch: master
Commit: c5088b497290ba1207085899ec635ef851635267
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=c5088b497290ba1207085899ec635ef851635267
Author: Thong Thai <thong.thai at amd.com>
Date: Mon Dec 7 10:05:57 2020 -0500
gallium: Fix VAAPI postproc blit
Fixes the VAAPI postproc issue mentioned in this comment
(https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6736#note_626808)
without changing the height of the underlying resource when doing the
blit.
This commit removes the 0.5 pixel center offset from the compute blit - VAAPI postproc is the only function that uses this compute blit.
Fixes: 49465babdb3 ("frontends/va/postproc: Use the actual image height when blitting")
Signed-off-by: Thong Thai <thong.thai at amd.com>
Reviewed-by: Marek Olšák <marek.olsak at amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7970>
---
src/gallium/auxiliary/util/u_compute.c | 4 ++--
src/gallium/frontends/va/postproc.c | 4 +---
2 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/src/gallium/auxiliary/util/u_compute.c b/src/gallium/auxiliary/util/u_compute.c
index bc884b6ae62..171cea86adf 100644
--- a/src/gallium/auxiliary/util/u_compute.c
+++ b/src/gallium/auxiliary/util/u_compute.c
@@ -92,8 +92,8 @@ void util_compute_blit(struct pipe_context *ctx, struct pipe_blit_info *blit_inf
float y_scale = blit_info->src.box.height / (float)blit_info->dst.box.height;
float z_scale = blit_info->src.box.depth / (float)blit_info->dst.box.depth;
- unsigned data[] = {u_bitcast_f2u((blit_info->src.box.x + 0.5) / (float)src->width0),
- u_bitcast_f2u((blit_info->src.box.y + 0.5) / (float)src->height0),
+ unsigned data[] = {u_bitcast_f2u(blit_info->src.box.x / (float)src->width0),
+ u_bitcast_f2u(blit_info->src.box.y / (float)src->height0),
u_bitcast_f2u(blit_info->src.box.z),
u_bitcast_f2u(0),
u_bitcast_f2u(x_scale / src->width0),
diff --git a/src/gallium/frontends/va/postproc.c b/src/gallium/frontends/va/postproc.c
index 946761be312..7ab56b5f4c2 100644
--- a/src/gallium/frontends/va/postproc.c
+++ b/src/gallium/frontends/va/postproc.c
@@ -204,7 +204,6 @@ static VAStatus vlVaPostProcBlit(vlVaDriver *drv, vlVaContext *context,
memset(&blit, 0, sizeof(blit));
blit.src.resource = from->texture;
- blit.src.resource->height0 = src_region->height;
blit.src.format = from->format;
blit.src.level = 0;
blit.src.box.z = from->u.tex.first_layer;
@@ -212,7 +211,6 @@ static VAStatus vlVaPostProcBlit(vlVaDriver *drv, vlVaContext *context,
vlVaGetBox(src, i, &blit.src.box, src_region);
blit.dst.resource = dst_surfaces[i]->texture;
- blit.dst.resource->height0 = dst_region->height;
blit.dst.format = dst_surfaces[i]->format;
blit.dst.level = 0;
blit.dst.box.z = dst_surfaces[i]->u.tex.first_layer;
@@ -311,7 +309,7 @@ vlVaHandleVAProcPipelineParameterBufferType(vlVaDriver *drv, vlVaContext *contex
src = src_surface->buffer;
dst = dst_surface->buffer;
- /* convert the destination buffer to progressive if we're deinterlacing
+ /* convert the destination buffer to progressive if we're deinterlacing
otherwise we might end up deinterlacing twice */
if (param->num_filters && dst->interlaced) {
vlVaSurface *surf;
More information about the mesa-commit
mailing list