diff options
author | Michel Dänzer <michel@tungstengraphics.com> | 2007-01-19 17:54:03 +0100 |
---|---|---|
committer | Michel Dänzer <michel@tungstengraphics.com> | 2007-01-19 17:56:06 +0100 |
commit | 65f4690ecb4576f60396fcccff8e5bd5d4b6645f (patch) | |
tree | c53bc9feb13b2cfd5e7b57cb8b38f1ffb6de49c0 /GL/glx/glxdri.c | |
parent | 8b3a591cd39f2d51209dc71b641cac79663e1b16 (diff) |
__glXDRIscreenProbe: Use drmOpen/CloseOnce.
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=9275 . Based on patch from
Alan Swanson.
Diffstat (limited to 'GL/glx/glxdri.c')
-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); |