From b46e359f583e73bec9b4531c3243e93bd46196f3 Mon Sep 17 00:00:00 2001 From: Michel Dänzer Date: Wed, 6 Dec 2006 14:54:43 +0100 Subject: glxinfo: When direct rendering is not enabled, print some hints. If indirect rendering is forced, say how. Otherwise, suggest setting LIBGL_DEBUG=verbose. Inspired by http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=379323 . --- progs/xdemos/glxinfo.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'progs/xdemos/glxinfo.c') diff --git a/progs/xdemos/glxinfo.c b/progs/xdemos/glxinfo.c index fdd1c0523f6..a1aca5ad31e 100644 --- a/progs/xdemos/glxinfo.c +++ b/progs/xdemos/glxinfo.c @@ -456,7 +456,19 @@ print_screen_info(Display *dpy, int scrnum, Bool allowDirect, GLboolean limits) } printf("display: %s screen: %d\n", displayName, scrnum); free(displayName); - printf("direct rendering: %s\n", glXIsDirect(dpy, ctx) ? "Yes" : "No"); + printf("direct rendering: "); + if (glXIsDirect(dpy, ctx)) { + printf("Yes\n"); + } else { + if (!allowDirect) { + printf("No (-i specified)\n"); + } else if (getenv("LIBGL_ALWAYS_INDIRECT")) { + printf("No (LIBGL_ALWAYS_INDIRECT set)\n"); + } else { + printf("No (If you want to find out why, try setting " + "LIBGL_DEBUG=verbose)\n"); + } + } printf("server glx vendor string: %s\n", serverVendor); printf("server glx version string: %s\n", serverVersion); printf("server glx extensions:\n"); -- cgit v1.2.3 From 73eee2402eec80b745141689ecff2d4ecf36035e Mon Sep 17 00:00:00 2001 From: Brian Date: Wed, 13 Dec 2006 08:30:26 -0700 Subject: Use XDisplayName() when reporting errors (bug 8079). --- progs/xdemos/glthreads.c | 2 +- progs/xdemos/glxcontexts.c | 4 ++-- progs/xdemos/glxgears_fbconfig.c | 2 +- progs/xdemos/glxheads.c | 2 +- progs/xdemos/glxinfo.c | 2 +- progs/xdemos/glxswapcontrol.c | 2 +- progs/xdemos/manywin.c | 2 +- progs/xdemos/opencloseopen.c | 2 +- progs/xdemos/pbinfo.c | 2 +- progs/xdemos/yuvrect_client.c | 2 +- 10 files changed, 11 insertions(+), 11 deletions(-) (limited to 'progs/xdemos/glxinfo.c') diff --git a/progs/xdemos/glthreads.c b/progs/xdemos/glthreads.c index 83413383dd4..989697fbcaa 100644 --- a/progs/xdemos/glthreads.c +++ b/progs/xdemos/glthreads.c @@ -473,7 +473,7 @@ main(int argc, char *argv[]) dpy = XOpenDisplay(displayName); if (!dpy) { - fprintf(stderr, "Unable to open display %s\n", displayName); + fprintf(stderr, "Unable to open display %s\n", XDisplayName(displayName)); return -1; } } diff --git a/progs/xdemos/glxcontexts.c b/progs/xdemos/glxcontexts.c index fbc296ef625..a9ff326ed5e 100644 --- a/progs/xdemos/glxcontexts.c +++ b/progs/xdemos/glxcontexts.c @@ -587,8 +587,8 @@ main(int argc, char *argv[]) dpy = XOpenDisplay(dpyName); if (!dpy) { - printf("Error: couldn't open display %s\n", - dpyName ? dpyName : getenv("DISPLAY")); + fprintf(stderr, "Error: couldn't open display %s\n", + XDisplayName(dpyName)); return -1; } diff --git a/progs/xdemos/glxgears_fbconfig.c b/progs/xdemos/glxgears_fbconfig.c index acbadd21ac5..2dac00b75d1 100644 --- a/progs/xdemos/glxgears_fbconfig.c +++ b/progs/xdemos/glxgears_fbconfig.c @@ -575,7 +575,7 @@ main(int argc, char *argv[]) dpy = XOpenDisplay(dpyName); if (!dpy) { - printf("Error: couldn't open display %s\n", dpyName); + printf("Error: couldn't open display %s\n", XDisplayName(dpyName)); return -1; } diff --git a/progs/xdemos/glxheads.c b/progs/xdemos/glxheads.c index 0145a70e91c..b3290e90d51 100644 --- a/progs/xdemos/glxheads.c +++ b/progs/xdemos/glxheads.c @@ -57,7 +57,7 @@ static int NumHeads = 0; static void Error(const char *display, const char *msg) { - fprintf(stderr, "Error on display %s - %s\n", display, msg); + fprintf(stderr, "Error on display %s - %s\n", XDisplayName(display), msg); exit(1); } diff --git a/progs/xdemos/glxinfo.c b/progs/xdemos/glxinfo.c index a1aca5ad31e..3e8e0be5203 100644 --- a/progs/xdemos/glxinfo.c +++ b/progs/xdemos/glxinfo.c @@ -939,7 +939,7 @@ main(int argc, char *argv[]) dpy = XOpenDisplay(displayName); if (!dpy) { - fprintf(stderr, "Error: unable to open display %s\n", displayName); + fprintf(stderr, "Error: unable to open display %s\n", XDisplayName(displayName)); return -1; } diff --git a/progs/xdemos/glxswapcontrol.c b/progs/xdemos/glxswapcontrol.c index 0ed5ebe4722..d9be984be57 100644 --- a/progs/xdemos/glxswapcontrol.c +++ b/progs/xdemos/glxswapcontrol.c @@ -749,7 +749,7 @@ main(int argc, char *argv[]) dpy = XOpenDisplay(dpyName); if (!dpy) { - printf("Error: couldn't open display %s\n", dpyName); + printf("Error: couldn't open display %s\n", XDisplayName(dpyName)); return -1; } diff --git a/progs/xdemos/manywin.c b/progs/xdemos/manywin.c index c9cca751341..cfea555210a 100644 --- a/progs/xdemos/manywin.c +++ b/progs/xdemos/manywin.c @@ -59,7 +59,7 @@ static GLuint TexObj = 0; static void Error(const char *display, const char *msg) { - fprintf(stderr, "Error on display %s - %s\n", display, msg); + fprintf(stderr, "Error on display %s - %s\n", XDisplayName(display), msg); exit(1); } diff --git a/progs/xdemos/opencloseopen.c b/progs/xdemos/opencloseopen.c index 2e4de24c71d..0b8d0618431 100644 --- a/progs/xdemos/opencloseopen.c +++ b/progs/xdemos/opencloseopen.c @@ -91,7 +91,7 @@ make_window( const char * dpyName, const char *name, dpy = XOpenDisplay(dpyName); if (!dpy) { - printf("Error: couldn't open display %s\n", dpyName); + printf("Error: couldn't open display %s\n", XDisplayName(dpyName)); exit(1); } diff --git a/progs/xdemos/pbinfo.c b/progs/xdemos/pbinfo.c index 88d93c8da62..b43adf1bb70 100644 --- a/progs/xdemos/pbinfo.c +++ b/progs/xdemos/pbinfo.c @@ -95,7 +95,7 @@ main(int argc, char *argv[]) dpy = XOpenDisplay(dpyName); if (!dpy) { - printf("Error: couldn't open display %s\n", dpyName ? dpyName : ":0"); + printf("Error: couldn't open display %s\n", XDisplayName(dpyName)); return 1; } diff --git a/progs/xdemos/yuvrect_client.c b/progs/xdemos/yuvrect_client.c index 48f82cb7599..e2b79a7c0e1 100644 --- a/progs/xdemos/yuvrect_client.c +++ b/progs/xdemos/yuvrect_client.c @@ -296,7 +296,7 @@ main(int argc, char *argv[]) dpy = XOpenDisplay(dpyName); if (!dpy) { printf("Error: couldn't open display %s\n", - dpyName ? dpyName : getenv("DISPLAY")); + XDisplayName(dpyName)); return -1; } -- cgit v1.2.3