From 0ff96aaef3b1da78dde1ad9f6c79cc8dd3367577 Mon Sep 17 00:00:00 2001 From: Lucas Stach Date: Thu, 13 Oct 2022 19:34:34 +0200 Subject: [PATCH] etnaviv: rs: fix MSAA alignment adjustment The RS window alignment restrictions apply to the downsampled side of the blit, so we must increase the blit size alignment by the MSAA scale to avoid RS hangs. If a multi-pipe resolve is used (when the GPU doesn't have the singlebuffer feature) then the Y alignment needs to be increased by the number of pixel pipes. The resource allocation has already been fixed to take this additional alignment requirement into account. Signed-off-by: Lucas Stach Reviewed-by: Christian Gmeiner Part-of: --- src/gallium/drivers/etnaviv/etnaviv_rs.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/etnaviv/etnaviv_rs.c b/src/gallium/drivers/etnaviv/etnaviv_rs.c index c4e21445ffa..bb4388b12af 100644 --- a/src/gallium/drivers/etnaviv/etnaviv_rs.c +++ b/src/gallium/drivers/etnaviv/etnaviv_rs.c @@ -686,8 +686,11 @@ etna_try_rs_blit(struct pipe_context *pctx, * Note: the RS width/height are converted to source samples here. */ unsigned int width = blit_info->src.box.width * msaa_xscale; unsigned int height = blit_info->src.box.height * msaa_yscale; - unsigned int w_align = ETNA_RS_WIDTH_MASK + 1; - unsigned int h_align = ETNA_RS_HEIGHT_MASK + 1; + unsigned int w_align = (ETNA_RS_WIDTH_MASK + 1) * msaa_xscale; + unsigned int h_align = (ETNA_RS_HEIGHT_MASK + 1) * msaa_yscale; + + if (!ctx->screen->specs.single_buffer) + h_align *= ctx->screen->specs.pixel_pipes; if (width & (w_align - 1) && width >= src_lev->width * msaa_xscale && width >= dst_lev->width) width = align(width, w_align);