diff options
76 files changed, 417 insertions, 1159 deletions
diff --git a/Xext/panoramiX.c b/Xext/panoramiX.c index 7f888e38d..2b3a5704e 100644 --- a/Xext/panoramiX.c +++ b/Xext/panoramiX.c @@ -53,9 +53,7 @@ Equipment Corporation. #include "servermd.h" #include "resource.h" #include "picturestr.h" -#ifdef XFIXES #include "xfixesint.h" -#endif #ifdef COMPOSITE #include "compint.h" #endif @@ -583,9 +581,7 @@ PanoramiXExtensionInit(void) ProcVector[X_StoreNamedColor] = PanoramiXStoreNamedColor; PanoramiXRenderInit(); -#ifdef XFIXES PanoramiXFixesInit(); -#endif #ifdef COMPOSITE PanoramiXCompositeInit(); #endif @@ -890,9 +886,7 @@ PanoramiXResetProc(ExtensionEntry * extEntry) int i; PanoramiXRenderReset(); -#ifdef XFIXES PanoramiXFixesReset(); -#endif #ifdef COMPOSITE PanoramiXCompositeReset (); #endif diff --git a/Xext/security.c b/Xext/security.c index 6cc9aa044..7bf6cc4b0 100644 --- a/Xext/security.c +++ b/Xext/security.c @@ -57,8 +57,9 @@ static DevPrivateKeyRec stateKeyRec; /* This is what we store as client security state */ typedef struct { - int haveState; - unsigned int trustLevel; + unsigned int haveState :1; + unsigned int live :1; + unsigned int trustLevel :2; XID authId; } SecurityStateRec; @@ -141,6 +142,7 @@ SecurityLabelInitial(void) state = dixLookupPrivate(&serverClient->devPrivates, stateKey); state->trustLevel = XSecurityClientTrusted; state->haveState = TRUE; + state->live = FALSE; } /* @@ -953,6 +955,7 @@ SecurityClientState(CallbackListPtr *pcbl, pointer unused, pointer calldata) state->trustLevel = XSecurityClientTrusted; state->authId = None; state->haveState = TRUE; + state->live = FALSE; break; case ClientStateRunning: @@ -963,6 +966,7 @@ SecurityClientState(CallbackListPtr *pcbl, pointer unused, pointer calldata) if (rc == Success) { /* it is a generated authorization */ pAuth->refcnt++; + state->live = TRUE; if (pAuth->refcnt == 1 && pAuth->timer) TimerCancel(pAuth->timer); @@ -975,9 +979,10 @@ SecurityClientState(CallbackListPtr *pcbl, pointer unused, pointer calldata) rc = dixLookupResourceByType((pointer *) &pAuth, state->authId, SecurityAuthorizationResType, serverClient, DixGetAttrAccess); - if (rc == Success) { + if (rc == Success && state->live) { /* it is a generated authorization */ pAuth->refcnt--; + state->live = FALSE; if (pAuth->refcnt == 0) SecurityStartAuthorizationTimer(pAuth); } diff --git a/composite/compalloc.c b/composite/compalloc.c index cc69c68f2..b7d731e33 100644 --- a/composite/compalloc.c +++ b/composite/compalloc.c @@ -205,7 +205,7 @@ compRedirectWindow(ClientPtr pClient, WindowPtr pWin, int update) anyMarked = compMarkWindows(pWin, &pLayerWin); if (cw->damageRegistered) { - DamageUnregister(&pWin->drawable, cw->damage); + DamageUnregister(cw->damage); cw->damageRegistered = FALSE; } cw->update = CompositeRedirectManual; @@ -638,7 +638,7 @@ compSetParentPixmap(WindowPtr pWin) CompWindowPtr cw = GetCompWindow(pWin); if (cw->damageRegistered) { - DamageUnregister(&pWin->drawable, cw->damage); + DamageUnregister(cw->damage); cw->damageRegistered = FALSE; DamageEmpty(cw->damage); } diff --git a/damageext/damageext.c b/damageext/damageext.c index cf6b63bf5..9521c2676 100644 --- a/damageext/damageext.c +++ b/damageext/damageext.c @@ -31,7 +31,6 @@ static unsigned char DamageReqCode; static int DamageEventBase; static RESTYPE DamageExtType; -static RESTYPE DamageExtWinType; static DevPrivateKeyRec DamageClientPrivateKeyRec; @@ -309,11 +308,14 @@ static const int version_requests[] = { #define NUM_VERSION_REQUESTS (sizeof (version_requests) / sizeof (version_requests[0])) static int (*ProcDamageVector[XDamageNumberRequests]) (ClientPtr) = { -/*************** Version 1 ******************/ + /*************** Version 1 ******************/ ProcDamageQueryVersion, - ProcDamageCreate, ProcDamageDestroy, ProcDamageSubtract, -/*************** Version 1.1 ****************/ -ProcDamageAdd,}; + ProcDamageCreate, + ProcDamageDestroy, + ProcDamageSubtract, + /*************** Version 1.1 ****************/ + ProcDamageAdd, +}; static int ProcDamageDispatch(ClientPtr client) @@ -389,11 +391,14 @@ SProcDamageAdd(ClientPtr client) } static int (*SProcDamageVector[XDamageNumberRequests]) (ClientPtr) = { -/*************** Version 1 ******************/ + /*************** Version 1 ******************/ SProcDamageQueryVersion, - SProcDamageCreate, SProcDamageDestroy, SProcDamageSubtract, -/*************** Version 1.1 ****************/ -SProcDamageAdd,}; + SProcDamageCreate, + SProcDamageDestroy, + SProcDamageSubtract, + /*************** Version 1.1 ****************/ + SProcDamageAdd, +}; static int SProcDamageDispatch(ClientPtr client) @@ -431,26 +436,13 @@ FreeDamageExt(pointer value, XID did) * Get rid of the resource table entry hanging from the window id */ pDamageExt->id = 0; - if (WindowDrawable(pDamageExt->pDrawable->type)) - FreeResourceByType(pDamageExt->pDrawable->id, DamageExtWinType, TRUE); if (pDamageExt->pDamage) { - DamageUnregister(pDamageExt->pDrawable, pDamageExt->pDamage); DamageDestroy(pDamageExt->pDamage); } free(pDamageExt); return Success; } -static int -FreeDamageExtWin(pointer value, XID wid) -{ - DamageExtPtr pDamageExt = (DamageExtPtr) value; - - if (pDamageExt->id) - FreeResource(pDamageExt->id, RT_NONE); - return Success; -} - static void SDamageNotifyEvent(xDamageNotifyEvent * from, xDamageNotifyEvent * to) { @@ -481,10 +473,6 @@ DamageExtensionInit(void) if (!DamageExtType) return; - DamageExtWinType = CreateNewResourceType(FreeDamageExtWin, "DamageExtWin"); - if (!DamageExtWinType) - return; - if (!dixRegisterPrivateKey (&DamageClientPrivateKeyRec, PRIVATE_CLIENT, sizeof(DamageClientRec))) return; diff --git a/dbe/Makefile.am b/dbe/Makefile.am index 043555b8c..7d034c7f7 100644 --- a/dbe/Makefile.am +++ b/dbe/Makefile.am @@ -9,5 +9,4 @@ endif libdbe_la_SOURCES = \ dbe.c \ midbe.c \ - midbe.h \ - midbestr.h + midbe.h @@ -90,10 +90,7 @@ DbeStubScreen(DbeScreenPrivPtr pDbeScreenPriv, int *nStubbedScreens) pDbeScreenPriv->GetVisualInfo = NULL; pDbeScreenPriv->AllocBackBufferName = NULL; pDbeScreenPriv->SwapBuffers = NULL; - pDbeScreenPriv->BeginIdiom = NULL; - pDbeScreenPriv->EndIdiom = NULL; pDbeScreenPriv->WinPrivDelete = NULL; - pDbeScreenPriv->ResetProc = NULL; (*nStubbedScreens)++; @@ -232,8 +229,7 @@ ProcDbeAllocateBackBufferName(ClientPtr client) * Allocate a window priv. */ - pDbeWindowPriv = - dixAllocateObjectWithPrivates(DbeWindowPrivRec, PRIVATE_DBE_WINDOW); + pDbeWindowPriv = calloc(1, sizeof(DbeWindowPrivRec)); if (!pDbeWindowPriv) return BadAlloc; @@ -545,44 +541,6 @@ ProcDbeSwapBuffers(ClientPtr client) /****************************************************************************** * - * DBE DIX Procedure: ProcDbeBeginIdiom - * - * Description: - * - * This function is for processing a DbeBeginIdiom request. - * This request informs the server that a complex swap will immediately - * follow this request. - * - * Return Values: - * - * Success - * - *****************************************************************************/ - -static int -ProcDbeBeginIdiom(ClientPtr client) -{ - /* REQUEST(xDbeBeginIdiomReq); */ - DbeScreenPrivPtr pDbeScreenPriv; - register int i; - - REQUEST_SIZE_MATCH(xDbeBeginIdiomReq); - - for (i = 0; i < screenInfo.numScreens; i++) { - pDbeScreenPriv = DBE_SCREEN_PRIV(screenInfo.screens[i]); - - /* Call the DDX begin idiom procedure if there is one. */ - if (pDbeScreenPriv->BeginIdiom) { - (*pDbeScreenPriv->BeginIdiom) (client); - } - } - - return Success; - -} /* ProcDbeBeginIdiom() */ - -/****************************************************************************** - * * DBE DIX Procedure: ProcDbeGetVisualInfo * * Description: @@ -818,7 +776,7 @@ ProcDbeDispatch(ClientPtr client) return (ProcDbeSwapBuffers(client)); case X_DbeBeginIdiom: - return (ProcDbeBeginIdiom(client)); + return Success; case X_DbeEndIdiom: return Success; @@ -982,32 +940,6 @@ SProcDbeSwapBuffers(ClientPtr client) /****************************************************************************** * - * DBE DIX Procedure: SProcDbeBeginIdiom - * - * Description: - * - * This function is for processing a DbeBeginIdiom request on a swapped - * server. This request informs the server that a complex swap will - * immediately follow this request. - * - * Return Values: - * - * Success - * - *****************************************************************************/ - -static int -SProcDbeBeginIdiom(ClientPtr client) -{ - REQUEST(xDbeBeginIdiomReq); - - swaps(&stuff->length); - return (ProcDbeBeginIdiom(client)); - -} /* SProcDbeBeginIdiom() */ - -/****************************************************************************** - * * DBE DIX Procedure: SProcDbeGetVisualInfo * * Description: @@ -1097,7 +1029,7 @@ SProcDbeDispatch(ClientPtr client) return (SProcDbeSwapBuffers(client)); case X_DbeBeginIdiom: - return (SProcDbeBeginIdiom(client)); + return Success; case X_DbeEndIdiom: return Success; @@ -1289,7 +1221,7 @@ DbeWindowPrivDelete(pointer pDbeWinPriv, XID id) NULL); /* We are done with the window priv. */ - dixFreeObjectWithPrivates(pDbeWindowPriv, PRIVATE_DBE_WINDOW); + free(pDbeWindowPriv); } return Success; @@ -1321,10 +1253,7 @@ DbeResetProc(ExtensionEntry * extEntry) if (pDbeScreenPriv) { /* Unwrap DestroyWindow, which was wrapped in DbeExtensionInit(). */ pScreen->DestroyWindow = pDbeScreenPriv->DestroyWindow; - - if (pDbeScreenPriv->ResetProc) - (*pDbeScreenPriv->ResetProc) (pScreen); - + pScreen->PositionWindow = pDbeScreenPriv->PositionWindow; free(pDbeScreenPriv); } } diff --git a/dbe/dbestruct.h b/dbe/dbestruct.h index f9d938af1..200206652 100644 --- a/dbe/dbestruct.h +++ b/dbe/dbestruct.h @@ -143,6 +143,20 @@ typedef struct _DbeWindowPrivRec { */ XID initIDs[DBE_INIT_MAX_IDS]; + /* Pointer to a drawable that contains the contents of the back buffer. + */ + PixmapPtr pBackBuffer; + + /* Pointer to a drawable that contains the contents of the front buffer. + * This pointer is only used for the XdbeUntouched swap action. For that + * swap action, we need to copy the front buffer (window) contents into + * this drawable, copy the contents of current back buffer drawable (the + * back buffer) into the window, swap the front and back drawable pointers, + * and then swap the drawable/resource associations in the resource + * database. + */ + PixmapPtr pFrontBuffer; + /* Device-specific private information. */ PrivateRec *devPrivates; @@ -180,16 +194,9 @@ typedef struct _DbeScreenPrivRec { int * /*pNumWindows */ , DbeSwapInfoPtr /*swapInfo */ ); - void (*BeginIdiom) (ClientPtr /*client */ - ); - void (*EndIdiom) (ClientPtr /*client */ - ); void (*WinPrivDelete) (DbeWindowPrivPtr /*pDbeWindowPriv */ , XID /*bufId */ ); - void (*ResetProc) (ScreenPtr /*pScreen */ - ); - } DbeScreenPrivRec, *DbeScreenPrivPtr; #endif /* DBE_STRUCT_H */ diff --git a/dbe/midbe.c b/dbe/midbe.c index d810d992e..3663fddcc 100644 --- a/dbe/midbe.c +++ b/dbe/midbe.c @@ -48,7 +48,6 @@ #include "resource.h" #include "opaque.h" #include "dbestruct.h" -#include "midbestr.h" #include "regionstr.h" #include "gcstruct.h" #include "inputstr.h" @@ -57,9 +56,6 @@ #include <stdio.h> -static DevPrivateKeyRec miDbeWindowPrivPrivKeyRec; - -#define miDbeWindowPrivPrivKey (&miDbeWindowPrivPrivKeyRec) /****************************************************************************** * @@ -138,7 +134,6 @@ miDbeAllocBackBufferName(WindowPtr pWin, XID bufId, int swapAction) { ScreenPtr pScreen; DbeWindowPrivPtr pDbeWindowPriv; - MiDbeWindowPrivPrivPtr pDbeWindowPrivPriv; DbeScreenPrivPtr pDbeScreenPriv; GCPtr pGC; xRectangle clearRect; @@ -156,12 +151,8 @@ miDbeAllocBackBufferName(WindowPtr pWin, XID bufId, int swapAction) pDbeScreenPriv = DBE_SCREEN_PRIV(pScreen); - /* Setup the window priv priv. */ - pDbeWindowPrivPriv = MI_DBE_WINDOW_PRIV_PRIV(pDbeWindowPriv); - pDbeWindowPrivPriv->pDbeWindowPriv = pDbeWindowPriv; - /* Get a front pixmap. */ - if (!(pDbeWindowPrivPriv->pFrontBuffer = + if (!(pDbeWindowPriv->pFrontBuffer = (*pScreen->CreatePixmap) (pScreen, pDbeWindowPriv->width, pDbeWindowPriv->height, pWin->drawable.depth, 0))) { @@ -169,22 +160,22 @@ miDbeAllocBackBufferName(WindowPtr pWin, XID bufId, int swapAction) } /* Get a back pixmap. */ - if (!(pDbeWindowPrivPriv->pBackBuffer = + if (!(pDbeWindowPriv->pBackBuffer = (*pScreen->CreatePixmap) (pScreen, pDbeWindowPriv->width, pDbeWindowPriv->height, pWin->drawable.depth, 0))) { - (*pScreen->DestroyPixmap) (pDbeWindowPrivPriv->pFrontBuffer); + (*pScreen->DestroyPixmap) (pDbeWindowPriv->pFrontBuffer); return BadAlloc; } /* Security creation/labeling check. */ rc = XaceHook(XACE_RESOURCE_ACCESS, serverClient, bufId, - dbeDrawableResType, pDbeWindowPrivPriv->pBackBuffer, + dbeDrawableResType, pDbeWindowPriv->pBackBuffer, RT_WINDOW, pWin, DixCreateAccess); /* Make the back pixmap a DBE drawable resource. */ if (rc != Success || !AddResource(bufId, dbeDrawableResType, - pDbeWindowPrivPriv->pBackBuffer)) { + pDbeWindowPriv->pBackBuffer)) { /* free the buffer and the drawable resource */ FreeResource(bufId, RT_NONE); return (rc == Success) ? BadAlloc : rc; @@ -193,11 +184,11 @@ miDbeAllocBackBufferName(WindowPtr pWin, XID bufId, int swapAction) /* Clear the back buffer. */ pGC = GetScratchGC(pWin->drawable.depth, pWin->drawable.pScreen); if ((*pDbeScreenPriv->SetupBackgroundPainter) (pWin, pGC)) { - ValidateGC((DrawablePtr) pDbeWindowPrivPriv->pBackBuffer, pGC); + ValidateGC((DrawablePtr) pDbeWindowPriv->pBackBuffer, pGC); clearRect.x = clearRect.y = 0; - clearRect.width = pDbeWindowPrivPriv->pBackBuffer->drawable.width; - clearRect.height = pDbeWindowPrivPriv->pBackBuffer->drawable.height; - (*pGC->ops->PolyFillRect) ((DrawablePtr) pDbeWindowPrivPriv-> + clearRect.width = pDbeWindowPriv->pBackBuffer->drawable.width; + clearRect.height = pDbeWindowPriv->pBackBuffer->drawable.height; + (*pGC->ops->PolyFillRect) ((DrawablePtr) pDbeWindowPriv-> pBackBuffer, pGC, 1, &clearRect); } FreeScratchGC(pGC); @@ -210,9 +201,8 @@ miDbeAllocBackBufferName(WindowPtr pWin, XID bufId, int swapAction) */ /* Associate the new ID with an existing pixmap. */ - pDbeWindowPrivPriv = MI_DBE_WINDOW_PRIV_PRIV(pDbeWindowPriv); if (!AddResource(bufId, dbeDrawableResType, - (pointer) pDbeWindowPrivPriv->pBackBuffer)) { + (pointer) pDbeWindowPriv->pBackBuffer)) { return BadAlloc; } @@ -237,12 +227,10 @@ static void miDbeAliasBuffers(DbeWindowPrivPtr pDbeWindowPriv) { int i; - MiDbeWindowPrivPrivPtr pDbeWindowPrivPriv = - MI_DBE_WINDOW_PRIV_PRIV(pDbeWindowPriv); for (i = 0; i < pDbeWindowPriv->nBufferIDs; i++) { ChangeResourceValue(pDbeWindowPriv->IDs[i], dbeDrawableResType, - (pointer) pDbeWindowPrivPriv->pBackBuffer); + (pointer) pDbeWindowPriv->pBackBuffer); } } /* miDbeAliasBuffers() */ @@ -261,15 +249,15 @@ static int miDbeSwapBuffers(ClientPtr client, int *pNumWindows, DbeSwapInfoPtr swapInfo) { DbeScreenPrivPtr pDbeScreenPriv; + DbeWindowPrivPtr pDbeWindowPriv; GCPtr pGC; WindowPtr pWin; - MiDbeWindowPrivPrivPtr pDbeWindowPrivPriv; PixmapPtr pTmpBuffer; xRectangle clearRect; pWin = swapInfo[0].pWindow; pDbeScreenPriv = DBE_SCREEN_PRIV_FROM_WINDOW(pWin); - pDbeWindowPrivPriv = MI_DBE_WINDOW_PRIV_PRIV_FROM_WINDOW(pWin); + pDbeWindowPriv = DBE_WINDOW_PRIV(pWin); pGC = GetScratchGC(pWin->drawable.depth, pWin->drawable.pScreen); /* @@ -286,9 +274,9 @@ miDbeSwapBuffers(ClientPtr client, int *pNumWindows, DbeSwapInfoPtr swapInfo) break; case XdbeUntouched: - ValidateGC((DrawablePtr) pDbeWindowPrivPriv->pFrontBuffer, pGC); + ValidateGC((DrawablePtr) pDbeWindowPriv->pFrontBuffer, pGC); (*pGC->ops->CopyArea) ((DrawablePtr) pWin, - (DrawablePtr) pDbeWindowPrivPriv->pFrontBuffer, + (DrawablePtr) pDbeWindowPriv->pFrontBuffer, pGC, 0, 0, pWin->drawable.width, pWin->drawable.height, 0, 0); break; @@ -305,7 +293,7 @@ miDbeSwapBuffers(ClientPtr client, int *pNumWindows, DbeSwapInfoPtr swapInfo) */ ValidateGC((DrawablePtr) pWin, pGC); - (*pGC->ops->CopyArea) ((DrawablePtr) pDbeWindowPrivPriv->pBackBuffer, + (*pGC->ops->CopyArea) ((DrawablePtr) pDbeWindowPriv->pBackBuffer, (DrawablePtr) pWin, pGC, 0, 0, pWin->drawable.width, pWin->drawable.height, 0, 0); @@ -321,23 +309,23 @@ miDbeSwapBuffers(ClientPtr client, int *pNumWindows, DbeSwapInfoPtr swapInfo) case XdbeBackground: if ((*pDbeScreenPriv->SetupBackgroundPainter) (pWin, pGC)) { - ValidateGC((DrawablePtr) pDbeWindowPrivPriv->pBackBuffer, pGC); + ValidateGC((DrawablePtr) pDbeWindowPriv->pBackBuffer, pGC); clearRect.x = 0; clearRect.y = 0; - clearRect.width = pDbeWindowPrivPriv->pBackBuffer->drawable.width; - clearRect.height = pDbeWindowPrivPriv->pBackBuffer->drawable.height; - (*pGC->ops->PolyFillRect) ((DrawablePtr) pDbeWindowPrivPriv-> + clearRect.width = pDbeWindowPriv->pBackBuffer->drawable.width; + clearRect.height = pDbeWindowPriv->pBackBuffer->drawable.height; + (*pGC->ops->PolyFillRect) ((DrawablePtr) pDbeWindowPriv-> pBackBuffer, pGC, 1, &clearRect); } break; case XdbeUntouched: /* Swap pixmap pointers. */ - pTmpBuffer = pDbeWindowPrivPriv->pBackBuffer; - pDbeWindowPrivPriv->pBackBuffer = pDbeWindowPrivPriv->pFrontBuffer; - pDbeWindowPrivPriv->pFrontBuffer = pTmpBuffer; + pTmpBuffer = pDbeWindowPriv->pBackBuffer; + pDbeWindowPriv->pBackBuffer = pDbeWindowPriv->pFrontBuffer; + pDbeWindowPriv->pFrontBuffer = pTmpBuffer; - miDbeAliasBuffers(pDbeWindowPrivPriv->pDbeWindowPriv); + miDbeAliasBuffers(pDbeWindowPriv); break; @@ -427,8 +415,6 @@ miDbeSwapBuffers(ClientPtr client, int *pNumWindows, DbeSwapInfoPtr swapInfo) static void miDbeWinPrivDelete(DbeWindowPrivPtr pDbeWindowPriv, XID bufId) { - MiDbeWindowPrivPrivPtr pDbeWindowPrivPriv; - if (pDbeWindowPriv->nBufferIDs != 0) { /* We still have at least one more buffer ID associated with this * window. @@ -440,18 +426,15 @@ miDbeWinPrivDelete(DbeWindowPrivPtr pDbeWindowPriv, XID bufId) * free some stuff. */ - pDbeWindowPrivPriv = MI_DBE_WINDOW_PRIV_PRIV(pDbeWindowPriv); - /* Destroy the front and back pixmaps. */ - if (pDbeWindowPrivPriv->pFrontBuffer) { + if (pDbeWindowPriv->pFrontBuffer) { (*pDbeWindowPriv->pWindow->drawable.pScreen-> - DestroyPixmap) (pDbeWindowPrivPriv->pFrontBuffer); + DestroyPixmap) (pDbeWindowPriv->pFrontBuffer); } - if (pDbeWindowPrivPriv->pBackBuffer) { + if (pDbeWindowPriv->pBackBuffer) { (*pDbeWindowPriv->pWindow->drawable.pScreen-> - DestroyPixmap) (pDbeWindowPrivPriv->pBackBuffer); + DestroyPixmap) (pDbeWindowPriv->pBackBuffer); } - } /* miDbeWinPrivDelete() */ /****************************************************************************** @@ -627,10 +610,6 @@ miDbePositionWindow(WindowPtr pWin, int x, int y) else { /* Clear out the new DBE buffer pixmaps. */ - MiDbeWindowPrivPrivPtr pDbeWindowPrivPriv; - - pDbeWindowPrivPriv = MI_DBE_WINDOW_PRIV_PRIV(pDbeWindowPriv); - /* I suppose this could avoid quite a bit of work if * it computed the minimal area required. */ @@ -641,9 +620,9 @@ miDbePositionWindow(WindowPtr pWin, int x, int y) } /* Copy the contents of the old front pixmap to the new one. */ if (pWin->bitGravity != ForgetGravity) { - (*pGC->ops->CopyArea) ((DrawablePtr) pDbeWindowPrivPriv-> - pFrontBuffer, (DrawablePtr) pFrontBuffer, - pGC, sourcex, sourcey, savewidth, saveheight, + (*pGC->ops->CopyArea) ((DrawablePtr) pDbeWindowPriv->pFrontBuffer, + (DrawablePtr) pFrontBuffer, pGC, + sourcex, sourcey, savewidth, saveheight, destx, desty); } @@ -654,8 +633,8 @@ miDbePositionWindow(WindowPtr pWin, int x, int y) } /* Copy the contents of the old back pixmap to the new one. */ if (pWin->bitGravity != ForgetGravity) { - (*pGC->ops->CopyArea) ((DrawablePtr) pDbeWindowPrivPriv-> - pBackBuffer, (DrawablePtr) pBackBuffer, pGC, + (*pGC->ops->CopyArea) ((DrawablePtr) pDbeWindowPriv->pBackBuffer, + (DrawablePtr) pBackBuffer, pGC, sourcex, sourcey, savewidth, saveheight, destx, desty); } @@ -664,11 +643,11 @@ miDbePositionWindow(WindowPtr pWin, int x, int y) * pixmaps. */ - (*pScreen->DestroyPixmap) (pDbeWindowPrivPriv->pFrontBuffer); - (*pScreen->DestroyPixmap) (pDbeWindowPrivPriv->pBackBuffer); + (*pScreen->DestroyPixmap) (pDbeWindowPriv->pFrontBuffer); + (*pScreen->DestroyPixmap) (pDbeWindowPriv->pBackBuffer); - pDbeWindowPrivPriv->pFrontBuffer = pFrontBuffer; - pDbeWindowPrivPriv->pBackBuffer = pBackBuffer; + pDbeWindowPriv->pFrontBuffer = pFrontBuffer; + pDbeWindowPriv->pBackBuffer = pBackBuffer; /* Make sure all XID are associated with the new back pixmap. */ miDbeAliasBuffers(pDbeWindowPriv); @@ -682,30 +661,6 @@ miDbePositionWindow(WindowPtr pWin, int x, int y) /****************************************************************************** * - * DBE MI Procedure: miDbeResetProc - * - * Description: - * - * This function is called from DbeResetProc(), which is called at the end - * of every server generation. This function peforms any MI-specific - * shutdown tasks. - * - *****************************************************************************/ - -static void -miDbeResetProc(ScreenPtr pScreen) -{ - DbeScreenPrivPtr pDbeScreenPriv; - - pDbeScreenPriv = DBE_SCREEN_PRIV(pScreen); - - /* Unwrap wrappers */ - pScreen->PositionWindow = pDbeScreenPriv->PositionWindow; - -} /* miDbeResetProc() */ - -/****************************************************************************** - * * DBE MI Procedure: miDbeInit * * Description: @@ -717,10 +672,6 @@ miDbeResetProc(ScreenPtr pScreen) Bool miDbeInit(ScreenPtr pScreen, DbeScreenPrivPtr pDbeScreenPriv) { - if (!dixRegisterPrivateKey(&miDbeWindowPrivPrivKeyRec, PRIVATE_DBE_WINDOW, - sizeof(MiDbeWindowPrivPrivRec))) - return FALSE; - /* Wrap functions. */ pDbeScreenPriv->PositionWindow = pScreen->PositionWindow; pScreen->PositionWindow = miDbePositionWindow; @@ -729,9 +680,6 @@ miDbeInit(ScreenPtr pScreen, DbeScreenPrivPtr pDbeScreenPriv) pDbeScreenPriv->GetVisualInfo = miDbeGetVisualInfo; pDbeScreenPriv->AllocBackBufferName = miDbeAllocBackBufferName; pDbeScreenPriv->SwapBuffers = miDbeSwapBuffers; - pDbeScreenPriv->BeginIdiom = 0; - pDbeScreenPriv->EndIdiom = 0; - pDbeScreenPriv->ResetProc = miDbeResetProc; pDbeScreenPriv->WinPrivDelete = miDbeWinPrivDelete; return TRUE; diff --git a/dbe/midbestr.h b/dbe/midbestr.h deleted file mode 100644 index 70017b045..000000000 --- a/dbe/midbestr.h +++ /dev/null @@ -1,75 +0,0 @@ -/****************************************************************************** - * - * Copyright (c) 1994, 1995 Hewlett-Packard Company - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL HEWLETT-PACKARD COMPANY BE LIABLE FOR ANY CLAIM, - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR - * THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the name of the Hewlett-Packard - * Company shall not be used in advertising or otherwise to promote the - * sale, use or other dealings in this Software without prior written - * authorization from the Hewlett-Packard Company. - * - * Header file for users of machine-independent DBE code - * - *****************************************************************************/ - -#ifdef HAVE_DIX_CONFIG_H -#include <dix-config.h> -#endif - -#ifndef MIDBE_STRUCT_H -#define MIDBE_STRUCT_H - -/* DEFINES */ - -#define MI_DBE_WINDOW_PRIV_PRIV(pDbeWindowPriv) \ - (!(pDbeWindowPriv) ? NULL : (MiDbeWindowPrivPrivPtr) \ - dixLookupPrivate(&(pDbeWindowPriv)->devPrivates, miDbeWindowPrivPrivKey)) - -#define MI_DBE_WINDOW_PRIV_PRIV_FROM_WINDOW(pWin)\ - MI_DBE_WINDOW_PRIV_PRIV(DBE_WINDOW_PRIV(pWin)) - -/* TYPEDEFS */ - -typedef struct _MiDbeWindowPrivPrivRec { - /* Place machine-specific fields in here. - * Since this is mi code, we do not really have machine-specific fields. - */ - - /* Pointer to a drawable that contains the contents of the back buffer. - */ - PixmapPtr pBackBuffer; - - /* Pointer to a drawable that contains the contents of the front buffer. - * This pointer is only used for the XdbeUntouched swap action. For that - * swap action, we need to copy the front buffer (window) contents into - * this drawable, copy the contents of current back buffer drawable (the - * back buffer) into the window, swap the front and back drawable pointers, - * and then swap the drawable/resource associations in the resource - * database. - */ - PixmapPtr pFrontBuffer; - - /* Pointer back to our window private with which we are associated. */ - DbeWindowPrivPtr pDbeWindowPriv; - -} MiDbeWindowPrivPrivRec, *MiDbeWindowPrivPrivPtr; - -#endif /* MIDBE_STRUCT_H */ diff --git a/dix/cursor.c b/dix/cursor.c index cd8305c6c..8cc54bd1f 100644 --- a/dix/cursor.c +++ b/dix/cursor.c @@ -71,9 +71,7 @@ static GlyphSharePtr sharedGlyphs = (GlyphSharePtr) NULL; DevScreenPrivateKeyRec cursorScreenDevPriv; -#ifdef XFIXES static CARD32 cursorSerial; -#endif static void FreeCursorBits(CursorBitsPtr bits) @@ -272,10 +270,8 @@ AllocARGBCursor(unsigned char *psrcbits, unsigned char *pmaskbits, bits->refcnt = -1; CheckForEmptyMask(bits); pCurs->bits = bits; -#ifdef XFIXES pCurs->serialNumber = ++cursorSerial; pCurs->name = None; -#endif pCurs->foreRed = foreRed; pCurs->foreGreen = foreGreen; @@ -433,10 +429,8 @@ AllocGlyphCursor(Font source, unsigned sourceChar, Font mask, unsigned maskChar, CheckForEmptyMask(bits); pCurs->bits = bits; pCurs->refcnt = 1; -#ifdef XFIXES pCurs->serialNumber = ++cursorSerial; pCurs->name = None; -#endif pCurs->foreRed = foreRed; pCurs->foreGreen = foreGreen; diff --git a/dix/dispatch.c b/dix/dispatch.c index 71fda4893..4fecfea7b 100644 --- a/dix/dispatch.c +++ b/dix/dispatch.c @@ -1974,7 +1974,7 @@ ProcPutImage(ClientPtr client) static int DoGetImage(ClientPtr client, int format, Drawable drawable, int x, int y, int width, int height, - Mask planemask, xGetImageReply ** im_return) + Mask planemask) { DrawablePtr pDraw, pBoundingDraw; int nlines, linesPerBuf, rc; @@ -2074,46 +2074,32 @@ DoGetImage(ClientPtr client, int format, Drawable drawable, xgi.length = length; - if (im_return) { - pBuf = calloc(1, sz_xGetImageReply + length); - if (!pBuf) - return BadAlloc; - if (widthBytesLine == 0) - linesPerBuf = 0; - else + xgi.length = bytes_to_int32(xgi.length); + if (widthBytesLine == 0 || height == 0) + linesPerBuf = 0; + else if (widthBytesLine >= IMAGE_BUFSIZE) + linesPerBuf = 1; + else { + linesPerBuf = IMAGE_BUFSIZE / widthBytesLine; + if (linesPerBuf > height) linesPerBuf = height; - *im_return = (xGetImageReply *) pBuf; - *(xGetImageReply *) pBuf = xgi; - pBuf += sz_xGetImageReply; } - else { - xgi.length = bytes_to_int32(xgi.length); - if (widthBytesLine == 0 || height == 0) - linesPerBuf = 0; - else if (widthBytesLine >= IMAGE_BUFSIZE) - linesPerBuf = 1; - else { - linesPerBuf = IMAGE_BUFSIZE / widthBytesLine; - if (linesPerBuf > height) - linesPerBuf = height; + length = linesPerBuf * widthBytesLine; + if (linesPerBuf < height) { + /* we have to make sure intermediate buffers don't need padding */ + while ((linesPerBuf > 1) && + (length & ((1L << LOG2_BYTES_PER_SCANLINE_PAD) - 1))) { + linesPerBuf--; + length -= widthBytesLine; } - length = linesPerBuf * widthBytesLine; - if (linesPerBuf < height) { - /* we have to make sure intermediate buffers don't need padding */ - while ((linesPerBuf > 1) && - (length & ((1L << LOG2_BYTES_PER_SCANLINE_PAD) - 1))) { - linesPerBuf--; - length -= widthBytesLine; - } - while (length & ((1L << LOG2_BYTES_PER_SCANLINE_PAD) - 1)) { - linesPerBuf++; - length += widthBytesLine; - } + while (length & ((1L << LOG2_BYTES_PER_SCANLINE_PAD) - 1)) { + linesPerBuf++; + length += widthBytesLine; } - if (!(pBuf = calloc(1, length))) - return BadAlloc; - WriteReplyToClient(client, sizeof(xGetImageReply), &xgi); } + if (!(pBuf = calloc(1, length))) + return BadAlloc; + WriteReplyToClient(client, sizeof(xGetImageReply), &xgi); if (pDraw->type == DRAWABLE_WINDOW) { pVisibleRegion = NotClippedByChildren((WindowPtr) pDraw); @@ -2142,13 +2128,10 @@ DoGetImage(ClientPtr client, int format, Drawable drawable, /* Note that this is NOT a call to WriteSwappedDataToClient, as we do NOT byte swap */ - if (!im_return) { - ReformatImage(pBuf, (int) (nlines * widthBytesLine), - BitsPerPixel(pDraw->depth), ClientOrder(client)); + ReformatImage(pBuf, (int) (nlines * widthBytesLine), + BitsPerPixel(pDraw->depth), ClientOrder(client)); -/* Don't split me, gcc pukes when you do */ - WriteToClient(client, (int) (nlines * widthBytesLine), pBuf); - } + WriteToClient(client, (int) (nlines * widthBytesLine), pBuf); linesDone += nlines; } } @@ -2173,18 +2156,10 @@ DoGetImage(ClientPtr client, int format, Drawable drawable, /* Note: NOT a call to WriteSwappedDataToClient, as we do NOT byte swap */ - if (im_return) { - pBuf += nlines * widthBytesLine; - } - else { - ReformatImage(pBuf, - (int) (nlines * widthBytesLine), - 1, ClientOrder(client)); - -/* Don't split me, gcc pukes when you do */ - WriteToClient(client, (int) (nlines * widthBytesLine), - pBuf); - } + ReformatImage(pBuf, (int) (nlines * widthBytesLine), + 1, ClientOrder(client)); + + WriteToClient(client, (int)(nlines * widthBytesLine), pBuf); linesDone += nlines; } } @@ -2192,8 +2167,7 @@ DoGetImage(ClientPtr client, int format, Drawable drawable, } if (pVisibleRegion) RegionDestroy(pVisibleRegion); - if (!im_return) - free(pBuf); + free(pBuf); return Success; } @@ -2207,7 +2181,7 @@ ProcGetImage(ClientPtr client) return DoGetImage(client, stuff->format, stuff->drawable, stuff->x, stuff->y, (int) stuff->width, (int) stuff->height, - stuff->planeMask, (xGetImageReply **) NULL); + stuff->planeMask); } int diff --git a/dix/pixmap.c b/dix/pixmap.c index fe9214739..d5dc3831b 100644 --- a/dix/pixmap.c +++ b/dix/pixmap.c @@ -202,7 +202,6 @@ PixmapStopDirtyTracking(PixmapPtr src, PixmapPtr slave_dst) xorg_list_for_each_entry_safe(ent, safe, &screen->pixmap_dirty_list, ent) { if (ent->src == src && ent->slave_dst == slave_dst) { - DamageUnregister(&src->drawable, ent->damage); DamageDestroy(ent->damage); xorg_list_del(&ent->ent); free(ent); diff --git a/dix/privates.c b/dix/privates.c index 55b9345a7..41b1a7678 100644 --- a/dix/privates.c +++ b/dix/privates.c @@ -105,7 +105,6 @@ static const char *key_names[PRIVATE_LAST] = { [PRIVATE_CURSOR_BITS] = "CURSOR_BITS", /* extension privates */ - [PRIVATE_DBE_WINDOW] = "DBE_WINDOW", [PRIVATE_DAMAGE] = "DAMAGE", [PRIVATE_GLYPH] = "GLYPH", [PRIVATE_GLYPHSET] = "GLYPHSET", diff --git a/dix/window.c b/dix/window.c index 9fa51c288..cff341b65 100644 --- a/dix/window.c +++ b/dix/window.c @@ -2847,11 +2847,9 @@ HandleSaveSet(ClientPtr client) for (j = 0; j < client->numSaved; j++) { pWin = SaveSetWindow(client->saveSet[j]); -#ifdef XFIXES if (SaveSetToRoot(client->saveSet[j])) pParent = pWin->drawable.pScreen->root; else -#endif { pParent = pWin->parent; while (pParent && (wClient(pParent) == client)) @@ -2859,11 +2857,9 @@ HandleSaveSet(ClientPtr client) } if (pParent) { if (pParent != pWin->parent) { -#ifdef XFIXES /* unmap first so that ReparentWindow doesn't remap */ if (!SaveSetShouldMap(client->saveSet[j])) UnmapWindow(pWin, FALSE); -#endif ReparentWindow(pWin, pParent, pWin->drawable.x - wBorderWidth(pWin) - pParent->drawable.x, @@ -2872,9 +2868,7 @@ HandleSaveSet(ClientPtr client) if (!pWin->realized && pWin->mapped) pWin->mapped = FALSE; } -#ifdef XFIXES if (SaveSetShouldMap(client->saveSet[j])) -#endif MapWindow(pWin, client); } } diff --git a/exa/exa_classic.c b/exa/exa_classic.c index 1fa534bc6..0fa422fcd 100644 --- a/exa/exa_classic.c +++ b/exa/exa_classic.c @@ -192,7 +192,6 @@ exaModifyPixmapHeader_classic(PixmapPtr pPixmap, int width, int height, * gpu memory, so there's no need to track damage. */ if (pExaPixmap->pDamage) { - DamageUnregister(&pPixmap->drawable, pExaPixmap->pDamage); DamageDestroy(pExaPixmap->pDamage); pExaPixmap->pDamage = NULL; } diff --git a/exa/exa_migration_mixed.c b/exa/exa_migration_mixed.c index 445c4fcbf..5e0bf152a 100644 --- a/exa/exa_migration_mixed.c +++ b/exa/exa_migration_mixed.c @@ -190,7 +190,6 @@ exaPrepareAccessReg_mixed(PixmapPtr pPixmap, int index, RegionPtr pReg) * copy anymore. Drivers that prefer DFS, should fail prepare * access. */ - DamageUnregister(&pPixmap->drawable, pExaPixmap->pDamage); DamageDestroy(pExaPixmap->pDamage); pExaPixmap->pDamage = NULL; diff --git a/exa/exa_mixed.c b/exa/exa_mixed.c index 0fb409102..3e2dcf263 100644 --- a/exa/exa_mixed.c +++ b/exa/exa_mixed.c @@ -139,7 +139,6 @@ exaModifyPixmapHeader_mixed(PixmapPtr pPixmap, int width, int height, int depth, if (pPixData) { if (pExaPixmap->driverPriv) { if (pExaPixmap->pDamage) { - DamageUnregister(&pPixmap->drawable, pExaPixmap->pDamage); DamageDestroy(pExaPixmap->pDamage); pExaPixmap->pDamage = NULL; } @@ -189,7 +188,6 @@ exaModifyPixmapHeader_mixed(PixmapPtr pPixmap, int width, int height, int depth, if (pExaPixmap->sys_ptr) { free(pExaPixmap->sys_ptr); pExaPixmap->sys_ptr = NULL; - DamageUnregister(&pPixmap->drawable, pExaPixmap->pDamage); DamageDestroy(pExaPixmap->pDamage); pExaPixmap->pDamage = NULL; RegionEmpty(&pExaPixmap->validSys); @@ -1111,17 +1111,6 @@ fbInitVisuals(VisualPtr * visualp, * fbcopy.c */ -/* Compatibility definition, to be removed at next ABI change. */ -typedef void (*fbCopyProc) (DrawablePtr pSrcDrawable, - DrawablePtr pDstDrawable, - GCPtr pGC, - BoxPtr pDstBox, - int nbox, - int dx, - int dy, - Bool reverse, - Bool upsidedown, Pixel bitplane, void *closure); - extern _X_EXPORT void fbCopyNtoN(DrawablePtr pSrcDrawable, @@ -1133,29 +1122,6 @@ fbCopyNtoN(DrawablePtr pSrcDrawable, int dy, Bool reverse, Bool upsidedown, Pixel bitplane, void *closure); -/* Compatibility wrapper, to be removed at next ABI change. */ -extern _X_EXPORT void - -fbCopyRegion(DrawablePtr pSrcDrawable, - DrawablePtr pDstDrawable, - GCPtr pGC, - RegionPtr pDstRegion, - int dx, - int dy, fbCopyProc copyProc, Pixel bitPlane, void *closure); - -/* Compatibility wrapper, to be removed at next ABI change. */ -extern _X_EXPORT RegionPtr - -fbDoCopy(DrawablePtr pSrcDrawable, - DrawablePtr pDstDrawable, - GCPtr pGC, - int xIn, - int yIn, - int widthSrc, - int heightSrc, - int xOut, - int yOut, fbCopyProc copyProc, Pixel bitplane, void *closure); - extern _X_EXPORT void fbCopy1toN(DrawablePtr pSrcDrawable, diff --git a/fb/fbcopy.c b/fb/fbcopy.c index e9c252a5e..541ef713b 100644 --- a/fb/fbcopy.c +++ b/fb/fbcopy.c @@ -28,33 +28,6 @@ #include "fb.h" -/* Compatibility wrapper, to be removed at next ABI change. */ -void -fbCopyRegion(DrawablePtr pSrcDrawable, - DrawablePtr pDstDrawable, - GCPtr pGC, - RegionPtr pDstRegion, - int dx, int dy, fbCopyProc copyProc, Pixel bitPlane, void *closure) -{ - miCopyRegion(pSrcDrawable, pDstDrawable, pGC, pDstRegion, dx, dy, copyProc, - bitPlane, closure); -} - -/* Compatibility wrapper, to be removed at next ABI change. */ -RegionPtr -fbDoCopy(DrawablePtr pSrcDrawable, - DrawablePtr pDstDrawable, - GCPtr pGC, - int xIn, - int yIn, - int widthSrc, - int heightSrc, - int xOut, int yOut, fbCopyProc copyProc, Pixel bitPlane, void *closure) -{ - return miDoCopy(pSrcDrawable, pDstDrawable, pGC, xIn, yIn, widthSrc, - heightSrc, xOut, yOut, copyProc, bitPlane, closure); -} - void fbCopyNtoN(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, diff --git a/glx/glxcmds.c b/glx/glxcmds.c index 5b7a628cc..73e76ca9f 100644 --- a/glx/glxcmds.c +++ b/glx/glxcmds.c @@ -50,6 +50,8 @@ #include "indirect_table.h" #include "indirect_util.h" +static char GLXServerVendorName[] = "SGI"; + _X_HIDDEN int validGlxScreen(ClientPtr client, int screen, __GLXscreen ** pGlxScreen, int *err) @@ -513,6 +515,10 @@ __glXGetDrawable(__GLXcontext * glxc, GLXDrawable drawId, ClientPtr client, pDraw, drawId, GLX_DRAWABLE_WINDOW, drawId, glxc->config); + if (!pGlxDraw) { + *error = BadAlloc; + return NULL; + } /* since we are creating the drawablePrivate, drawId should be new */ if (!AddResource(drawId, __glXDrawableRes, pGlxDraw)) { @@ -1026,7 +1032,7 @@ __glXDisp_GetVisualConfigs(__GLXclientState * cl, GLbyte * pc) return Success; } -#define __GLX_TOTAL_FBCONFIG_ATTRIBS (37) +#define __GLX_TOTAL_FBCONFIG_ATTRIBS (44) #define __GLX_FBCONFIG_ATTRIBS_LENGTH (__GLX_TOTAL_FBCONFIG_ATTRIBS * 2) /** * Send the set of GLXFBConfigs to the client. There is not currently @@ -1111,13 +1117,23 @@ DoGetFBConfigs(__GLXclientState * cl, unsigned screen) WRITE_PAIR(GLX_SWAP_METHOD_OML, modes->swapMethod); WRITE_PAIR(GLX_SAMPLES_SGIS, modes->samples); WRITE_PAIR(GLX_SAMPLE_BUFFERS_SGIS, modes->sampleBuffers); - /* GLX_VISUAL_SELECT_GROUP_SGIX ? */ + WRITE_PAIR(GLX_VISUAL_SELECT_GROUP_SGIX, modes->visualSelectGroup); WRITE_PAIR(GLX_DRAWABLE_TYPE, modes->drawableType); WRITE_PAIR(GLX_BIND_TO_TEXTURE_RGB_EXT, modes->bindToTextureRgb); WRITE_PAIR(GLX_BIND_TO_TEXTURE_RGBA_EXT, modes->bindToTextureRgba); WRITE_PAIR(GLX_BIND_TO_MIPMAP_TEXTURE_EXT, modes->bindToMipmapTexture); WRITE_PAIR(GLX_BIND_TO_TEXTURE_TARGETS_EXT, modes->bindToTextureTargets); + WRITE_PAIR(GLX_Y_INVERTED_EXT, modes->yInverted); + if (modes->drawableType & GLX_PBUFFER_BIT) { + WRITE_PAIR(GLX_MAX_PBUFFER_WIDTH, modes->maxPbufferWidth); + WRITE_PAIR(GLX_MAX_PBUFFER_HEIGHT, modes->maxPbufferHeight); + WRITE_PAIR(GLX_MAX_PBUFFER_PIXELS, modes->maxPbufferPixels); + WRITE_PAIR(GLX_OPTIMAL_PBUFFER_WIDTH_SGIX, + modes->optimalPbufferWidth); + WRITE_PAIR(GLX_OPTIMAL_PBUFFER_HEIGHT_SGIX, + modes->optimalPbufferHeight); + } /* Add attribute only if its value is not default. */ if (modes->sRGBCapable != GL_FALSE) { WRITE_PAIR(GLX_FRAMEBUFFER_SRGB_CAPABLE_EXT, modes->sRGBCapable); @@ -1414,6 +1430,8 @@ DoCreatePbuffer(ClientPtr client, int screenNum, XID fbconfigId, width, height, config->rgbBits, 0); __glXleaveServer(GL_FALSE); + if (!pPixmap) + return BadAlloc; /* Assign the pixmap the same id as the pbuffer and add it as a * resource so it and the DRI2 drawable will be reclaimed when the @@ -1455,7 +1473,6 @@ __glXDisp_CreatePbuffer(__GLXclientState * cl, GLbyte * pc) height = attrs[i * 2 + 1]; break; case GLX_LARGEST_PBUFFER: - case GLX_PRESERVED_CONTENTS: /* FIXME: huh... */ break; } @@ -1473,6 +1490,10 @@ __glXDisp_CreateGLXPbufferSGIX(__GLXclientState * cl, GLbyte * pc) REQUEST_AT_LEAST_SIZE(xGLXCreateGLXPbufferSGIXReq); + /* + * We should really handle attributes correctly, but this extension + * is so rare I have difficulty caring. + */ return DoCreatePbuffer(cl->client, req->screen, req->fbconfig, req->width, req->height, req->pbuffer); } @@ -1680,15 +1701,14 @@ DoQueryContext(__GLXclientState * cl, GLXContextID gcId) ClientPtr client = cl->client; __GLXcontext *ctx; xGLXQueryContextInfoEXTReply reply; - int nProps; - int *sendBuf, *pSendBuf; + int nProps = 3; + int sendBuf[nProps * 2]; int nReplyBytes; int err; if (!validGlxContext(cl->client, gcId, DixReadAccess, &ctx, &err)) return err; - nProps = 3; reply = (xGLXQueryContextInfoEXTReply) { .type = X_Reply, .sequenceNumber = client->sequence, @@ -1697,17 +1717,12 @@ DoQueryContext(__GLXclientState * cl, GLXContextID gcId) }; nReplyBytes = reply.length << 2; - sendBuf = (int *) malloc((size_t) nReplyBytes); - if (sendBuf == NULL) { - return __glXError(GLXBadContext); /* XXX: Is this correct? */ - } - pSendBuf = sendBuf; - *pSendBuf++ = GLX_SHARE_CONTEXT_EXT; - *pSendBuf++ = (int) (ctx->share_id); - *pSendBuf++ = GLX_VISUAL_ID_EXT; - *pSendBuf++ = (int) (ctx->config->visualID); - *pSendBuf++ = GLX_SCREEN_EXT; - *pSendBuf++ = (int) (ctx->pGlxScreen->pScreen->myNum); + sendBuf[0] = GLX_SHARE_CONTEXT_EXT; + sendBuf[1] = (int) (ctx->share_id); + sendBuf[2] = GLX_VISUAL_ID_EXT; + sendBuf[3] = (int) (ctx->config->visualID); + sendBuf[4] = GLX_SCREEN_EXT; + sendBuf[5] = (int) (ctx->pGlxScreen->pScreen->myNum); if (client->swapped) { __glXSwapQueryContextInfoEXTReply(client, &reply, sendBuf); @@ -1716,7 +1731,6 @@ DoQueryContext(__GLXclientState * cl, GLXContextID gcId) WriteToClient(client, sz_xGLXQueryContextInfoEXTReply, &reply); WriteToClient(client, nReplyBytes, sendBuf); } - free((char *) sendBuf); return Success; } @@ -1890,28 +1904,44 @@ DoGetDrawableAttributes(__GLXclientState * cl, XID drawId) ClientPtr client = cl->client; xGLXGetDrawableAttributesReply reply; __GLXdrawable *pGlxDraw; - CARD32 attributes[6]; - int numAttribs, error; + CARD32 attributes[14]; + int numAttribs = 0, error; if (!validGlxDrawable(client, drawId, GLX_DRAWABLE_ANY, DixGetAttrAccess, &pGlxDraw, &error)) return error; - numAttribs = 3; - reply = (xGLXGetDrawableAttributesReply) { - .type = X_Reply, - .sequenceNumber = client->sequence, - .length = numAttribs << 1, - .numAttribs = numAttribs - }; - attributes[0] = GLX_TEXTURE_TARGET_EXT; attributes[1] = pGlxDraw->target == GL_TEXTURE_2D ? GLX_TEXTURE_2D_EXT : GLX_TEXTURE_RECTANGLE_EXT; + numAttribs++; attributes[2] = GLX_Y_INVERTED_EXT; attributes[3] = GL_FALSE; + numAttribs++; attributes[4] = GLX_EVENT_MASK; attributes[5] = pGlxDraw->eventMask; + numAttribs++; + attributes[6] = GLX_WIDTH; + attributes[7] = pGlxDraw->pDraw->width; + numAttribs++; + attributes[8] = GLX_HEIGHT; + attributes[9] = pGlxDraw->pDraw->height; + numAttribs++; + attributes[10] = GLX_FBCONFIG_ID; + attributes[11] = pGlxDraw->config->fbconfigID; + numAttribs++; + if (pGlxDraw->type == GLX_DRAWABLE_PBUFFER) { + attributes[12] = GLX_PRESERVED_CONTENTS; + attributes[13] = GL_TRUE; + numAttribs++; + } + + reply = (xGLXGetDrawableAttributesReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = numAttribs << 1, + .numAttribs = numAttribs + }; if (client->swapped) { __glXSwapGetDrawableAttributesReply(client, &reply, attributes); @@ -2160,15 +2190,12 @@ __glXDisp_RenderLarge(__GLXclientState * cl, GLbyte * pc) ** Make enough space in the buffer, then copy the entire request. */ if (cl->largeCmdBufSize < cmdlen) { - if (!cl->largeCmdBuf) { - cl->largeCmdBuf = (GLbyte *) malloc(cmdlen); - } - else { - cl->largeCmdBuf = (GLbyte *) realloc(cl->largeCmdBuf, cmdlen); - } - if (!cl->largeCmdBuf) { - return BadAlloc; - } + GLbyte *newbuf = cl->largeCmdBuf; + + if (!(newbuf = realloc(newbuf, cmdlen))) + return BadAlloc; + + cl->largeCmdBuf = newbuf; cl->largeCmdBufSize = cmdlen; } memcpy(cl->largeCmdBuf, pc, dataBytes); @@ -2384,7 +2411,7 @@ __glXDisp_QueryServerString(__GLXclientState * cl, GLbyte * pc) switch (req->name) { case GLX_VENDOR: - ptr = pGlxScreen->GLXvendor; + ptr = GLXServerVendorName; break; case GLX_VERSION: /* Return to the server version rather than the screen version diff --git a/glx/glxcontext.h b/glx/glxcontext.h index 4764e56f5..3d08c9929 100644 --- a/glx/glxcontext.h +++ b/glx/glxcontext.h @@ -55,7 +55,6 @@ struct __GLXcontext { /* ** list of context structs */ - __GLXcontext *last; __GLXcontext *next; /* diff --git a/glx/glxdri2.c b/glx/glxdri2.c index 8a1fa4159..f662b2188 100644 --- a/glx/glxdri2.c +++ b/glx/glxdri2.c @@ -941,8 +941,7 @@ __glXDRIscreenProbe(ScreenPtr pScreen) if (screen == NULL) return NULL; - if (!xf86LoaderCheckSymbol("DRI2Connect") || - !DRI2Connect(serverClient, pScreen, DRI2DriverDRI, + if (!DRI2Connect(serverClient, pScreen, DRI2DriverDRI, &screen->fd, &driverName, &deviceName)) { LogMessage(X_INFO, "AIGLX: Screen %d is not DRI2 capable\n", pScreen->myNum); diff --git a/glx/glxext.c b/glx/glxext.c index bc7fe8217..2c3f5edf0 100644 --- a/glx/glxext.c +++ b/glx/glxext.c @@ -286,10 +286,6 @@ glxClientCallback(CallbackListPtr *list, pointer closure, pointer data) switch (pClient->clientState) { case ClientStateRunning: - /* - ** By default, assume that the client supports - ** GLX major version 1 minor version 0 protocol. - */ cl->client = pClient; break; diff --git a/glx/glxscreens.c b/glx/glxscreens.c index 61d590cc8..78769f401 100644 --- a/glx/glxscreens.c +++ b/glx/glxscreens.c @@ -128,7 +128,6 @@ static const char GLServerExtensions[] = "GL_NV_blend_square " "GL_NV_depth_clamp " "GL_NV_fog_distance " - "GL_NV_fragment_program " "GL_NV_fragment_program_option " "GL_NV_fragment_program2 " "GL_NV_light_max_exponent " @@ -139,9 +138,6 @@ static const char GLServerExtensions[] = "GL_NV_texture_env_combine4 " "GL_NV_texture_expand_normal " "GL_NV_texture_rectangle " - "GL_NV_vertex_program " - "GL_NV_vertex_program1_1 " - "GL_NV_vertex_program2 " "GL_NV_vertex_program2_option " "GL_NV_vertex_program3 " "GL_OES_compressed_paletted_texture " @@ -154,13 +150,14 @@ static const char GLServerExtensions[] = "GL_SGIS_texture_edge_clamp " "GL_SGIS_texture_lod " "GL_SGIX_depth_texture " - "GL_SGIX_shadow " "GL_SGIX_shadow_ambient " "GL_SUN_slice_accum "; + "GL_SGIX_shadow " + "GL_SGIX_shadow_ambient " + "GL_SUN_slice_accum "; /* ** We have made the simplifying assuption that the same extensions are ** supported across all screens in a multi-screen system. */ -static char GLXServerVendorName[] = "SGI"; unsigned glxMajorVersion = SERVER_GLX_MAJOR_VERSION; unsigned glxMinorVersion = SERVER_GLX_MINOR_VERSION; static char GLXServerExtensions[] = @@ -169,12 +166,14 @@ static char GLXServerExtensions[] = "GLX_EXT_visual_rating " "GLX_EXT_import_context " "GLX_EXT_texture_from_pixmap " - "GLX_OML_swap_method " "GLX_SGI_make_current_read " + "GLX_OML_swap_method " + "GLX_SGI_make_current_read " #ifndef __APPLE__ "GLX_SGIS_multisample " #endif "GLX_SGIX_fbconfig " - "GLX_SGIX_pbuffer " "GLX_MESA_copy_sub_buffer "; + "GLX_SGIX_pbuffer " + "GLX_MESA_copy_sub_buffer "; static Bool glxCloseScreen(ScreenPtr pScreen) @@ -330,7 +329,6 @@ __glXScreenInit(__GLXscreen * pGlxScreen, ScreenPtr pScreen) pGlxScreen->pScreen = pScreen; pGlxScreen->GLextensions = strdup(GLServerExtensions); - pGlxScreen->GLXvendor = strdup(GLXServerVendorName); pGlxScreen->GLXextensions = strdup(GLXServerExtensions); /* All GLX providers must support all of the functionality required for at @@ -420,7 +418,6 @@ __glXScreenInit(__GLXscreen * pGlxScreen, ScreenPtr pScreen) void __glXScreenDestroy(__GLXscreen * screen) { - free(screen->GLXvendor); free(screen->GLXextensions); free(screen->GLextensions); free(screen->visuals); diff --git a/glx/glxscreens.h b/glx/glxscreens.h index 0a7b6043e..c8119fd21 100644 --- a/glx/glxscreens.h +++ b/glx/glxscreens.h @@ -54,8 +54,6 @@ struct __GLXconfig { GLint level; - GLint pixmapMode; - /* GLX */ GLint visualID; GLint visualType; /**< One of the GLX X visual types. (i.e., @@ -94,8 +92,6 @@ struct __GLXconfig { /* OML_swap_method */ GLint swapMethod; - GLint screen; - /* EXT_texture_from_pixmap */ GLint bindToTextureRgb; GLint bindToTextureRgba; @@ -145,7 +141,6 @@ struct __GLXscreen { char *GLextensions; - char *GLXvendor; char *GLXextensions; /** diff --git a/hw/dmx/Makefile.am b/hw/dmx/Makefile.am index fb727e656..a05af139e 100644 --- a/hw/dmx/Makefile.am +++ b/hw/dmx/Makefile.am @@ -56,8 +56,6 @@ Xdmx_SOURCES = dmx.c \ dmxprop.h \ dmxscrinit.c \ dmxscrinit.h \ - dmxshadow.c \ - dmxshadow.h \ dmxstat.c \ dmxstat.h \ dmxsync.c \ diff --git a/hw/dmx/dmx.h b/hw/dmx/dmx.h index f0cb04459..7242e4380 100644 --- a/hw/dmx/dmx.h +++ b/hw/dmx/dmx.h @@ -254,10 +254,6 @@ typedef struct _DMXScreenInfo { /* Global variables available to all Xserver/hw/dmx routines. */ extern int dmxNumScreens; /**< Number of dmxScreens */ extern DMXScreenInfo *dmxScreens; /**< List of outputs */ -extern int dmxShadowFB; /**< Non-zero if using - - * shadow frame-buffer - * (deprecated) */ extern XErrorEvent dmxLastErrorEvent; /**< Last error that * occurred */ diff --git a/hw/dmx/dmxcursor.c b/hw/dmx/dmxcursor.c index 35aca81b4..70f2bc4b4 100644 --- a/hw/dmx/dmxcursor.c +++ b/hw/dmx/dmxcursor.c @@ -197,8 +197,6 @@ miPointerScreenFuncRec dmxPointerCursorFuncs = { dmxCursorOffScreen, dmxCrossScreen, dmxWarpCursor, - NULL, - NULL, }; /** Create a list of screens that we'll manipulate. */ diff --git a/hw/dmx/dmxinit.c b/hw/dmx/dmxinit.c index 7de402b06..65416ed26 100644 --- a/hw/dmx/dmxinit.c +++ b/hw/dmx/dmxinit.c @@ -82,8 +82,6 @@ DMXScreenInfo *dmxScreens; int dmxNumInputs; DMXInputInfo *dmxInputs; -int dmxShadowFB = FALSE; - XErrorEvent dmxLastErrorEvent; Bool dmxErrorOccurred = FALSE; @@ -854,9 +852,6 @@ InitOutput(ScreenInfo * pScreenInfo, int argc, char *argv[]) /* Initialized things that need timer hooks */ dmxStatInit(); dmxSyncInit(); /* Calls RegisterBlockAndWakeupHandlers */ - - dmxLog(dmxInfo, "Shadow framebuffer support %s\n", - dmxShadowFB ? "enabled" : "disabled"); } /* RATS: Assuming the fp string (which comes from the command-line argv @@ -951,10 +946,6 @@ ddxProcessArgument(int argc, char *argv[], int i) retval = 2; } else if (!strcmp(argv[i], "-noshadowfb")) { - dmxLog(dmxWarning, - "-noshadowfb has been deprecated " - "since it is now the default\n"); - dmxShadowFB = FALSE; retval = 1; } else if (!strcmp(argv[i], "-nomulticursor")) { @@ -962,7 +953,6 @@ ddxProcessArgument(int argc, char *argv[], int i) retval = 1; } else if (!strcmp(argv[i], "-shadowfb")) { - dmxShadowFB = TRUE; retval = 1; } else if (!strcmp(argv[i], "-configfile")) { diff --git a/hw/dmx/dmxpict.c b/hw/dmx/dmxpict.c index b1177cf41..c9762c2f1 100644 --- a/hw/dmx/dmxpict.c +++ b/hw/dmx/dmxpict.c @@ -141,10 +141,6 @@ dmxPictureInit(ScreenPtr pScreen, PictFormatPtr formats, int nformats) DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum]; PictureScreenPtr ps; - /* The shadow framebuffer only relies on FB to be initialized */ - if (dmxShadowFB) - return fbPictureInit(pScreen, formats, nformats); - if (!miPictureInit(pScreen, formats, nformats)) return FALSE; diff --git a/hw/dmx/dmxscrinit.c b/hw/dmx/dmxscrinit.c index 849ef16a1..963d3a9de 100644 --- a/hw/dmx/dmxscrinit.c +++ b/hw/dmx/dmxscrinit.c @@ -41,7 +41,6 @@ #include "dmx.h" #include "dmxsync.h" -#include "dmxshadow.h" #include "dmxscrinit.h" #include "dmxcursor.h" #include "dmxgc.h" @@ -159,37 +158,18 @@ dmxBEScreenInit(ScreenPtr pScreen) XMapWindow(dmxScreen->beDisplay, dmxScreen->scrnWin); - if (dmxShadowFB) { - mask = (GCFunction | GCPlaneMask | GCClipMask); - gcvals.function = GXcopy; - gcvals.plane_mask = AllPlanes; - gcvals.clip_mask = None; - - dmxScreen->shadowGC = XCreateGC(dmxScreen->beDisplay, - dmxScreen->scrnWin, mask, &gcvals); - - dmxScreen->shadowFBImage = - XCreateImage(dmxScreen->beDisplay, - dmxScreen->beVisuals[dmxScreen->beDefVisualIndex]. - visual, dmxScreen->beDepth, ZPixmap, 0, - (char *) dmxScreen->shadow, dmxScreen->scrnWidth, - dmxScreen->scrnHeight, dmxScreen->beBPP, - PixmapBytePad(dmxScreen->scrnWidth, dmxScreen->beBPP)); - } - else { - /* Create default drawables (used during GC creation) */ - for (i = 0; i < dmxScreen->beNumPixmapFormats; i++) - for (j = 0; j < dmxScreen->beNumDepths; j++) - if ((dmxScreen->bePixmapFormats[i].depth == 1) || - (dmxScreen->bePixmapFormats[i].depth == - dmxScreen->beDepths[j])) { - dmxScreen->scrnDefDrawables[i] = (Drawable) - XCreatePixmap(dmxScreen->beDisplay, dmxScreen->scrnWin, - 1, 1, - dmxScreen->bePixmapFormats[i].depth); - break; - } - } + /* Create default drawables (used during GC creation) */ + for (i = 0; i < dmxScreen->beNumPixmapFormats; i++) + for (j = 0; j < dmxScreen->beNumDepths; j++) + if ((dmxScreen->bePixmapFormats[i].depth == 1) || + (dmxScreen->bePixmapFormats[i].depth == + dmxScreen->beDepths[j])) { + dmxScreen->scrnDefDrawables[i] = (Drawable) + XCreatePixmap(dmxScreen->beDisplay, dmxScreen->scrnWin, + 1, 1, + dmxScreen->bePixmapFormats[i].depth); + break; + } } /** Initialize screen number \a pScreen->myNum. */ @@ -215,19 +195,12 @@ dmxScreenInit(ScreenPtr pScreen, int argc, char *argv[]) dmxGeneration = serverGeneration; } - if (dmxShadowFB) { - dmxScreen->shadow = shadowAlloc(dmxScreen->scrnWidth, - dmxScreen->scrnHeight, - dmxScreen->beBPP); - } - else { - if (!dmxInitGC(pScreen)) - return FALSE; - if (!dmxInitWindow(pScreen)) - return FALSE; - if (!dmxInitPixmap(pScreen)) - return FALSE; - } + if (!dmxInitGC(pScreen)) + return FALSE; + if (!dmxInitWindow(pScreen)) + return FALSE; + if (!dmxInitPixmap(pScreen)) + return FALSE; /* * Initalise the visual types. miSetVisualTypesAndMasks() requires @@ -267,7 +240,7 @@ dmxScreenInit(ScreenPtr pScreen, int argc, char *argv[]) } fbScreenInit(pScreen, - dmxShadowFB ? dmxScreen->shadow : NULL, + NULL, dmxScreen->scrnWidth, dmxScreen->scrnHeight, dmxScreen->beXDPI, @@ -278,22 +251,14 @@ dmxScreenInit(ScreenPtr pScreen, int argc, char *argv[]) pScreen->GetWindowPixmap = NULL; pScreen->SetWindowPixmap = NULL; - if (dmxShadowFB && !shadowInit(pScreen, dmxShadowUpdateProc, NULL)) - return FALSE; + MAXSCREENSALLOC(dmxCursorGeneration); + if (dmxCursorGeneration[pScreen->myNum] != serverGeneration) { + if (!(miPointerInitialize(pScreen, + &dmxPointerSpriteFuncs, + &dmxPointerCursorFuncs, FALSE))) + return FALSE; - if (dmxShadowFB) { - miDCInitialize(pScreen, &dmxPointerCursorFuncs); - } - else { - MAXSCREENSALLOC(dmxCursorGeneration); - if (dmxCursorGeneration[pScreen->myNum] != serverGeneration) { - if (!(miPointerInitialize(pScreen, - &dmxPointerSpriteFuncs, - &dmxPointerCursorFuncs, FALSE))) - return FALSE; - - dmxCursorGeneration[pScreen->myNum] = serverGeneration; - } + dmxCursorGeneration[pScreen->myNum] = serverGeneration; } DMX_WRAP(CloseScreen, dmxCloseScreen, dmxScreen, pScreen); @@ -301,49 +266,47 @@ dmxScreenInit(ScreenPtr pScreen, int argc, char *argv[]) dmxBEScreenInit(pScreen); - if (!dmxShadowFB) { - /* Wrap GC functions */ - DMX_WRAP(CreateGC, dmxCreateGC, dmxScreen, pScreen); - - /* Wrap Window functions */ - DMX_WRAP(CreateWindow, dmxCreateWindow, dmxScreen, pScreen); - DMX_WRAP(DestroyWindow, dmxDestroyWindow, dmxScreen, pScreen); - DMX_WRAP(PositionWindow, dmxPositionWindow, dmxScreen, pScreen); - DMX_WRAP(ChangeWindowAttributes, dmxChangeWindowAttributes, dmxScreen, - pScreen); - DMX_WRAP(RealizeWindow, dmxRealizeWindow, dmxScreen, pScreen); - DMX_WRAP(UnrealizeWindow, dmxUnrealizeWindow, dmxScreen, pScreen); - DMX_WRAP(RestackWindow, dmxRestackWindow, dmxScreen, pScreen); - DMX_WRAP(WindowExposures, dmxWindowExposures, dmxScreen, pScreen); - DMX_WRAP(CopyWindow, dmxCopyWindow, dmxScreen, pScreen); - - DMX_WRAP(ResizeWindow, dmxResizeWindow, dmxScreen, pScreen); - DMX_WRAP(ReparentWindow, dmxReparentWindow, dmxScreen, pScreen); - - DMX_WRAP(ChangeBorderWidth, dmxChangeBorderWidth, dmxScreen, pScreen); - - /* Wrap Image functions */ - DMX_WRAP(GetImage, dmxGetImage, dmxScreen, pScreen); - DMX_WRAP(GetSpans, dmxGetSpans, dmxScreen, pScreen); - - /* Wrap Pixmap functions */ - DMX_WRAP(CreatePixmap, dmxCreatePixmap, dmxScreen, pScreen); - DMX_WRAP(DestroyPixmap, dmxDestroyPixmap, dmxScreen, pScreen); - DMX_WRAP(BitmapToRegion, dmxBitmapToRegion, dmxScreen, pScreen); - - /* Wrap Font functions */ - DMX_WRAP(RealizeFont, dmxRealizeFont, dmxScreen, pScreen); - DMX_WRAP(UnrealizeFont, dmxUnrealizeFont, dmxScreen, pScreen); - - /* Wrap Colormap functions */ - DMX_WRAP(CreateColormap, dmxCreateColormap, dmxScreen, pScreen); - DMX_WRAP(DestroyColormap, dmxDestroyColormap, dmxScreen, pScreen); - DMX_WRAP(InstallColormap, dmxInstallColormap, dmxScreen, pScreen); - DMX_WRAP(StoreColors, dmxStoreColors, dmxScreen, pScreen); - - /* Wrap Shape functions */ - DMX_WRAP(SetShape, dmxSetShape, dmxScreen, pScreen); - } + /* Wrap GC functions */ + DMX_WRAP(CreateGC, dmxCreateGC, dmxScreen, pScreen); + + /* Wrap Window functions */ + DMX_WRAP(CreateWindow, dmxCreateWindow, dmxScreen, pScreen); + DMX_WRAP(DestroyWindow, dmxDestroyWindow, dmxScreen, pScreen); + DMX_WRAP(PositionWindow, dmxPositionWindow, dmxScreen, pScreen); + DMX_WRAP(ChangeWindowAttributes, dmxChangeWindowAttributes, dmxScreen, + pScreen); + DMX_WRAP(RealizeWindow, dmxRealizeWindow, dmxScreen, pScreen); + DMX_WRAP(UnrealizeWindow, dmxUnrealizeWindow, dmxScreen, pScreen); + DMX_WRAP(RestackWindow, dmxRestackWindow, dmxScreen, pScreen); + DMX_WRAP(WindowExposures, dmxWindowExposures, dmxScreen, pScreen); + DMX_WRAP(CopyWindow, dmxCopyWindow, dmxScreen, pScreen); + + DMX_WRAP(ResizeWindow, dmxResizeWindow, dmxScreen, pScreen); + DMX_WRAP(ReparentWindow, dmxReparentWindow, dmxScreen, pScreen); + + DMX_WRAP(ChangeBorderWidth, dmxChangeBorderWidth, dmxScreen, pScreen); + + /* Wrap Image functions */ + DMX_WRAP(GetImage, dmxGetImage, dmxScreen, pScreen); + DMX_WRAP(GetSpans, dmxGetSpans, dmxScreen, pScreen); + + /* Wrap Pixmap functions */ + DMX_WRAP(CreatePixmap, dmxCreatePixmap, dmxScreen, pScreen); + DMX_WRAP(DestroyPixmap, dmxDestroyPixmap, dmxScreen, pScreen); + DMX_WRAP(BitmapToRegion, dmxBitmapToRegion, dmxScreen, pScreen); + + /* Wrap Font functions */ + DMX_WRAP(RealizeFont, dmxRealizeFont, dmxScreen, pScreen); + DMX_WRAP(UnrealizeFont, dmxUnrealizeFont, dmxScreen, pScreen); + + /* Wrap Colormap functions */ + DMX_WRAP(CreateColormap, dmxCreateColormap, dmxScreen, pScreen); + DMX_WRAP(DestroyColormap, dmxDestroyColormap, dmxScreen, pScreen); + DMX_WRAP(InstallColormap, dmxInstallColormap, dmxScreen, pScreen); + DMX_WRAP(StoreColors, dmxStoreColors, dmxScreen, pScreen); + + /* Wrap Shape functions */ + DMX_WRAP(SetShape, dmxSetShape, dmxScreen, pScreen); if (!dmxCreateDefColormap(pScreen)) return FALSE; @@ -370,22 +333,13 @@ dmxBECloseScreen(ScreenPtr pScreen) XDestroyWindow(dmxScreen->beDisplay, dmxScreen->scrnWin); dmxScreen->scrnWin = (Window) 0; - if (dmxShadowFB) { - /* Free the shadow GC and image assocated with the back-end server */ - XFreeGC(dmxScreen->beDisplay, dmxScreen->shadowGC); - dmxScreen->shadowGC = NULL; - XFree(dmxScreen->shadowFBImage); - dmxScreen->shadowFBImage = NULL; - } - else { - /* Free the default drawables */ - for (i = 0; i < dmxScreen->beNumPixmapFormats; i++) { - if (dmxScreen->scrnDefDrawables[i]) { - XFreePixmap(dmxScreen->beDisplay, - dmxScreen->scrnDefDrawables[i]); - dmxScreen->scrnDefDrawables[i] = (Drawable) 0; - } - } + /* Free the default drawables */ + for (i = 0; i < dmxScreen->beNumPixmapFormats; i++) { + if (dmxScreen->scrnDefDrawables[i]) { + XFreePixmap(dmxScreen->beDisplay, + dmxScreen->scrnDefDrawables[i]); + dmxScreen->scrnDefDrawables[i] = (Drawable) 0; + } } /* Free resources allocated during initialization (in dmxinit.c) */ @@ -432,48 +386,41 @@ dmxCloseScreen(ScreenPtr pScreen) dmxResetFonts(); } - if (dmxShadowFB) { - /* Free the shadow framebuffer */ - free(dmxScreen->shadow); - } - else { - - /* Unwrap Shape functions */ - DMX_UNWRAP(SetShape, dmxScreen, pScreen); + /* Unwrap Shape functions */ + DMX_UNWRAP(SetShape, dmxScreen, pScreen); - /* Unwrap the pScreen functions */ - DMX_UNWRAP(CreateGC, dmxScreen, pScreen); + /* Unwrap the pScreen functions */ + DMX_UNWRAP(CreateGC, dmxScreen, pScreen); - DMX_UNWRAP(CreateWindow, dmxScreen, pScreen); - DMX_UNWRAP(DestroyWindow, dmxScreen, pScreen); - DMX_UNWRAP(PositionWindow, dmxScreen, pScreen); - DMX_UNWRAP(ChangeWindowAttributes, dmxScreen, pScreen); - DMX_UNWRAP(RealizeWindow, dmxScreen, pScreen); - DMX_UNWRAP(UnrealizeWindow, dmxScreen, pScreen); - DMX_UNWRAP(RestackWindow, dmxScreen, pScreen); - DMX_UNWRAP(WindowExposures, dmxScreen, pScreen); - DMX_UNWRAP(CopyWindow, dmxScreen, pScreen); + DMX_UNWRAP(CreateWindow, dmxScreen, pScreen); + DMX_UNWRAP(DestroyWindow, dmxScreen, pScreen); + DMX_UNWRAP(PositionWindow, dmxScreen, pScreen); + DMX_UNWRAP(ChangeWindowAttributes, dmxScreen, pScreen); + DMX_UNWRAP(RealizeWindow, dmxScreen, pScreen); + DMX_UNWRAP(UnrealizeWindow, dmxScreen, pScreen); + DMX_UNWRAP(RestackWindow, dmxScreen, pScreen); + DMX_UNWRAP(WindowExposures, dmxScreen, pScreen); + DMX_UNWRAP(CopyWindow, dmxScreen, pScreen); - DMX_UNWRAP(ResizeWindow, dmxScreen, pScreen); - DMX_UNWRAP(ReparentWindow, dmxScreen, pScreen); + DMX_UNWRAP(ResizeWindow, dmxScreen, pScreen); + DMX_UNWRAP(ReparentWindow, dmxScreen, pScreen); - DMX_UNWRAP(ChangeBorderWidth, dmxScreen, pScreen); + DMX_UNWRAP(ChangeBorderWidth, dmxScreen, pScreen); - DMX_UNWRAP(GetImage, dmxScreen, pScreen); - DMX_UNWRAP(GetSpans, dmxScreen, pScreen); + DMX_UNWRAP(GetImage, dmxScreen, pScreen); + DMX_UNWRAP(GetSpans, dmxScreen, pScreen); - DMX_UNWRAP(CreatePixmap, dmxScreen, pScreen); - DMX_UNWRAP(DestroyPixmap, dmxScreen, pScreen); - DMX_UNWRAP(BitmapToRegion, dmxScreen, pScreen); + DMX_UNWRAP(CreatePixmap, dmxScreen, pScreen); + DMX_UNWRAP(DestroyPixmap, dmxScreen, pScreen); + DMX_UNWRAP(BitmapToRegion, dmxScreen, pScreen); - DMX_UNWRAP(RealizeFont, dmxScreen, pScreen); - DMX_UNWRAP(UnrealizeFont, dmxScreen, pScreen); + DMX_UNWRAP(RealizeFont, dmxScreen, pScreen); + DMX_UNWRAP(UnrealizeFont, dmxScreen, pScreen); - DMX_UNWRAP(CreateColormap, dmxScreen, pScreen); - DMX_UNWRAP(DestroyColormap, dmxScreen, pScreen); - DMX_UNWRAP(InstallColormap, dmxScreen, pScreen); - DMX_UNWRAP(StoreColors, dmxScreen, pScreen); - } + DMX_UNWRAP(CreateColormap, dmxScreen, pScreen); + DMX_UNWRAP(DestroyColormap, dmxScreen, pScreen); + DMX_UNWRAP(InstallColormap, dmxScreen, pScreen); + DMX_UNWRAP(StoreColors, dmxScreen, pScreen); DMX_UNWRAP(SaveScreen, dmxScreen, pScreen); diff --git a/hw/dmx/dmxshadow.c b/hw/dmx/dmxshadow.c deleted file mode 100644 index 9b4bafc34..000000000 --- a/hw/dmx/dmxshadow.c +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright 2001 Red Hat Inc., Durham, North Carolina. - * - * All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation on the rights to use, copy, modify, merge, - * publish, distribute, sublicense, and/or sell copies of the Software, - * and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice (including the - * next paragraph) shall be included in all copies or substantial - * portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NON-INFRINGEMENT. IN NO EVENT SHALL RED HAT AND/OR THEIR SUPPLIERS - * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -/* - * Authors: - * Kevin E. Martin <kem@redhat.com> - * David H. Dawes <dawes@xfree86.org> - * - */ - -#ifdef HAVE_DMX_CONFIG_H -#include <dmx-config.h> -#endif - -#include "dmx.h" -#include "dmxsync.h" -#include "dmxshadow.h" - -/** \file - * This file provides support for the shadow frame buffer. */ - -/** Update the screen from the shadow frame buffer. */ -void -dmxShadowUpdateProc(ScreenPtr pScreen, shadowBufPtr pBuf) -{ - RegionPtr damage = &pBuf->damage; - int nbox = RegionNumRects(damage); - BoxPtr pbox = RegionRects(damage); - DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum]; - - if (!dmxScreen->beDisplay) - return; - - while (nbox--) { - XPutImage(dmxScreen->beDisplay, - dmxScreen->scrnWin, - dmxScreen->shadowGC, - dmxScreen->shadowFBImage, - pbox->x1, pbox->y1, - pbox->x1, pbox->y1, pbox->x2 - pbox->x1, pbox->y2 - pbox->y1); - - pbox++; - } - - dmxSync(dmxScreen, FALSE); -} diff --git a/hw/dmx/dmxshadow.h b/hw/dmx/dmxshadow.h deleted file mode 100644 index 081b4d1dc..000000000 --- a/hw/dmx/dmxshadow.h +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2001 Red Hat Inc., Durham, North Carolina. - * - * All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation on the rights to use, copy, modify, merge, - * publish, distribute, sublicense, and/or sell copies of the Software, - * and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice (including the - * next paragraph) shall be included in all copies or substantial - * portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NON-INFRINGEMENT. IN NO EVENT SHALL RED HAT AND/OR THEIR SUPPLIERS - * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -/* - * Authors: - * Kevin E. Martin <kem@redhat.com> - * David H. Dawes <dawes@xfree86.org> - * - */ - -/** \file - * Interface for shadow framebuffer support. \see dmxshadow.c */ - -#ifndef DMXSHADOW_H -#define DMXSHADOW_H - -#include "shadow.h" -#include "scrnintstr.h" - -extern void dmxShadowUpdateProc(ScreenPtr pScreen, shadowBufPtr pBuf); - -#endif /* DMXSHADOW_H */ diff --git a/hw/dmx/glxProxy/Makefile.am b/hw/dmx/glxProxy/Makefile.am index 4ee1036b3..c3df169e1 100644 --- a/hw/dmx/glxProxy/Makefile.am +++ b/hw/dmx/glxProxy/Makefile.am @@ -22,7 +22,6 @@ libglxproxy_a_SOURCES = compsize.c \ glxsingle.h \ glxswap.c \ glxswap.h \ - glxutil.c \ glxutil.h \ glxvendor.c \ glxvendor.h \ diff --git a/hw/dmx/glxProxy/glxcmds.c b/hw/dmx/glxProxy/glxcmds.c index 8cdb25ec6..335da37ac 100644 --- a/hw/dmx/glxProxy/glxcmds.c +++ b/hw/dmx/glxProxy/glxcmds.c @@ -2734,8 +2734,6 @@ __glXClientInfo(__GLXclientState * cl, GLbyte * pc) int to_screen = 0; int s; - cl->GLClientmajorVersion = req->major; - cl->GLClientminorVersion = req->minor; free(cl->GLClientextensions); buf = (const char *) (req + 1); cl->GLClientextensions = strdup(buf); diff --git a/hw/dmx/glxProxy/glxext.c b/hw/dmx/glxProxy/glxext.c index e72a040ed..b46970864 100644 --- a/hw/dmx/glxProxy/glxext.c +++ b/hw/dmx/glxProxy/glxext.c @@ -88,12 +88,6 @@ ResetClientState(int clientIndex) memset(cl, 0, sizeof(__GLXclientState)); cl->be_displays = keep_be_displays; - /* - ** By default, assume that the client supports - ** GLX major version 1 minor version 0 protocol. - */ - cl->GLClientmajorVersion = 1; - cl->GLClientminorVersion = 0; free(cl->GLClientextensions); memset(cl->be_displays, 0, screenInfo.numScreens * sizeof(Display *)); diff --git a/hw/dmx/glxProxy/glxserver.h b/hw/dmx/glxProxy/glxserver.h index ad9496619..754ad30a0 100644 --- a/hw/dmx/glxProxy/glxserver.h +++ b/hw/dmx/glxProxy/glxserver.h @@ -119,8 +119,6 @@ struct __GLXclientStateRec { /* Back pointer to X client record */ ClientPtr client; - int GLClientmajorVersion; - int GLClientminorVersion; char *GLClientextensions; GLXContextTag *be_currentCTag; diff --git a/hw/dmx/glxProxy/glxutil.c b/hw/dmx/glxProxy/glxutil.c deleted file mode 100644 index f90dbf141..000000000 --- a/hw/dmx/glxProxy/glxutil.c +++ /dev/null @@ -1,37 +0,0 @@ -/* - * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) - * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice including the dates of first publication and - * either this permission notice or a reference to - * http://oss.sgi.com/projects/FreeB/ - * shall be included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF - * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - * - * Except as contained in this notice, the name of Silicon Graphics, Inc. - * shall not be used in advertising or otherwise to promote the sale, use or - * other dealings in this Software without prior written authorization from - * Silicon Graphics, Inc. - */ - -#include "glxserver.h" -#include "glxutil.h" - -void -__glXNop(void) -{ -} diff --git a/hw/dmx/glxProxy/glxutil.h b/hw/dmx/glxProxy/glxutil.h index d3c72862d..605c07b43 100644 --- a/hw/dmx/glxProxy/glxutil.h +++ b/hw/dmx/glxProxy/glxutil.h @@ -31,8 +31,6 @@ * Silicon Graphics, Inc. */ -extern void __glXNop(void); - /* context helper routines */ extern __GLXcontext *__glXLookupContextByTag(__GLXclientState *, GLXContextTag); extern DrawablePtr __glXLookupDrawableByTag(__GLXclientState * cl, diff --git a/hw/dmx/input/dmxbackend.c b/hw/dmx/input/dmxbackend.c index 9463c87d3..807e02328 100644 --- a/hw/dmx/input/dmxbackend.c +++ b/hw/dmx/input/dmxbackend.c @@ -419,10 +419,9 @@ dmxBackendCollectEvents(DevicePtr pDev, } break; case MotionNotify: - DMXDBG9("dmxBackendCollectEvents: MotionNotify %d/%d (mi %d)" + DMXDBG8("dmxBackendCollectEvents: MotionNotify %d/%d" " newscreen=%d: %d %d (e=%d; last=%d,%d)\n", dmxScreen->index, priv->myScreen, - miPointerCurrentScreen()->myNum, priv->newscreen, X.xmotion.x, X.xmotion.y, entered, priv->lastX, priv->lastY); @@ -579,9 +578,6 @@ dmxBackendLateReInit(DevicePtr pDev) GETPRIVFROMPDEV; int x, y; - DMXDBG1("dmxBackendLateReInit miPointerCurrentScreen() = %p\n", - miPointerCurrentScreen()); - dmxBackendSameDisplay(NULL, 0); /* Invalidate cache */ dmxBackendInitPrivate(pDev); dmxBackendComputeCenter(priv); diff --git a/hw/dmx/input/dmxcommon.c b/hw/dmx/input/dmxcommon.c index 5f25e8832..db558b55f 100644 --- a/hw/dmx/input/dmxcommon.c +++ b/hw/dmx/input/dmxcommon.c @@ -502,11 +502,6 @@ dmxCommonMouOn(DevicePtr pDev) GETDMXINPUTFROMPRIV; priv->eventMask |= DMX_POINTER_EVENT_MASK; - if (dmxShadowFB) { - XWarpPointer(priv->display, priv->window, priv->window, - 0, 0, 0, 0, priv->initPointerX, priv->initPointerY); - dmxSync(&dmxScreens[dmxInput->scrnIdx], TRUE); - } if (!priv->be) { XSelectInput(priv->display, priv->window, priv->eventMask); AddEnabledDevice(XConnectionNumber(priv->display)); diff --git a/hw/dmx/man/Xdmx.man b/hw/dmx/man/Xdmx.man index bbce85608..6b3feb13b 100644 --- a/hw/dmx/man/Xdmx.man +++ b/hw/dmx/man/Xdmx.man @@ -179,16 +179,6 @@ will switch to another VC in local (raw) mode. .RE .sp .TP 8 -.BI "-shadowfb" -This option turns on (legacy) support for the shadow frame buffer. -.sp -.TP 8 -.BI "-noshadowfb" -This option turns off (legacy) support for the shadow frame buffer. -Note that this option has been deprecated and will be removed in the -next release. -.sp -.TP 8 .BI "-nomulticursor" This option turns off support for displaying multiple cursors on overlapped back-end displays. This option is available for testing and diff --git a/hw/kdrive/ephyr/ephyr.c b/hw/kdrive/ephyr/ephyr.c index 02d497073..db08e98af 100644 --- a/hw/kdrive/ephyr/ephyr.c +++ b/hw/kdrive/ephyr/ephyr.c @@ -389,10 +389,7 @@ ephyrUnsetInternalDamage(ScreenPtr pScreen) KdScreenPriv(pScreen); KdScreenInfo *screen = pScreenPriv->screen; EphyrScrPriv *scrpriv = screen->driver; - PixmapPtr pPixmap = NULL; - pPixmap = (*pScreen->GetScreenPixmap) (pScreen); - DamageUnregister(&pPixmap->drawable, scrpriv->pDamage); DamageDestroy(scrpriv->pDamage); RemoveBlockAndWakeupHandlers(ephyrInternalDamageBlockHandler, @@ -823,8 +820,6 @@ miPointerScreenFuncRec ephyrPointerScreenFuncs = { ephyrCursorOffScreen, ephyrCrossScreen, ephyrWarpCursor, - NULL, - NULL }; #ifdef XF86DRI diff --git a/hw/kdrive/ephyr/ephyrinit.c b/hw/kdrive/ephyr/ephyrinit.c index 9a1dd7d94..447ff6ba1 100644 --- a/hw/kdrive/ephyr/ephyrinit.c +++ b/hw/kdrive/ephyr/ephyrinit.c @@ -28,6 +28,7 @@ #endif #include "ephyr.h" #include "ephyrlog.h" +#include "glx_extinit.h" extern Window EphyrPreExistingHostWin; extern Bool EphyrWantGrayScale; @@ -47,6 +48,22 @@ extern KdKeyboardDriver LinuxEvdevKeyboardDriver; void processScreenArg(const char *screen_size, char *parent_id); +static const +ExtensionModule ephyrExtensions[] = { +#ifdef GLXEXT + {GlxExtensionInit, "GLX", &noGlxExtension}, +#endif +}; + +static void +ephyrExtensionInit(void) +{ + int i; + + for (i = 0; i < ARRAY_SIZE(ephyrExtensions); i++) + LoadExtension(&ephyrExtensions[i], TRUE); +} + void InitCard(char *name) { @@ -57,6 +74,9 @@ InitCard(char *name) void InitOutput(ScreenInfo * pScreenInfo, int argc, char **argv) { + if (serverGeneration == 1) + ephyrExtensionInit(); + KdInitOutput(pScreenInfo, argc, argv); } diff --git a/hw/xfree86/common/xf86Cursor.c b/hw/xfree86/common/xf86Cursor.c index 65a9e8264..7d0776eaa 100644 --- a/hw/xfree86/common/xf86Cursor.c +++ b/hw/xfree86/common/xf86Cursor.c @@ -72,9 +72,6 @@ static miPointerScreenFuncRec xf86PointerScreenFuncs = { xf86CursorOffScreen, xf86CrossScreen, xf86WarpCursor, - /* let miPointerInitialize take care of these */ - NULL, - NULL }; static xf86ScreenLayoutRec xf86ScreenLayout[MAXSCREENS]; diff --git a/hw/xfree86/modes/xf86Rotate.c b/hw/xfree86/modes/xf86Rotate.c index a3937478f..495af9ba7 100644 --- a/hw/xfree86/modes/xf86Rotate.c +++ b/hw/xfree86/modes/xf86Rotate.c @@ -272,14 +272,10 @@ xf86RotateDestroy(xf86CrtcPtr crtc) screenDrawable = &pScreen->root->drawable; /* Free damage structure */ if (xf86_config->rotation_damage_registered) { - if (screenDrawable) - DamageUnregister(screenDrawable, - xf86_config->rotation_damage); xf86_config->rotation_damage_registered = FALSE; DisableLimitedSchedulingLatency(); } - if (screenDrawable) - DamageDestroy(xf86_config->rotation_damage); + DamageDestroy(xf86_config->rotation_damage); xf86_config->rotation_damage = NULL; } } diff --git a/hw/xfree86/os-support/shared/vidmem.c b/hw/xfree86/os-support/shared/vidmem.c index 514fc2fa7..68ed30e41 100644 --- a/hw/xfree86/os-support/shared/vidmem.c +++ b/hw/xfree86/os-support/shared/vidmem.c @@ -257,16 +257,3 @@ xf86LinearVidMem(void) xf86InitVidMem(); return vidMemInfo.linearSupported; } - -void -xf86MapReadSideEffects(int ScreenNum, int Flags, pointer base, - unsigned long Size) -{ - if (!(Flags & VIDMEM_READSIDEEFFECT)) - return; - - if (!vidMemInfo.initialised || !vidMemInfo.readSideEffects) - return; - - vidMemInfo.readSideEffects(ScreenNum, base, Size); -} diff --git a/hw/xfree86/os-support/xf86OSpriv.h b/hw/xfree86/os-support/xf86OSpriv.h index 65769c16f..bd734f554 100644 --- a/hw/xfree86/os-support/xf86OSpriv.h +++ b/hw/xfree86/os-support/xf86OSpriv.h @@ -38,7 +38,6 @@ typedef pointer (*SetWCProcPtr) (int, unsigned long, unsigned long, Bool, MessageType); typedef void (*ProtectMemProcPtr) (int, pointer, unsigned long, Bool); typedef void (*UndoWCProcPtr) (int, pointer); -typedef void (*ReadSideEffectsProcPtr) (int, pointer, unsigned long); typedef struct { Bool initialised; @@ -47,7 +46,6 @@ typedef struct { ProtectMemProcPtr protectMem; SetWCProcPtr setWC; UndoWCProcPtr undoWC; - ReadSideEffectsProcPtr readSideEffects; Bool linearSupported; } VidMemInfo, *VidMemInfoPtr; diff --git a/hw/xfree86/os-support/xf86_OSproc.h b/hw/xfree86/os-support/xf86_OSproc.h index 6be594651..106168aba 100644 --- a/hw/xfree86/os-support/xf86_OSproc.h +++ b/hw/xfree86/os-support/xf86_OSproc.h @@ -136,8 +136,6 @@ extern _X_EXPORT _X_DEPRECATED pointer xf86MapVidMem(int, int, unsigned long, unsigned long); extern _X_EXPORT _X_DEPRECATED void xf86UnMapVidMem(int, pointer, unsigned long); -extern _X_EXPORT _X_DEPRECATED void xf86MapReadSideEffects(int, int, pointer, - unsigned long); extern _X_EXPORT int xf86ReadBIOS(unsigned long, unsigned long, unsigned char *, int); extern _X_EXPORT Bool xf86EnableIO(void); diff --git a/hw/xfree86/vbe/vbe.c b/hw/xfree86/vbe/vbe.c index f0344af9c..39f0cefb6 100644 --- a/hw/xfree86/vbe/vbe.c +++ b/hw/xfree86/vbe/vbe.c @@ -319,10 +319,8 @@ vbeReadEDID(vbeInfoPtr pVbe) } xf86MonPtr -vbeDoEDID(vbeInfoPtr pVbe, pointer pDDCModule) +vbeDoEDID(vbeInfoPtr pVbe, pointer unused) { - xf86MonPtr pMonitor; - pointer pModule; unsigned char *DDC_data = NULL; if (!pVbe) @@ -330,23 +328,12 @@ vbeDoEDID(vbeInfoPtr pVbe, pointer pDDCModule) if (pVbe->version < 0x200) return NULL; - if (!(pModule = pDDCModule)) { - pModule = - xf86LoadSubModule(pVbe->pInt10->pScrn, "ddc"); - if (!pModule) - return NULL; - } - DDC_data = vbeReadEDID(pVbe); if (!DDC_data) return NULL; - pMonitor = xf86InterpretEDID(pVbe->pInt10->pScrn->scrnIndex, DDC_data); - - if (!pDDCModule) - xf86UnloadSubModule(pModule); - return pMonitor; + return xf86InterpretEDID(pVbe->pInt10->pScrn->scrnIndex, DDC_data); } #define GET_UNALIGNED2(x) \ diff --git a/hw/xnest/GCOps.c b/hw/xnest/GCOps.c index e26a1363b..7b1956de0 100644 --- a/hw/xnest/GCOps.c +++ b/hw/xnest/GCOps.c @@ -94,15 +94,29 @@ xnestPutImage(DrawablePtr pDrawable, GCPtr pGC, int depth, int x, int y, } } +static int +xnestIgnoreErrorHandler (Display *display, + XErrorEvent *event) +{ + return False; /* return value is ignored */ +} + void xnestGetImage(DrawablePtr pDrawable, int x, int y, int w, int h, unsigned int format, unsigned long planeMask, char *pImage) { XImage *ximage; int length; + int (*old_handler)(Display*, XErrorEvent*); + + /* we may get BadMatch error when xnest window is minimized */ + XSync(xnestDisplay, False); + old_handler = XSetErrorHandler (xnestIgnoreErrorHandler); ximage = XGetImage(xnestDisplay, xnestDrawable(pDrawable), x, y, w, h, planeMask, format); + XSync(xnestDisplay, False); + XSetErrorHandler(old_handler); if (ximage) { length = ximage->bytes_per_line * ximage->height; diff --git a/hw/xnest/Pixmap.c b/hw/xnest/Pixmap.c index 13e1610fd..2902acd56 100644 --- a/hw/xnest/Pixmap.c +++ b/hw/xnest/Pixmap.c @@ -78,6 +78,21 @@ xnestDestroyPixmap(PixmapPtr pPixmap) return TRUE; } +Bool +xnestModifyPixmapHeader(PixmapPtr pPixmap, int width, int height, int depth, + int bitsPerPixel, int devKind, pointer pPixData) +{ + if(!xnestPixmapPriv(pPixmap)->pixmap && width > 0 && height > 0) { + xnestPixmapPriv(pPixmap)->pixmap = + XCreatePixmap(xnestDisplay, + xnestDefaultWindows[pPixmap->drawable.pScreen->myNum], + width, height, depth); + } + + return miModifyPixmapHeader(pPixmap, width, height, depth, + bitsPerPixel, devKind, pPixData); +} + RegionPtr xnestPixmapToRegion(PixmapPtr pPixmap) { diff --git a/hw/xnest/Screen.c b/hw/xnest/Screen.c index 58b5a1199..abb4d372d 100644 --- a/hw/xnest/Screen.c +++ b/hw/xnest/Screen.c @@ -282,6 +282,7 @@ xnestOpenScreen(ScreenPtr pScreen, int argc, char *argv[]) pScreen->CreatePixmap = xnestCreatePixmap; pScreen->DestroyPixmap = xnestDestroyPixmap; + pScreen->ModifyPixmapHeader = xnestModifyPixmapHeader; /* Font procedures */ diff --git a/hw/xnest/XNPixmap.h b/hw/xnest/XNPixmap.h index 268ba1e8b..5b2e796fe 100644 --- a/hw/xnest/XNPixmap.h +++ b/hw/xnest/XNPixmap.h @@ -33,6 +33,8 @@ typedef struct { PixmapPtr xnestCreatePixmap(ScreenPtr pScreen, int width, int height, int depth, unsigned usage_hint); Bool xnestDestroyPixmap(PixmapPtr pPixmap); +Bool xnestModifyPixmapHeader(PixmapPtr pPixmap, int width, int height, int depth, + int bitsPerPixel, int devKind, pointer pPixData); RegionPtr xnestPixmapToRegion(PixmapPtr pPixmap); #endif /* XNESTPIXMAP_H */ diff --git a/hw/xquartz/GL/glcontextmodes.c b/hw/xquartz/GL/glcontextmodes.c index dc97f89e4..1ce3570c8 100644 --- a/hw/xquartz/GL/glcontextmodes.c +++ b/hw/xquartz/GL/glcontextmodes.c @@ -555,7 +555,6 @@ _gl_context_modes_are_same(const __GLcontextModes * a, (a->stencilBits == b->stencilBits) && (a->numAuxBuffers == b->numAuxBuffers) && (a->level == b->level) && - (a->pixmapMode == b->pixmapMode) && (a->visualRating == b->visualRating) && (a->transparentPixel == b->transparentPixel) && diff --git a/hw/xquartz/GL/visualConfigs.c b/hw/xquartz/GL/visualConfigs.c index a00abf29a..92142cb0d 100644 --- a/hw/xquartz/GL/visualConfigs.c +++ b/hw/xquartz/GL/visualConfigs.c @@ -144,7 +144,6 @@ __GLXconfig *__glXAquaCreateVisualConfigs(int *numConfigsPtr, int screenNumber) c->level = 0; c->indexBits = 0; - c->pixmapMode = 0; // TODO: What should this be? if(conf->accelerated) { c->visualRating = GLX_NONE; diff --git a/hw/xquartz/xpr/xprCursor.c b/hw/xquartz/xpr/xprCursor.c index 0392a4639..4168f7c53 100644 --- a/hw/xquartz/xpr/xprCursor.c +++ b/hw/xquartz/xpr/xprCursor.c @@ -305,8 +305,6 @@ static miPointerScreenFuncRec quartzScreenFuncsRec = { QuartzCursorOffScreen, QuartzCrossScreen, QuartzWarpCursor, - NULL, - NULL }; /* diff --git a/hw/xwin/glx/indirect.c b/hw/xwin/glx/indirect.c index 14a47110a..02f9b0e75 100644 --- a/hw/xwin/glx/indirect.c +++ b/hw/xwin/glx/indirect.c @@ -1715,7 +1715,6 @@ fbConfigToPixelFormat(__GLXconfig * mode, PIXELFORMATDESCRIPTOR * pfdret, pfd.cAuxBuffers = mode->numAuxBuffers; /* mode->level ? */ - /* mode->pixmapMode ? */ *pfdret = pfd; @@ -1925,7 +1924,6 @@ glxWinCreateConfigs(HDC hdc, glxWinScreen * screen) // pfd.dwLayerMask; // ignored // pfd.dwDamageMask; // ignored - c->base.pixmapMode = 0; c->base.visualID = -1; // will be set by __glXScreenInit() /* EXT_visual_rating / GLX 1.2 */ @@ -2263,7 +2261,6 @@ glxWinCreateConfigsExt(HDC hdc, glxWinScreen * screen) } c->base.level = 0; - c->base.pixmapMode = 0; // ??? c->base.visualID = -1; // will be set by __glXScreenInit() /* EXT_visual_rating / GLX 1.2 */ diff --git a/include/cursorstr.h b/include/cursorstr.h index 68ab2ecfd..2157954c9 100644 --- a/include/cursorstr.h +++ b/include/cursorstr.h @@ -78,10 +78,8 @@ typedef struct _Cursor { int refcnt; PrivateRec *devPrivates; /* set by pScr->RealizeCursor */ XID id; -#ifdef XFIXES CARD32 serialNumber; Atom name; -#endif } CursorRec; #define CURSOR_REC_SIZE (sizeof(CursorRec) + dixPrivatesSize(PRIVATE_CURSOR)) diff --git a/include/dixstruct.h b/include/dixstruct.h index aef822ca2..0be7f0e27 100644 --- a/include/dixstruct.h +++ b/include/dixstruct.h @@ -61,7 +61,6 @@ typedef enum { ClientStateInitial, ClientStateGone } ClientState; -#ifdef XFIXES typedef struct _saveSet { struct _Window *windowPtr; Bool toRoot; @@ -73,16 +72,6 @@ typedef struct _saveSet { #define SaveSetAssignWindow(ss,w) ((ss).windowPtr = (w)) #define SaveSetAssignToRoot(ss,tr) ((ss).toRoot = (tr)) #define SaveSetAssignMap(ss,m) ((ss).map = (m)) -#else -typedef struct _Window *SaveSetElt; - -#define SaveSetWindow(ss) (ss) -#define SaveSetToRoot(ss) FALSE -#define SaveSetShouldMap(ss) TRUE -#define SaveSetAssignWindow(ss,w) ((ss) = (w)) -#define SaveSetAssignToRoot(ss,tr) -#define SaveSetAssignMap(ss,m) -#endif typedef struct _Client { pointer requestBuffer; diff --git a/include/extinit.h b/include/extinit.h index 5690d7b01..6d67bf2e5 100644 --- a/include/extinit.h +++ b/include/extinit.h @@ -140,10 +140,8 @@ extern void XFree86BigfontExtensionInit(void); extern void BigReqExtensionInit(void); -#ifdef XFIXES extern _X_EXPORT Bool noXFixesExtension; extern void XFixesExtensionInit(void); -#endif extern void XInputExtensionInit(void); extern _X_EXPORT void AssignTypeAndName(DeviceIntPtr dev, diff --git a/include/list.h b/include/list.h index 11de7c561..455c670d3 100644 --- a/include/list.h +++ b/include/list.h @@ -213,7 +213,7 @@ xorg_list_del(struct xorg_list *entry) * * @return True if the list contains one or more elements or False otherwise. */ -static inline Bool +static inline int xorg_list_is_empty(struct xorg_list *head) { return head->next == head; diff --git a/include/privates.h b/include/privates.h index 2c8864b8a..0abdce784 100644 --- a/include/privates.h +++ b/include/privates.h @@ -46,7 +46,6 @@ typedef enum { PRIVATE_CURSOR_BITS, /* extension privates */ - PRIVATE_DBE_WINDOW, PRIVATE_DAMAGE, PRIVATE_GLYPH, PRIVATE_GLYPHSET, diff --git a/mi/miinitext.c b/mi/miinitext.c index dbca9f774..145da38e9 100644 --- a/mi/miinitext.c +++ b/mi/miinitext.c @@ -86,7 +86,6 @@ SOFTWARE. #undef DBE #undef SCREENSAVER #undef RANDR -#undef XFIXES #undef DAMAGE #undef COMPOSITE #undef MITSHM @@ -168,9 +167,7 @@ static ExtensionToggle ExtensionToggleList[] = { {"XFree86-VidModeExtension", &noXFree86VidModeExtension}, #endif #endif -#ifdef XFIXES {"XFIXES", &noXFixesExtension}, -#endif #ifdef PANORAMIX {"XINERAMA", &noPanoramiXExtension}, #endif @@ -263,10 +260,8 @@ static ExtensionModule staticExtensions[] = { */ {PseudoramiXExtensionInit, "PseudoramiX", &noPseudoramiXExtension}, #endif -#ifdef XFIXES /* must be before Render to layer DisplayCursor correctly */ {XFixesExtensionInit, "XFIXES", &noXFixesExtension}, -#endif #ifdef XF86BIGFONT {XFree86BigfontExtensionInit, XF86BIGFONTNAME, &noXFree86BigfontExtension}, #endif diff --git a/mi/mipointer.c b/mi/mipointer.c index b8503f450..5d591a1dc 100644 --- a/mi/mipointer.c +++ b/mi/mipointer.c @@ -118,13 +118,6 @@ miPointerInitialize(ScreenPtr pScreen, return FALSE; pScreenPriv->spriteFuncs = spriteFuncs; pScreenPriv->screenFuncs = screenFuncs; - /* - * check for uninitialized methods - */ - if (!screenFuncs->EnqueueEvent) - screenFuncs->EnqueueEvent = mieqEnqueue; - if (!screenFuncs->NewEventScreen) - screenFuncs->NewEventScreen = mieqSwitchScreen; pScreenPriv->waitForUpdate = waitForUpdate; pScreenPriv->showTransparent = FALSE; pScreenPriv->CloseScreen = pScreen->CloseScreen; @@ -363,7 +356,7 @@ miPointerWarpCursor(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y) pPointer = MIPOINTER(pDev); if (pPointer->pScreen != pScreen) { - (*pScreenPriv->screenFuncs->NewEventScreen) (pDev, pScreen, TRUE); + mieqSwitchScreen(pDev, pScreen, TRUE); changedScreen = TRUE; } @@ -480,7 +473,7 @@ miPointerSetScreen(DeviceIntPtr pDev, int screen_no, int x, int y) pScreen = screenInfo.screens[screen_no]; pScreenPriv = GetScreenPrivate(pScreen); - (*pScreenPriv->screenFuncs->NewEventScreen) (pDev, pScreen, FALSE); + mieqSwitchScreen(pDev, pScreen, FALSE); NewCurrentScreen(pDev, pScreen, x, y); pPointer->limits.x2 = pScreen->width; @@ -488,15 +481,6 @@ miPointerSetScreen(DeviceIntPtr pDev, int screen_no, int x, int y) } /** - * @return The current screen of the VCP - */ -ScreenPtr -miPointerCurrentScreen(void) -{ - return miPointerGetScreen(inputInfo.pointer); -} - -/** * @return The current screen of the given device or NULL. */ ScreenPtr @@ -617,8 +601,7 @@ miPointerSetPosition(DeviceIntPtr pDev, int mode, double *screenx, (*pScreenPriv->screenFuncs->CursorOffScreen) (&newScreen, &x, &y); if (newScreen != pScreen) { pScreen = newScreen; - (*pScreenPriv->screenFuncs->NewEventScreen) (pDev, pScreen, - FALSE); + mieqSwitchScreen(pDev, pScreen, FALSE); /* Smash the confine to the new screen */ pPointer->limits.x2 = pScreen->width; pPointer->limits.y2 = pScreen->height; diff --git a/mi/mipointer.h b/mi/mipointer.h index f89dff31e..bdeed1242 100644 --- a/mi/mipointer.h +++ b/mi/mipointer.h @@ -71,13 +71,6 @@ typedef struct _miPointerScreenFuncRec { int /* x */ , int /* y */ ); - void (*EnqueueEvent) (DeviceIntPtr /* pDev */ , - InternalEvent * /* event */ - ); - void (*NewEventScreen) (DeviceIntPtr /* pDev */ , - ScreenPtr /* pScr */ , - Bool /* set_dequeue_screen */ - ); } miPointerScreenFuncRec, *miPointerScreenFuncPtr; extern _X_EXPORT Bool miDCInitialize(ScreenPtr /*pScreen */ , @@ -98,11 +91,6 @@ extern _X_EXPORT void miPointerWarpCursor(DeviceIntPtr /*pDev */ , int /*y */ ); -/* Deprecated in favour of miPointerGetScreen. */ -extern _X_EXPORT ScreenPtr -miPointerCurrentScreen(void -) _X_DEPRECATED; - extern _X_EXPORT ScreenPtr miPointerGetScreen(DeviceIntPtr pDev); extern _X_EXPORT void diff --git a/mi/misprite.c b/mi/misprite.c index 97bbf8ef5..85ca022ed 100644 --- a/mi/misprite.c +++ b/mi/misprite.c @@ -86,10 +86,6 @@ typedef struct { /* os layer procedures */ ScreenBlockHandlerProcPtr BlockHandler; - /* device cursor procedures */ - DeviceCursorInitializeProcPtr DeviceCursorInitialize; - DeviceCursorCleanupProcPtr DeviceCursorCleanup; - xColorItem colors[2]; ColormapPtr pInstalledMap; ColormapPtr pColormap; @@ -150,8 +146,7 @@ static void miSpriteDisableDamage(ScreenPtr pScreen, miSpriteScreenPtr pScreenPriv) { if (pScreenPriv->damageRegistered) { - DamageUnregister(&(pScreen->GetScreenPixmap(pScreen)->drawable), - pScreenPriv->pDamage); + DamageUnregister(pScreenPriv->pDamage); pScreenPriv->damageRegistered = 0; } } @@ -329,9 +324,6 @@ miSpriteInitialize(ScreenPtr pScreen, miPointerScreenFuncPtr screenFuncs) pScreenPriv->BlockHandler = NULL; - pScreenPriv->DeviceCursorInitialize = pScreen->DeviceCursorInitialize; - pScreenPriv->DeviceCursorCleanup = pScreen->DeviceCursorCleanup; - pScreenPriv->pInstalledMap = NULL; pScreenPriv->pColormap = NULL; pScreenPriv->colors[SOURCE_COLOR].red = 0; diff --git a/mi/miwideline.c b/mi/miwideline.c index ca18f156e..b76e7a818 100644 --- a/mi/miwideline.c +++ b/mi/miwideline.c @@ -994,7 +994,7 @@ miLineProjectingCap(DrawablePtr pDrawable, GCPtr pGC, unsigned long pixel, { int xorgi = 0, yorgi = 0; int lw; - PolyEdgeRec lefts[2], rights[2]; + PolyEdgeRec lefts[4], rights[4]; int lefty, righty, topy, bottomy; PolyEdgePtr left, right; PolyEdgePtr top, bottom; @@ -1166,7 +1166,7 @@ miWideSegment(DrawablePtr pDrawable, PolyEdgePtr top, bottom; int lefty, righty, topy, bottomy; int signdx; - PolyEdgeRec lefts[2], rights[2]; + PolyEdgeRec lefts[4], rights[4]; LineFacePtr tface; int lw = pGC->lineWidth; @@ -1520,7 +1520,7 @@ miWideDashSegment(DrawablePtr pDrawable, PolyVertexRec vertices[4]; PolyVertexRec saveRight, saveBottom; PolySlopeRec slopes[4]; - PolyEdgeRec left[2], right[2]; + PolyEdgeRec left[4], right[4]; LineFaceRec lcapFace, rcapFace; int nleft, nright; int h; diff --git a/miext/damage/damage.c b/miext/damage/damage.c index a98c20ec0..cc0299143 100644 --- a/miext/damage/damage.c +++ b/miext/damage/damage.c @@ -119,51 +119,6 @@ getDrawableDamageRef(DrawablePtr pDrawable) DamagePtr *pPrev = (DamagePtr *) \ dixLookupPrivateAddr(&(pWindow)->devPrivates, damageWinPrivateKey) -static void -damageReportDamagePostRendering(DamagePtr pDamage, RegionPtr pOldDamage, - RegionPtr pDamageRegion) -{ - BoxRec tmpBox; - RegionRec tmpRegion, newDamage; - Bool was_empty; - - RegionUnion(&newDamage, pOldDamage, pDamageRegion); - - switch (pDamage->damageLevel) { - case DamageReportRawRegion: - (*pDamage->damageReportPostRendering) (pDamage, pDamageRegion, - pDamage->closure); - break; - case DamageReportDeltaRegion: - RegionNull(&tmpRegion); - RegionSubtract(&tmpRegion, pDamageRegion, pOldDamage); - if (RegionNotEmpty(&tmpRegion)) { - (*pDamage->damageReportPostRendering) (pDamage, &tmpRegion, - pDamage->closure); - } - RegionUninit(&tmpRegion); - break; - case DamageReportBoundingBox: - tmpBox = *RegionExtents(pOldDamage); - if (!BOX_SAME(&tmpBox, RegionExtents(&newDamage))) { - (*pDamage->damageReportPostRendering) (pDamage, &newDamage, - pDamage->closure); - } - break; - case DamageReportNonEmpty: - was_empty = !RegionNotEmpty(pOldDamage); - if (was_empty && RegionNotEmpty(&newDamage)) { - (*pDamage->damageReportPostRendering) (pDamage, &newDamage, - pDamage->closure); - } - break; - case DamageReportNone: - break; - } - - RegionUninit(&newDamage); -} - #if DAMAGE_DEBUG_ENABLE static void _damageRegionAppend(DrawablePtr pDrawable, RegionPtr pRegion, Bool clip, @@ -299,14 +254,10 @@ damageRegionAppend(DrawablePtr pDrawable, RegionPtr pRegion, Bool clip, RegionTranslate(pDamageRegion, -draw_x, -draw_y); /* Store damage region if needed after submission. */ - if (pDamage->reportAfter || pDamage->damageMarker) + if (pDamage->reportAfter) RegionUnion(&pDamage->pendingDamage, &pDamage->pendingDamage, pDamageRegion); - /* Duplicate current damage if needed. */ - if (pDamage->damageMarker) - RegionCopy(&pDamage->backupDamage, &pDamage->damage); - /* Report damage now, if desired. */ if (!pDamage->reportAfter) { if (pDamage->damageReport) @@ -335,12 +286,6 @@ damageRegionProcessPending(DrawablePtr pDrawable) drawableDamage(pDrawable); for (; pDamage != NULL; pDamage = pDamage->pNext) { - /* submit damage marker whenever possible. */ - if (pDamage->damageMarker) - (*pDamage->damageMarker) (pDrawable, pDamage, - &pDamage->backupDamage, - &pDamage->pendingDamage, - pDamage->closure); if (pDamage->reportAfter) { /* It's possible that there is only interest in postRendering reporting. */ if (pDamage->damageReport) @@ -350,10 +295,8 @@ damageRegionProcessPending(DrawablePtr pDrawable) &pDamage->pendingDamage); } - if (pDamage->reportAfter || pDamage->damageMarker) + if (pDamage->reportAfter) RegionEmpty(&pDamage->pendingDamage); - if (pDamage->damageMarker) - RegionEmpty(&pDamage->backupDamage); } } @@ -1336,7 +1279,7 @@ damageDamageChars(DrawablePtr pDrawable, #define TT_POLY16 2 #define TT_IMAGE16 3 -static int +static void damageText(DrawablePtr pDrawable, GCPtr pGC, int x, @@ -1345,39 +1288,29 @@ damageText(DrawablePtr pDrawable, char *chars, FontEncoding fontEncoding, Bool textType) { CharInfoPtr *charinfo; - CharInfoPtr *info; unsigned long i; unsigned int n; - int w; Bool imageblt; imageblt = (textType == TT_IMAGE8) || (textType == TT_IMAGE16); + if (!checkGCDamage(pDrawable, pGC)) + return; + charinfo = malloc(count * sizeof(CharInfoPtr)); if (!charinfo) - return x; + return; GetGlyphs(pGC->font, count, (unsigned char *) chars, fontEncoding, &i, charinfo); n = (unsigned int) i; - w = 0; - if (!imageblt) - for (info = charinfo; i--; info++) - w += (*info)->metrics.characterWidth; if (n != 0) { damageDamageChars(pDrawable, pGC->font, x + pDrawable->x, y + pDrawable->y, n, charinfo, imageblt, pGC->subWindowMode); - if (imageblt) - (*pGC->ops->ImageGlyphBlt) (pDrawable, pGC, x, y, n, charinfo, - FONTGLYPHS(pGC->font)); - else - (*pGC->ops->PolyGlyphBlt) (pDrawable, pGC, x, y, n, charinfo, - FONTGLYPHS(pGC->font)); } free(charinfo); - return x + w; } static int @@ -1385,12 +1318,9 @@ damagePolyText8(DrawablePtr pDrawable, GCPtr pGC, int x, int y, int count, char *chars) { DAMAGE_GC_OP_PROLOGUE(pGC, pDrawable); - - if (checkGCDamage(pDrawable, pGC)) - x = damageText(pDrawable, pGC, x, y, (unsigned long) count, chars, - Linear8Bit, TT_POLY8); - else - x = (*pGC->ops->PolyText8) (pDrawable, pGC, x, y, count, chars); + damageText(pDrawable, pGC, x, y, (unsigned long) count, chars, Linear8Bit, + TT_POLY8); + x = (*pGC->ops->PolyText8) (pDrawable, pGC, x, y, count, chars); damageRegionProcessPending(pDrawable); DAMAGE_GC_OP_EPILOGUE(pGC, pDrawable); return x; @@ -1401,14 +1331,10 @@ damagePolyText16(DrawablePtr pDrawable, GCPtr pGC, int x, int y, int count, unsigned short *chars) { DAMAGE_GC_OP_PROLOGUE(pGC, pDrawable); - - if (checkGCDamage(pDrawable, pGC)) - x = damageText(pDrawable, pGC, x, y, (unsigned long) count, - (char *) chars, - FONTLASTROW(pGC->font) == 0 ? Linear16Bit : TwoD16Bit, - TT_POLY16); - else - x = (*pGC->ops->PolyText16) (pDrawable, pGC, x, y, count, chars); + damageText(pDrawable, pGC, x, y, (unsigned long) count, (char *) chars, + FONTLASTROW(pGC->font) == 0 ? Linear16Bit : TwoD16Bit, + TT_POLY16); + x = (*pGC->ops->PolyText16) (pDrawable, pGC, x, y, count, chars); damageRegionProcessPending(pDrawable); DAMAGE_GC_OP_EPILOGUE(pGC, pDrawable); return x; @@ -1419,12 +1345,9 @@ damageImageText8(DrawablePtr pDrawable, GCPtr pGC, int x, int y, int count, char *chars) { DAMAGE_GC_OP_PROLOGUE(pGC, pDrawable); - - if (checkGCDamage(pDrawable, pGC)) - damageText(pDrawable, pGC, x, y, (unsigned long) count, chars, - Linear8Bit, TT_IMAGE8); - else - (*pGC->ops->ImageText8) (pDrawable, pGC, x, y, count, chars); + damageText(pDrawable, pGC, x, y, (unsigned long) count, chars, Linear8Bit, + TT_IMAGE8); + (*pGC->ops->ImageText8) (pDrawable, pGC, x, y, count, chars); damageRegionProcessPending(pDrawable); DAMAGE_GC_OP_EPILOGUE(pGC, pDrawable); } @@ -1434,13 +1357,10 @@ damageImageText16(DrawablePtr pDrawable, GCPtr pGC, int x, int y, int count, unsigned short *chars) { DAMAGE_GC_OP_PROLOGUE(pGC, pDrawable); - - if (checkGCDamage(pDrawable, pGC)) - damageText(pDrawable, pGC, x, y, (unsigned long) count, (char *) chars, - FONTLASTROW(pGC->font) == 0 ? Linear16Bit : TwoD16Bit, - TT_IMAGE16); - else - (*pGC->ops->ImageText16) (pDrawable, pGC, x, y, count, chars); + damageText(pDrawable, pGC, x, y, (unsigned long) count, (char *) chars, + FONTLASTROW(pGC->font) == 0 ? Linear16Bit : TwoD16Bit, + TT_IMAGE16); + (*pGC->ops->ImageText16) (pDrawable, pGC, x, y, count, chars); damageRegionProcessPending(pDrawable); DAMAGE_GC_OP_EPILOGUE(pGC, pDrawable); } @@ -1637,7 +1557,6 @@ damageDestroyWindow(WindowPtr pWindow) damageScrPriv(pScreen); while ((pDamage = damageGetWinPriv(pWindow))) { - DamageUnregister(&pWindow->drawable, pDamage); DamageDestroy(pDamage); } unwrap(pScrPriv, pScreen, DestroyWindow); @@ -1786,9 +1705,7 @@ DamageCreate(DamageReportFunc damageReport, pDamage->reportAfter = FALSE; pDamage->damageReport = damageReport; - pDamage->damageReportPostRendering = NULL; pDamage->damageDestroy = damageDestroy; - pDamage->damageMarker = NULL; pDamage->pScreen = pScreen; (*pScrPriv->funcs.Create) (pDamage); @@ -1844,8 +1761,9 @@ DamageDrawInternal(ScreenPtr pScreen, Bool enable) } void -DamageUnregister(DrawablePtr pDrawable, DamagePtr pDamage) +DamageUnregister(DamagePtr pDamage) { + DrawablePtr pDrawable = pDamage->pDrawable; ScreenPtr pScreen = pDrawable->pScreen; damageScrPriv(pScreen); @@ -1888,6 +1806,9 @@ DamageDestroy(DamagePtr pDamage) damageScrPriv(pScreen); + if (pDamage->pDrawable) + DamageUnregister(pDamage); + if (pDamage->damageDestroy) (*pDamage->damageDestroy) (pDamage, pDamage->closure); (*pScrPriv->funcs.Destroy) (pDamage); @@ -1956,17 +1877,6 @@ DamageRegionProcessPending(DrawablePtr pDrawable) damageRegionProcessPending(pDrawable); } -/* If a damage marker is provided, then this function must be called after rendering is done. */ -/* Please do call back so any future enhancements can assume this function is called. */ -/* There are no strict timing requirements for calling this function, just as soon as (is cheaply) possible. */ -void -DamageRegionRendered(DrawablePtr pDrawable, DamagePtr pDamage, - RegionPtr pOldDamage, RegionPtr pRegion) -{ - if (pDamage->damageReportPostRendering) - damageReportDamagePostRendering(pDamage, pOldDamage, pRegion); -} - /* This call is very odd, i'm leaving it intact for API sake, but please don't use it. */ void DamageDamageRegion(DrawablePtr pDrawable, RegionPtr pRegion) @@ -1986,15 +1896,6 @@ DamageSetReportAfterOp(DamagePtr pDamage, Bool reportAfter) pDamage->reportAfter = reportAfter; } -void -DamageSetPostRenderingFunctions(DamagePtr pDamage, - DamageReportFunc damageReportPostRendering, - DamageMarkerFunc damageMarker) -{ - pDamage->damageReportPostRendering = damageReportPostRendering; - pDamage->damageMarker = damageMarker; -} - DamageScreenFuncsPtr DamageGetScreenFuncs(ScreenPtr pScreen) { diff --git a/miext/damage/damage.h b/miext/damage/damage.h index c2c313a15..525b2db5d 100644 --- a/miext/damage/damage.h +++ b/miext/damage/damage.h @@ -41,12 +41,6 @@ typedef void (*DamageReportFunc) (DamagePtr pDamage, RegionPtr pRegion, void *closure); typedef void (*DamageDestroyFunc) (DamagePtr pDamage, void *closure); -/* It's the responsibility of the driver to duplicate both regions. */ -/* At some point DamageRegionRendered() must be called. */ -typedef void (*DamageMarkerFunc) (DrawablePtr pDrawable, DamagePtr pDamage, - RegionPtr pOldDamage, RegionPtr pRegion, - void *closure); - typedef void (*DamageScreenCreateFunc) (DamagePtr); typedef void (*DamageScreenRegisterFunc) (DrawablePtr, DamagePtr); typedef void (*DamageScreenUnregisterFunc) (DrawablePtr, DamagePtr); @@ -80,7 +74,7 @@ extern _X_EXPORT void DamageRegister(DrawablePtr pDrawable, DamagePtr pDamage); extern _X_EXPORT void - DamageUnregister(DrawablePtr pDrawable, DamagePtr pDamage); + DamageUnregister(DamagePtr pDamage); extern _X_EXPORT void DamageDestroy(DamagePtr pDamage); @@ -105,12 +99,6 @@ extern _X_EXPORT void extern _X_EXPORT void DamageRegionProcessPending(DrawablePtr pDrawable); -/* Call this some time after rendering is done, only relevant when a damageMarker is provided. */ -extern _X_EXPORT void - -DamageRegionRendered(DrawablePtr pDrawable, DamagePtr pDamage, - RegionPtr pOldDamage, RegionPtr pRegion); - /* Call this when you create a new Damage and you wish to send an initial damage message (to it). */ extern _X_EXPORT void DamageReportDamage(DamagePtr pDamage, RegionPtr pDamageRegion); @@ -122,12 +110,6 @@ extern _X_EXPORT void extern _X_EXPORT void DamageSetReportAfterOp(DamagePtr pDamage, Bool reportAfter); -extern _X_EXPORT void - -DamageSetPostRenderingFunctions(DamagePtr pDamage, - DamageReportFunc damageReportPostRendering, - DamageMarkerFunc damageMarker); - extern _X_EXPORT DamageScreenFuncsPtr DamageGetScreenFuncs(ScreenPtr); #endif /* _DAMAGE_H_ */ diff --git a/miext/damage/damagestr.h b/miext/damage/damagestr.h index 89189905e..36753ee20 100644 --- a/miext/damage/damagestr.h +++ b/miext/damage/damagestr.h @@ -44,13 +44,10 @@ typedef struct _damage { DrawablePtr pDrawable; DamageReportFunc damageReport; - DamageReportFunc damageReportPostRendering; DamageDestroyFunc damageDestroy; - DamageMarkerFunc damageMarker; Bool reportAfter; RegionRec pendingDamage; /* will be flushed post submission at the latest */ - RegionRec backupDamage; /* for use with damageMarker */ ScreenPtr pScreen; PrivateRec *devPrivates; } DamageRec; diff --git a/miext/shadow/shadow.c b/miext/shadow/shadow.c index 2d869e54b..1a9088c43 100644 --- a/miext/shadow/shadow.c +++ b/miext/shadow/shadow.c @@ -219,7 +219,7 @@ shadowRemove(ScreenPtr pScreen, PixmapPtr pPixmap) shadowBuf(pScreen); if (pBuf->pPixmap) { - DamageUnregister(&pBuf->pPixmap->drawable, pBuf->pDamage); + DamageUnregister(pBuf->pDamage); pBuf->update = 0; pBuf->window = 0; pBuf->randr = 0; diff --git a/miext/sync/misync.c b/miext/sync/misync.c index d24921a18..b6914d18d 100644 --- a/miext/sync/misync.c +++ b/miext/sync/misync.c @@ -182,20 +182,21 @@ miSyncSetup(ScreenPtr pScreen) &miSyncScreenDestroyFence }; - if (dixPrivateKeyRegistered(syncScreenPrivateKey)) - return TRUE; - - if (!dixRegisterPrivateKey(syncScreenPrivateKey, PRIVATE_SCREEN, - sizeof(SyncScreenPrivRec))) - return FALSE; + if (!dixPrivateKeyRegistered(syncScreenPrivateKey)) { + if (!dixRegisterPrivateKey(syncScreenPrivateKey, PRIVATE_SCREEN, + sizeof(SyncScreenPrivRec))) + return FALSE; + } pScreenPriv = SYNC_SCREEN_PRIV(pScreen); - pScreenPriv->funcs = miSyncScreenFuncs; + if (pScreenPriv->funcs.CreateFence) { + pScreenPriv->funcs = miSyncScreenFuncs; - /* Wrap CloseScreen to clean up */ - pScreenPriv->CloseScreen = pScreen->CloseScreen; - pScreen->CloseScreen = SyncCloseScreen; + /* Wrap CloseScreen to clean up */ + pScreenPriv->CloseScreen = pScreen->CloseScreen; + pScreen->CloseScreen = SyncCloseScreen; + } return TRUE; } @@ -206,27 +206,17 @@ YieldControlDeath(void) timesThisConnection = 0; } -int -ReadRequestFromClient(ClientPtr client) +/* If an input buffer was empty, either free it if it is too big or link it + * into our list of free input buffers. This means that different clients can + * share the same input buffer (at different times). This was done to save + * memory. + */ +static void +NextAvailableInput(OsCommPtr oc) { - OsCommPtr oc = (OsCommPtr) client->osPrivate; - ConnectionInputPtr oci = oc->input; - int fd = oc->fd; - unsigned int gotnow, needed; - int result; - register xReq *request; - Bool need_header; - Bool move_header; - - /* If an input buffer was empty, either free it if it is too big - * or link it into our list of free input buffers. This means that - * different clients can share the same input buffer (at different - * times). This was done to save memory. - */ - if (AvailableInput) { if (AvailableInput != oc) { - register ConnectionInputPtr aci = AvailableInput->input; + ConnectionInputPtr aci = AvailableInput->input; if (aci->size > BUFWATERMARK) { free(aci->buffer); @@ -236,10 +226,25 @@ ReadRequestFromClient(ClientPtr client) aci->next = FreeInputs; FreeInputs = aci; } - AvailableInput->input = (ConnectionInputPtr) NULL; + AvailableInput->input = NULL; } - AvailableInput = (OsCommPtr) NULL; + AvailableInput = NULL; } +} + +int +ReadRequestFromClient(ClientPtr client) +{ + OsCommPtr oc = (OsCommPtr) client->osPrivate; + ConnectionInputPtr oci = oc->input; + int fd = oc->fd; + unsigned int gotnow, needed; + int result; + register xReq *request; + Bool need_header; + Bool move_header; + + NextAvailableInput(oc); /* make sure we have an input buffer */ @@ -494,22 +499,8 @@ InsertFakeRequest(ClientPtr client, char *data, int count) int fd = oc->fd; int gotnow, moveup; - if (AvailableInput) { - if (AvailableInput != oc) { - ConnectionInputPtr aci = AvailableInput->input; + NextAvailableInput(oc); - if (aci->size > BUFWATERMARK) { - free(aci->buffer); - free(aci); - } - else { - aci->next = FreeInputs; - FreeInputs = aci; - } - AvailableInput->input = (ConnectionInputPtr) NULL; - } - AvailableInput = (OsCommPtr) NULL; - } if (!oci) { if ((oci = FreeInputs)) FreeInputs = oci->next; @@ -814,7 +805,7 @@ WriteToClient(ClientPtr who, int count, const void *__buf) } } #endif - if (oco->count + count + padBytes > oco->size) { + if (oco->count == 0 || oco->count + count + padBytes > oco->size) { FD_CLR(oc->fd, &OutputPending); if (!XFD_ANYSET(&OutputPending)) { CriticalOutputPending = FALSE; diff --git a/os/utils.c b/os/utils.c index 60e828e28..97c3125e6 100644 --- a/os/utils.c +++ b/os/utils.c @@ -169,9 +169,7 @@ Bool noXFree86DRIExtension = FALSE; #ifdef XF86VIDMODE Bool noXFree86VidModeExtension = FALSE; #endif -#ifdef XFIXES Bool noXFixesExtension = FALSE; -#endif #ifdef PANORAMIX /* Xinerama is disabled by default unless enabled via +xinerama */ Bool noPanoramiXExtension = TRUE; diff --git a/randr/rrpointer.c b/randr/rrpointer.c index ec803e9d1..eb6b6770c 100644 --- a/randr/rrpointer.c +++ b/randr/rrpointer.c @@ -82,7 +82,7 @@ RRPointerToNearestCrtc(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y, else dx = 0; if (y < crtc->y) - dy = crtc->y - x; + dy = crtc->y - y; else if (y > crtc->y + scan_height) dy = y - (crtc->y + scan_height); else |