Roderick Colenbrander : wgl: Add a direct rendering check to new winediag channel.

Alexandre Julliard julliard at winehq.org
Fri Dec 4 09:11:27 CST 2009


Module: wine
Branch: master
Commit: a191184ae9b2c3f7d94fd39c3674066fe79494b7
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=a191184ae9b2c3f7d94fd39c3674066fe79494b7

Author: Roderick Colenbrander <thunderbird2k at gmail.com>
Date:   Thu Dec  3 21:12:26 2009 +0100

wgl: Add a direct rendering check to new winediag channel.

---

 dlls/winex11.drv/opengl.c |   21 +++++++++++++++++++++
 1 files changed, 21 insertions(+), 0 deletions(-)

diff --git a/dlls/winex11.drv/opengl.c b/dlls/winex11.drv/opengl.c
index 19e3fe3..aadb7f1 100644
--- a/dlls/winex11.drv/opengl.c
+++ b/dlls/winex11.drv/opengl.c
@@ -29,12 +29,20 @@
 #include <stdlib.h>
 #include <string.h>
 
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_SYS_UN_H
+#include <sys/un.h>
+#endif
+
 #include "x11drv.h"
 #include "winternl.h"
 #include "wine/library.h"
 #include "wine/debug.h"
 
 WINE_DEFAULT_DEBUG_CHANNEL(wgl);
+WINE_DECLARE_DEBUG_CHANNEL(winediag);
 
 #ifdef SONAME_LIBGL
 
@@ -351,6 +359,19 @@ static BOOL X11DRV_WineGL_InitOpenglInfo(void)
     TRACE("Client GLX vendor:     : %s.\n", WineGLInfo.glxClientVendor);
     TRACE("Direct rendering enabled: %s\n", WineGLInfo.glxDirect ? "True" : "False");
 
+    if(!WineGLInfo.glxDirect)
+    {
+        int fd = ConnectionNumber(gdi_display);
+        struct sockaddr_un uaddr;
+        unsigned int uaddrlen = sizeof(struct sockaddr_un);
+
+        /* In general indirect rendering on a local X11 server indicates a driver problem.
+         * Detect a local X11 server by checking whether the X11 socket is a Unix socket.
+         */
+        if(!getsockname(fd, &uaddr, &uaddrlen) && uaddr.sun_family == AF_UNIX)
+            ERR_(winediag)("Direct rendering is disabled, most likely your OpenGL drivers haven't been installed correctly\n");
+    }
+
     if(vis) XFree(vis);
     if(ctx) {
         pglXMakeCurrent(gdi_display, None, NULL);    




More information about the wine-cvs mailing list