Mesa (main): panfrost: Add nocache debug flag for disabling the BO cache
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Mon Aug 16 15:06:02 UTC 2021
Module: Mesa
Branch: main
Commit: dab97fe227739781652564504a27ff6ea08fb98e
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=dab97fe227739781652564504a27ff6ea08fb98e
Author: Icecream95 <ixn at disroot.org>
Date: Sat Aug 14 23:45:52 2021 +1200
panfrost: Add nocache debug flag for disabling the BO cache
Useful for making execution more deterministic.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12378>
---
src/gallium/drivers/panfrost/pan_screen.c | 1 +
src/panfrost/lib/pan_bo.c | 2 +-
src/panfrost/lib/pan_util.h | 1 +
3 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/gallium/drivers/panfrost/pan_screen.c b/src/gallium/drivers/panfrost/pan_screen.c
index 3a55c272f77..5067a64dbad 100644
--- a/src/gallium/drivers/panfrost/pan_screen.c
+++ b/src/gallium/drivers/panfrost/pan_screen.c
@@ -70,6 +70,7 @@ static const struct debug_named_value panfrost_debug_options[] = {
{"msaa16", PAN_DBG_MSAA16, "Enable MSAA 8x and 16x support"},
{"noindirect", PAN_DBG_NOINDIRECT, "Emulate indirect draws on the CPU"},
{"linear", PAN_DBG_LINEAR, "Force linear textures"},
+ {"nocache", PAN_DBG_NO_CACHE, "Disable BO cache"},
DEBUG_NAMED_VALUE_END
};
diff --git a/src/panfrost/lib/pan_bo.c b/src/panfrost/lib/pan_bo.c
index 7e07c41cc32..033f06cc8e1 100644
--- a/src/panfrost/lib/pan_bo.c
+++ b/src/panfrost/lib/pan_bo.c
@@ -267,7 +267,7 @@ panfrost_bo_cache_put(struct panfrost_bo *bo)
{
struct panfrost_device *dev = bo->dev;
- if (bo->flags & PAN_BO_SHARED)
+ if (bo->flags & PAN_BO_SHARED || dev->debug & PAN_DBG_NO_CACHE)
return false;
pthread_mutex_lock(&dev->bo_cache.lock);
diff --git a/src/panfrost/lib/pan_util.h b/src/panfrost/lib/pan_util.h
index 439085950d7..3a13b5e11d5 100644
--- a/src/panfrost/lib/pan_util.h
+++ b/src/panfrost/lib/pan_util.h
@@ -41,6 +41,7 @@
#define PAN_DBG_MSAA16 0x0400
#define PAN_DBG_NOINDIRECT 0x0800
#define PAN_DBG_LINEAR 0x1000
+#define PAN_DBG_NO_CACHE 0x2000
unsigned
panfrost_translate_swizzle_4(const unsigned char swizzle[4]);
More information about the mesa-commit
mailing list