glx: Convert undocumented LIBGL_DIAGNOSTIC to LIBGL_DEBUG=verbose
Reviewed-by: Eric Anholt <eric@anholt.net> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10381>
This commit is contained in:
@@ -183,8 +183,7 @@ apple_glx_create_context(void **ptr, Display * dpy, int screen,
|
||||
*x11errorptr = false;
|
||||
}
|
||||
|
||||
if (env_var_as_boolean("LIBGL_DIAGNOSTIC", false))
|
||||
fprintf(stderr, "error: %s\n", apple_cgl.error_string(error));
|
||||
DebugMessageF("error: %s\n", apple_cgl.error_string(error));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -38,14 +38,9 @@
|
||||
#include "apple_glx_log.h"
|
||||
#include "util/debug.h"
|
||||
|
||||
static bool diagnostic = false;
|
||||
static aslclient aslc;
|
||||
|
||||
void apple_glx_log_init(void) {
|
||||
if (env_var_as_boolean("LIBGL_DIAGNOSTIC", false)) {
|
||||
diagnostic = true;
|
||||
}
|
||||
|
||||
aslc = asl_open(NULL, NULL, 0);
|
||||
}
|
||||
|
||||
@@ -90,15 +85,8 @@ void _apple_glx_vlog(int level, const char *file, const char *function,
|
||||
#endif
|
||||
}
|
||||
|
||||
if (diagnostic) {
|
||||
va_list args2;
|
||||
va_copy(args2, args);
|
||||
|
||||
fprintf(stderr, "%-9s %24s:%-4d %s(%"PRIu64"): ",
|
||||
_asl_level_string(level), file, line, function, thread);
|
||||
vfprintf(stderr, fmt, args2);
|
||||
va_end(args2);
|
||||
}
|
||||
DebugMessageF("%-9s %24s:%-4d %s(%"PRIu64"): ",
|
||||
_asl_level_string(level), file, line, function, thread);
|
||||
|
||||
msg = asl_new(ASL_TYPE_MSG);
|
||||
if (msg) {
|
||||
|
||||
@@ -210,10 +210,8 @@ get_max_size(int *widthresult, int *heightresult)
|
||||
|
||||
err = apple_cgl.choose_pixel_format(attr, &pfobj, &vsref);
|
||||
if (kCGLNoError != err) {
|
||||
if (env_var_as_boolean("LIBGL_DIAGNOSTIC", false)) {
|
||||
printf("choose_pixel_format error in %s: %s\n", __func__,
|
||||
apple_cgl.error_string(err));
|
||||
}
|
||||
DebugMessageF("choose_pixel_format error in %s: %s\n", __func__,
|
||||
apple_cgl.error_string(err));
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -222,10 +220,8 @@ get_max_size(int *widthresult, int *heightresult)
|
||||
err = apple_cgl.create_context(pfobj, NULL, &newcontext);
|
||||
|
||||
if (kCGLNoError != err) {
|
||||
if (env_var_as_boolean("LIBGL_DIAGNOSTIC", false)) {
|
||||
printf("create_context error in %s: %s\n", __func__,
|
||||
apple_cgl.error_string(err));
|
||||
}
|
||||
DebugMessageF("create_context error in %s: %s\n", __func__,
|
||||
apple_cgl.error_string(err));
|
||||
|
||||
apple_cgl.destroy_pixel_format(pfobj);
|
||||
|
||||
@@ -235,8 +231,8 @@ get_max_size(int *widthresult, int *heightresult)
|
||||
err = apple_cgl.set_current_context(newcontext);
|
||||
|
||||
if (kCGLNoError != err) {
|
||||
printf("set_current_context error in %s: %s\n", __func__,
|
||||
apple_cgl.error_string(err));
|
||||
DebugMessageF("set_current_context error in %s: %s\n", __func__,
|
||||
apple_cgl.error_string(err));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
+5
-9
@@ -621,16 +621,12 @@ __glXInitializeVisualConfigFromTags(struct glx_config * config, int count,
|
||||
case None:
|
||||
i = count;
|
||||
break;
|
||||
default:
|
||||
if(env_var_as_boolean("LIBGL_DIAGNOSTIC", false)) {
|
||||
long int tagvalue = *bp++;
|
||||
fprintf(stderr, "WARNING: unknown GLX tag from server: "
|
||||
"tag 0x%lx value 0x%lx\n", tag, tagvalue);
|
||||
} else {
|
||||
/* Ignore the unrecognized tag's value */
|
||||
bp++;
|
||||
default: {
|
||||
long int tagvalue = *bp++;
|
||||
DebugMessageF("WARNING: unknown GLX tag from server: "
|
||||
"tag 0x%lx value 0x%lx\n", tag, tagvalue);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user