freedreno: quiet INFO_MSG

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>
This commit is contained in:
Rob Clark 2020-02-15 15:32:12 -08:00 committed by Marge Bot
parent 838ed2885d
commit 7b4d6bb1ec
2 changed files with 13 additions and 1 deletions

View 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;
}

View 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", \