Mesa (master): freedreno/a6xx: Fix z24s8 non-ubwc blits on a630.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Jan 6 23:13:49 UTC 2021


Module: Mesa
Branch: master
Commit: 6a8601fb248902e4829632980ba236cb78c2464f
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=6a8601fb248902e4829632980ba236cb78c2464f

Author: Eric Anholt <eric at anholt.net>
Date:   Mon Jan  4 11:34:00 2021 -0800

freedreno/a6xx: Fix z24s8 non-ubwc blits on a630.

Taken from the logic in turnip (though they have the format table have
8888_unorm and override to z24s8_as_rgba for blits in the ubwc case)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8319>

---

 src/gallium/drivers/freedreno/a6xx/fd6_blitter.c | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/freedreno/a6xx/fd6_blitter.c b/src/gallium/drivers/freedreno/a6xx/fd6_blitter.c
index ee0c7986ea5..f7e66ef05ee 100644
--- a/src/gallium/drivers/freedreno/a6xx/fd6_blitter.c
+++ b/src/gallium/drivers/freedreno/a6xx/fd6_blitter.c
@@ -883,6 +883,9 @@ handle_zs_blit(struct fd_context *ctx, const struct pipe_blit_info *info)
 		dump_blit_info(info);
 	}
 
+	struct fd_resource *src = fd_resource(info->src.resource);
+	struct fd_resource *dst = fd_resource(info->dst.resource);
+
 	switch (info->dst.format) {
 	case PIPE_FORMAT_S8_UINT:
 		debug_assert(info->mask == PIPE_MASK_S);
@@ -903,8 +906,8 @@ handle_zs_blit(struct fd_context *ctx, const struct pipe_blit_info *info)
 			blit.mask = PIPE_MASK_R;
 			blit.src.format = PIPE_FORMAT_R8_UINT;
 			blit.dst.format = PIPE_FORMAT_R8_UINT;
-			blit.src.resource = &fd_resource(info->src.resource)->stencil->base;
-			blit.dst.resource = &fd_resource(info->dst.resource)->stencil->base;
+			blit.src.resource = &src->stencil->base;
+			blit.dst.resource = &dst->stencil->base;
 			do_rewritten_blit(ctx, &blit);
 		}
 
@@ -933,6 +936,15 @@ handle_zs_blit(struct fd_context *ctx, const struct pipe_blit_info *info)
 			blit.mask |= PIPE_MASK_A;
 		blit.src.format = PIPE_FORMAT_Z24_UNORM_S8_UINT_AS_R8G8B8A8;
 		blit.dst.format = PIPE_FORMAT_Z24_UNORM_S8_UINT_AS_R8G8B8A8;
+		/* non-UBWC Z24_UNORM_S8_UINT_AS_R8G8B8A8 is broken on a630, fall back to
+		 * 8888_unorm.
+		 */
+		if (!ctx->screen->info.a6xx.has_z24uint_s8uint) {
+			if (!src->layout.ubwc)
+				blit.src.format = PIPE_FORMAT_RGBA8888_UNORM;
+			if (!dst->layout.ubwc)
+				blit.dst.format = PIPE_FORMAT_RGBA8888_UNORM;
+		}
 		return fd_blitter_blit(ctx, &blit);
 
 	default:



More information about the mesa-commit mailing list