panfrost: disable tile-pipelining when needed

On v5, as well as v7 onwards, we can disable pipelining in order to fit
more data into the tile-memory. This is important in order to support
multiple, large color buffers with high MSAA sample counts.

Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33925>
This commit is contained in:
Erik Faye-Lund 2025-03-10 18:20:24 +01:00 committed by Marge Bot
parent 77d38bb7ca
commit 20acee81ac
3 changed files with 29 additions and 0 deletions

View file

@ -626,6 +626,13 @@ panfrost_batch_to_fb_info(const struct panfrost_batch *batch,
}
screen->vtbl.select_tile_size(fb);
#if PAN_ARCH != 6
if (fb->cbuf_allocation > fb->tile_buf_budget) {
perf_debug(batch->ctx,
"Using too much tile-memory, disabling pipelining");
}
#endif
}
static void

View file

@ -427,6 +427,17 @@ GENX(pan_select_tile_size)(struct pan_fb_info *fb)
fb->z_tile_buf_budget >> util_logbase2_ceil(zs_bytes_per_pixel));
}
#if PAN_ARCH != 6
/* Check if we're using too much tile-memory; if we are, try disabling
* pipelining. This works because we're starting with an optimistic half
* of the tile-budget, so we actually have another half that can be used.
*
* On v6 GPUs, doing this is not allowed; they *have* to pipeline.
*/
if (fb->tile_size < 4 * 4)
fb->tile_size *= 2;
#endif
/* Clamp tile size to hardware limits */
fb->tile_size =
MIN2(fb->tile_size, panfrost_max_effective_tile_size(PAN_ARCH));
@ -434,7 +445,11 @@ GENX(pan_select_tile_size)(struct pan_fb_info *fb)
/* Colour buffer allocations must be 1K aligned. */
fb->cbuf_allocation = ALIGN_POT(bytes_per_pixel * fb->tile_size, 1024);
#if PAN_ARCH == 6
assert(fb->cbuf_allocation <= fb->tile_buf_budget && "tile too big");
#else
assert(fb->cbuf_allocation <= fb->tile_buf_budget * 2 && "tile too big");
#endif
}
static enum mali_color_format

View file

@ -297,6 +297,13 @@ panvk_per_arch(cmd_init_render_state)(struct panvk_cmd_buffer *cmdbuf,
assert(fbinfo->width && fbinfo->height);
GENX(pan_select_tile_size)(fbinfo);
#if PAN_ARCH != 6
if (fbinfo->cbuf_allocation > fbinfo->tile_buf_budget) {
vk_perf(VK_LOG_OBJS(&cmdbuf->vk.base),
"Using too much tile-memory, disabling pipelining");
}
#endif
}
void