freedreno: add env var to override GMEM size
authorRob Clark <robdclark@chromium.org>
Tue, 25 Aug 2020 17:03:31 +0000 (10:03 -0700)
committerMarge Bot <eric+marge@anholt.net>
Tue, 25 Aug 2020 22:20:41 +0000 (22:20 +0000)
Sometimes it is useful to force a smaller size while debugging.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6461>

src/gallium/drivers/freedreno/freedreno_screen.c
src/gallium/drivers/freedreno/freedreno_screen.h

index 90704de8cd745f365fe3fb8af2103d0fa45bb279..f2b8eee9531526f7ca37fe51413eaaeefd1320ec 100644 (file)
@@ -879,7 +879,7 @@ fd_screen_create(struct fd_device *dev, struct renderonly *ro)
                DBG("could not get GMEM size");
                goto fail;
        }
-       screen->gmemsize_bytes = val;
+       screen->gmemsize_bytes = env_var_as_unsigned("FD_MESA_GMEM", val);
 
        if (fd_device_version(dev) >= FD_VERSION_GMEM_BASE) {
                fd_pipe_get_param(screen->pipe, FD_GMEM_BASE, &screen->gmem_base);
index 4707496ef06ad3da6d7e331d930b9c9f38f0c541..2a657cc42d944c73a2e17cf00552ab17aa03917a 100644 (file)
@@ -32,6 +32,7 @@
 #include "perfcntrs/freedreno_perfcntr.h"
 
 #include "pipe/p_screen.h"
+#include "util/debug.h"
 #include "util/u_memory.h"
 #include "util/slab.h"
 #include "util/simple_mtx.h"