glx: turn LIBGL_DIAGNOSTIC into a boolean
Instead of setting based on set/unset, allow users to use boolean values. Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
This commit is contained in:
parent
6ea8db5b4c
commit
f4a9d205d8
|
@ -99,6 +99,7 @@ libglx_la_SOURCES = \
|
||||||
|
|
||||||
libglx_la_LIBADD = \
|
libglx_la_LIBADD = \
|
||||||
$(top_builddir)/src/loader/libloader.la \
|
$(top_builddir)/src/loader/libloader.la \
|
||||||
|
$(top_builddir)/src/util/libmesautil.la \
|
||||||
$(top_builddir)/src/util/libxmlconfig.la
|
$(top_builddir)/src/util/libxmlconfig.la
|
||||||
|
|
||||||
if HAVE_DRISW
|
if HAVE_DRISW
|
||||||
|
|
|
@ -29,6 +29,7 @@ env.Append(CPPDEFINES = [
|
||||||
|
|
||||||
env.Prepend(LIBS = [
|
env.Prepend(LIBS = [
|
||||||
libloader,
|
libloader,
|
||||||
|
mesautil,
|
||||||
glapi
|
glapi
|
||||||
])
|
])
|
||||||
|
|
||||||
|
|
|
@ -55,6 +55,8 @@
|
||||||
#include "apple_cgl.h"
|
#include "apple_cgl.h"
|
||||||
#include "apple_glx_drawable.h"
|
#include "apple_glx_drawable.h"
|
||||||
|
|
||||||
|
#include "util/debug.h"
|
||||||
|
|
||||||
static pthread_mutex_t context_lock = PTHREAD_MUTEX_INITIALIZER;
|
static pthread_mutex_t context_lock = PTHREAD_MUTEX_INITIALIZER;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -181,7 +183,7 @@ apple_glx_create_context(void **ptr, Display * dpy, int screen,
|
||||||
*x11errorptr = false;
|
*x11errorptr = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (getenv("LIBGL_DIAGNOSTIC"))
|
if (env_var_as_boolean("LIBGL_DIAGNOSTIC", false))
|
||||||
fprintf(stderr, "error: %s\n", apple_cgl.error_string(error));
|
fprintf(stderr, "error: %s\n", apple_cgl.error_string(error));
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -36,12 +36,13 @@
|
||||||
#include <inttypes.h>
|
#include <inttypes.h>
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
#include "apple_glx_log.h"
|
#include "apple_glx_log.h"
|
||||||
|
#include "util/debug.h"
|
||||||
|
|
||||||
static bool diagnostic = false;
|
static bool diagnostic = false;
|
||||||
static aslclient aslc;
|
static aslclient aslc;
|
||||||
|
|
||||||
void apple_glx_log_init(void) {
|
void apple_glx_log_init(void) {
|
||||||
if (getenv("LIBGL_DIAGNOSTIC")) {
|
if (env_var_as_boolean("LIBGL_DIAGNOSTIC", false)) {
|
||||||
diagnostic = true;
|
diagnostic = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -40,12 +40,14 @@
|
||||||
#include "apple_glx_context.h"
|
#include "apple_glx_context.h"
|
||||||
#include "apple_glx_drawable.h"
|
#include "apple_glx_drawable.h"
|
||||||
|
|
||||||
|
#include <stdbool.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include "apple_glx.h"
|
#include "apple_glx.h"
|
||||||
#include "glxconfig.h"
|
#include "glxconfig.h"
|
||||||
#include "apple_cgl.h"
|
#include "apple_cgl.h"
|
||||||
|
#include "util/debug.h"
|
||||||
|
|
||||||
/* mesa defines in glew.h, Apple in glext.h.
|
/* mesa defines in glew.h, Apple in glext.h.
|
||||||
* Due to namespace nightmares, just do it here.
|
* Due to namespace nightmares, just do it here.
|
||||||
|
@ -208,7 +210,7 @@ get_max_size(int *widthresult, int *heightresult)
|
||||||
|
|
||||||
err = apple_cgl.choose_pixel_format(attr, &pfobj, &vsref);
|
err = apple_cgl.choose_pixel_format(attr, &pfobj, &vsref);
|
||||||
if (kCGLNoError != err) {
|
if (kCGLNoError != err) {
|
||||||
if (getenv("LIBGL_DIAGNOSTIC")) {
|
if (env_var_as_boolean("LIBGL_DIAGNOSTIC", false)) {
|
||||||
printf("choose_pixel_format error in %s: %s\n", __func__,
|
printf("choose_pixel_format error in %s: %s\n", __func__,
|
||||||
apple_cgl.error_string(err));
|
apple_cgl.error_string(err));
|
||||||
}
|
}
|
||||||
|
@ -220,7 +222,7 @@ get_max_size(int *widthresult, int *heightresult)
|
||||||
err = apple_cgl.create_context(pfobj, NULL, &newcontext);
|
err = apple_cgl.create_context(pfobj, NULL, &newcontext);
|
||||||
|
|
||||||
if (kCGLNoError != err) {
|
if (kCGLNoError != err) {
|
||||||
if (getenv("LIBGL_DIAGNOSTIC")) {
|
if (env_var_as_boolean("LIBGL_DIAGNOSTIC", false)) {
|
||||||
printf("create_context error in %s: %s\n", __func__,
|
printf("create_context error in %s: %s\n", __func__,
|
||||||
apple_cgl.error_string(err));
|
apple_cgl.error_string(err));
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,6 +38,8 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
#include <stdbool.h>
|
||||||
|
|
||||||
#include "glxclient.h"
|
#include "glxclient.h"
|
||||||
#include <X11/extensions/Xext.h>
|
#include <X11/extensions/Xext.h>
|
||||||
#include <X11/extensions/extutil.h>
|
#include <X11/extensions/extutil.h>
|
||||||
|
@ -47,6 +49,8 @@
|
||||||
#endif
|
#endif
|
||||||
#include "glxextensions.h"
|
#include "glxextensions.h"
|
||||||
|
|
||||||
|
#include "util/debug.h"
|
||||||
|
|
||||||
#include <X11/Xlib-xcb.h>
|
#include <X11/Xlib-xcb.h>
|
||||||
#include <xcb/xcb.h>
|
#include <xcb/xcb.h>
|
||||||
#include <xcb/glx.h>
|
#include <xcb/glx.h>
|
||||||
|
@ -577,7 +581,7 @@ __glXInitializeVisualConfigFromTags(struct glx_config * config, int count,
|
||||||
i = count;
|
i = count;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
if(getenv("LIBGL_DIAGNOSTIC")) {
|
if(env_var_as_boolean("LIBGL_DIAGNOSTIC", false)) {
|
||||||
long int tagvalue = *bp++;
|
long int tagvalue = *bp++;
|
||||||
fprintf(stderr, "WARNING: unknown GLX tag from server: "
|
fprintf(stderr, "WARNING: unknown GLX tag from server: "
|
||||||
"tag 0x%lx value 0x%lx\n", tag, tagvalue);
|
"tag 0x%lx value 0x%lx\n", tag, tagvalue);
|
||||||
|
|
Loading…
Reference in New Issue