From 175e02baeda9db26af627bff0cb228c69a0fbbdd Mon Sep 17 00:00:00 2001 From: Asahi Lina Date: Sat, 22 Jul 2023 18:31:45 +0900 Subject: [PATCH] asahi: Add a noshadow debug flag This lets us trivially test whether resource shadowing helps or hurts any given workload. Signed-off-by: Asahi Lina Part-of: --- src/asahi/lib/agx_device.h | 1 + src/gallium/drivers/asahi/agx_pipe.c | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/src/asahi/lib/agx_device.h b/src/asahi/lib/agx_device.h index 837a63b..6e90132 100644 --- a/src/asahi/lib/agx_device.h +++ b/src/asahi/lib/agx_device.h @@ -29,6 +29,7 @@ enum agx_dbg { AGX_DBG_SYNCTVB = BITFIELD_BIT(13), AGX_DBG_SMALLTILE = BITFIELD_BIT(14), AGX_DBG_NOMSAA = BITFIELD_BIT(15), + AGX_DBG_NOSHADOW = BITFIELD_BIT(16), }; /* Dummy partial declarations, pending real UAPI */ diff --git a/src/gallium/drivers/asahi/agx_pipe.c b/src/gallium/drivers/asahi/agx_pipe.c index 720242f..5a0fa7f 100644 --- a/src/gallium/drivers/asahi/agx_pipe.c +++ b/src/gallium/drivers/asahi/agx_pipe.c @@ -68,6 +68,7 @@ static const struct debug_named_value agx_debug_options[] = { {"synctvb", AGX_DBG_SYNCTVB, "Synchronous TVB growth"}, {"smalltile", AGX_DBG_SMALLTILE,"Force 16x16 tiles"}, {"nomsaa", AGX_DBG_NOMSAA, "Force disable MSAA"}, + {"noshadow", AGX_DBG_NOSHADOW, "Force disable resource shadowing"}, DEBUG_NAMED_VALUE_END }; /* clang-format on */ @@ -659,6 +660,9 @@ agx_shadow(struct agx_context *ctx, struct agx_resource *rsrc, bool needs_copy) struct agx_bo *old = rsrc->bo; unsigned flags = old->flags; + if (dev->debug & AGX_DBG_NOSHADOW) + return false; + /* If a resource is (or could be) shared, shadowing would desync across * processes. (It's also not what this path is for.) */ -- 2.7.4