aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/hw/xwin/glx/indirect.c
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/hw/xwin/glx/indirect.c')
-rw-r--r--xorg-server/hw/xwin/glx/indirect.c44
1 files changed, 29 insertions, 15 deletions
diff --git a/xorg-server/hw/xwin/glx/indirect.c b/xorg-server/hw/xwin/glx/indirect.c
index 56f677a8f..3f34146e5 100644
--- a/xorg-server/hw/xwin/glx/indirect.c
+++ b/xorg-server/hw/xwin/glx/indirect.c
@@ -398,7 +398,9 @@ fbConfigsDump(unsigned int n, __GLXconfig * c)
static __GLXscreen *glxWinScreenProbe(ScreenPtr pScreen);
static __GLXcontext *glxWinCreateContext(__GLXscreen * screen,
__GLXconfig * modes,
- __GLXcontext * baseShareContext);
+ __GLXcontext * baseShareContext,
+ unsigned num_attribs,
+ const uint32_t * attribs, int *error);
static __GLXdrawable *glxWinCreateDrawable(ClientPtr client,
__GLXscreen * screen,
DrawablePtr pDraw,
@@ -473,7 +475,7 @@ static void
glxLogExtensions(const char *prefix, const char *extensions)
{
int length = 0;
- char *strl;
+ const char *strl;
char *str = strdup(extensions);
if (str == NULL) {
@@ -482,6 +484,8 @@ glxLogExtensions(const char *prefix, const char *extensions)
}
strl = strtok(str, " ");
+ if (strl == NULL)
+ strl = "";
ErrorF("%s%s", prefix, strl);
length = strlen(prefix) + strlen(strl);
@@ -515,6 +519,7 @@ glxWinScreenProbe(ScreenPtr pScreen)
{
glxWinScreen *screen;
const char *gl_extensions;
+ const char *gl_renderer;
const char *wgl_extensions;
HWND hwnd;
HDC hdc;
@@ -538,14 +543,6 @@ glxWinScreenProbe(ScreenPtr pScreen)
if (NULL == screen)
return NULL;
- /* Wrap RealizeWindow, UnrealizeWindow and CopyWindow on this screen */
- screen->RealizeWindow = pScreen->RealizeWindow;
- pScreen->RealizeWindow = glxWinRealizeWindow;
- screen->UnrealizeWindow = pScreen->UnrealizeWindow;
- pScreen->UnrealizeWindow = glxWinUnrealizeWindow;
- screen->CopyWindow = pScreen->CopyWindow;
- pScreen->CopyWindow = glxWinCopyWindow;
-
/* Dump out some useful information about the native renderer */
// create window class
@@ -595,7 +592,8 @@ glxWinScreenProbe(ScreenPtr pScreen)
ErrorF("GL_VERSION: %s\n", glGetStringWrapperNonstatic(GL_VERSION));
ErrorF("GL_VENDOR: %s\n", glGetStringWrapperNonstatic(GL_VENDOR));
- ErrorF("GL_RENDERER: %s\n", glGetStringWrapperNonstatic(GL_RENDERER));
+ gl_renderer = (const char *) glGetStringWrapperNonstatic(GL_RENDERER);
+ ErrorF("GL_RENDERER: %s\n", gl_renderer);
gl_extensions = (const char *) glGetStringWrapperNonstatic(GL_EXTENSIONS);
glxLogExtensions("GL_EXTENSIONS: ", gl_extensions);
wgl_extensions = wglGetExtensionsStringARBWrapper(hdc);
@@ -603,6 +601,13 @@ glxWinScreenProbe(ScreenPtr pScreen)
wgl_extensions = "";
glxLogExtensions("WGL_EXTENSIONS: ", wgl_extensions);
+ if (strcasecmp(gl_renderer, "GDI Generic") == 0) {
+ free(screen);
+ LogMessage(X_ERROR,
+ "AIGLX: Won't use generic native renderer as it is not accelerated\n");
+ return NULL;
+ }
+
// Can you see the problem here? The extensions string is DC specific
// Different DCs for windows on a multimonitor system driven by multiple cards
// might have completely different capabilities. Of course, good luck getting
@@ -720,9 +725,6 @@ glxWinScreenProbe(ScreenPtr pScreen)
__glXScreenInit(&screen->base, pScreen);
- // dump out fbConfigs now fbConfigIds and visualIDs have been assigned
- fbConfigsDump(screen->base.numFBConfigs, screen->base.fbconfigs);
-
// Override the GL extensions string set by __glXScreenInit()
screen->base.GLextensions = strdup(gl_extensions);
@@ -765,6 +767,17 @@ glxWinScreenProbe(ScreenPtr pScreen)
ReleaseDC(hwnd, hdc);
DestroyWindow(hwnd);
+ // dump out fbConfigs now fbConfigIds and visualIDs have been assigned
+ fbConfigsDump(screen->base.numFBConfigs, screen->base.fbconfigs);
+
+ /* Wrap RealizeWindow, UnrealizeWindow and CopyWindow on this screen */
+ screen->RealizeWindow = pScreen->RealizeWindow;
+ pScreen->RealizeWindow = glxWinRealizeWindow;
+ screen->UnrealizeWindow = pScreen->UnrealizeWindow;
+ pScreen->UnrealizeWindow = glxWinUnrealizeWindow;
+ screen->CopyWindow = pScreen->CopyWindow;
+ pScreen->CopyWindow = glxWinCopyWindow;
+
return &screen->base;
}
@@ -1571,7 +1584,8 @@ glxWinContextDestroy(__GLXcontext * base)
static __GLXcontext *
glxWinCreateContext(__GLXscreen * screen,
- __GLXconfig * modes, __GLXcontext * baseShareContext)
+ __GLXconfig * modes, __GLXcontext * baseShareContext,
+ unsigned num_attribs, const uint32_t * attribs, int *error)
{
__GLXWinContext *context;
__GLXWinContext *shareContext = (__GLXWinContext *) baseShareContext;