diff --git a/src/gallium/drivers/panfrost/pan_job.c b/src/gallium/drivers/panfrost/pan_job.c index 9ba80d3def2..c1d2909ec8a 100644 --- a/src/gallium/drivers/panfrost/pan_job.c +++ b/src/gallium/drivers/panfrost/pan_job.c @@ -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 diff --git a/src/panfrost/lib/pan_desc.c b/src/panfrost/lib/pan_desc.c index 4d605f249c6..6cbd124c772 100644 --- a/src/panfrost/lib/pan_desc.c +++ b/src/panfrost/lib/pan_desc.c @@ -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 diff --git a/src/panfrost/vulkan/panvk_vX_cmd_draw.c b/src/panfrost/vulkan/panvk_vX_cmd_draw.c index 307a19746af..0b8bddfd21c 100644 --- a/src/panfrost/vulkan/panvk_vX_cmd_draw.c +++ b/src/panfrost/vulkan/panvk_vX_cmd_draw.c @@ -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