diff options
author | Michel Dänzer <michel@tungstengraphics.com> | 2007-01-19 17:54:03 +0100 |
---|---|---|
committer | Adam Jackson <ajax@benzedrine.nwnk.net> | 2007-01-22 17:52:19 -0500 |
commit | cf7049352009fa013c6da8d21e2242bd2eccfa8f (patch) | |
tree | 1b2b9ed11a28cb41c65dffc2203c9007beeb308a | |
parent | 6b23b12cc81916b3f66ba74f0fd2803aa87a027b (diff) |
__glXDRIscreenProbe: Use drmOpen/CloseOnce.
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=9275 . Based on patch from
Alan Swanson.
(cherry picked from 65f4690ecb4576f60396fcccff8e5bd5d4b6645f commit)
-rw-r--r-- | GL/glx/glxdri.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/GL/glx/glxdri.c b/GL/glx/glxdri.c index 170662c7e..e03570468 100644 --- a/GL/glx/glxdri.c +++ b/GL/glx/glxdri.c @@ -864,6 +864,7 @@ __glXDRIscreenProbe(ScreenPtr pScreen) int api_ver = COPY_SUB_BUFFER_INTERNAL_VERSION; drm_magic_t magic; drmVersionPtr version; + int newlyopened; char *driverName; drm_handle_t hFB; int junk; @@ -914,10 +915,10 @@ __glXDRIscreenProbe(ScreenPtr pScreen) goto handle_error; } - fd = drmOpen(NULL, BusID); + fd = drmOpenOnce(NULL, BusID, &newlyopened); if (fd < 0) { - LogMessage(X_ERROR, "AIGLX error: drmOpen failed (%s)\n", + LogMessage(X_ERROR, "AIGLX error: drmOpenOnce failed (%s)\n", strerror(-fd)); goto handle_error; } @@ -940,7 +941,7 @@ __glXDRIscreenProbe(ScreenPtr pScreen) drm_version.patch = -1; } - if (!DRIAuthConnection(pScreen, magic)) { + if (newlyopened && !DRIAuthConnection(pScreen, magic)) { LogMessage(X_ERROR, "AIGLX error: DRIAuthConnection failed\n"); goto handle_error; } @@ -1082,7 +1083,7 @@ __glXDRIscreenProbe(ScreenPtr pScreen) xfree(dev_priv); if (fd >= 0) - drmClose(fd); + drmCloseOnce(fd); DRICloseConnection(pScreen); |