From: Rob Clark Date: Sat, 15 Feb 2020 23:32:12 +0000 (-0800) Subject: freedreno: quiet INFO_MSG X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=7b4d6bb1ec65d87316540e076661ddffec26e3a5;p=mesa.git freedreno: quiet INFO_MSG Probably not useful unless LIBGL_DEBUG is set to something. Signed-off-by: Rob Clark Part-of: --- diff --git a/src/freedreno/drm/freedreno_device.c b/src/freedreno/drm/freedreno_device.c index 0a760bc4e38..1031aaf1bef 100644 --- a/src/freedreno/drm/freedreno_device.c +++ b/src/freedreno/drm/freedreno_device.c @@ -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; +} diff --git a/src/freedreno/drm/freedreno_priv.h b/src/freedreno/drm/freedreno_priv.h index 36cb8fb6044..98124b72f2b 100644 --- a/src/freedreno/drm/freedreno_priv.h +++ b/src/freedreno/drm/freedreno_priv.h @@ -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", \