glamor: Only log a backtrace above a debug level

GLAMOR now logs an xorg_backtrace whenever a GL error is raised, to help
with debugging issues and identify the root cause of the GL error in the

Yet that's meant for debugging, not necessarily something worth enabling
all the time.

Add a new debug level for glamor and log the backtraces only when the
debug level is set above that value, e.g. GLAMOR_DEBUG=4

Signed-off-by: Olivier Fourdan <>
See-also: xorg/xserver#1288
Fixes: 3b265c59 - glamor: Dump backtrace on GL error
4 jobs for glamor-backtrace-debug-level in 4 minutes and 44 seconds (queued for 1 second)