asahi: Add smalltile debug option

This lets us force small tiles when they otherwise would not be
necessary, which is useful for decoupling tile size and the logic that
depends on it from things like MSAA and MRT which can trigger small
tiles.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24258>
This commit is contained in:
Asahi Lina
2023-07-05 20:25:01 +09:00
committed by Marge Bot
parent 35715db30d
commit e9b2f02c2f
3 changed files with 8 additions and 0 deletions
+1
View File
@@ -27,6 +27,7 @@ enum agx_dbg {
AGX_DBG_BATCH = BITFIELD_BIT(11),
AGX_DBG_NOWC = BITFIELD_BIT(12),
AGX_DBG_SYNCTVB = BITFIELD_BIT(13),
AGX_DBG_SMALLTILE = BITFIELD_BIT(14),
};
/* Dummy partial declarations, pending real UAPI */
+1
View File
@@ -65,6 +65,7 @@ static const struct debug_named_value agx_debug_options[] = {
{"batch", AGX_DBG_BATCH, "Log batches"},
{"nowc", AGX_DBG_NOWC, "Disable write-combining"},
{"synctvb", AGX_DBG_SYNCTVB, "Synchronous TVB growth"},
{"smalltile", AGX_DBG_SMALLTILE,"Force 16x16 tiles"},
DEBUG_NAMED_VALUE_END
};
/* clang-format on */
+6
View File
@@ -1422,6 +1422,9 @@ agx_compile_variant(struct agx_device *dev, struct agx_uncompiled_shader *so,
struct agx_tilebuffer_layout tib = agx_build_tilebuffer_layout(
key->rt_formats, key->nr_cbufs, key->nr_samples);
if (dev->debug & AGX_DBG_SMALLTILE)
tib.tile_size = (struct agx_tile_size){16, 16};
nir_lower_blend_options opts = {
.scalar_blend_const = true,
.logicop_enable = key->blend.logicop_enable,
@@ -2250,6 +2253,9 @@ agx_batch_init_state(struct agx_batch *batch)
formats, batch->key.nr_cbufs,
util_framebuffer_get_num_samples(&batch->key));
if (agx_device(batch->ctx->base.screen)->debug & AGX_DBG_SMALLTILE)
batch->tilebuffer_layout.tile_size = (struct agx_tile_size){16, 16};
if (batch->key.zsbuf) {
struct agx_resource *rsrc = agx_resource(batch->key.zsbuf->texture);
agx_batch_writes(batch, rsrc);