Module: Mesa
Branch: main
Commit: 62f3e703c8cdae76f300b21981c32e48d7265b5c
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=62f3e703c8cdae76f300b21981c32e48d7265b5c

Author: Rob Clark <[email protected]>
Date:   Thu May 12 08:04:11 2022 -0700

freedreno/drm: Use DEBUG_GET_ONCE_OPTION()

In particular this uses os_get_option() so the android setprop fallback
works.

Signed-off-by: Rob Clark <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16477>

---

 src/freedreno/drm/freedreno_device.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/src/freedreno/drm/freedreno_device.c 
b/src/freedreno/drm/freedreno_device.c
index 0a7fbdc251a..57b33a11e12 100644
--- a/src/freedreno/drm/freedreno_device.c
+++ b/src/freedreno/drm/freedreno_device.c
@@ -208,15 +208,12 @@ fd_device_version(struct fd_device *dev)
    return dev->version;
 }
 
+DEBUG_GET_ONCE_BOOL_OPTION(libgl, "LIBGL_DEBUG", false)
+
 bool
 fd_dbg(void)
 {
-   static int dbg;
-
-   if (!dbg)
-      dbg = getenv("LIBGL_DEBUG") ? 1 : -1;
-
-   return dbg == 1;
+   return debug_get_option_libgl();
 }
 
 bool

Reply via email to