Mesa (master): pan/bi: Add a define for the Bifrost shader prefetch size

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Jan 13 00:28:36 UTC 2021


Module: Mesa
Branch: master
Commit: e74b2edcef9bd3aed41b8bb013efd9e771ae647c
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=e74b2edcef9bd3aed41b8bb013efd9e771ae647c

Author: Icecream95 <ixn at disroot.org>
Date:   Tue Jan 12 22:21:39 2021 +1300

pan/bi: Add a define for the Bifrost shader prefetch size

Found by adding NOPs to the start of a shader and checking dmesg to
see at what sizes the GPU faulted trying to read the following
non-executable page.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8428>

---

 src/panfrost/bifrost/bifrost_compile.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/panfrost/bifrost/bifrost_compile.c b/src/panfrost/bifrost/bifrost_compile.c
index 40034ae5d79..ea26034dafd 100644
--- a/src/panfrost/bifrost/bifrost_compile.c
+++ b/src/panfrost/bifrost/bifrost_compile.c
@@ -47,6 +47,10 @@ static const struct debug_named_value bifrost_debug_options[] = {
 
 DEBUG_GET_ONCE_FLAGS_OPTION(bifrost_debug, "BIFROST_MESA_DEBUG", bifrost_debug_options, 0)
 
+/* How many bytes are prefetched by the Bifrost shader core. Past the end of
+ * the shader, this range must contain valid instructions or zero. */
+#define BIFROST_SHADER_PREFETCH 96
+
 /* TODO: This is not thread safe!! */
 static unsigned SHADER_DB_COUNT = 0;
 



More information about the mesa-commit mailing list