diff options
Diffstat (limited to 'xorg-server/hw')
-rw-r--r-- | xorg-server/hw/xfree86/dri2/dri2.c | 8 | ||||
-rw-r--r-- | xorg-server/hw/xfree86/modes/xf86Rotate.c | 24 | ||||
-rw-r--r-- | xorg-server/hw/xwin/glx/gen_gl_wrappers.py | 4 | ||||
-rw-r--r-- | xorg-server/hw/xwin/glx/indirect.c | 68 |
4 files changed, 43 insertions, 61 deletions
diff --git a/xorg-server/hw/xfree86/dri2/dri2.c b/xorg-server/hw/xfree86/dri2/dri2.c index d0f17896d..d3b3c73f8 100644 --- a/xorg-server/hw/xfree86/dri2/dri2.c +++ b/xorg-server/hw/xfree86/dri2/dri2.c @@ -1111,14 +1111,14 @@ DRI2Connect(ScreenPtr pScreen, unsigned int driverType, int *fd, return TRUE; } -static Bool +static int DRI2AuthMagic (ScreenPtr pScreen, uint32_t magic) { DRI2ScreenPtr ds = DRI2GetScreen(pScreen); - if (ds == NULL || (*ds->LegacyAuthMagic) (ds->fd, magic)) - return FALSE; + if (ds == NULL) + return -EINVAL; - return TRUE; + return (*ds->LegacyAuthMagic) (ds->fd, magic); } Bool diff --git a/xorg-server/hw/xfree86/modes/xf86Rotate.c b/xorg-server/hw/xfree86/modes/xf86Rotate.c index 6a661e195..31e03727e 100644 --- a/xorg-server/hw/xfree86/modes/xf86Rotate.c +++ b/xorg-server/hw/xfree86/modes/xf86Rotate.c @@ -46,28 +46,6 @@ /* borrowed from composite extension, move to Render and publish? */ -static VisualPtr -compGetWindowVisual(WindowPtr pWin) -{ - ScreenPtr pScreen = pWin->drawable.pScreen; - VisualID vid = wVisual(pWin); - int i; - - for (i = 0; i < pScreen->numVisuals; i++) - if (pScreen->visuals[i].vid == vid) - return &pScreen->visuals[i]; - return 0; -} - -static PictFormatPtr -compWindowFormat(WindowPtr pWin) -{ - ScreenPtr pScreen = pWin->drawable.pScreen; - - return PictureMatchVisual(pScreen, pWin->drawable.depth, - compGetWindowVisual(pWin)); -} - #define F(x) IntToxFixed(x) #define toF(x) ((float) (x) / 65536.0f) @@ -79,7 +57,7 @@ xf86RotateCrtcRedisplay(xf86CrtcPtr crtc, RegionPtr region) ScreenPtr screen = scrn->pScreen; WindowPtr root = screen->root; PixmapPtr dst_pixmap = crtc->rotatedPixmap; - PictFormatPtr format = compWindowFormat(screen->root); + PictFormatPtr format = PictureWindowFormat(screen->root); int error; PicturePtr src, dst; int n = RegionNumRects(region); diff --git a/xorg-server/hw/xwin/glx/gen_gl_wrappers.py b/xorg-server/hw/xwin/glx/gen_gl_wrappers.py index d4beee230..d45e7aea9 100644 --- a/xorg-server/hw/xwin/glx/gen_gl_wrappers.py +++ b/xorg-server/hw/xwin/glx/gen_gl_wrappers.py @@ -224,6 +224,8 @@ for w in sorted(wrappers.keys()) : if l[2] == 'in' : if l[3] == 'array' : arg = 'const ' + typemap[l[1]] + ' *' + l[0] + elif l[3] == 'reference' : + arg = 'const ' + typemap[l[1]] + ' *' + l[0] else : arg = typemap[l[1]] + ' ' + l[0] elif l[2] == 'out' : @@ -318,7 +320,7 @@ if dispatchheader : for d in sorted(dispatch.keys()) : if wrappers.has_key(d) : - print ' SET_'+ d + '(disp, (void *)' + prefix + d + 'Wrapper);' + print ' SET_'+ d + '(disp, (void *)' + prefix + d + 'Wrapper);' else : print '#pragma message("No wrapper for ' + prefix + d + ' !")' diff --git a/xorg-server/hw/xwin/glx/indirect.c b/xorg-server/hw/xwin/glx/indirect.c index 45a6294b5..9dd9660ce 100644 --- a/xorg-server/hw/xwin/glx/indirect.c +++ b/xorg-server/hw/xwin/glx/indirect.c @@ -438,8 +438,7 @@ static __GLXcontext *glxWinCreateContext(__GLXscreen * screen, __GLXconfig * modes, __GLXcontext * baseShareContext, unsigned num_attribs, - const uint32_t *attribs, - int *error); + const uint32_t * attribs, int *error); static __GLXdrawable *glxWinCreateDrawable(ClientPtr client, __GLXscreen * screen, DrawablePtr pDraw, @@ -527,7 +526,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) { @@ -536,15 +535,11 @@ glxLogExtensions(const char *prefix, const char *extensions) } strl = strtok(str, " "); - if (!strl) - { - winDebug("%s", prefix); - } - else - { - winDebug("%s%s", prefix, strl); - length = strlen(prefix) + strlen(strl); - } + if (strl == NULL) + strl = ""; + winDebug("%s%s", prefix, strl); + + length = strlen(prefix) + strlen(strl); while (1) { strl = strtok(NULL, " "); @@ -576,6 +571,7 @@ glxWinScreenProbe(ScreenPtr pScreen) { glxWinScreen *screen; const char *gl_extensions; + const char *gl_renderer; const char *wgl_extensions; HWND hwnd; HDC hdc; @@ -601,18 +597,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; - screen->PositionWindow = pScreen->PositionWindow; - pScreen->PositionWindow = glxWinPositionWindow; - screen->DestroyWindow = pScreen->DestroyWindow; - pScreen->DestroyWindow = glxWinDestroyWindow; - /* Dump out some useful information about the native renderer */ // create window class @@ -665,7 +649,8 @@ glxWinScreenProbe(ScreenPtr pScreen) winDebug("GL_VERSION: %s\n", glGetStringWrapperNonstatic(GL_VERSION)); winDebug("GL_VENDOR: %s\n", glGetStringWrapperNonstatic(GL_VENDOR)); - winDebug("GL_RENDERER: %s\n", glGetStringWrapperNonstatic(GL_RENDERER)); + gl_renderer = (const char *) glGetStringWrapperNonstatic(GL_RENDERER); + winDebug("GL_RENDERER: %s\n", gl_renderer); gl_extensions = (const char *) glGetStringWrapperNonstatic(GL_EXTENSIONS); glxLogExtensions("GL_EXTENSIONS: ", gl_extensions); wgl_extensions = wglGetExtensionsStringARBWrapper(hdc); @@ -673,6 +658,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 @@ -790,11 +782,6 @@ glxWinScreenProbe(ScreenPtr pScreen) __glXScreenInit(&screen->base, pScreen); -#ifdef _DEBUG - // dump out fbConfigs now fbConfigIds and visualIDs have been assigned - fbConfigsDump(screen->base.numFBConfigs, screen->base.fbconfigs); -#endif - // Override the GL extensions string set by __glXScreenInit() screen->base.GLextensions = strdup(gl_extensions); @@ -837,6 +824,23 @@ glxWinScreenProbe(ScreenPtr pScreen) ReleaseDC(hwnd, hdc); DestroyWindow(hwnd); +#ifdef _DEBUG + // dump out fbConfigs now fbConfigIds and visualIDs have been assigned + fbConfigsDump(screen->base.numFBConfigs, screen->base.fbconfigs); +#endif + + /* 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; + screen->PositionWindow = pScreen->PositionWindow; + pScreen->PositionWindow = glxWinPositionWindow; + screen->DestroyWindow = pScreen->DestroyWindow; + pScreen->DestroyWindow = glxWinDestroyWindow; + return &screen->base; } @@ -1772,9 +1776,7 @@ glxWinContextDestroy(__GLXcontext * base) static __GLXcontext * glxWinCreateContext(__GLXscreen * screen, __GLXconfig * modes, __GLXcontext * baseShareContext, - unsigned num_attribs, - const uint32_t *attribs, - int *error) + unsigned num_attribs, const uint32_t * attribs, int *error) { __GLXWinContext *context; __GLXWinContext *shareContext = (__GLXWinContext *) baseShareContext; |