freedreno: quiet INFO_MSG
authorRob Clark <robdclark@chromium.org>
Sat, 15 Feb 2020 23:32:12 +0000 (15:32 -0800)
committerMarge Bot <eric+marge@anholt.net>
Tue, 18 Feb 2020 20:52:42 +0000 (20:52 +0000)
Probably not useful unless LIBGL_DEBUG is set to something.

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

src/freedreno/drm/freedreno_device.c
src/freedreno/drm/freedreno_priv.h

index 0a760bc4e386e41a5d515b60f01bf7accacef795..1031aaf1beff719b96ebc01bf32be0c45012d697 100644 (file)
@@ -141,3 +141,13 @@ enum fd_version fd_device_version(struct fd_device *dev)
 {
        return dev->version;
 }
+
+bool fd_dbg(void)
+{
+       static int dbg;
+
+       if (!dbg)
+               dbg = getenv("LIBGL_DEBUG") ? 1 : -1;
+
+       return dbg == 1;
+}
index 36cb8fb6044d617e74ca1ba4f93c8483971172d2..98124b72f2b3f8a20948c5e41aa053aeebcb186e 100644 (file)
@@ -182,8 +182,10 @@ struct fd_bo *fd_bo_new_ring(struct fd_device *dev, uint32_t size);
 
 #define enable_debug 0  /* TODO make dynamic */
 
+bool fd_dbg(void);
+
 #define INFO_MSG(fmt, ...) \
-               do { debug_printf("[I] "fmt " (%s:%d)\n", \
+               do { if (fd_dbg()) debug_printf("[I] "fmt " (%s:%d)\n", \
                                ##__VA_ARGS__, __FUNCTION__, __LINE__); } while (0)
 #define DEBUG_MSG(fmt, ...) \
                do if (enable_debug) { debug_printf("[D] "fmt " (%s:%d)\n", \