summaryrefslogtreecommitdiff
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
parent5449634e3c9428005aba5b3322ced7e86c62f185 (diff)
Improve error logging.
-rw-r--r--ChangeLog4
-rw-r--r--GL/glx/glxdri.c44
2 files changed, 21 insertions, 27 deletions
diff --git a/ChangeLog b/ChangeLog
index 8836cb6ce..15f4ca66d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2006-03-22 Kristian Høgsberg <krh@redhat.com>
+
+ * GL/glx/glxdri.c (__glXDRIscreenProbe): Improve error logging.
+
Wed Mar 22 16:28:46 2006 Søren Sandmann <sandmann@redhat.com>
* fb/fbmmx.c (fbCopyAreammx): Use inline assembly for copy area,
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;