From 3873be16d050ab12fc78f1e7f0c36c2ac88d0a98 Mon Sep 17 00:00:00 2001 From: Jon TURNEY Date: Mon, 11 Oct 2010 16:21:40 +0100 Subject: [PATCH 01/12] hw/xwin/glx: Fix fbconfig dumper formatting for 3 digit index numbers Some graphics hardware supports hundreds of pixel formats, so adjust formatting in fbconfig dumper for 3 digit index numbers Also report the PFD_SUPPORT_DIRECTDRAW, PFD_DIRECT3D_ACCELERATED and PFD_SUPPORT_COMPOSITION flags introduced with aero Reviewed-by: Colin Harrison Signed-off-by: Jon TURNEY --- hw/xwin/glx/indirect.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/hw/xwin/glx/indirect.c b/hw/xwin/glx/indirect.c index bd2a1ad30..720b2f00c 100644 --- a/hw/xwin/glx/indirect.c +++ b/hw/xwin/glx/indirect.c @@ -80,6 +80,17 @@ #define NUM_ELEMENTS(x) (sizeof(x)/ sizeof(x[1])) +/* Not yet in w32api */ +#ifndef PFD_SUPPORT_DIRECTDRAW +#define PFD_SUPPORT_DIRECTDRAW 0x00002000 +#endif +#ifndef PFD_DIRECT3D_ACCELERATED +#define PFD_DIRECT3D_ACCELERATED 0x00004000 +#endif +#ifndef PFD_SUPPORT_COMPOSITION +#define PFD_SUPPORT_COMPOSITION 0x00008000 +#endif + /* ---------------------------------------------------------------------- */ /* * structure definitions @@ -247,6 +258,9 @@ static void pfdOut(const PIXELFORMATDESCRIPTOR *pfd) DUMP_PFD_FLAG(PFD_SWAP_COPY); DUMP_PFD_FLAG(PFD_SWAP_LAYER_BUFFERS); DUMP_PFD_FLAG(PFD_GENERIC_ACCELERATED); + DUMP_PFD_FLAG(PFD_SUPPORT_DIRECTDRAW); + DUMP_PFD_FLAG(PFD_DIRECT3D_ACCELERATED); + DUMP_PFD_FLAG(PFD_SUPPORT_COMPOSITION); DUMP_PFD_FLAG(PFD_DEPTH_DONTCARE); DUMP_PFD_FLAG(PFD_DOUBLEBUFFER_DONTCARE); DUMP_PFD_FLAG(PFD_STEREO_DONTCARE); @@ -328,7 +342,7 @@ fbConfigsDump(unsigned int n, __GLXconfig *c) { unsigned int i = ((GLXWinConfig *)c)->pixelFormatIndex; - ErrorF("%3d %2x %2x " + ErrorF("%3d %3x %3x " "%-11s" " %3d %3d %s %s %s %s %s " "%2d %2d %2d %2d " From eecc8e06eb4bdfd4354144206d990cd9ccb69721 Mon Sep 17 00:00:00 2001 From: Jon TURNEY Date: Sat, 30 Oct 2010 17:22:33 +0100 Subject: [PATCH 02/12] hw/xwin/glx: Improvements to glxWinErrorMessage() reporting in WGL GLX provider Request the message using languageID 0 (best effort), rather than only using language neutral messages Always report the numeric error code. Trim any trailing \r from FormatMessage() output Reviewed-by: Colin Harrison Signed-off-by: Jon TURNEY --- hw/xwin/glx/indirect.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/hw/xwin/glx/indirect.c b/hw/xwin/glx/indirect.c index 720b2f00c..32322998c 100644 --- a/hw/xwin/glx/indirect.c +++ b/hw/xwin/glx/indirect.c @@ -211,22 +211,25 @@ static const char *glxWinErrorMessage(void) { static char errorbuffer[1024]; + unsigned int last_error = GetLastError(); if (!FormatMessage( - FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, + FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS | FORMAT_MESSAGE_MAX_WIDTH_MASK, NULL, - GetLastError(), - MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), + last_error, + 0, (LPTSTR) &errorbuffer, sizeof(errorbuffer), NULL )) { - snprintf(errorbuffer, sizeof(errorbuffer), "Unknown error in FormatMessage: %08x!", (unsigned)GetLastError()); + snprintf(errorbuffer, sizeof(errorbuffer), "Unknown error"); } - if (errorbuffer[strlen(errorbuffer)-1] == '\n') + if ((errorbuffer[strlen(errorbuffer)-1] == '\n') || (errorbuffer[strlen(errorbuffer)-1] == '\r')) errorbuffer[strlen(errorbuffer)-1] = 0; + sprintf(errorbuffer + strlen(errorbuffer), " (%08x)", last_error); + return errorbuffer; } From 8216316867f07819b8e8b377f2633fbf8876abf7 Mon Sep 17 00:00:00 2001 From: Jon TURNEY Date: Sat, 30 Oct 2010 17:23:52 +0100 Subject: [PATCH 03/12] hw/xwin/glx: Better handling of SetPixelFormat() failure Propagate and report the failure if SetPixelFormat() fails Reviewed-by: Colin Harrison Signed-off-by: Jon TURNEY --- hw/xwin/glx/indirect.c | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/hw/xwin/glx/indirect.c b/hw/xwin/glx/indirect.c index 32322998c..ea4f97bf7 100644 --- a/hw/xwin/glx/indirect.c +++ b/hw/xwin/glx/indirect.c @@ -987,7 +987,7 @@ int glxWinReleaseTexImage(__GLXcontext *baseContext, * lists with the old one... */ -static void +static Bool glxWinSetPixelFormat(__GLXWinContext *gc, HDC hdc, int bppOverride, int drawableTypeOverride) { __GLXscreen *screen = gc->base.pGlxScreen; @@ -1009,10 +1009,10 @@ glxWinSetPixelFormat(__GLXWinContext *gc, HDC hdc, int bppOverride, int drawable if (!SetPixelFormat(hdc, winConfig->pixelFormatIndex, NULL)) { ErrorF("SetPixelFormat error: %s\n", glxWinErrorMessage()); - return; + return FALSE; } - return; + return TRUE; } /* @@ -1044,7 +1044,7 @@ glxWinSetPixelFormat(__GLXWinContext *gc, HDC hdc, int bppOverride, int drawable if (fbConfigToPixelFormat(gc->base.config, &pfd, drawableTypeOverride)) { ErrorF("glxWinSetPixelFormat: fbConfigToPixelFormat failed\n"); - return; + return FALSE; } if (glxWinDebugSettings.dumpPFD) @@ -1060,7 +1060,7 @@ glxWinSetPixelFormat(__GLXWinContext *gc, HDC hdc, int bppOverride, int drawable if (pixelFormat == 0) { ErrorF("ChoosePixelFormat error: %s\n", glxWinErrorMessage()); - return; + return FALSE; } GLWIN_DEBUG_MSG("ChoosePixelFormat: chose pixelFormatIndex %d", pixelFormat); @@ -1069,7 +1069,7 @@ glxWinSetPixelFormat(__GLXWinContext *gc, HDC hdc, int bppOverride, int drawable if (!SetPixelFormat(hdc, pixelFormat, &pfd)) { ErrorF("SetPixelFormat error: %s\n", glxWinErrorMessage()); - return; + return FALSE; } } else @@ -1078,7 +1078,7 @@ glxWinSetPixelFormat(__GLXWinContext *gc, HDC hdc, int bppOverride, int drawable if (pixelFormat == 0) { ErrorF("wglChoosePixelFormat error: %s\n", glxWinErrorMessage()); - return; + return FALSE; } GLWIN_DEBUG_MSG("wglChoosePixelFormat: chose pixelFormatIndex %d", pixelFormat); @@ -1087,9 +1087,11 @@ glxWinSetPixelFormat(__GLXWinContext *gc, HDC hdc, int bppOverride, int drawable if (!SetPixelFormat(hdc, pixelFormat, NULL)) { ErrorF("SetPixelFormat error: %s\n", glxWinErrorMessage()); - return; + return FALSE; } } + + return TRUE; } static HDC @@ -1140,7 +1142,13 @@ glxWinMakeDC(__GLXWinContext *gc, __GLXWinDrawable *draw, HDC *hdc, HWND *hwnd) gc->hwnd = *hwnd; /* We must select a pixelformat, but SetPixelFormat can only be called once for a window... */ - glxWinSetPixelFormat(gc, *hdc, 0, GLX_WINDOW_BIT); + if (!glxWinSetPixelFormat(gc, *hdc, 0, GLX_WINDOW_BIT)) + { + ErrorF("glxWinSetPixelFormat error: %s\n", glxWinErrorMessage()); + ReleaseDC(*hwnd, *hdc); + *hdc = NULL; + return NULL; + } } } break; From 9915b169237e3b2d817bd3d4455f3c01dd7dd2b5 Mon Sep 17 00:00:00 2001 From: Jon TURNEY Date: Mon, 1 Nov 2010 19:53:42 +0000 Subject: [PATCH 04/12] hw/xwin/glx: Don't spam log with wglwrap symbol resolution status at startup ... instead just log if an attempt is made to call a wrapper for a function which didn't resolve Reviewed-by: Colin Harrison Signed-off-by: Jon TURNEY --- hw/xwin/glx/wgl_ext_api.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/hw/xwin/glx/wgl_ext_api.c b/hw/xwin/glx/wgl_ext_api.c index 1020916dc..78b6e2a02 100644 --- a/hw/xwin/glx/wgl_ext_api.c +++ b/hw/xwin/glx/wgl_ext_api.c @@ -43,17 +43,14 @@ static type type##proc = NULL; #define PRERESOLVE(type, symbol) \ - type##proc = (type)wglGetProcAddress(symbol); \ - if (type##proc == NULL) \ - ErrorF("wglwrap: Can't resolve \"%s\"\n", symbol); \ - else \ - ErrorF("wglwrap: Resolved \"%s\"\n", symbol); + type##proc = (type)wglGetProcAddress(symbol); #define RESOLVE_RET(type, symbol, retval) \ if (type##proc == NULL) { \ - __glXErrorCallBack(0); \ - return retval; \ - } + ErrorF("wglwrap: Can't resolve \"%s\"\n", symbol); \ + __glXErrorCallBack(0); \ + return retval; \ + } #define RESOLVE(procname, symbol) RESOLVE_RET(procname, symbol,) From b67e80c84e4af54007aa1bd1e4a97a4d1b3d3765 Mon Sep 17 00:00:00 2001 From: Jon TURNEY Date: Mon, 24 Jan 2011 18:41:05 +0000 Subject: [PATCH 05/12] hw/xwin/glx: Handle failure to get any fbconfigs more gracefully. Handle failure to get any useful pixel formats for GLX fbconfigs more gracefully: If we didn't get any useful pixel formats from wglGetPixelFormatAttribivARB(), fall back to using DescribePixelFormat(). If that doesn't give us any useful pixel formats, fallback to software rendering. This works around a problem with Intel 845G drivers, where wglGetPixelFormatAttribivARB() doesn't seem to work as we expect it to... Reviewed-by: Colin Harrison Signed-off-by: Jon TURNEY --- hw/xwin/glx/indirect.c | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/hw/xwin/glx/indirect.c b/hw/xwin/glx/indirect.c index ea4f97bf7..478e0ec1a 100644 --- a/hw/xwin/glx/indirect.c +++ b/hw/xwin/glx/indirect.c @@ -668,17 +668,37 @@ glxWinScreenProbe(ScreenPtr pScreen) screen->base.swapInterval = glxWinScreenSwapInterval; screen->base.pScreen = pScreen; + // Creating the fbConfigs initializes screen->base.fbconfigs and screen->base.numFBConfigs if (strstr(wgl_extensions, "WGL_ARB_pixel_format")) { glxWinCreateConfigsExt(hdc, screen); - screen->has_WGL_ARB_pixel_format = TRUE; + + /* + Some graphics drivers appear to advertise WGL_ARB_pixel_format, + but it doesn't work usefully, so we have to be prepared for it + to fail and fall back to using DescribePixelFormat() + */ + if (screen->base.numFBConfigs > 0) + { + screen->has_WGL_ARB_pixel_format = TRUE; + } } - else + + if (screen->base.numFBConfigs <= 0) { glxWinCreateConfigs(hdc, screen); screen->has_WGL_ARB_pixel_format = FALSE; } - // Initializes screen->base.fbconfigs and screen->base.numFBConfigs + + /* + If we still didn't get any fbConfigs, we can't provide GLX for this screen + */ + if (screen->base.numFBConfigs <= 0) + { + free(screen); + LogMessage(X_ERROR,"AIGLX: No fbConfigs could be made from native OpenGL pixel formats\n"); + return NULL; + } /* These will be set by __glXScreenInit */ screen->base.visuals = NULL; From 98c6d91a48f460fdbca93700ab637eadf946fb0e Mon Sep 17 00:00:00 2001 From: Colin Harrison Date: Thu, 24 Mar 2011 20:39:51 +0000 Subject: [PATCH 06/12] hw/xwin/glx: Fix some warnings in generated wrapper code Add a suitable cast to the generated code for glWinSetupDispatchTable() so it doesn't generate screeds of warnings Reviewed-by: Jon TURNEY Signed-off-by: Jon TURNEY --- hw/xwin/glx/gen_gl_wrappers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/xwin/glx/gen_gl_wrappers.py b/hw/xwin/glx/gen_gl_wrappers.py index d7fe98dec..e2d960ec6 100755 --- a/hw/xwin/glx/gen_gl_wrappers.py +++ b/hw/xwin/glx/gen_gl_wrappers.py @@ -312,7 +312,7 @@ if dispatchheader : for d in sorted(dispatch.keys()) : if wrappers.has_key(d) : - print ' SET_'+ d + '(disp, ' + prefix + d + 'Wrapper);' + print ' SET_'+ d + '(disp, (void *)' + prefix + d + 'Wrapper);' else : print '#warning No wrapper for ' + prefix + d + ' !' From b0b54338e2f8aed6e6a683ebddd2a2acbefabecd Mon Sep 17 00:00:00 2001 From: Jon TURNEY Date: Mon, 11 Oct 2010 16:25:03 +0100 Subject: [PATCH 07/12] hw/xwin: Add a flag to track which windows have been drawn to using WGL. Reviewed-by: Colin Harrison Signed-off-by: Jon TURNEY --- hw/xwin/glx/Makefile.am | 6 +++++- hw/xwin/glx/winpriv.c | 3 +++ hw/xwin/winmultiwindowwindow.c | 10 +++++++++- hw/xwin/winmultiwindowwndproc.c | 14 ++++++++++++++ hw/xwin/winwindow.h | 3 +++ 5 files changed, 34 insertions(+), 2 deletions(-) diff --git a/hw/xwin/glx/Makefile.am b/hw/xwin/glx/Makefile.am index cdcba35c9..6b840bacb 100644 --- a/hw/xwin/glx/Makefile.am +++ b/hw/xwin/glx/Makefile.am @@ -16,7 +16,11 @@ if XWIN_MULTIWINDOWEXTWM DEFS_MULTIWINDOWEXTWM = -DXWIN_MULTIWINDOWEXTWM endif -DEFS = $(DEFS_MULTIWINDOW) $(DEFS_MULTIWINDOWEXTWM) +if XWIN_GLX_WINDOWS +DEFS_GLX_WINDOWS = -DXWIN_GLX_WINDOWS +endif + +DEFS = $(DEFS_MULTIWINDOW) $(DEFS_MULTIWINDOWEXTWM) $(DEFS_GLX_WINDOWS) INCLUDES = -I$(top_srcdir)/miext/rootless diff --git a/hw/xwin/glx/winpriv.c b/hw/xwin/glx/winpriv.c index a35392b26..7772a7569 100644 --- a/hw/xwin/glx/winpriv.c +++ b/hw/xwin/glx/winpriv.c @@ -61,6 +61,9 @@ HWND winGetWindowInfo(WindowPtr pWin) { /* copy window handle */ hwnd = pWinPriv->hWnd; + + /* mark GLX active on that hwnd */ + pWinPriv->fWglUsed = TRUE; } return hwnd; diff --git a/hw/xwin/winmultiwindowwindow.c b/hw/xwin/winmultiwindowwindow.c index 2d9a46e40..2139c7cf5 100644 --- a/hw/xwin/winmultiwindowwindow.c +++ b/hw/xwin/winmultiwindowwindow.c @@ -110,7 +110,10 @@ winCreateWindowMultiWindow (WindowPtr pWin) pWinPriv->hWnd = NULL; pWinPriv->pScreenPriv = winGetScreenPriv(pWin->drawable.pScreen); pWinPriv->fXKilled = FALSE; - +#ifdef XWIN_GLX_WINDOWS + pWinPriv->fWglUsed = FALSE; +#endif + return fResult; } @@ -652,6 +655,11 @@ winDestroyWindowsWindow (WindowPtr pWin) winDestroyIcon(hIcon); winDestroyIcon(hIconSm); +#ifdef XWIN_GLX_WINDOWS + /* No longer note WGL used on this window */ + pWinPriv->fWglUsed = FALSE; +#endif + /* Process all messages on our queue */ while (PeekMessage (&msg, NULL, 0, 0, PM_REMOVE)) { diff --git a/hw/xwin/winmultiwindowwndproc.c b/hw/xwin/winmultiwindowwndproc.c index 1a3be78d5..fb1938b3a 100644 --- a/hw/xwin/winmultiwindowwndproc.c +++ b/hw/xwin/winmultiwindowwndproc.c @@ -472,6 +472,20 @@ winTopLevelWindowProc (HWND hwnd, UINT message, return 0; } +#ifdef XWIN_GLX_WINDOWS + if (pWinPriv->fWglUsed) + { + /* + For regions which are being drawn by GL, the shadow framebuffer doesn't have the + correct bits, so don't bitblt from the shadow framebuffer + + XXX: For now, just leave it alone, but ideally we want to send an expose event to + the window so it really redraws the affected region... + */ + ValidateRect(hwnd, &(ps.rcPaint)); + } + else +#endif /* Try to copy from the shadow buffer */ if (!BitBlt (hdcUpdate, ps.rcPaint.left, ps.rcPaint.top, diff --git a/hw/xwin/winwindow.h b/hw/xwin/winwindow.h index ebe43091f..a6c8e05dd 100644 --- a/hw/xwin/winwindow.h +++ b/hw/xwin/winwindow.h @@ -80,6 +80,9 @@ typedef struct winPrivScreenPtr pScreenPriv; Bool fXKilled; HDWP hDwp; +#ifdef XWIN_GLX_WINDOWS + Bool fWglUsed; +#endif /* Privates used by primary fb DirectDraw server */ LPDDSURFACEDESC pddsdPrimary; From 276735ef5d12e79fe051996f100c5730c1e69334 Mon Sep 17 00:00:00 2001 From: Jon TURNEY Date: Mon, 11 Oct 2010 16:22:49 +0100 Subject: [PATCH 08/12] hw/xwin: Report Window XIDs in Window debug messages Report Window XIDs in Window create/destroy/reparent debug messages It's actually quite useful if you are trying to corrolate those events with what a client is doing... Reviewed-by: Colin Harrison Signed-off-by: Jon TURNEY --- hw/xwin/glx/winpriv.c | 2 +- hw/xwin/winmultiwindowwindow.c | 17 +++++------------ 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/hw/xwin/glx/winpriv.c b/hw/xwin/glx/winpriv.c index 7772a7569..460973730 100644 --- a/hw/xwin/glx/winpriv.c +++ b/hw/xwin/glx/winpriv.c @@ -19,7 +19,7 @@ winCreateWindowsWindow (WindowPtr pWin); */ HWND winGetWindowInfo(WindowPtr pWin) { - winDebug("%s: pWin=%p\n", __FUNCTION__, pWin); + winTrace("%s: pWin %p XID 0x%x\n", __FUNCTION__, pWin, pWin->drawable.id); /* a real window was requested */ if (pWin != NULL) diff --git a/hw/xwin/winmultiwindowwindow.c b/hw/xwin/winmultiwindowwindow.c index 2139c7cf5..2329d163e 100644 --- a/hw/xwin/winmultiwindowwindow.c +++ b/hw/xwin/winmultiwindowwindow.c @@ -375,9 +375,8 @@ winReparentWindowMultiWindow (WindowPtr pWin, WindowPtr pPriorParent) ScreenPtr pScreen = pWin->drawable.pScreen; winScreenPriv(pScreen); -#if CYGMULTIWINDOW_DEBUG - ErrorF ("winReparentMultiWindow - pWin: %08x\n", pWin); -#endif + winDebug("winReparentMultiWindow - pWin:%08x XID:0x%x, reparent from pWin:%08x XID:0x%x to pWin:%08x XID:0x%x\n", + pWin, pWin->drawable.id, pPriorParent, pPriorParent->drawable.id, pWin->parent, pWin->parent->drawable.id); WIN_UNWRAP(ReparentWindow); if (pScreen->ReparentWindow) @@ -501,9 +500,7 @@ winCreateWindowsWindow (WindowPtr pWin) winInitMultiWindowClass(); -#if CYGMULTIWINDOW_DEBUG - ErrorF ("winCreateWindowsWindow - pWin: %08x\n", pWin); -#endif + winDebug("winCreateWindowsTopLevelWindow - pWin:%08x XID:0x%x \n", pWin, pWin->drawable.id); iX = pWin->drawable.x + GetSystemMetrics (SM_XVIRTUALSCREEN); iY = pWin->drawable.y + GetSystemMetrics (SM_YVIRTUALSCREEN); @@ -629,9 +626,7 @@ winDestroyWindowsWindow (WindowPtr pWin) HICON hIcon; HICON hIconSm; -#if CYGMULTIWINDOW_DEBUG - ErrorF ("winDestroyWindowsWindow\n"); -#endif + winDebug("winDestroyWindowsWindow - pWin:%08x XID:0x%x \n", pWin, pWin->drawable.id); /* Bail out if the Windows window handle is invalid */ if (pWinPriv->hWnd == NULL) @@ -671,9 +666,7 @@ winDestroyWindowsWindow (WindowPtr pWin) winInDestroyWindowsWindow = oldstate; -#if CYGMULTIWINDOW_DEBUG - ErrorF ("-winDestroyWindowsWindow\n"); -#endif + winDebug("winDestroyWindowsWindow - done\n"); } From d62726019e4b7bfac8a23d0d733677b141047d66 Mon Sep 17 00:00:00 2001 From: Jon TURNEY Date: Tue, 2 Nov 2010 11:38:53 +0000 Subject: [PATCH 09/12] hw/xwin: Add items to WGL AIGLX todo Reviewed-by: Colin Harrison Signed-off-by: Jon TURNEY --- hw/xwin/glx/indirect.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/hw/xwin/glx/indirect.c b/hw/xwin/glx/indirect.c index 478e0ec1a..235e96b5d 100644 --- a/hw/xwin/glx/indirect.c +++ b/hw/xwin/glx/indirect.c @@ -49,8 +49,17 @@ - pbuffer clobbering: we don't get async notification, but can we arrange to emit the event when we notice it's been clobbered? at the very least, check if it's been clobbered before using it? - - are the __GLXConfig * we get handed back ones we are made (so we can extend the structure - with privates?) Or are they created inside the GLX core as well? + - XGetImage() doesn't work on pixmaps; need to do more work to make the format and location + of the native pixmap compatible + - implement GLX_EXT_texture_from_pixmap in terms of WGL_ARB_render_texture + (not quite straightforward as we will have to create a pbuffer and copy the pixmap texture + into it) +*/ + +/* + Assumptions: + - the __GLXConfig * we get handed back ones we are made (so we can extend the structure + with privates) and never get created inside the GLX core */ /* From 005e68ba59782b60dd5c44a06c75b1fa5e8d70d8 Mon Sep 17 00:00:00 2001 From: Jon TURNEY Date: Thu, 20 Jan 2011 16:21:04 +0000 Subject: [PATCH 10/12] hw/xwin: Add -wgl option to XWin manpage Document the -[no]wgl options in the XWin manpage Reviewed-by: Colin Harrison Signed-off-by: Jon TURNEY --- hw/xwin/man/XWin.man | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hw/xwin/man/XWin.man b/hw/xwin/man/XWin.man index 7975fd30d..6e69a185d 100644 --- a/hw/xwin/man/XWin.man +++ b/hw/xwin/man/XWin.man @@ -208,6 +208,10 @@ Enable or disable the \fICtrl-Alt-Backspace\fP key combination as a signal to exit the X Server. The \fICtrl-Alt-Backspace\fP key combination is disabled by default. .TP 8 +.B \-[no]wgl +Enable [disable] the GLX extension to use the native Windows WGL interface +for hardware accelerated OpenGL (AIGLX). (Experimental) +.TP 8 .B \-[no]winkill Enable or disable the \fIAlt-F4\fP key combination as a signal to exit the X Server. From 42bc198775a78b328612427c4c8ed4d17e005ae9 Mon Sep 17 00:00:00 2001 From: Jon TURNEY Date: Mon, 24 Jan 2011 18:29:41 +0000 Subject: [PATCH 11/12] glx: Remove a few lingering traces of __GLXscreen.GLXVersion The GLXversion member of the __GLXscreen struct is just cruft since commit ad5c0d9efa47476ed5cf75c82265c73919e468b4, when we started returning the minimum GLX version supported by all of the screens on the display, rather than the maximum version supported by the server. Reviewed-by: Jeremy Huddleston Signed-off-by: Jon TURNEY --- glx/glxscreens.h | 1 - hw/dmx/glxProxy/glxscreens.h | 1 - hw/xquartz/GL/indirect.c | 3 ++- hw/xwin/glx/indirect.c | 8 ++------ 4 files changed, 4 insertions(+), 9 deletions(-) diff --git a/glx/glxscreens.h b/glx/glxscreens.h index 93b4109e0..eb2926045 100644 --- a/glx/glxscreens.h +++ b/glx/glxscreens.h @@ -142,7 +142,6 @@ struct __GLXscreen { char *GLextensions; char *GLXvendor; - char *GLXversion; char *GLXextensions; /** diff --git a/hw/dmx/glxProxy/glxscreens.h b/hw/dmx/glxProxy/glxscreens.h index a57c387fe..da50bdc85 100644 --- a/hw/dmx/glxProxy/glxscreens.h +++ b/hw/dmx/glxProxy/glxscreens.h @@ -43,7 +43,6 @@ typedef struct { GLint *isGLXvis; char *GLXvendor; - char *GLXversion; char *GLXextensions; } __GLXscreenInfo; diff --git a/hw/xquartz/GL/indirect.c b/hw/xquartz/GL/indirect.c index 41168729f..4876ab992 100644 --- a/hw/xquartz/GL/indirect.c +++ b/hw/xquartz/GL/indirect.c @@ -477,7 +477,8 @@ static __GLXscreen * __glXAquaScreenProbe(ScreenPtr pScreen) { __glXScreenInit(&screen->base, pScreen); - screen->base.GLXversion = strdup("1.4"); + screen->base.GLXmajor = 1; + screen->base.GLXminor = 4; screen->base.GLXextensions = strdup("GLX_SGIX_fbconfig " "GLX_SGIS_multisample " "GLX_ARB_multisample " diff --git a/hw/xwin/glx/indirect.c b/hw/xwin/glx/indirect.c index 235e96b5d..86fef55d1 100644 --- a/hw/xwin/glx/indirect.c +++ b/hw/xwin/glx/indirect.c @@ -735,30 +735,26 @@ glxWinScreenProbe(ScreenPtr pScreen) // // Override the GLX version (__glXScreenInit() sets it to "1.2") - // if we have all the needed extensionsto operate as a higher version + // if we have all the needed extensions to operate as a higher version // // SGIX_fbconfig && SGIX_pbuffer && SGI_make_current_read -> 1.3 // ARB_multisample -> 1.4 // if (screen->has_WGL_ARB_pbuffer && glx_sgi_make_current_read) { - free(screen->base.GLXversion); - if (screen->has_WGL_ARB_multisample) { - screen->base.GLXversion = strdup("1.4"); screen->base.GLXmajor = 1; screen->base.GLXminor = 4; } else { - screen->base.GLXversion = strdup("1.3"); screen->base.GLXmajor = 1; screen->base.GLXminor = 3; } - LogMessage(X_INFO, "AIGLX: Set GLX version to %s\n", screen->base.GLXversion); } } + LogMessage(X_INFO, "AIGLX: Set GLX version to %d.%d\n", screen->base.GLXmajor, screen->base.GLXminor); wglMakeCurrent(NULL, NULL); wglDeleteContext(hglrc); From af0fbc37e35ddaabf12a8d7abc79ea11958ec8ac Mon Sep 17 00:00:00 2001 From: Gaetan Nadon Date: Thu, 23 Jun 2011 07:45:13 -0400 Subject: [PATCH 12/12] XWinrc: replace hard coded section number with __filemansuffix__ Reviewed-by: Cyril Brulebois Signed-off-by: Gaetan Nadon Signed-off-by: Jon TURNEY --- hw/xwin/man/XWinrc.man | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/xwin/man/XWinrc.man b/hw/xwin/man/XWinrc.man index 5c1fb979b..e4c454fba 100644 --- a/hw/xwin/man/XWinrc.man +++ b/hw/xwin/man/XWinrc.man @@ -1,4 +1,4 @@ -.TH XWIN 5 __vendorversion__ +.TH XWIN __filemansuffix__ __vendorversion__ .SH NAME