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 <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19066>
This commit is contained in:
Lucas Stach 2022-10-13 19:34:34 +02:00 committed by Marge Bot
parent 6dfae66016
commit 0ff96aaef3

View file

@ -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);