summaryrefslogtreecommitdiff
path: root/GL/glx
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@redhat.com>2006-03-22 22:49:52 +0000
committerKristian Høgsberg <krh@redhat.com>2006-03-22 22:49:52 +0000
commit6d2896b384e17512e8f12036daabcd575d21f804 (patch)
tree99c4bc3dab851dd7411d84136a9f287b4460ef51 /GL/glx
parent5449634e3c9428005aba5b3322ced7e86c62f185 (diff)
Improve error logging.
Diffstat (limited to 'GL/glx')
-rw-r--r--GL/glx/glxdri.c44
1 files changed, 17 insertions, 27 deletions
diff --git a/GL/glx/glxdri.c b/GL/glx/glxdri.c
index 0760290a1..9e5c6b019 100644
--- a/GL/glx/glxdri.c
+++ b/GL/glx/glxdri.c
@@ -712,8 +712,6 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
__DRIframebuffer framebuffer;
int fd = -1;
int status;
- const char *err_msg;
- const char *err_extra = NULL;
int api_ver = INTERNAL_VERSION;
drm_magic_t magic;
drmVersionPtr version;
@@ -750,21 +748,20 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
framebuffer.dev_priv = NULL;
if (!DRIOpenConnection(pScreen, &hSAREA, &BusID)) {
- err_msg = "DRIOpenConnection";
- err_extra = NULL;
+ LogMessage(X_ERROR, "AIGLX error: DRIOpenConnection failed\n");
goto handle_error;
}
fd = drmOpen(NULL, BusID);
if (fd < 0) {
- err_msg = "open DRM";
- err_extra = strerror( -fd );
+ LogMessage(X_ERROR, "AIGLX error: drmOpen failed (%s)\n",
+ strerror(-fd));
goto handle_error;
}
if (drmGetMagic(fd, &magic)) {
- err_msg = "drmGetMagic";
+ LogMessage(X_ERROR, "AIGLX error: drmGetMagic failed\n");
goto handle_error;
}
@@ -782,7 +779,7 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
}
if (!DRIAuthConnection(pScreen, magic)) {
- err_msg = "DRIAuthConnection";
+ LogMessage(X_ERROR, "AIGLX error: DRIAuthConnection failed\n");
goto handle_error;
}
@@ -794,7 +791,7 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
&ddx_version.minor,
&ddx_version.patch,
&driverName)) {
- err_msg = "DRIGetClientDriverName";
+ LogMessage(X_ERROR, "AIGLX error: DRIGetClientDriverName failed\n");
goto handle_error;
}
@@ -803,15 +800,15 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
screen->driver = dlopen(filename, RTLD_LAZY | RTLD_LOCAL);
if (screen->driver == NULL) {
- err_msg = "Loading driver";
- err_extra = filename;
+ LogMessage(X_ERROR, "AIGLX error: dlopen of %s failed (%s)\n",
+ filename, dlerror());
goto handle_error;
}
createNewScreen = dlsym(screen->driver, CREATE_NEW_SCREEN_FUNC);
if (createNewScreen == NULL) {
- err_msg = "Driver entry point lookup";
- err_extra = CREATE_NEW_SCREEN_FUNC;
+ LogMessage(X_ERROR, "AIGLX error: dlsym for %s failed (%s)\n",
+ CREATE_NEW_SCREEN_FUNC, dlerror());
goto handle_error;
}
@@ -824,7 +821,7 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
if (!DRIGetDeviceInfo(pScreen, &hFB, &junk,
&framebuffer.size, &framebuffer.stride,
&framebuffer.dev_priv_size, &framebuffer.dev_priv)) {
- err_msg = "XF86DRIGetDeviceInfo";
+ LogMessage(X_ERROR, "AIGLX error: XF86DRIGetDeviceInfo failed");
goto handle_error;
}
@@ -835,7 +832,7 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
* do... */
dev_priv = xalloc(framebuffer.dev_priv_size);
if (dev_priv == NULL) {
- err_msg = "dev_priv allocation";
+ LogMessage(X_ERROR, "AIGLX error: dev_priv allocation failed");
goto handle_error;
}
memcpy(dev_priv, framebuffer.dev_priv, framebuffer.dev_priv_size);
@@ -848,8 +845,8 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
status = drmMap(fd, hFB, framebuffer.size,
(drmAddressPtr)&framebuffer.base);
if (status != 0) {
- err_msg = "drmMap of framebuffer";
- err_extra = strerror( -status );
+ LogMessage(X_ERROR, "AIGLX error: drmMap of framebuffer failed (%s)",
+ strerror(-status));
goto handle_error;
}
@@ -858,8 +855,8 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
*/
status = drmMap(fd, hSAREA, SAREA_MAX, &pSAREA);
if (status != 0) {
- err_msg = "drmMap of sarea";
- err_extra = strerror( -status );
+ LogMessage(X_ERROR, "AIGLX error: drmMap of SAREA failed (%s)",
+ strerror(-status));
goto handle_error;
}
@@ -879,8 +876,7 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
&driver_modes);
if (screen->driScreen.private == NULL) {
- err_msg = "InitDriver";
- err_extra = NULL;
+ LogMessage(X_ERROR, "AIGLX error: Calling driver entry point failed");
goto handle_error;
}
@@ -916,12 +912,6 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
xfree(screen);
- if (err_extra != NULL)
- LogMessage(X_ERROR,
- "AIGLX error: %s failed (%s)\n", err_msg, err_extra);
- else
- LogMessage(X_ERROR, "AIGLX error: %s failed\n", err_msg);
-
LogMessage(X_ERROR, "GLX-DRI: reverting to software rendering\n");
return NULL;