Merge remote-tracking branch 'ajax/xserver-next'

This commit is contained in:
Keith Packard 2013-10-04 13:50:04 -07:00
commit 5d2ec6933f
76 changed files with 414 additions and 1156 deletions

View File

@ -53,9 +53,7 @@ Equipment Corporation.
#include "servermd.h" #include "servermd.h"
#include "resource.h" #include "resource.h"
#include "picturestr.h" #include "picturestr.h"
#ifdef XFIXES
#include "xfixesint.h" #include "xfixesint.h"
#endif
#ifdef COMPOSITE #ifdef COMPOSITE
#include "compint.h" #include "compint.h"
#endif #endif
@ -583,9 +581,7 @@ PanoramiXExtensionInit(void)
ProcVector[X_StoreNamedColor] = PanoramiXStoreNamedColor; ProcVector[X_StoreNamedColor] = PanoramiXStoreNamedColor;
PanoramiXRenderInit(); PanoramiXRenderInit();
#ifdef XFIXES
PanoramiXFixesInit(); PanoramiXFixesInit();
#endif
#ifdef COMPOSITE #ifdef COMPOSITE
PanoramiXCompositeInit(); PanoramiXCompositeInit();
#endif #endif
@ -890,9 +886,7 @@ PanoramiXResetProc(ExtensionEntry * extEntry)
int i; int i;
PanoramiXRenderReset(); PanoramiXRenderReset();
#ifdef XFIXES
PanoramiXFixesReset(); PanoramiXFixesReset();
#endif
#ifdef COMPOSITE #ifdef COMPOSITE
PanoramiXCompositeReset (); PanoramiXCompositeReset ();
#endif #endif

View File

@ -57,8 +57,9 @@ static DevPrivateKeyRec stateKeyRec;
/* This is what we store as client security state */ /* This is what we store as client security state */
typedef struct { typedef struct {
int haveState; unsigned int haveState :1;
unsigned int trustLevel; unsigned int live :1;
unsigned int trustLevel :2;
XID authId; XID authId;
} SecurityStateRec; } SecurityStateRec;
@ -141,6 +142,7 @@ SecurityLabelInitial(void)
state = dixLookupPrivate(&serverClient->devPrivates, stateKey); state = dixLookupPrivate(&serverClient->devPrivates, stateKey);
state->trustLevel = XSecurityClientTrusted; state->trustLevel = XSecurityClientTrusted;
state->haveState = TRUE; state->haveState = TRUE;
state->live = FALSE;
} }
/* /*
@ -953,6 +955,7 @@ SecurityClientState(CallbackListPtr *pcbl, pointer unused, pointer calldata)
state->trustLevel = XSecurityClientTrusted; state->trustLevel = XSecurityClientTrusted;
state->authId = None; state->authId = None;
state->haveState = TRUE; state->haveState = TRUE;
state->live = FALSE;
break; break;
case ClientStateRunning: case ClientStateRunning:
@ -963,6 +966,7 @@ SecurityClientState(CallbackListPtr *pcbl, pointer unused, pointer calldata)
if (rc == Success) { if (rc == Success) {
/* it is a generated authorization */ /* it is a generated authorization */
pAuth->refcnt++; pAuth->refcnt++;
state->live = TRUE;
if (pAuth->refcnt == 1 && pAuth->timer) if (pAuth->refcnt == 1 && pAuth->timer)
TimerCancel(pAuth->timer); TimerCancel(pAuth->timer);
@ -975,9 +979,10 @@ SecurityClientState(CallbackListPtr *pcbl, pointer unused, pointer calldata)
rc = dixLookupResourceByType((pointer *) &pAuth, state->authId, rc = dixLookupResourceByType((pointer *) &pAuth, state->authId,
SecurityAuthorizationResType, serverClient, SecurityAuthorizationResType, serverClient,
DixGetAttrAccess); DixGetAttrAccess);
if (rc == Success) { if (rc == Success && state->live) {
/* it is a generated authorization */ /* it is a generated authorization */
pAuth->refcnt--; pAuth->refcnt--;
state->live = FALSE;
if (pAuth->refcnt == 0) if (pAuth->refcnt == 0)
SecurityStartAuthorizationTimer(pAuth); SecurityStartAuthorizationTimer(pAuth);
} }

View File

@ -205,7 +205,7 @@ compRedirectWindow(ClientPtr pClient, WindowPtr pWin, int update)
anyMarked = compMarkWindows(pWin, &pLayerWin); anyMarked = compMarkWindows(pWin, &pLayerWin);
if (cw->damageRegistered) { if (cw->damageRegistered) {
DamageUnregister(&pWin->drawable, cw->damage); DamageUnregister(cw->damage);
cw->damageRegistered = FALSE; cw->damageRegistered = FALSE;
} }
cw->update = CompositeRedirectManual; cw->update = CompositeRedirectManual;
@ -638,7 +638,7 @@ compSetParentPixmap(WindowPtr pWin)
CompWindowPtr cw = GetCompWindow(pWin); CompWindowPtr cw = GetCompWindow(pWin);
if (cw->damageRegistered) { if (cw->damageRegistered) {
DamageUnregister(&pWin->drawable, cw->damage); DamageUnregister(cw->damage);
cw->damageRegistered = FALSE; cw->damageRegistered = FALSE;
DamageEmpty(cw->damage); DamageEmpty(cw->damage);
} }

View File

@ -31,7 +31,6 @@
static unsigned char DamageReqCode; static unsigned char DamageReqCode;
static int DamageEventBase; static int DamageEventBase;
static RESTYPE DamageExtType; static RESTYPE DamageExtType;
static RESTYPE DamageExtWinType;
static DevPrivateKeyRec DamageClientPrivateKeyRec; static DevPrivateKeyRec DamageClientPrivateKeyRec;
@ -311,9 +310,12 @@ static const int version_requests[] = {
static int (*ProcDamageVector[XDamageNumberRequests]) (ClientPtr) = { static int (*ProcDamageVector[XDamageNumberRequests]) (ClientPtr) = {
/*************** Version 1 ******************/ /*************** Version 1 ******************/
ProcDamageQueryVersion, ProcDamageQueryVersion,
ProcDamageCreate, ProcDamageDestroy, ProcDamageSubtract, ProcDamageCreate,
ProcDamageDestroy,
ProcDamageSubtract,
/*************** Version 1.1 ****************/ /*************** Version 1.1 ****************/
ProcDamageAdd,}; ProcDamageAdd,
};
static int static int
ProcDamageDispatch(ClientPtr client) ProcDamageDispatch(ClientPtr client)
@ -391,9 +393,12 @@ SProcDamageAdd(ClientPtr client)
static int (*SProcDamageVector[XDamageNumberRequests]) (ClientPtr) = { static int (*SProcDamageVector[XDamageNumberRequests]) (ClientPtr) = {
/*************** Version 1 ******************/ /*************** Version 1 ******************/
SProcDamageQueryVersion, SProcDamageQueryVersion,
SProcDamageCreate, SProcDamageDestroy, SProcDamageSubtract, SProcDamageCreate,
SProcDamageDestroy,
SProcDamageSubtract,
/*************** Version 1.1 ****************/ /*************** Version 1.1 ****************/
SProcDamageAdd,}; SProcDamageAdd,
};
static int static int
SProcDamageDispatch(ClientPtr client) SProcDamageDispatch(ClientPtr client)
@ -431,26 +436,13 @@ FreeDamageExt(pointer value, XID did)
* Get rid of the resource table entry hanging from the window id * Get rid of the resource table entry hanging from the window id
*/ */
pDamageExt->id = 0; pDamageExt->id = 0;
if (WindowDrawable(pDamageExt->pDrawable->type))
FreeResourceByType(pDamageExt->pDrawable->id, DamageExtWinType, TRUE);
if (pDamageExt->pDamage) { if (pDamageExt->pDamage) {
DamageUnregister(pDamageExt->pDrawable, pDamageExt->pDamage);
DamageDestroy(pDamageExt->pDamage); DamageDestroy(pDamageExt->pDamage);
} }
free(pDamageExt); free(pDamageExt);
return Success; 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 static void
SDamageNotifyEvent(xDamageNotifyEvent * from, xDamageNotifyEvent * to) SDamageNotifyEvent(xDamageNotifyEvent * from, xDamageNotifyEvent * to)
{ {
@ -481,10 +473,6 @@ DamageExtensionInit(void)
if (!DamageExtType) if (!DamageExtType)
return; return;
DamageExtWinType = CreateNewResourceType(FreeDamageExtWin, "DamageExtWin");
if (!DamageExtWinType)
return;
if (!dixRegisterPrivateKey if (!dixRegisterPrivateKey
(&DamageClientPrivateKeyRec, PRIVATE_CLIENT, sizeof(DamageClientRec))) (&DamageClientPrivateKeyRec, PRIVATE_CLIENT, sizeof(DamageClientRec)))
return; return;

View File

@ -9,5 +9,4 @@ endif
libdbe_la_SOURCES = \ libdbe_la_SOURCES = \
dbe.c \ dbe.c \
midbe.c \ midbe.c \
midbe.h \ midbe.h
midbestr.h

View File

@ -90,10 +90,7 @@ DbeStubScreen(DbeScreenPrivPtr pDbeScreenPriv, int *nStubbedScreens)
pDbeScreenPriv->GetVisualInfo = NULL; pDbeScreenPriv->GetVisualInfo = NULL;
pDbeScreenPriv->AllocBackBufferName = NULL; pDbeScreenPriv->AllocBackBufferName = NULL;
pDbeScreenPriv->SwapBuffers = NULL; pDbeScreenPriv->SwapBuffers = NULL;
pDbeScreenPriv->BeginIdiom = NULL;
pDbeScreenPriv->EndIdiom = NULL;
pDbeScreenPriv->WinPrivDelete = NULL; pDbeScreenPriv->WinPrivDelete = NULL;
pDbeScreenPriv->ResetProc = NULL;
(*nStubbedScreens)++; (*nStubbedScreens)++;
@ -232,8 +229,7 @@ ProcDbeAllocateBackBufferName(ClientPtr client)
* Allocate a window priv. * Allocate a window priv.
*/ */
pDbeWindowPriv = pDbeWindowPriv = calloc(1, sizeof(DbeWindowPrivRec));
dixAllocateObjectWithPrivates(DbeWindowPrivRec, PRIVATE_DBE_WINDOW);
if (!pDbeWindowPriv) if (!pDbeWindowPriv)
return BadAlloc; return BadAlloc;
@ -543,44 +539,6 @@ ProcDbeSwapBuffers(ClientPtr client)
} /* ProcDbeSwapBuffers() */ } /* ProcDbeSwapBuffers() */
/******************************************************************************
*
* 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 * DBE DIX Procedure: ProcDbeGetVisualInfo
@ -818,7 +776,7 @@ ProcDbeDispatch(ClientPtr client)
return (ProcDbeSwapBuffers(client)); return (ProcDbeSwapBuffers(client));
case X_DbeBeginIdiom: case X_DbeBeginIdiom:
return (ProcDbeBeginIdiom(client)); return Success;
case X_DbeEndIdiom: case X_DbeEndIdiom:
return Success; return Success;
@ -980,32 +938,6 @@ SProcDbeSwapBuffers(ClientPtr client)
} /* SProcDbeSwapBuffers() */ } /* SProcDbeSwapBuffers() */
/******************************************************************************
*
* 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 * DBE DIX Procedure: SProcDbeGetVisualInfo
@ -1097,7 +1029,7 @@ SProcDbeDispatch(ClientPtr client)
return (SProcDbeSwapBuffers(client)); return (SProcDbeSwapBuffers(client));
case X_DbeBeginIdiom: case X_DbeBeginIdiom:
return (SProcDbeBeginIdiom(client)); return Success;
case X_DbeEndIdiom: case X_DbeEndIdiom:
return Success; return Success;
@ -1289,7 +1221,7 @@ DbeWindowPrivDelete(pointer pDbeWinPriv, XID id)
NULL); NULL);
/* We are done with the window priv. */ /* We are done with the window priv. */
dixFreeObjectWithPrivates(pDbeWindowPriv, PRIVATE_DBE_WINDOW); free(pDbeWindowPriv);
} }
return Success; return Success;
@ -1321,10 +1253,7 @@ DbeResetProc(ExtensionEntry * extEntry)
if (pDbeScreenPriv) { if (pDbeScreenPriv) {
/* Unwrap DestroyWindow, which was wrapped in DbeExtensionInit(). */ /* Unwrap DestroyWindow, which was wrapped in DbeExtensionInit(). */
pScreen->DestroyWindow = pDbeScreenPriv->DestroyWindow; pScreen->DestroyWindow = pDbeScreenPriv->DestroyWindow;
pScreen->PositionWindow = pDbeScreenPriv->PositionWindow;
if (pDbeScreenPriv->ResetProc)
(*pDbeScreenPriv->ResetProc) (pScreen);
free(pDbeScreenPriv); free(pDbeScreenPriv);
} }
} }

View File

@ -143,6 +143,20 @@ typedef struct _DbeWindowPrivRec {
*/ */
XID initIDs[DBE_INIT_MAX_IDS]; 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. /* Device-specific private information.
*/ */
PrivateRec *devPrivates; PrivateRec *devPrivates;
@ -180,16 +194,9 @@ typedef struct _DbeScreenPrivRec {
int * /*pNumWindows */ , int * /*pNumWindows */ ,
DbeSwapInfoPtr /*swapInfo */ DbeSwapInfoPtr /*swapInfo */
); );
void (*BeginIdiom) (ClientPtr /*client */
);
void (*EndIdiom) (ClientPtr /*client */
);
void (*WinPrivDelete) (DbeWindowPrivPtr /*pDbeWindowPriv */ , void (*WinPrivDelete) (DbeWindowPrivPtr /*pDbeWindowPriv */ ,
XID /*bufId */ XID /*bufId */
); );
void (*ResetProc) (ScreenPtr /*pScreen */
);
} DbeScreenPrivRec, *DbeScreenPrivPtr; } DbeScreenPrivRec, *DbeScreenPrivPtr;
#endif /* DBE_STRUCT_H */ #endif /* DBE_STRUCT_H */

View File

@ -48,7 +48,6 @@
#include "resource.h" #include "resource.h"
#include "opaque.h" #include "opaque.h"
#include "dbestruct.h" #include "dbestruct.h"
#include "midbestr.h"
#include "regionstr.h" #include "regionstr.h"
#include "gcstruct.h" #include "gcstruct.h"
#include "inputstr.h" #include "inputstr.h"
@ -57,9 +56,6 @@
#include <stdio.h> #include <stdio.h>
static DevPrivateKeyRec miDbeWindowPrivPrivKeyRec;
#define miDbeWindowPrivPrivKey (&miDbeWindowPrivPrivKeyRec)
/****************************************************************************** /******************************************************************************
* *
@ -138,7 +134,6 @@ miDbeAllocBackBufferName(WindowPtr pWin, XID bufId, int swapAction)
{ {
ScreenPtr pScreen; ScreenPtr pScreen;
DbeWindowPrivPtr pDbeWindowPriv; DbeWindowPrivPtr pDbeWindowPriv;
MiDbeWindowPrivPrivPtr pDbeWindowPrivPriv;
DbeScreenPrivPtr pDbeScreenPriv; DbeScreenPrivPtr pDbeScreenPriv;
GCPtr pGC; GCPtr pGC;
xRectangle clearRect; xRectangle clearRect;
@ -156,12 +151,8 @@ miDbeAllocBackBufferName(WindowPtr pWin, XID bufId, int swapAction)
pDbeScreenPriv = DBE_SCREEN_PRIV(pScreen); pDbeScreenPriv = DBE_SCREEN_PRIV(pScreen);
/* Setup the window priv priv. */
pDbeWindowPrivPriv = MI_DBE_WINDOW_PRIV_PRIV(pDbeWindowPriv);
pDbeWindowPrivPriv->pDbeWindowPriv = pDbeWindowPriv;
/* Get a front pixmap. */ /* Get a front pixmap. */
if (!(pDbeWindowPrivPriv->pFrontBuffer = if (!(pDbeWindowPriv->pFrontBuffer =
(*pScreen->CreatePixmap) (pScreen, pDbeWindowPriv->width, (*pScreen->CreatePixmap) (pScreen, pDbeWindowPriv->width,
pDbeWindowPriv->height, pDbeWindowPriv->height,
pWin->drawable.depth, 0))) { pWin->drawable.depth, 0))) {
@ -169,22 +160,22 @@ miDbeAllocBackBufferName(WindowPtr pWin, XID bufId, int swapAction)
} }
/* Get a back pixmap. */ /* Get a back pixmap. */
if (!(pDbeWindowPrivPriv->pBackBuffer = if (!(pDbeWindowPriv->pBackBuffer =
(*pScreen->CreatePixmap) (pScreen, pDbeWindowPriv->width, (*pScreen->CreatePixmap) (pScreen, pDbeWindowPriv->width,
pDbeWindowPriv->height, pDbeWindowPriv->height,
pWin->drawable.depth, 0))) { pWin->drawable.depth, 0))) {
(*pScreen->DestroyPixmap) (pDbeWindowPrivPriv->pFrontBuffer); (*pScreen->DestroyPixmap) (pDbeWindowPriv->pFrontBuffer);
return BadAlloc; return BadAlloc;
} }
/* Security creation/labeling check. */ /* Security creation/labeling check. */
rc = XaceHook(XACE_RESOURCE_ACCESS, serverClient, bufId, rc = XaceHook(XACE_RESOURCE_ACCESS, serverClient, bufId,
dbeDrawableResType, pDbeWindowPrivPriv->pBackBuffer, dbeDrawableResType, pDbeWindowPriv->pBackBuffer,
RT_WINDOW, pWin, DixCreateAccess); RT_WINDOW, pWin, DixCreateAccess);
/* Make the back pixmap a DBE drawable resource. */ /* Make the back pixmap a DBE drawable resource. */
if (rc != Success || !AddResource(bufId, dbeDrawableResType, if (rc != Success || !AddResource(bufId, dbeDrawableResType,
pDbeWindowPrivPriv->pBackBuffer)) { pDbeWindowPriv->pBackBuffer)) {
/* free the buffer and the drawable resource */ /* free the buffer and the drawable resource */
FreeResource(bufId, RT_NONE); FreeResource(bufId, RT_NONE);
return (rc == Success) ? BadAlloc : rc; return (rc == Success) ? BadAlloc : rc;
@ -193,11 +184,11 @@ miDbeAllocBackBufferName(WindowPtr pWin, XID bufId, int swapAction)
/* Clear the back buffer. */ /* Clear the back buffer. */
pGC = GetScratchGC(pWin->drawable.depth, pWin->drawable.pScreen); pGC = GetScratchGC(pWin->drawable.depth, pWin->drawable.pScreen);
if ((*pDbeScreenPriv->SetupBackgroundPainter) (pWin, pGC)) { if ((*pDbeScreenPriv->SetupBackgroundPainter) (pWin, pGC)) {
ValidateGC((DrawablePtr) pDbeWindowPrivPriv->pBackBuffer, pGC); ValidateGC((DrawablePtr) pDbeWindowPriv->pBackBuffer, pGC);
clearRect.x = clearRect.y = 0; clearRect.x = clearRect.y = 0;
clearRect.width = pDbeWindowPrivPriv->pBackBuffer->drawable.width; clearRect.width = pDbeWindowPriv->pBackBuffer->drawable.width;
clearRect.height = pDbeWindowPrivPriv->pBackBuffer->drawable.height; clearRect.height = pDbeWindowPriv->pBackBuffer->drawable.height;
(*pGC->ops->PolyFillRect) ((DrawablePtr) pDbeWindowPrivPriv-> (*pGC->ops->PolyFillRect) ((DrawablePtr) pDbeWindowPriv->
pBackBuffer, pGC, 1, &clearRect); pBackBuffer, pGC, 1, &clearRect);
} }
FreeScratchGC(pGC); FreeScratchGC(pGC);
@ -210,9 +201,8 @@ miDbeAllocBackBufferName(WindowPtr pWin, XID bufId, int swapAction)
*/ */
/* Associate the new ID with an existing pixmap. */ /* Associate the new ID with an existing pixmap. */
pDbeWindowPrivPriv = MI_DBE_WINDOW_PRIV_PRIV(pDbeWindowPriv);
if (!AddResource(bufId, dbeDrawableResType, if (!AddResource(bufId, dbeDrawableResType,
(pointer) pDbeWindowPrivPriv->pBackBuffer)) { (pointer) pDbeWindowPriv->pBackBuffer)) {
return BadAlloc; return BadAlloc;
} }
@ -237,12 +227,10 @@ static void
miDbeAliasBuffers(DbeWindowPrivPtr pDbeWindowPriv) miDbeAliasBuffers(DbeWindowPrivPtr pDbeWindowPriv)
{ {
int i; int i;
MiDbeWindowPrivPrivPtr pDbeWindowPrivPriv =
MI_DBE_WINDOW_PRIV_PRIV(pDbeWindowPriv);
for (i = 0; i < pDbeWindowPriv->nBufferIDs; i++) { for (i = 0; i < pDbeWindowPriv->nBufferIDs; i++) {
ChangeResourceValue(pDbeWindowPriv->IDs[i], dbeDrawableResType, ChangeResourceValue(pDbeWindowPriv->IDs[i], dbeDrawableResType,
(pointer) pDbeWindowPrivPriv->pBackBuffer); (pointer) pDbeWindowPriv->pBackBuffer);
} }
} /* miDbeAliasBuffers() */ } /* miDbeAliasBuffers() */
@ -261,15 +249,15 @@ static int
miDbeSwapBuffers(ClientPtr client, int *pNumWindows, DbeSwapInfoPtr swapInfo) miDbeSwapBuffers(ClientPtr client, int *pNumWindows, DbeSwapInfoPtr swapInfo)
{ {
DbeScreenPrivPtr pDbeScreenPriv; DbeScreenPrivPtr pDbeScreenPriv;
DbeWindowPrivPtr pDbeWindowPriv;
GCPtr pGC; GCPtr pGC;
WindowPtr pWin; WindowPtr pWin;
MiDbeWindowPrivPrivPtr pDbeWindowPrivPriv;
PixmapPtr pTmpBuffer; PixmapPtr pTmpBuffer;
xRectangle clearRect; xRectangle clearRect;
pWin = swapInfo[0].pWindow; pWin = swapInfo[0].pWindow;
pDbeScreenPriv = DBE_SCREEN_PRIV_FROM_WINDOW(pWin); 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); pGC = GetScratchGC(pWin->drawable.depth, pWin->drawable.pScreen);
/* /*
@ -286,9 +274,9 @@ miDbeSwapBuffers(ClientPtr client, int *pNumWindows, DbeSwapInfoPtr swapInfo)
break; break;
case XdbeUntouched: case XdbeUntouched:
ValidateGC((DrawablePtr) pDbeWindowPrivPriv->pFrontBuffer, pGC); ValidateGC((DrawablePtr) pDbeWindowPriv->pFrontBuffer, pGC);
(*pGC->ops->CopyArea) ((DrawablePtr) pWin, (*pGC->ops->CopyArea) ((DrawablePtr) pWin,
(DrawablePtr) pDbeWindowPrivPriv->pFrontBuffer, (DrawablePtr) pDbeWindowPriv->pFrontBuffer,
pGC, 0, 0, pWin->drawable.width, pGC, 0, 0, pWin->drawable.width,
pWin->drawable.height, 0, 0); pWin->drawable.height, 0, 0);
break; break;
@ -305,7 +293,7 @@ miDbeSwapBuffers(ClientPtr client, int *pNumWindows, DbeSwapInfoPtr swapInfo)
*/ */
ValidateGC((DrawablePtr) pWin, pGC); ValidateGC((DrawablePtr) pWin, pGC);
(*pGC->ops->CopyArea) ((DrawablePtr) pDbeWindowPrivPriv->pBackBuffer, (*pGC->ops->CopyArea) ((DrawablePtr) pDbeWindowPriv->pBackBuffer,
(DrawablePtr) pWin, pGC, 0, 0, (DrawablePtr) pWin, pGC, 0, 0,
pWin->drawable.width, pWin->drawable.height, 0, 0); pWin->drawable.width, pWin->drawable.height, 0, 0);
@ -321,23 +309,23 @@ miDbeSwapBuffers(ClientPtr client, int *pNumWindows, DbeSwapInfoPtr swapInfo)
case XdbeBackground: case XdbeBackground:
if ((*pDbeScreenPriv->SetupBackgroundPainter) (pWin, pGC)) { if ((*pDbeScreenPriv->SetupBackgroundPainter) (pWin, pGC)) {
ValidateGC((DrawablePtr) pDbeWindowPrivPriv->pBackBuffer, pGC); ValidateGC((DrawablePtr) pDbeWindowPriv->pBackBuffer, pGC);
clearRect.x = 0; clearRect.x = 0;
clearRect.y = 0; clearRect.y = 0;
clearRect.width = pDbeWindowPrivPriv->pBackBuffer->drawable.width; clearRect.width = pDbeWindowPriv->pBackBuffer->drawable.width;
clearRect.height = pDbeWindowPrivPriv->pBackBuffer->drawable.height; clearRect.height = pDbeWindowPriv->pBackBuffer->drawable.height;
(*pGC->ops->PolyFillRect) ((DrawablePtr) pDbeWindowPrivPriv-> (*pGC->ops->PolyFillRect) ((DrawablePtr) pDbeWindowPriv->
pBackBuffer, pGC, 1, &clearRect); pBackBuffer, pGC, 1, &clearRect);
} }
break; break;
case XdbeUntouched: case XdbeUntouched:
/* Swap pixmap pointers. */ /* Swap pixmap pointers. */
pTmpBuffer = pDbeWindowPrivPriv->pBackBuffer; pTmpBuffer = pDbeWindowPriv->pBackBuffer;
pDbeWindowPrivPriv->pBackBuffer = pDbeWindowPrivPriv->pFrontBuffer; pDbeWindowPriv->pBackBuffer = pDbeWindowPriv->pFrontBuffer;
pDbeWindowPrivPriv->pFrontBuffer = pTmpBuffer; pDbeWindowPriv->pFrontBuffer = pTmpBuffer;
miDbeAliasBuffers(pDbeWindowPrivPriv->pDbeWindowPriv); miDbeAliasBuffers(pDbeWindowPriv);
break; break;
@ -427,8 +415,6 @@ miDbeSwapBuffers(ClientPtr client, int *pNumWindows, DbeSwapInfoPtr swapInfo)
static void static void
miDbeWinPrivDelete(DbeWindowPrivPtr pDbeWindowPriv, XID bufId) miDbeWinPrivDelete(DbeWindowPrivPtr pDbeWindowPriv, XID bufId)
{ {
MiDbeWindowPrivPrivPtr pDbeWindowPrivPriv;
if (pDbeWindowPriv->nBufferIDs != 0) { if (pDbeWindowPriv->nBufferIDs != 0) {
/* We still have at least one more buffer ID associated with this /* We still have at least one more buffer ID associated with this
* window. * window.
@ -440,18 +426,15 @@ miDbeWinPrivDelete(DbeWindowPrivPtr pDbeWindowPriv, XID bufId)
* free some stuff. * free some stuff.
*/ */
pDbeWindowPrivPriv = MI_DBE_WINDOW_PRIV_PRIV(pDbeWindowPriv);
/* Destroy the front and back pixmaps. */ /* Destroy the front and back pixmaps. */
if (pDbeWindowPrivPriv->pFrontBuffer) { if (pDbeWindowPriv->pFrontBuffer) {
(*pDbeWindowPriv->pWindow->drawable.pScreen-> (*pDbeWindowPriv->pWindow->drawable.pScreen->
DestroyPixmap) (pDbeWindowPrivPriv->pFrontBuffer); DestroyPixmap) (pDbeWindowPriv->pFrontBuffer);
} }
if (pDbeWindowPrivPriv->pBackBuffer) { if (pDbeWindowPriv->pBackBuffer) {
(*pDbeWindowPriv->pWindow->drawable.pScreen-> (*pDbeWindowPriv->pWindow->drawable.pScreen->
DestroyPixmap) (pDbeWindowPrivPriv->pBackBuffer); DestroyPixmap) (pDbeWindowPriv->pBackBuffer);
} }
} /* miDbeWinPrivDelete() */ } /* miDbeWinPrivDelete() */
/****************************************************************************** /******************************************************************************
@ -627,10 +610,6 @@ miDbePositionWindow(WindowPtr pWin, int x, int y)
else { else {
/* Clear out the new DBE buffer pixmaps. */ /* 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 /* I suppose this could avoid quite a bit of work if
* it computed the minimal area required. * 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. */ /* Copy the contents of the old front pixmap to the new one. */
if (pWin->bitGravity != ForgetGravity) { if (pWin->bitGravity != ForgetGravity) {
(*pGC->ops->CopyArea) ((DrawablePtr) pDbeWindowPrivPriv-> (*pGC->ops->CopyArea) ((DrawablePtr) pDbeWindowPriv->pFrontBuffer,
pFrontBuffer, (DrawablePtr) pFrontBuffer, (DrawablePtr) pFrontBuffer, pGC,
pGC, sourcex, sourcey, savewidth, saveheight, sourcex, sourcey, savewidth, saveheight,
destx, desty); 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. */ /* Copy the contents of the old back pixmap to the new one. */
if (pWin->bitGravity != ForgetGravity) { if (pWin->bitGravity != ForgetGravity) {
(*pGC->ops->CopyArea) ((DrawablePtr) pDbeWindowPrivPriv-> (*pGC->ops->CopyArea) ((DrawablePtr) pDbeWindowPriv->pBackBuffer,
pBackBuffer, (DrawablePtr) pBackBuffer, pGC, (DrawablePtr) pBackBuffer, pGC,
sourcex, sourcey, savewidth, saveheight, sourcex, sourcey, savewidth, saveheight,
destx, desty); destx, desty);
} }
@ -664,11 +643,11 @@ miDbePositionWindow(WindowPtr pWin, int x, int y)
* pixmaps. * pixmaps.
*/ */
(*pScreen->DestroyPixmap) (pDbeWindowPrivPriv->pFrontBuffer); (*pScreen->DestroyPixmap) (pDbeWindowPriv->pFrontBuffer);
(*pScreen->DestroyPixmap) (pDbeWindowPrivPriv->pBackBuffer); (*pScreen->DestroyPixmap) (pDbeWindowPriv->pBackBuffer);
pDbeWindowPrivPriv->pFrontBuffer = pFrontBuffer; pDbeWindowPriv->pFrontBuffer = pFrontBuffer;
pDbeWindowPrivPriv->pBackBuffer = pBackBuffer; pDbeWindowPriv->pBackBuffer = pBackBuffer;
/* Make sure all XID are associated with the new back pixmap. */ /* Make sure all XID are associated with the new back pixmap. */
miDbeAliasBuffers(pDbeWindowPriv); miDbeAliasBuffers(pDbeWindowPriv);
@ -680,30 +659,6 @@ miDbePositionWindow(WindowPtr pWin, int x, int y)
} /* miDbePositionWindow() */ } /* miDbePositionWindow() */
/******************************************************************************
*
* 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 * DBE MI Procedure: miDbeInit
@ -717,10 +672,6 @@ miDbeResetProc(ScreenPtr pScreen)
Bool Bool
miDbeInit(ScreenPtr pScreen, DbeScreenPrivPtr pDbeScreenPriv) miDbeInit(ScreenPtr pScreen, DbeScreenPrivPtr pDbeScreenPriv)
{ {
if (!dixRegisterPrivateKey(&miDbeWindowPrivPrivKeyRec, PRIVATE_DBE_WINDOW,
sizeof(MiDbeWindowPrivPrivRec)))
return FALSE;
/* Wrap functions. */ /* Wrap functions. */
pDbeScreenPriv->PositionWindow = pScreen->PositionWindow; pDbeScreenPriv->PositionWindow = pScreen->PositionWindow;
pScreen->PositionWindow = miDbePositionWindow; pScreen->PositionWindow = miDbePositionWindow;
@ -729,9 +680,6 @@ miDbeInit(ScreenPtr pScreen, DbeScreenPrivPtr pDbeScreenPriv)
pDbeScreenPriv->GetVisualInfo = miDbeGetVisualInfo; pDbeScreenPriv->GetVisualInfo = miDbeGetVisualInfo;
pDbeScreenPriv->AllocBackBufferName = miDbeAllocBackBufferName; pDbeScreenPriv->AllocBackBufferName = miDbeAllocBackBufferName;
pDbeScreenPriv->SwapBuffers = miDbeSwapBuffers; pDbeScreenPriv->SwapBuffers = miDbeSwapBuffers;
pDbeScreenPriv->BeginIdiom = 0;
pDbeScreenPriv->EndIdiom = 0;
pDbeScreenPriv->ResetProc = miDbeResetProc;
pDbeScreenPriv->WinPrivDelete = miDbeWinPrivDelete; pDbeScreenPriv->WinPrivDelete = miDbeWinPrivDelete;
return TRUE; return TRUE;

View File

@ -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 */

View File

@ -71,9 +71,7 @@ static GlyphSharePtr sharedGlyphs = (GlyphSharePtr) NULL;
DevScreenPrivateKeyRec cursorScreenDevPriv; DevScreenPrivateKeyRec cursorScreenDevPriv;
#ifdef XFIXES
static CARD32 cursorSerial; static CARD32 cursorSerial;
#endif
static void static void
FreeCursorBits(CursorBitsPtr bits) FreeCursorBits(CursorBitsPtr bits)
@ -272,10 +270,8 @@ AllocARGBCursor(unsigned char *psrcbits, unsigned char *pmaskbits,
bits->refcnt = -1; bits->refcnt = -1;
CheckForEmptyMask(bits); CheckForEmptyMask(bits);
pCurs->bits = bits; pCurs->bits = bits;
#ifdef XFIXES
pCurs->serialNumber = ++cursorSerial; pCurs->serialNumber = ++cursorSerial;
pCurs->name = None; pCurs->name = None;
#endif
pCurs->foreRed = foreRed; pCurs->foreRed = foreRed;
pCurs->foreGreen = foreGreen; pCurs->foreGreen = foreGreen;
@ -433,10 +429,8 @@ AllocGlyphCursor(Font source, unsigned sourceChar, Font mask, unsigned maskChar,
CheckForEmptyMask(bits); CheckForEmptyMask(bits);
pCurs->bits = bits; pCurs->bits = bits;
pCurs->refcnt = 1; pCurs->refcnt = 1;
#ifdef XFIXES
pCurs->serialNumber = ++cursorSerial; pCurs->serialNumber = ++cursorSerial;
pCurs->name = None; pCurs->name = None;
#endif
pCurs->foreRed = foreRed; pCurs->foreRed = foreRed;
pCurs->foreGreen = foreGreen; pCurs->foreGreen = foreGreen;

View File

@ -1974,7 +1974,7 @@ ProcPutImage(ClientPtr client)
static int static int
DoGetImage(ClientPtr client, int format, Drawable drawable, DoGetImage(ClientPtr client, int format, Drawable drawable,
int x, int y, int width, int height, int x, int y, int width, int height,
Mask planemask, xGetImageReply ** im_return) Mask planemask)
{ {
DrawablePtr pDraw, pBoundingDraw; DrawablePtr pDraw, pBoundingDraw;
int nlines, linesPerBuf, rc; int nlines, linesPerBuf, rc;
@ -2074,19 +2074,6 @@ DoGetImage(ClientPtr client, int format, Drawable drawable,
xgi.length = length; xgi.length = length;
if (im_return) {
pBuf = calloc(1, sz_xGetImageReply + length);
if (!pBuf)
return BadAlloc;
if (widthBytesLine == 0)
linesPerBuf = 0;
else
linesPerBuf = height;
*im_return = (xGetImageReply *) pBuf;
*(xGetImageReply *) pBuf = xgi;
pBuf += sz_xGetImageReply;
}
else {
xgi.length = bytes_to_int32(xgi.length); xgi.length = bytes_to_int32(xgi.length);
if (widthBytesLine == 0 || height == 0) if (widthBytesLine == 0 || height == 0)
linesPerBuf = 0; linesPerBuf = 0;
@ -2113,7 +2100,6 @@ DoGetImage(ClientPtr client, int format, Drawable drawable,
if (!(pBuf = calloc(1, length))) if (!(pBuf = calloc(1, length)))
return BadAlloc; return BadAlloc;
WriteReplyToClient(client, sizeof(xGetImageReply), &xgi); WriteReplyToClient(client, sizeof(xGetImageReply), &xgi);
}
if (pDraw->type == DRAWABLE_WINDOW) { if (pDraw->type == DRAWABLE_WINDOW) {
pVisibleRegion = NotClippedByChildren((WindowPtr) pDraw); pVisibleRegion = NotClippedByChildren((WindowPtr) pDraw);
@ -2142,13 +2128,10 @@ DoGetImage(ClientPtr client, int format, Drawable drawable,
/* Note that this is NOT a call to WriteSwappedDataToClient, /* Note that this is NOT a call to WriteSwappedDataToClient,
as we do NOT byte swap */ as we do NOT byte swap */
if (!im_return) {
ReformatImage(pBuf, (int) (nlines * widthBytesLine), ReformatImage(pBuf, (int) (nlines * widthBytesLine),
BitsPerPixel(pDraw->depth), ClientOrder(client)); 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; linesDone += nlines;
} }
} }
@ -2173,18 +2156,10 @@ DoGetImage(ClientPtr client, int format, Drawable drawable,
/* Note: NOT a call to WriteSwappedDataToClient, /* Note: NOT a call to WriteSwappedDataToClient,
as we do NOT byte swap */ as we do NOT byte swap */
if (im_return) { ReformatImage(pBuf, (int) (nlines * widthBytesLine),
pBuf += nlines * widthBytesLine;
}
else {
ReformatImage(pBuf,
(int) (nlines * widthBytesLine),
1, ClientOrder(client)); 1, 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; linesDone += nlines;
} }
} }
@ -2192,7 +2167,6 @@ DoGetImage(ClientPtr client, int format, Drawable drawable,
} }
if (pVisibleRegion) if (pVisibleRegion)
RegionDestroy(pVisibleRegion); RegionDestroy(pVisibleRegion);
if (!im_return)
free(pBuf); free(pBuf);
return Success; return Success;
} }
@ -2207,7 +2181,7 @@ ProcGetImage(ClientPtr client)
return DoGetImage(client, stuff->format, stuff->drawable, return DoGetImage(client, stuff->format, stuff->drawable,
stuff->x, stuff->y, stuff->x, stuff->y,
(int) stuff->width, (int) stuff->height, (int) stuff->width, (int) stuff->height,
stuff->planeMask, (xGetImageReply **) NULL); stuff->planeMask);
} }
int int

View File

@ -202,7 +202,6 @@ PixmapStopDirtyTracking(PixmapPtr src, PixmapPtr slave_dst)
xorg_list_for_each_entry_safe(ent, safe, &screen->pixmap_dirty_list, ent) { xorg_list_for_each_entry_safe(ent, safe, &screen->pixmap_dirty_list, ent) {
if (ent->src == src && ent->slave_dst == slave_dst) { if (ent->src == src && ent->slave_dst == slave_dst) {
DamageUnregister(&src->drawable, ent->damage);
DamageDestroy(ent->damage); DamageDestroy(ent->damage);
xorg_list_del(&ent->ent); xorg_list_del(&ent->ent);
free(ent); free(ent);

View File

@ -105,7 +105,6 @@ static const char *key_names[PRIVATE_LAST] = {
[PRIVATE_CURSOR_BITS] = "CURSOR_BITS", [PRIVATE_CURSOR_BITS] = "CURSOR_BITS",
/* extension privates */ /* extension privates */
[PRIVATE_DBE_WINDOW] = "DBE_WINDOW",
[PRIVATE_DAMAGE] = "DAMAGE", [PRIVATE_DAMAGE] = "DAMAGE",
[PRIVATE_GLYPH] = "GLYPH", [PRIVATE_GLYPH] = "GLYPH",
[PRIVATE_GLYPHSET] = "GLYPHSET", [PRIVATE_GLYPHSET] = "GLYPHSET",

View File

@ -2847,11 +2847,9 @@ HandleSaveSet(ClientPtr client)
for (j = 0; j < client->numSaved; j++) { for (j = 0; j < client->numSaved; j++) {
pWin = SaveSetWindow(client->saveSet[j]); pWin = SaveSetWindow(client->saveSet[j]);
#ifdef XFIXES
if (SaveSetToRoot(client->saveSet[j])) if (SaveSetToRoot(client->saveSet[j]))
pParent = pWin->drawable.pScreen->root; pParent = pWin->drawable.pScreen->root;
else else
#endif
{ {
pParent = pWin->parent; pParent = pWin->parent;
while (pParent && (wClient(pParent) == client)) while (pParent && (wClient(pParent) == client))
@ -2859,11 +2857,9 @@ HandleSaveSet(ClientPtr client)
} }
if (pParent) { if (pParent) {
if (pParent != pWin->parent) { if (pParent != pWin->parent) {
#ifdef XFIXES
/* unmap first so that ReparentWindow doesn't remap */ /* unmap first so that ReparentWindow doesn't remap */
if (!SaveSetShouldMap(client->saveSet[j])) if (!SaveSetShouldMap(client->saveSet[j]))
UnmapWindow(pWin, FALSE); UnmapWindow(pWin, FALSE);
#endif
ReparentWindow(pWin, pParent, ReparentWindow(pWin, pParent,
pWin->drawable.x - wBorderWidth(pWin) - pWin->drawable.x - wBorderWidth(pWin) -
pParent->drawable.x, pParent->drawable.x,
@ -2872,9 +2868,7 @@ HandleSaveSet(ClientPtr client)
if (!pWin->realized && pWin->mapped) if (!pWin->realized && pWin->mapped)
pWin->mapped = FALSE; pWin->mapped = FALSE;
} }
#ifdef XFIXES
if (SaveSetShouldMap(client->saveSet[j])) if (SaveSetShouldMap(client->saveSet[j]))
#endif
MapWindow(pWin, client); MapWindow(pWin, client);
} }
} }

View File

@ -192,7 +192,6 @@ exaModifyPixmapHeader_classic(PixmapPtr pPixmap, int width, int height,
* gpu memory, so there's no need to track damage. * gpu memory, so there's no need to track damage.
*/ */
if (pExaPixmap->pDamage) { if (pExaPixmap->pDamage) {
DamageUnregister(&pPixmap->drawable, pExaPixmap->pDamage);
DamageDestroy(pExaPixmap->pDamage); DamageDestroy(pExaPixmap->pDamage);
pExaPixmap->pDamage = NULL; pExaPixmap->pDamage = NULL;
} }

View File

@ -190,7 +190,6 @@ exaPrepareAccessReg_mixed(PixmapPtr pPixmap, int index, RegionPtr pReg)
* copy anymore. Drivers that prefer DFS, should fail prepare * copy anymore. Drivers that prefer DFS, should fail prepare
* access. * access.
*/ */
DamageUnregister(&pPixmap->drawable, pExaPixmap->pDamage);
DamageDestroy(pExaPixmap->pDamage); DamageDestroy(pExaPixmap->pDamage);
pExaPixmap->pDamage = NULL; pExaPixmap->pDamage = NULL;

View File

@ -139,7 +139,6 @@ exaModifyPixmapHeader_mixed(PixmapPtr pPixmap, int width, int height, int depth,
if (pPixData) { if (pPixData) {
if (pExaPixmap->driverPriv) { if (pExaPixmap->driverPriv) {
if (pExaPixmap->pDamage) { if (pExaPixmap->pDamage) {
DamageUnregister(&pPixmap->drawable, pExaPixmap->pDamage);
DamageDestroy(pExaPixmap->pDamage); DamageDestroy(pExaPixmap->pDamage);
pExaPixmap->pDamage = NULL; pExaPixmap->pDamage = NULL;
} }
@ -189,7 +188,6 @@ exaModifyPixmapHeader_mixed(PixmapPtr pPixmap, int width, int height, int depth,
if (pExaPixmap->sys_ptr) { if (pExaPixmap->sys_ptr) {
free(pExaPixmap->sys_ptr); free(pExaPixmap->sys_ptr);
pExaPixmap->sys_ptr = NULL; pExaPixmap->sys_ptr = NULL;
DamageUnregister(&pPixmap->drawable, pExaPixmap->pDamage);
DamageDestroy(pExaPixmap->pDamage); DamageDestroy(pExaPixmap->pDamage);
pExaPixmap->pDamage = NULL; pExaPixmap->pDamage = NULL;
RegionEmpty(&pExaPixmap->validSys); RegionEmpty(&pExaPixmap->validSys);

34
fb/fb.h
View File

@ -1111,17 +1111,6 @@ fbInitVisuals(VisualPtr * visualp,
* fbcopy.c * 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 extern _X_EXPORT void
fbCopyNtoN(DrawablePtr pSrcDrawable, fbCopyNtoN(DrawablePtr pSrcDrawable,
@ -1133,29 +1122,6 @@ fbCopyNtoN(DrawablePtr pSrcDrawable,
int dy, int dy,
Bool reverse, Bool upsidedown, Pixel bitplane, void *closure); 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 extern _X_EXPORT void
fbCopy1toN(DrawablePtr pSrcDrawable, fbCopy1toN(DrawablePtr pSrcDrawable,

View File

@ -28,33 +28,6 @@
#include "fb.h" #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 void
fbCopyNtoN(DrawablePtr pSrcDrawable, fbCopyNtoN(DrawablePtr pSrcDrawable,
DrawablePtr pDstDrawable, DrawablePtr pDstDrawable,

View File

@ -50,6 +50,8 @@
#include "indirect_table.h" #include "indirect_table.h"
#include "indirect_util.h" #include "indirect_util.h"
static char GLXServerVendorName[] = "SGI";
_X_HIDDEN int _X_HIDDEN int
validGlxScreen(ClientPtr client, int screen, __GLXscreen ** pGlxScreen, validGlxScreen(ClientPtr client, int screen, __GLXscreen ** pGlxScreen,
int *err) int *err)
@ -513,6 +515,10 @@ __glXGetDrawable(__GLXcontext * glxc, GLXDrawable drawId, ClientPtr client,
pDraw, drawId, pDraw, drawId,
GLX_DRAWABLE_WINDOW, GLX_DRAWABLE_WINDOW,
drawId, glxc->config); drawId, glxc->config);
if (!pGlxDraw) {
*error = BadAlloc;
return NULL;
}
/* since we are creating the drawablePrivate, drawId should be new */ /* since we are creating the drawablePrivate, drawId should be new */
if (!AddResource(drawId, __glXDrawableRes, pGlxDraw)) { if (!AddResource(drawId, __glXDrawableRes, pGlxDraw)) {
@ -1026,7 +1032,7 @@ __glXDisp_GetVisualConfigs(__GLXclientState * cl, GLbyte * pc)
return Success; return Success;
} }
#define __GLX_TOTAL_FBCONFIG_ATTRIBS (37) #define __GLX_TOTAL_FBCONFIG_ATTRIBS (44)
#define __GLX_FBCONFIG_ATTRIBS_LENGTH (__GLX_TOTAL_FBCONFIG_ATTRIBS * 2) #define __GLX_FBCONFIG_ATTRIBS_LENGTH (__GLX_TOTAL_FBCONFIG_ATTRIBS * 2)
/** /**
* Send the set of GLXFBConfigs to the client. There is not currently * 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_SWAP_METHOD_OML, modes->swapMethod);
WRITE_PAIR(GLX_SAMPLES_SGIS, modes->samples); WRITE_PAIR(GLX_SAMPLES_SGIS, modes->samples);
WRITE_PAIR(GLX_SAMPLE_BUFFERS_SGIS, modes->sampleBuffers); 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_DRAWABLE_TYPE, modes->drawableType);
WRITE_PAIR(GLX_BIND_TO_TEXTURE_RGB_EXT, modes->bindToTextureRgb); 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_TEXTURE_RGBA_EXT, modes->bindToTextureRgba);
WRITE_PAIR(GLX_BIND_TO_MIPMAP_TEXTURE_EXT, modes->bindToMipmapTexture); WRITE_PAIR(GLX_BIND_TO_MIPMAP_TEXTURE_EXT, modes->bindToMipmapTexture);
WRITE_PAIR(GLX_BIND_TO_TEXTURE_TARGETS_EXT, WRITE_PAIR(GLX_BIND_TO_TEXTURE_TARGETS_EXT,
modes->bindToTextureTargets); 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. */ /* Add attribute only if its value is not default. */
if (modes->sRGBCapable != GL_FALSE) { if (modes->sRGBCapable != GL_FALSE) {
WRITE_PAIR(GLX_FRAMEBUFFER_SRGB_CAPABLE_EXT, modes->sRGBCapable); WRITE_PAIR(GLX_FRAMEBUFFER_SRGB_CAPABLE_EXT, modes->sRGBCapable);
@ -1414,6 +1430,8 @@ DoCreatePbuffer(ClientPtr client, int screenNum, XID fbconfigId,
width, height, width, height,
config->rgbBits, 0); config->rgbBits, 0);
__glXleaveServer(GL_FALSE); __glXleaveServer(GL_FALSE);
if (!pPixmap)
return BadAlloc;
/* Assign the pixmap the same id as the pbuffer and add it as a /* 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 * 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]; height = attrs[i * 2 + 1];
break; break;
case GLX_LARGEST_PBUFFER: case GLX_LARGEST_PBUFFER:
case GLX_PRESERVED_CONTENTS:
/* FIXME: huh... */ /* FIXME: huh... */
break; break;
} }
@ -1473,6 +1490,10 @@ __glXDisp_CreateGLXPbufferSGIX(__GLXclientState * cl, GLbyte * pc)
REQUEST_AT_LEAST_SIZE(xGLXCreateGLXPbufferSGIXReq); 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, return DoCreatePbuffer(cl->client, req->screen, req->fbconfig,
req->width, req->height, req->pbuffer); req->width, req->height, req->pbuffer);
} }
@ -1680,15 +1701,14 @@ DoQueryContext(__GLXclientState * cl, GLXContextID gcId)
ClientPtr client = cl->client; ClientPtr client = cl->client;
__GLXcontext *ctx; __GLXcontext *ctx;
xGLXQueryContextInfoEXTReply reply; xGLXQueryContextInfoEXTReply reply;
int nProps; int nProps = 3;
int *sendBuf, *pSendBuf; int sendBuf[nProps * 2];
int nReplyBytes; int nReplyBytes;
int err; int err;
if (!validGlxContext(cl->client, gcId, DixReadAccess, &ctx, &err)) if (!validGlxContext(cl->client, gcId, DixReadAccess, &ctx, &err))
return err; return err;
nProps = 3;
reply = (xGLXQueryContextInfoEXTReply) { reply = (xGLXQueryContextInfoEXTReply) {
.type = X_Reply, .type = X_Reply,
.sequenceNumber = client->sequence, .sequenceNumber = client->sequence,
@ -1697,17 +1717,12 @@ DoQueryContext(__GLXclientState * cl, GLXContextID gcId)
}; };
nReplyBytes = reply.length << 2; nReplyBytes = reply.length << 2;
sendBuf = (int *) malloc((size_t) nReplyBytes); sendBuf[0] = GLX_SHARE_CONTEXT_EXT;
if (sendBuf == NULL) { sendBuf[1] = (int) (ctx->share_id);
return __glXError(GLXBadContext); /* XXX: Is this correct? */ sendBuf[2] = GLX_VISUAL_ID_EXT;
} sendBuf[3] = (int) (ctx->config->visualID);
pSendBuf = sendBuf; sendBuf[4] = GLX_SCREEN_EXT;
*pSendBuf++ = GLX_SHARE_CONTEXT_EXT; sendBuf[5] = (int) (ctx->pGlxScreen->pScreen->myNum);
*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);
if (client->swapped) { if (client->swapped) {
__glXSwapQueryContextInfoEXTReply(client, &reply, sendBuf); __glXSwapQueryContextInfoEXTReply(client, &reply, sendBuf);
@ -1716,7 +1731,6 @@ DoQueryContext(__GLXclientState * cl, GLXContextID gcId)
WriteToClient(client, sz_xGLXQueryContextInfoEXTReply, &reply); WriteToClient(client, sz_xGLXQueryContextInfoEXTReply, &reply);
WriteToClient(client, nReplyBytes, sendBuf); WriteToClient(client, nReplyBytes, sendBuf);
} }
free((char *) sendBuf);
return Success; return Success;
} }
@ -1890,14 +1904,38 @@ DoGetDrawableAttributes(__GLXclientState * cl, XID drawId)
ClientPtr client = cl->client; ClientPtr client = cl->client;
xGLXGetDrawableAttributesReply reply; xGLXGetDrawableAttributesReply reply;
__GLXdrawable *pGlxDraw; __GLXdrawable *pGlxDraw;
CARD32 attributes[6]; CARD32 attributes[14];
int numAttribs, error; int numAttribs = 0, error;
if (!validGlxDrawable(client, drawId, GLX_DRAWABLE_ANY, if (!validGlxDrawable(client, drawId, GLX_DRAWABLE_ANY,
DixGetAttrAccess, &pGlxDraw, &error)) DixGetAttrAccess, &pGlxDraw, &error))
return error; return error;
numAttribs = 3; 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) { reply = (xGLXGetDrawableAttributesReply) {
.type = X_Reply, .type = X_Reply,
.sequenceNumber = client->sequence, .sequenceNumber = client->sequence,
@ -1905,14 +1943,6 @@ DoGetDrawableAttributes(__GLXclientState * cl, XID drawId)
.numAttribs = numAttribs .numAttribs = numAttribs
}; };
attributes[0] = GLX_TEXTURE_TARGET_EXT;
attributes[1] = pGlxDraw->target == GL_TEXTURE_2D ? GLX_TEXTURE_2D_EXT :
GLX_TEXTURE_RECTANGLE_EXT;
attributes[2] = GLX_Y_INVERTED_EXT;
attributes[3] = GL_FALSE;
attributes[4] = GLX_EVENT_MASK;
attributes[5] = pGlxDraw->eventMask;
if (client->swapped) { if (client->swapped) {
__glXSwapGetDrawableAttributesReply(client, &reply, attributes); __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. ** Make enough space in the buffer, then copy the entire request.
*/ */
if (cl->largeCmdBufSize < cmdlen) { if (cl->largeCmdBufSize < cmdlen) {
if (!cl->largeCmdBuf) { GLbyte *newbuf = cl->largeCmdBuf;
cl->largeCmdBuf = (GLbyte *) malloc(cmdlen);
} if (!(newbuf = realloc(newbuf, cmdlen)))
else {
cl->largeCmdBuf = (GLbyte *) realloc(cl->largeCmdBuf, cmdlen);
}
if (!cl->largeCmdBuf) {
return BadAlloc; return BadAlloc;
}
cl->largeCmdBuf = newbuf;
cl->largeCmdBufSize = cmdlen; cl->largeCmdBufSize = cmdlen;
} }
memcpy(cl->largeCmdBuf, pc, dataBytes); memcpy(cl->largeCmdBuf, pc, dataBytes);
@ -2384,7 +2411,7 @@ __glXDisp_QueryServerString(__GLXclientState * cl, GLbyte * pc)
switch (req->name) { switch (req->name) {
case GLX_VENDOR: case GLX_VENDOR:
ptr = pGlxScreen->GLXvendor; ptr = GLXServerVendorName;
break; break;
case GLX_VERSION: case GLX_VERSION:
/* Return to the server version rather than the screen version /* Return to the server version rather than the screen version

View File

@ -55,7 +55,6 @@ struct __GLXcontext {
/* /*
** list of context structs ** list of context structs
*/ */
__GLXcontext *last;
__GLXcontext *next; __GLXcontext *next;
/* /*

View File

@ -941,8 +941,7 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
if (screen == NULL) if (screen == NULL)
return NULL; return NULL;
if (!xf86LoaderCheckSymbol("DRI2Connect") || if (!DRI2Connect(serverClient, pScreen, DRI2DriverDRI,
!DRI2Connect(serverClient, pScreen, DRI2DriverDRI,
&screen->fd, &driverName, &deviceName)) { &screen->fd, &driverName, &deviceName)) {
LogMessage(X_INFO, LogMessage(X_INFO,
"AIGLX: Screen %d is not DRI2 capable\n", pScreen->myNum); "AIGLX: Screen %d is not DRI2 capable\n", pScreen->myNum);

View File

@ -286,10 +286,6 @@ glxClientCallback(CallbackListPtr *list, pointer closure, pointer data)
switch (pClient->clientState) { switch (pClient->clientState) {
case ClientStateRunning: case ClientStateRunning:
/*
** By default, assume that the client supports
** GLX major version 1 minor version 0 protocol.
*/
cl->client = pClient; cl->client = pClient;
break; break;

View File

@ -128,7 +128,6 @@ static const char GLServerExtensions[] =
"GL_NV_blend_square " "GL_NV_blend_square "
"GL_NV_depth_clamp " "GL_NV_depth_clamp "
"GL_NV_fog_distance " "GL_NV_fog_distance "
"GL_NV_fragment_program "
"GL_NV_fragment_program_option " "GL_NV_fragment_program_option "
"GL_NV_fragment_program2 " "GL_NV_fragment_program2 "
"GL_NV_light_max_exponent " "GL_NV_light_max_exponent "
@ -139,9 +138,6 @@ static const char GLServerExtensions[] =
"GL_NV_texture_env_combine4 " "GL_NV_texture_env_combine4 "
"GL_NV_texture_expand_normal " "GL_NV_texture_expand_normal "
"GL_NV_texture_rectangle " "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_program2_option "
"GL_NV_vertex_program3 " "GL_NV_vertex_program3 "
"GL_OES_compressed_paletted_texture " "GL_OES_compressed_paletted_texture "
@ -154,13 +150,14 @@ static const char GLServerExtensions[] =
"GL_SGIS_texture_edge_clamp " "GL_SGIS_texture_edge_clamp "
"GL_SGIS_texture_lod " "GL_SGIS_texture_lod "
"GL_SGIX_depth_texture " "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 ** We have made the simplifying assuption that the same extensions are
** supported across all screens in a multi-screen system. ** supported across all screens in a multi-screen system.
*/ */
static char GLXServerVendorName[] = "SGI";
unsigned glxMajorVersion = SERVER_GLX_MAJOR_VERSION; unsigned glxMajorVersion = SERVER_GLX_MAJOR_VERSION;
unsigned glxMinorVersion = SERVER_GLX_MINOR_VERSION; unsigned glxMinorVersion = SERVER_GLX_MINOR_VERSION;
static char GLXServerExtensions[] = static char GLXServerExtensions[] =
@ -169,12 +166,14 @@ static char GLXServerExtensions[] =
"GLX_EXT_visual_rating " "GLX_EXT_visual_rating "
"GLX_EXT_import_context " "GLX_EXT_import_context "
"GLX_EXT_texture_from_pixmap " "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__ #ifndef __APPLE__
"GLX_SGIS_multisample " "GLX_SGIS_multisample "
#endif #endif
"GLX_SGIX_fbconfig " "GLX_SGIX_fbconfig "
"GLX_SGIX_pbuffer " "GLX_MESA_copy_sub_buffer "; "GLX_SGIX_pbuffer "
"GLX_MESA_copy_sub_buffer ";
static Bool static Bool
glxCloseScreen(ScreenPtr pScreen) glxCloseScreen(ScreenPtr pScreen)
@ -330,7 +329,6 @@ __glXScreenInit(__GLXscreen * pGlxScreen, ScreenPtr pScreen)
pGlxScreen->pScreen = pScreen; pGlxScreen->pScreen = pScreen;
pGlxScreen->GLextensions = strdup(GLServerExtensions); pGlxScreen->GLextensions = strdup(GLServerExtensions);
pGlxScreen->GLXvendor = strdup(GLXServerVendorName);
pGlxScreen->GLXextensions = strdup(GLXServerExtensions); pGlxScreen->GLXextensions = strdup(GLXServerExtensions);
/* All GLX providers must support all of the functionality required for at /* All GLX providers must support all of the functionality required for at
@ -420,7 +418,6 @@ __glXScreenInit(__GLXscreen * pGlxScreen, ScreenPtr pScreen)
void void
__glXScreenDestroy(__GLXscreen * screen) __glXScreenDestroy(__GLXscreen * screen)
{ {
free(screen->GLXvendor);
free(screen->GLXextensions); free(screen->GLXextensions);
free(screen->GLextensions); free(screen->GLextensions);
free(screen->visuals); free(screen->visuals);

View File

@ -54,8 +54,6 @@ struct __GLXconfig {
GLint level; GLint level;
GLint pixmapMode;
/* GLX */ /* GLX */
GLint visualID; GLint visualID;
GLint visualType; /**< One of the GLX X visual types. (i.e., GLint visualType; /**< One of the GLX X visual types. (i.e.,
@ -94,8 +92,6 @@ struct __GLXconfig {
/* OML_swap_method */ /* OML_swap_method */
GLint swapMethod; GLint swapMethod;
GLint screen;
/* EXT_texture_from_pixmap */ /* EXT_texture_from_pixmap */
GLint bindToTextureRgb; GLint bindToTextureRgb;
GLint bindToTextureRgba; GLint bindToTextureRgba;
@ -145,7 +141,6 @@ struct __GLXscreen {
char *GLextensions; char *GLextensions;
char *GLXvendor;
char *GLXextensions; char *GLXextensions;
/** /**

View File

@ -56,8 +56,6 @@ Xdmx_SOURCES = dmx.c \
dmxprop.h \ dmxprop.h \
dmxscrinit.c \ dmxscrinit.c \
dmxscrinit.h \ dmxscrinit.h \
dmxshadow.c \
dmxshadow.h \
dmxstat.c \ dmxstat.c \
dmxstat.h \ dmxstat.h \
dmxsync.c \ dmxsync.c \

View File

@ -254,10 +254,6 @@ typedef struct _DMXScreenInfo {
/* Global variables available to all Xserver/hw/dmx routines. */ /* Global variables available to all Xserver/hw/dmx routines. */
extern int dmxNumScreens; /**< Number of dmxScreens */ extern int dmxNumScreens; /**< Number of dmxScreens */
extern DMXScreenInfo *dmxScreens; /**< List of outputs */ extern DMXScreenInfo *dmxScreens; /**< List of outputs */
extern int dmxShadowFB; /**< Non-zero if using
* shadow frame-buffer
* (deprecated) */
extern XErrorEvent dmxLastErrorEvent; /**< Last error that extern XErrorEvent dmxLastErrorEvent; /**< Last error that
* occurred */ * occurred */

View File

@ -197,8 +197,6 @@ miPointerScreenFuncRec dmxPointerCursorFuncs = {
dmxCursorOffScreen, dmxCursorOffScreen,
dmxCrossScreen, dmxCrossScreen,
dmxWarpCursor, dmxWarpCursor,
NULL,
NULL,
}; };
/** Create a list of screens that we'll manipulate. */ /** Create a list of screens that we'll manipulate. */

View File

@ -82,8 +82,6 @@ DMXScreenInfo *dmxScreens;
int dmxNumInputs; int dmxNumInputs;
DMXInputInfo *dmxInputs; DMXInputInfo *dmxInputs;
int dmxShadowFB = FALSE;
XErrorEvent dmxLastErrorEvent; XErrorEvent dmxLastErrorEvent;
Bool dmxErrorOccurred = FALSE; Bool dmxErrorOccurred = FALSE;
@ -854,9 +852,6 @@ InitOutput(ScreenInfo * pScreenInfo, int argc, char *argv[])
/* Initialized things that need timer hooks */ /* Initialized things that need timer hooks */
dmxStatInit(); dmxStatInit();
dmxSyncInit(); /* Calls RegisterBlockAndWakeupHandlers */ 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 /* 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; retval = 2;
} }
else if (!strcmp(argv[i], "-noshadowfb")) { else if (!strcmp(argv[i], "-noshadowfb")) {
dmxLog(dmxWarning,
"-noshadowfb has been deprecated "
"since it is now the default\n");
dmxShadowFB = FALSE;
retval = 1; retval = 1;
} }
else if (!strcmp(argv[i], "-nomulticursor")) { else if (!strcmp(argv[i], "-nomulticursor")) {
@ -962,7 +953,6 @@ ddxProcessArgument(int argc, char *argv[], int i)
retval = 1; retval = 1;
} }
else if (!strcmp(argv[i], "-shadowfb")) { else if (!strcmp(argv[i], "-shadowfb")) {
dmxShadowFB = TRUE;
retval = 1; retval = 1;
} }
else if (!strcmp(argv[i], "-configfile")) { else if (!strcmp(argv[i], "-configfile")) {

View File

@ -141,10 +141,6 @@ dmxPictureInit(ScreenPtr pScreen, PictFormatPtr formats, int nformats)
DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum]; DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum];
PictureScreenPtr ps; PictureScreenPtr ps;
/* The shadow framebuffer only relies on FB to be initialized */
if (dmxShadowFB)
return fbPictureInit(pScreen, formats, nformats);
if (!miPictureInit(pScreen, formats, nformats)) if (!miPictureInit(pScreen, formats, nformats))
return FALSE; return FALSE;

View File

@ -41,7 +41,6 @@
#include "dmx.h" #include "dmx.h"
#include "dmxsync.h" #include "dmxsync.h"
#include "dmxshadow.h"
#include "dmxscrinit.h" #include "dmxscrinit.h"
#include "dmxcursor.h" #include "dmxcursor.h"
#include "dmxgc.h" #include "dmxgc.h"
@ -159,24 +158,6 @@ dmxBEScreenInit(ScreenPtr pScreen)
XMapWindow(dmxScreen->beDisplay, dmxScreen->scrnWin); 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) */ /* Create default drawables (used during GC creation) */
for (i = 0; i < dmxScreen->beNumPixmapFormats; i++) for (i = 0; i < dmxScreen->beNumPixmapFormats; i++)
for (j = 0; j < dmxScreen->beNumDepths; j++) for (j = 0; j < dmxScreen->beNumDepths; j++)
@ -190,7 +171,6 @@ dmxBEScreenInit(ScreenPtr pScreen)
break; break;
} }
} }
}
/** Initialize screen number \a pScreen->myNum. */ /** Initialize screen number \a pScreen->myNum. */
Bool Bool
@ -215,19 +195,12 @@ dmxScreenInit(ScreenPtr pScreen, int argc, char *argv[])
dmxGeneration = serverGeneration; dmxGeneration = serverGeneration;
} }
if (dmxShadowFB) {
dmxScreen->shadow = shadowAlloc(dmxScreen->scrnWidth,
dmxScreen->scrnHeight,
dmxScreen->beBPP);
}
else {
if (!dmxInitGC(pScreen)) if (!dmxInitGC(pScreen))
return FALSE; return FALSE;
if (!dmxInitWindow(pScreen)) if (!dmxInitWindow(pScreen))
return FALSE; return FALSE;
if (!dmxInitPixmap(pScreen)) if (!dmxInitPixmap(pScreen))
return FALSE; return FALSE;
}
/* /*
* Initalise the visual types. miSetVisualTypesAndMasks() requires * Initalise the visual types. miSetVisualTypesAndMasks() requires
@ -267,7 +240,7 @@ dmxScreenInit(ScreenPtr pScreen, int argc, char *argv[])
} }
fbScreenInit(pScreen, fbScreenInit(pScreen,
dmxShadowFB ? dmxScreen->shadow : NULL, NULL,
dmxScreen->scrnWidth, dmxScreen->scrnWidth,
dmxScreen->scrnHeight, dmxScreen->scrnHeight,
dmxScreen->beXDPI, dmxScreen->beXDPI,
@ -278,13 +251,6 @@ dmxScreenInit(ScreenPtr pScreen, int argc, char *argv[])
pScreen->GetWindowPixmap = NULL; pScreen->GetWindowPixmap = NULL;
pScreen->SetWindowPixmap = NULL; pScreen->SetWindowPixmap = NULL;
if (dmxShadowFB && !shadowInit(pScreen, dmxShadowUpdateProc, NULL))
return FALSE;
if (dmxShadowFB) {
miDCInitialize(pScreen, &dmxPointerCursorFuncs);
}
else {
MAXSCREENSALLOC(dmxCursorGeneration); MAXSCREENSALLOC(dmxCursorGeneration);
if (dmxCursorGeneration[pScreen->myNum] != serverGeneration) { if (dmxCursorGeneration[pScreen->myNum] != serverGeneration) {
if (!(miPointerInitialize(pScreen, if (!(miPointerInitialize(pScreen,
@ -294,14 +260,12 @@ dmxScreenInit(ScreenPtr pScreen, int argc, char *argv[])
dmxCursorGeneration[pScreen->myNum] = serverGeneration; dmxCursorGeneration[pScreen->myNum] = serverGeneration;
} }
}
DMX_WRAP(CloseScreen, dmxCloseScreen, dmxScreen, pScreen); DMX_WRAP(CloseScreen, dmxCloseScreen, dmxScreen, pScreen);
DMX_WRAP(SaveScreen, dmxSaveScreen, dmxScreen, pScreen); DMX_WRAP(SaveScreen, dmxSaveScreen, dmxScreen, pScreen);
dmxBEScreenInit(pScreen); dmxBEScreenInit(pScreen);
if (!dmxShadowFB) {
/* Wrap GC functions */ /* Wrap GC functions */
DMX_WRAP(CreateGC, dmxCreateGC, dmxScreen, pScreen); DMX_WRAP(CreateGC, dmxCreateGC, dmxScreen, pScreen);
@ -343,7 +307,6 @@ dmxScreenInit(ScreenPtr pScreen, int argc, char *argv[])
/* Wrap Shape functions */ /* Wrap Shape functions */
DMX_WRAP(SetShape, dmxSetShape, dmxScreen, pScreen); DMX_WRAP(SetShape, dmxSetShape, dmxScreen, pScreen);
}
if (!dmxCreateDefColormap(pScreen)) if (!dmxCreateDefColormap(pScreen))
return FALSE; return FALSE;
@ -370,14 +333,6 @@ dmxBECloseScreen(ScreenPtr pScreen)
XDestroyWindow(dmxScreen->beDisplay, dmxScreen->scrnWin); XDestroyWindow(dmxScreen->beDisplay, dmxScreen->scrnWin);
dmxScreen->scrnWin = (Window) 0; 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 */ /* Free the default drawables */
for (i = 0; i < dmxScreen->beNumPixmapFormats; i++) { for (i = 0; i < dmxScreen->beNumPixmapFormats; i++) {
if (dmxScreen->scrnDefDrawables[i]) { if (dmxScreen->scrnDefDrawables[i]) {
@ -386,7 +341,6 @@ dmxBECloseScreen(ScreenPtr pScreen)
dmxScreen->scrnDefDrawables[i] = (Drawable) 0; dmxScreen->scrnDefDrawables[i] = (Drawable) 0;
} }
} }
}
/* Free resources allocated during initialization (in dmxinit.c) */ /* Free resources allocated during initialization (in dmxinit.c) */
for (i = 0; i < dmxScreen->beNumDefColormaps; i++) for (i = 0; i < dmxScreen->beNumDefColormaps; i++)
@ -432,12 +386,6 @@ dmxCloseScreen(ScreenPtr pScreen)
dmxResetFonts(); dmxResetFonts();
} }
if (dmxShadowFB) {
/* Free the shadow framebuffer */
free(dmxScreen->shadow);
}
else {
/* Unwrap Shape functions */ /* Unwrap Shape functions */
DMX_UNWRAP(SetShape, dmxScreen, pScreen); DMX_UNWRAP(SetShape, dmxScreen, pScreen);
@ -473,7 +421,6 @@ dmxCloseScreen(ScreenPtr pScreen)
DMX_UNWRAP(DestroyColormap, dmxScreen, pScreen); DMX_UNWRAP(DestroyColormap, dmxScreen, pScreen);
DMX_UNWRAP(InstallColormap, dmxScreen, pScreen); DMX_UNWRAP(InstallColormap, dmxScreen, pScreen);
DMX_UNWRAP(StoreColors, dmxScreen, pScreen); DMX_UNWRAP(StoreColors, dmxScreen, pScreen);
}
DMX_UNWRAP(SaveScreen, dmxScreen, pScreen); DMX_UNWRAP(SaveScreen, dmxScreen, pScreen);

View File

@ -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);
}

View File

@ -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 */

View File

@ -22,7 +22,6 @@ libglxproxy_a_SOURCES = compsize.c \
glxsingle.h \ glxsingle.h \
glxswap.c \ glxswap.c \
glxswap.h \ glxswap.h \
glxutil.c \
glxutil.h \ glxutil.h \
glxvendor.c \ glxvendor.c \
glxvendor.h \ glxvendor.h \

View File

@ -2734,8 +2734,6 @@ __glXClientInfo(__GLXclientState * cl, GLbyte * pc)
int to_screen = 0; int to_screen = 0;
int s; int s;
cl->GLClientmajorVersion = req->major;
cl->GLClientminorVersion = req->minor;
free(cl->GLClientextensions); free(cl->GLClientextensions);
buf = (const char *) (req + 1); buf = (const char *) (req + 1);
cl->GLClientextensions = strdup(buf); cl->GLClientextensions = strdup(buf);

View File

@ -88,12 +88,6 @@ ResetClientState(int clientIndex)
memset(cl, 0, sizeof(__GLXclientState)); memset(cl, 0, sizeof(__GLXclientState));
cl->be_displays = keep_be_displays; 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); free(cl->GLClientextensions);
memset(cl->be_displays, 0, screenInfo.numScreens * sizeof(Display *)); memset(cl->be_displays, 0, screenInfo.numScreens * sizeof(Display *));

View File

@ -119,8 +119,6 @@ struct __GLXclientStateRec {
/* Back pointer to X client record */ /* Back pointer to X client record */
ClientPtr client; ClientPtr client;
int GLClientmajorVersion;
int GLClientminorVersion;
char *GLClientextensions; char *GLClientextensions;
GLXContextTag *be_currentCTag; GLXContextTag *be_currentCTag;

View File

@ -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)
{
}

View File

@ -31,8 +31,6 @@
* Silicon Graphics, Inc. * Silicon Graphics, Inc.
*/ */
extern void __glXNop(void);
/* context helper routines */ /* context helper routines */
extern __GLXcontext *__glXLookupContextByTag(__GLXclientState *, GLXContextTag); extern __GLXcontext *__glXLookupContextByTag(__GLXclientState *, GLXContextTag);
extern DrawablePtr __glXLookupDrawableByTag(__GLXclientState * cl, extern DrawablePtr __glXLookupDrawableByTag(__GLXclientState * cl,

View File

@ -419,10 +419,9 @@ dmxBackendCollectEvents(DevicePtr pDev,
} }
break; break;
case MotionNotify: case MotionNotify:
DMXDBG9("dmxBackendCollectEvents: MotionNotify %d/%d (mi %d)" DMXDBG8("dmxBackendCollectEvents: MotionNotify %d/%d"
" newscreen=%d: %d %d (e=%d; last=%d,%d)\n", " newscreen=%d: %d %d (e=%d; last=%d,%d)\n",
dmxScreen->index, priv->myScreen, dmxScreen->index, priv->myScreen,
miPointerCurrentScreen()->myNum,
priv->newscreen, priv->newscreen,
X.xmotion.x, X.xmotion.y, X.xmotion.x, X.xmotion.y,
entered, priv->lastX, priv->lastY); entered, priv->lastX, priv->lastY);
@ -579,9 +578,6 @@ dmxBackendLateReInit(DevicePtr pDev)
GETPRIVFROMPDEV; GETPRIVFROMPDEV;
int x, y; int x, y;
DMXDBG1("dmxBackendLateReInit miPointerCurrentScreen() = %p\n",
miPointerCurrentScreen());
dmxBackendSameDisplay(NULL, 0); /* Invalidate cache */ dmxBackendSameDisplay(NULL, 0); /* Invalidate cache */
dmxBackendInitPrivate(pDev); dmxBackendInitPrivate(pDev);
dmxBackendComputeCenter(priv); dmxBackendComputeCenter(priv);

View File

@ -502,11 +502,6 @@ dmxCommonMouOn(DevicePtr pDev)
GETDMXINPUTFROMPRIV; GETDMXINPUTFROMPRIV;
priv->eventMask |= DMX_POINTER_EVENT_MASK; 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) { if (!priv->be) {
XSelectInput(priv->display, priv->window, priv->eventMask); XSelectInput(priv->display, priv->window, priv->eventMask);
AddEnabledDevice(XConnectionNumber(priv->display)); AddEnabledDevice(XConnectionNumber(priv->display));

View File

@ -179,16 +179,6 @@ will switch to another VC in local (raw) mode.
.RE .RE
.sp .sp
.TP 8 .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" .BI "-nomulticursor"
This option turns off support for displaying multiple cursors on This option turns off support for displaying multiple cursors on
overlapped back-end displays. This option is available for testing and overlapped back-end displays. This option is available for testing and

View File

@ -389,10 +389,7 @@ ephyrUnsetInternalDamage(ScreenPtr pScreen)
KdScreenPriv(pScreen); KdScreenPriv(pScreen);
KdScreenInfo *screen = pScreenPriv->screen; KdScreenInfo *screen = pScreenPriv->screen;
EphyrScrPriv *scrpriv = screen->driver; EphyrScrPriv *scrpriv = screen->driver;
PixmapPtr pPixmap = NULL;
pPixmap = (*pScreen->GetScreenPixmap) (pScreen);
DamageUnregister(&pPixmap->drawable, scrpriv->pDamage);
DamageDestroy(scrpriv->pDamage); DamageDestroy(scrpriv->pDamage);
RemoveBlockAndWakeupHandlers(ephyrInternalDamageBlockHandler, RemoveBlockAndWakeupHandlers(ephyrInternalDamageBlockHandler,
@ -823,8 +820,6 @@ miPointerScreenFuncRec ephyrPointerScreenFuncs = {
ephyrCursorOffScreen, ephyrCursorOffScreen,
ephyrCrossScreen, ephyrCrossScreen,
ephyrWarpCursor, ephyrWarpCursor,
NULL,
NULL
}; };
#ifdef XF86DRI #ifdef XF86DRI

View File

@ -28,6 +28,7 @@
#endif #endif
#include "ephyr.h" #include "ephyr.h"
#include "ephyrlog.h" #include "ephyrlog.h"
#include "glx_extinit.h"
extern Window EphyrPreExistingHostWin; extern Window EphyrPreExistingHostWin;
extern Bool EphyrWantGrayScale; extern Bool EphyrWantGrayScale;
@ -47,6 +48,22 @@ extern KdKeyboardDriver LinuxEvdevKeyboardDriver;
void processScreenArg(const char *screen_size, char *parent_id); 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 void
InitCard(char *name) InitCard(char *name)
{ {
@ -57,6 +74,9 @@ InitCard(char *name)
void void
InitOutput(ScreenInfo * pScreenInfo, int argc, char **argv) InitOutput(ScreenInfo * pScreenInfo, int argc, char **argv)
{ {
if (serverGeneration == 1)
ephyrExtensionInit();
KdInitOutput(pScreenInfo, argc, argv); KdInitOutput(pScreenInfo, argc, argv);
} }

View File

@ -72,9 +72,6 @@ static miPointerScreenFuncRec xf86PointerScreenFuncs = {
xf86CursorOffScreen, xf86CursorOffScreen,
xf86CrossScreen, xf86CrossScreen,
xf86WarpCursor, xf86WarpCursor,
/* let miPointerInitialize take care of these */
NULL,
NULL
}; };
static xf86ScreenLayoutRec xf86ScreenLayout[MAXSCREENS]; static xf86ScreenLayoutRec xf86ScreenLayout[MAXSCREENS];

View File

@ -272,13 +272,9 @@ xf86RotateDestroy(xf86CrtcPtr crtc)
screenDrawable = &pScreen->root->drawable; screenDrawable = &pScreen->root->drawable;
/* Free damage structure */ /* Free damage structure */
if (xf86_config->rotation_damage_registered) { if (xf86_config->rotation_damage_registered) {
if (screenDrawable)
DamageUnregister(screenDrawable,
xf86_config->rotation_damage);
xf86_config->rotation_damage_registered = FALSE; xf86_config->rotation_damage_registered = FALSE;
DisableLimitedSchedulingLatency(); DisableLimitedSchedulingLatency();
} }
if (screenDrawable)
DamageDestroy(xf86_config->rotation_damage); DamageDestroy(xf86_config->rotation_damage);
xf86_config->rotation_damage = NULL; xf86_config->rotation_damage = NULL;
} }

View File

@ -257,16 +257,3 @@ xf86LinearVidMem(void)
xf86InitVidMem(); xf86InitVidMem();
return vidMemInfo.linearSupported; 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);
}

View File

@ -38,7 +38,6 @@ typedef pointer (*SetWCProcPtr) (int, unsigned long, unsigned long, Bool,
MessageType); MessageType);
typedef void (*ProtectMemProcPtr) (int, pointer, unsigned long, Bool); typedef void (*ProtectMemProcPtr) (int, pointer, unsigned long, Bool);
typedef void (*UndoWCProcPtr) (int, pointer); typedef void (*UndoWCProcPtr) (int, pointer);
typedef void (*ReadSideEffectsProcPtr) (int, pointer, unsigned long);
typedef struct { typedef struct {
Bool initialised; Bool initialised;
@ -47,7 +46,6 @@ typedef struct {
ProtectMemProcPtr protectMem; ProtectMemProcPtr protectMem;
SetWCProcPtr setWC; SetWCProcPtr setWC;
UndoWCProcPtr undoWC; UndoWCProcPtr undoWC;
ReadSideEffectsProcPtr readSideEffects;
Bool linearSupported; Bool linearSupported;
} VidMemInfo, *VidMemInfoPtr; } VidMemInfo, *VidMemInfoPtr;

View File

@ -136,8 +136,6 @@ extern _X_EXPORT _X_DEPRECATED pointer xf86MapVidMem(int, int, unsigned long,
unsigned long); unsigned long);
extern _X_EXPORT _X_DEPRECATED void xf86UnMapVidMem(int, pointer, extern _X_EXPORT _X_DEPRECATED void xf86UnMapVidMem(int, pointer,
unsigned long); 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 *, extern _X_EXPORT int xf86ReadBIOS(unsigned long, unsigned long, unsigned char *,
int); int);
extern _X_EXPORT Bool xf86EnableIO(void); extern _X_EXPORT Bool xf86EnableIO(void);

View File

@ -319,10 +319,8 @@ vbeReadEDID(vbeInfoPtr pVbe)
} }
xf86MonPtr xf86MonPtr
vbeDoEDID(vbeInfoPtr pVbe, pointer pDDCModule) vbeDoEDID(vbeInfoPtr pVbe, pointer unused)
{ {
xf86MonPtr pMonitor;
pointer pModule;
unsigned char *DDC_data = NULL; unsigned char *DDC_data = NULL;
if (!pVbe) if (!pVbe)
@ -330,23 +328,12 @@ vbeDoEDID(vbeInfoPtr pVbe, pointer pDDCModule)
if (pVbe->version < 0x200) if (pVbe->version < 0x200)
return NULL; return NULL;
if (!(pModule = pDDCModule)) {
pModule =
xf86LoadSubModule(pVbe->pInt10->pScrn, "ddc");
if (!pModule)
return NULL;
}
DDC_data = vbeReadEDID(pVbe); DDC_data = vbeReadEDID(pVbe);
if (!DDC_data) if (!DDC_data)
return NULL; return NULL;
pMonitor = xf86InterpretEDID(pVbe->pInt10->pScrn->scrnIndex, DDC_data); return xf86InterpretEDID(pVbe->pInt10->pScrn->scrnIndex, DDC_data);
if (!pDDCModule)
xf86UnloadSubModule(pModule);
return pMonitor;
} }
#define GET_UNALIGNED2(x) \ #define GET_UNALIGNED2(x) \

View File

@ -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 void
xnestGetImage(DrawablePtr pDrawable, int x, int y, int w, int h, xnestGetImage(DrawablePtr pDrawable, int x, int y, int w, int h,
unsigned int format, unsigned long planeMask, char *pImage) unsigned int format, unsigned long planeMask, char *pImage)
{ {
XImage *ximage; XImage *ximage;
int length; 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), ximage = XGetImage(xnestDisplay, xnestDrawable(pDrawable),
x, y, w, h, planeMask, format); x, y, w, h, planeMask, format);
XSync(xnestDisplay, False);
XSetErrorHandler(old_handler);
if (ximage) { if (ximage) {
length = ximage->bytes_per_line * ximage->height; length = ximage->bytes_per_line * ximage->height;

View File

@ -78,6 +78,21 @@ xnestDestroyPixmap(PixmapPtr pPixmap)
return TRUE; 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 RegionPtr
xnestPixmapToRegion(PixmapPtr pPixmap) xnestPixmapToRegion(PixmapPtr pPixmap)
{ {

View File

@ -282,6 +282,7 @@ xnestOpenScreen(ScreenPtr pScreen, int argc, char *argv[])
pScreen->CreatePixmap = xnestCreatePixmap; pScreen->CreatePixmap = xnestCreatePixmap;
pScreen->DestroyPixmap = xnestDestroyPixmap; pScreen->DestroyPixmap = xnestDestroyPixmap;
pScreen->ModifyPixmapHeader = xnestModifyPixmapHeader;
/* Font procedures */ /* Font procedures */

View File

@ -33,6 +33,8 @@ typedef struct {
PixmapPtr xnestCreatePixmap(ScreenPtr pScreen, int width, int height, PixmapPtr xnestCreatePixmap(ScreenPtr pScreen, int width, int height,
int depth, unsigned usage_hint); int depth, unsigned usage_hint);
Bool xnestDestroyPixmap(PixmapPtr pPixmap); Bool xnestDestroyPixmap(PixmapPtr pPixmap);
Bool xnestModifyPixmapHeader(PixmapPtr pPixmap, int width, int height, int depth,
int bitsPerPixel, int devKind, pointer pPixData);
RegionPtr xnestPixmapToRegion(PixmapPtr pPixmap); RegionPtr xnestPixmapToRegion(PixmapPtr pPixmap);
#endif /* XNESTPIXMAP_H */ #endif /* XNESTPIXMAP_H */

View File

@ -555,7 +555,6 @@ _gl_context_modes_are_same(const __GLcontextModes * a,
(a->stencilBits == b->stencilBits) && (a->stencilBits == b->stencilBits) &&
(a->numAuxBuffers == b->numAuxBuffers) && (a->numAuxBuffers == b->numAuxBuffers) &&
(a->level == b->level) && (a->level == b->level) &&
(a->pixmapMode == b->pixmapMode) &&
(a->visualRating == b->visualRating) && (a->visualRating == b->visualRating) &&
(a->transparentPixel == b->transparentPixel) && (a->transparentPixel == b->transparentPixel) &&

View File

@ -144,7 +144,6 @@ __GLXconfig *__glXAquaCreateVisualConfigs(int *numConfigsPtr, int screenNumber)
c->level = 0; c->level = 0;
c->indexBits = 0; c->indexBits = 0;
c->pixmapMode = 0; // TODO: What should this be?
if(conf->accelerated) { if(conf->accelerated) {
c->visualRating = GLX_NONE; c->visualRating = GLX_NONE;

View File

@ -305,8 +305,6 @@ static miPointerScreenFuncRec quartzScreenFuncsRec = {
QuartzCursorOffScreen, QuartzCursorOffScreen,
QuartzCrossScreen, QuartzCrossScreen,
QuartzWarpCursor, QuartzWarpCursor,
NULL,
NULL
}; };
/* /*

View File

@ -1715,7 +1715,6 @@ fbConfigToPixelFormat(__GLXconfig * mode, PIXELFORMATDESCRIPTOR * pfdret,
pfd.cAuxBuffers = mode->numAuxBuffers; pfd.cAuxBuffers = mode->numAuxBuffers;
/* mode->level ? */ /* mode->level ? */
/* mode->pixmapMode ? */
*pfdret = pfd; *pfdret = pfd;
@ -1925,7 +1924,6 @@ glxWinCreateConfigs(HDC hdc, glxWinScreen * screen)
// pfd.dwLayerMask; // ignored // pfd.dwLayerMask; // ignored
// pfd.dwDamageMask; // ignored // pfd.dwDamageMask; // ignored
c->base.pixmapMode = 0;
c->base.visualID = -1; // will be set by __glXScreenInit() c->base.visualID = -1; // will be set by __glXScreenInit()
/* EXT_visual_rating / GLX 1.2 */ /* EXT_visual_rating / GLX 1.2 */
@ -2263,7 +2261,6 @@ glxWinCreateConfigsExt(HDC hdc, glxWinScreen * screen)
} }
c->base.level = 0; c->base.level = 0;
c->base.pixmapMode = 0; // ???
c->base.visualID = -1; // will be set by __glXScreenInit() c->base.visualID = -1; // will be set by __glXScreenInit()
/* EXT_visual_rating / GLX 1.2 */ /* EXT_visual_rating / GLX 1.2 */

View File

@ -78,10 +78,8 @@ typedef struct _Cursor {
int refcnt; int refcnt;
PrivateRec *devPrivates; /* set by pScr->RealizeCursor */ PrivateRec *devPrivates; /* set by pScr->RealizeCursor */
XID id; XID id;
#ifdef XFIXES
CARD32 serialNumber; CARD32 serialNumber;
Atom name; Atom name;
#endif
} CursorRec; } CursorRec;
#define CURSOR_REC_SIZE (sizeof(CursorRec) + dixPrivatesSize(PRIVATE_CURSOR)) #define CURSOR_REC_SIZE (sizeof(CursorRec) + dixPrivatesSize(PRIVATE_CURSOR))

View File

@ -61,7 +61,6 @@ typedef enum { ClientStateInitial,
ClientStateGone ClientStateGone
} ClientState; } ClientState;
#ifdef XFIXES
typedef struct _saveSet { typedef struct _saveSet {
struct _Window *windowPtr; struct _Window *windowPtr;
Bool toRoot; Bool toRoot;
@ -73,16 +72,6 @@ typedef struct _saveSet {
#define SaveSetAssignWindow(ss,w) ((ss).windowPtr = (w)) #define SaveSetAssignWindow(ss,w) ((ss).windowPtr = (w))
#define SaveSetAssignToRoot(ss,tr) ((ss).toRoot = (tr)) #define SaveSetAssignToRoot(ss,tr) ((ss).toRoot = (tr))
#define SaveSetAssignMap(ss,m) ((ss).map = (m)) #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 { typedef struct _Client {
pointer requestBuffer; pointer requestBuffer;

View File

@ -140,10 +140,8 @@ extern void XFree86BigfontExtensionInit(void);
extern void BigReqExtensionInit(void); extern void BigReqExtensionInit(void);
#ifdef XFIXES
extern _X_EXPORT Bool noXFixesExtension; extern _X_EXPORT Bool noXFixesExtension;
extern void XFixesExtensionInit(void); extern void XFixesExtensionInit(void);
#endif
extern void XInputExtensionInit(void); extern void XInputExtensionInit(void);
extern _X_EXPORT void AssignTypeAndName(DeviceIntPtr dev, extern _X_EXPORT void AssignTypeAndName(DeviceIntPtr dev,

View File

@ -213,7 +213,7 @@ xorg_list_del(struct xorg_list *entry)
* *
* @return True if the list contains one or more elements or False otherwise. * @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) xorg_list_is_empty(struct xorg_list *head)
{ {
return head->next == head; return head->next == head;

View File

@ -46,7 +46,6 @@ typedef enum {
PRIVATE_CURSOR_BITS, PRIVATE_CURSOR_BITS,
/* extension privates */ /* extension privates */
PRIVATE_DBE_WINDOW,
PRIVATE_DAMAGE, PRIVATE_DAMAGE,
PRIVATE_GLYPH, PRIVATE_GLYPH,
PRIVATE_GLYPHSET, PRIVATE_GLYPHSET,

View File

@ -86,7 +86,6 @@ SOFTWARE.
#undef DBE #undef DBE
#undef SCREENSAVER #undef SCREENSAVER
#undef RANDR #undef RANDR
#undef XFIXES
#undef DAMAGE #undef DAMAGE
#undef COMPOSITE #undef COMPOSITE
#undef MITSHM #undef MITSHM
@ -168,9 +167,7 @@ static ExtensionToggle ExtensionToggleList[] = {
{"XFree86-VidModeExtension", &noXFree86VidModeExtension}, {"XFree86-VidModeExtension", &noXFree86VidModeExtension},
#endif #endif
#endif #endif
#ifdef XFIXES
{"XFIXES", &noXFixesExtension}, {"XFIXES", &noXFixesExtension},
#endif
#ifdef PANORAMIX #ifdef PANORAMIX
{"XINERAMA", &noPanoramiXExtension}, {"XINERAMA", &noPanoramiXExtension},
#endif #endif
@ -263,10 +260,8 @@ static ExtensionModule staticExtensions[] = {
*/ */
{PseudoramiXExtensionInit, "PseudoramiX", &noPseudoramiXExtension}, {PseudoramiXExtensionInit, "PseudoramiX", &noPseudoramiXExtension},
#endif #endif
#ifdef XFIXES
/* must be before Render to layer DisplayCursor correctly */ /* must be before Render to layer DisplayCursor correctly */
{XFixesExtensionInit, "XFIXES", &noXFixesExtension}, {XFixesExtensionInit, "XFIXES", &noXFixesExtension},
#endif
#ifdef XF86BIGFONT #ifdef XF86BIGFONT
{XFree86BigfontExtensionInit, XF86BIGFONTNAME, &noXFree86BigfontExtension}, {XFree86BigfontExtensionInit, XF86BIGFONTNAME, &noXFree86BigfontExtension},
#endif #endif

View File

@ -118,13 +118,6 @@ miPointerInitialize(ScreenPtr pScreen,
return FALSE; return FALSE;
pScreenPriv->spriteFuncs = spriteFuncs; pScreenPriv->spriteFuncs = spriteFuncs;
pScreenPriv->screenFuncs = screenFuncs; pScreenPriv->screenFuncs = screenFuncs;
/*
* check for uninitialized methods
*/
if (!screenFuncs->EnqueueEvent)
screenFuncs->EnqueueEvent = mieqEnqueue;
if (!screenFuncs->NewEventScreen)
screenFuncs->NewEventScreen = mieqSwitchScreen;
pScreenPriv->waitForUpdate = waitForUpdate; pScreenPriv->waitForUpdate = waitForUpdate;
pScreenPriv->showTransparent = FALSE; pScreenPriv->showTransparent = FALSE;
pScreenPriv->CloseScreen = pScreen->CloseScreen; pScreenPriv->CloseScreen = pScreen->CloseScreen;
@ -363,7 +356,7 @@ miPointerWarpCursor(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y)
pPointer = MIPOINTER(pDev); pPointer = MIPOINTER(pDev);
if (pPointer->pScreen != pScreen) { if (pPointer->pScreen != pScreen) {
(*pScreenPriv->screenFuncs->NewEventScreen) (pDev, pScreen, TRUE); mieqSwitchScreen(pDev, pScreen, TRUE);
changedScreen = TRUE; changedScreen = TRUE;
} }
@ -480,22 +473,13 @@ miPointerSetScreen(DeviceIntPtr pDev, int screen_no, int x, int y)
pScreen = screenInfo.screens[screen_no]; pScreen = screenInfo.screens[screen_no];
pScreenPriv = GetScreenPrivate(pScreen); pScreenPriv = GetScreenPrivate(pScreen);
(*pScreenPriv->screenFuncs->NewEventScreen) (pDev, pScreen, FALSE); mieqSwitchScreen(pDev, pScreen, FALSE);
NewCurrentScreen(pDev, pScreen, x, y); NewCurrentScreen(pDev, pScreen, x, y);
pPointer->limits.x2 = pScreen->width; pPointer->limits.x2 = pScreen->width;
pPointer->limits.y2 = pScreen->height; pPointer->limits.y2 = pScreen->height;
} }
/**
* @return The current screen of the VCP
*/
ScreenPtr
miPointerCurrentScreen(void)
{
return miPointerGetScreen(inputInfo.pointer);
}
/** /**
* @return The current screen of the given device or NULL. * @return The current screen of the given device or NULL.
*/ */
@ -617,8 +601,7 @@ miPointerSetPosition(DeviceIntPtr pDev, int mode, double *screenx,
(*pScreenPriv->screenFuncs->CursorOffScreen) (&newScreen, &x, &y); (*pScreenPriv->screenFuncs->CursorOffScreen) (&newScreen, &x, &y);
if (newScreen != pScreen) { if (newScreen != pScreen) {
pScreen = newScreen; pScreen = newScreen;
(*pScreenPriv->screenFuncs->NewEventScreen) (pDev, pScreen, mieqSwitchScreen(pDev, pScreen, FALSE);
FALSE);
/* Smash the confine to the new screen */ /* Smash the confine to the new screen */
pPointer->limits.x2 = pScreen->width; pPointer->limits.x2 = pScreen->width;
pPointer->limits.y2 = pScreen->height; pPointer->limits.y2 = pScreen->height;

View File

@ -71,13 +71,6 @@ typedef struct _miPointerScreenFuncRec {
int /* x */ , int /* x */ ,
int /* y */ int /* y */
); );
void (*EnqueueEvent) (DeviceIntPtr /* pDev */ ,
InternalEvent * /* event */
);
void (*NewEventScreen) (DeviceIntPtr /* pDev */ ,
ScreenPtr /* pScr */ ,
Bool /* set_dequeue_screen */
);
} miPointerScreenFuncRec, *miPointerScreenFuncPtr; } miPointerScreenFuncRec, *miPointerScreenFuncPtr;
extern _X_EXPORT Bool miDCInitialize(ScreenPtr /*pScreen */ , extern _X_EXPORT Bool miDCInitialize(ScreenPtr /*pScreen */ ,
@ -98,11 +91,6 @@ extern _X_EXPORT void miPointerWarpCursor(DeviceIntPtr /*pDev */ ,
int /*y */ int /*y */
); );
/* Deprecated in favour of miPointerGetScreen. */
extern _X_EXPORT ScreenPtr
miPointerCurrentScreen(void
) _X_DEPRECATED;
extern _X_EXPORT ScreenPtr extern _X_EXPORT ScreenPtr
miPointerGetScreen(DeviceIntPtr pDev); miPointerGetScreen(DeviceIntPtr pDev);
extern _X_EXPORT void extern _X_EXPORT void

View File

@ -86,10 +86,6 @@ typedef struct {
/* os layer procedures */ /* os layer procedures */
ScreenBlockHandlerProcPtr BlockHandler; ScreenBlockHandlerProcPtr BlockHandler;
/* device cursor procedures */
DeviceCursorInitializeProcPtr DeviceCursorInitialize;
DeviceCursorCleanupProcPtr DeviceCursorCleanup;
xColorItem colors[2]; xColorItem colors[2];
ColormapPtr pInstalledMap; ColormapPtr pInstalledMap;
ColormapPtr pColormap; ColormapPtr pColormap;
@ -150,8 +146,7 @@ static void
miSpriteDisableDamage(ScreenPtr pScreen, miSpriteScreenPtr pScreenPriv) miSpriteDisableDamage(ScreenPtr pScreen, miSpriteScreenPtr pScreenPriv)
{ {
if (pScreenPriv->damageRegistered) { if (pScreenPriv->damageRegistered) {
DamageUnregister(&(pScreen->GetScreenPixmap(pScreen)->drawable), DamageUnregister(pScreenPriv->pDamage);
pScreenPriv->pDamage);
pScreenPriv->damageRegistered = 0; pScreenPriv->damageRegistered = 0;
} }
} }
@ -329,9 +324,6 @@ miSpriteInitialize(ScreenPtr pScreen, miPointerScreenFuncPtr screenFuncs)
pScreenPriv->BlockHandler = NULL; pScreenPriv->BlockHandler = NULL;
pScreenPriv->DeviceCursorInitialize = pScreen->DeviceCursorInitialize;
pScreenPriv->DeviceCursorCleanup = pScreen->DeviceCursorCleanup;
pScreenPriv->pInstalledMap = NULL; pScreenPriv->pInstalledMap = NULL;
pScreenPriv->pColormap = NULL; pScreenPriv->pColormap = NULL;
pScreenPriv->colors[SOURCE_COLOR].red = 0; pScreenPriv->colors[SOURCE_COLOR].red = 0;

View File

@ -994,7 +994,7 @@ miLineProjectingCap(DrawablePtr pDrawable, GCPtr pGC, unsigned long pixel,
{ {
int xorgi = 0, yorgi = 0; int xorgi = 0, yorgi = 0;
int lw; int lw;
PolyEdgeRec lefts[2], rights[2]; PolyEdgeRec lefts[4], rights[4];
int lefty, righty, topy, bottomy; int lefty, righty, topy, bottomy;
PolyEdgePtr left, right; PolyEdgePtr left, right;
PolyEdgePtr top, bottom; PolyEdgePtr top, bottom;
@ -1166,7 +1166,7 @@ miWideSegment(DrawablePtr pDrawable,
PolyEdgePtr top, bottom; PolyEdgePtr top, bottom;
int lefty, righty, topy, bottomy; int lefty, righty, topy, bottomy;
int signdx; int signdx;
PolyEdgeRec lefts[2], rights[2]; PolyEdgeRec lefts[4], rights[4];
LineFacePtr tface; LineFacePtr tface;
int lw = pGC->lineWidth; int lw = pGC->lineWidth;
@ -1520,7 +1520,7 @@ miWideDashSegment(DrawablePtr pDrawable,
PolyVertexRec vertices[4]; PolyVertexRec vertices[4];
PolyVertexRec saveRight, saveBottom; PolyVertexRec saveRight, saveBottom;
PolySlopeRec slopes[4]; PolySlopeRec slopes[4];
PolyEdgeRec left[2], right[2]; PolyEdgeRec left[4], right[4];
LineFaceRec lcapFace, rcapFace; LineFaceRec lcapFace, rcapFace;
int nleft, nright; int nleft, nright;
int h; int h;

View File

@ -119,51 +119,6 @@ getDrawableDamageRef(DrawablePtr pDrawable)
DamagePtr *pPrev = (DamagePtr *) \ DamagePtr *pPrev = (DamagePtr *) \
dixLookupPrivateAddr(&(pWindow)->devPrivates, damageWinPrivateKey) 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 #if DAMAGE_DEBUG_ENABLE
static void static void
_damageRegionAppend(DrawablePtr pDrawable, RegionPtr pRegion, Bool clip, _damageRegionAppend(DrawablePtr pDrawable, RegionPtr pRegion, Bool clip,
@ -299,14 +254,10 @@ damageRegionAppend(DrawablePtr pDrawable, RegionPtr pRegion, Bool clip,
RegionTranslate(pDamageRegion, -draw_x, -draw_y); RegionTranslate(pDamageRegion, -draw_x, -draw_y);
/* Store damage region if needed after submission. */ /* Store damage region if needed after submission. */
if (pDamage->reportAfter || pDamage->damageMarker) if (pDamage->reportAfter)
RegionUnion(&pDamage->pendingDamage, RegionUnion(&pDamage->pendingDamage,
&pDamage->pendingDamage, pDamageRegion); &pDamage->pendingDamage, pDamageRegion);
/* Duplicate current damage if needed. */
if (pDamage->damageMarker)
RegionCopy(&pDamage->backupDamage, &pDamage->damage);
/* Report damage now, if desired. */ /* Report damage now, if desired. */
if (!pDamage->reportAfter) { if (!pDamage->reportAfter) {
if (pDamage->damageReport) if (pDamage->damageReport)
@ -335,12 +286,6 @@ damageRegionProcessPending(DrawablePtr pDrawable)
drawableDamage(pDrawable); drawableDamage(pDrawable);
for (; pDamage != NULL; pDamage = pDamage->pNext) { 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) { if (pDamage->reportAfter) {
/* It's possible that there is only interest in postRendering reporting. */ /* It's possible that there is only interest in postRendering reporting. */
if (pDamage->damageReport) if (pDamage->damageReport)
@ -350,10 +295,8 @@ damageRegionProcessPending(DrawablePtr pDrawable)
&pDamage->pendingDamage); &pDamage->pendingDamage);
} }
if (pDamage->reportAfter || pDamage->damageMarker) if (pDamage->reportAfter)
RegionEmpty(&pDamage->pendingDamage); RegionEmpty(&pDamage->pendingDamage);
if (pDamage->damageMarker)
RegionEmpty(&pDamage->backupDamage);
} }
} }
@ -1336,7 +1279,7 @@ damageDamageChars(DrawablePtr pDrawable,
#define TT_POLY16 2 #define TT_POLY16 2
#define TT_IMAGE16 3 #define TT_IMAGE16 3
static int static void
damageText(DrawablePtr pDrawable, damageText(DrawablePtr pDrawable,
GCPtr pGC, GCPtr pGC,
int x, int x,
@ -1345,39 +1288,29 @@ damageText(DrawablePtr pDrawable,
char *chars, FontEncoding fontEncoding, Bool textType) char *chars, FontEncoding fontEncoding, Bool textType)
{ {
CharInfoPtr *charinfo; CharInfoPtr *charinfo;
CharInfoPtr *info;
unsigned long i; unsigned long i;
unsigned int n; unsigned int n;
int w;
Bool imageblt; Bool imageblt;
imageblt = (textType == TT_IMAGE8) || (textType == TT_IMAGE16); imageblt = (textType == TT_IMAGE8) || (textType == TT_IMAGE16);
if (!checkGCDamage(pDrawable, pGC))
return;
charinfo = malloc(count * sizeof(CharInfoPtr)); charinfo = malloc(count * sizeof(CharInfoPtr));
if (!charinfo) if (!charinfo)
return x; return;
GetGlyphs(pGC->font, count, (unsigned char *) chars, GetGlyphs(pGC->font, count, (unsigned char *) chars,
fontEncoding, &i, charinfo); fontEncoding, &i, charinfo);
n = (unsigned int) i; n = (unsigned int) i;
w = 0;
if (!imageblt)
for (info = charinfo; i--; info++)
w += (*info)->metrics.characterWidth;
if (n != 0) { if (n != 0) {
damageDamageChars(pDrawable, pGC->font, x + pDrawable->x, damageDamageChars(pDrawable, pGC->font, x + pDrawable->x,
y + pDrawable->y, n, charinfo, imageblt, y + pDrawable->y, n, charinfo, imageblt,
pGC->subWindowMode); 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); free(charinfo);
return x + w;
} }
static int static int
@ -1385,11 +1318,8 @@ damagePolyText8(DrawablePtr pDrawable,
GCPtr pGC, int x, int y, int count, char *chars) GCPtr pGC, int x, int y, int count, char *chars)
{ {
DAMAGE_GC_OP_PROLOGUE(pGC, pDrawable); DAMAGE_GC_OP_PROLOGUE(pGC, pDrawable);
damageText(pDrawable, pGC, x, y, (unsigned long) count, chars, Linear8Bit,
if (checkGCDamage(pDrawable, pGC)) TT_POLY8);
x = damageText(pDrawable, pGC, x, y, (unsigned long) count, chars,
Linear8Bit, TT_POLY8);
else
x = (*pGC->ops->PolyText8) (pDrawable, pGC, x, y, count, chars); x = (*pGC->ops->PolyText8) (pDrawable, pGC, x, y, count, chars);
damageRegionProcessPending(pDrawable); damageRegionProcessPending(pDrawable);
DAMAGE_GC_OP_EPILOGUE(pGC, pDrawable); DAMAGE_GC_OP_EPILOGUE(pGC, pDrawable);
@ -1401,13 +1331,9 @@ damagePolyText16(DrawablePtr pDrawable,
GCPtr pGC, int x, int y, int count, unsigned short *chars) GCPtr pGC, int x, int y, int count, unsigned short *chars)
{ {
DAMAGE_GC_OP_PROLOGUE(pGC, pDrawable); DAMAGE_GC_OP_PROLOGUE(pGC, pDrawable);
damageText(pDrawable, pGC, x, y, (unsigned long) count, (char *) chars,
if (checkGCDamage(pDrawable, pGC))
x = damageText(pDrawable, pGC, x, y, (unsigned long) count,
(char *) chars,
FONTLASTROW(pGC->font) == 0 ? Linear16Bit : TwoD16Bit, FONTLASTROW(pGC->font) == 0 ? Linear16Bit : TwoD16Bit,
TT_POLY16); TT_POLY16);
else
x = (*pGC->ops->PolyText16) (pDrawable, pGC, x, y, count, chars); x = (*pGC->ops->PolyText16) (pDrawable, pGC, x, y, count, chars);
damageRegionProcessPending(pDrawable); damageRegionProcessPending(pDrawable);
DAMAGE_GC_OP_EPILOGUE(pGC, pDrawable); DAMAGE_GC_OP_EPILOGUE(pGC, pDrawable);
@ -1419,11 +1345,8 @@ damageImageText8(DrawablePtr pDrawable,
GCPtr pGC, int x, int y, int count, char *chars) GCPtr pGC, int x, int y, int count, char *chars)
{ {
DAMAGE_GC_OP_PROLOGUE(pGC, pDrawable); DAMAGE_GC_OP_PROLOGUE(pGC, pDrawable);
damageText(pDrawable, pGC, x, y, (unsigned long) count, chars, Linear8Bit,
if (checkGCDamage(pDrawable, pGC)) TT_IMAGE8);
damageText(pDrawable, pGC, x, y, (unsigned long) count, chars,
Linear8Bit, TT_IMAGE8);
else
(*pGC->ops->ImageText8) (pDrawable, pGC, x, y, count, chars); (*pGC->ops->ImageText8) (pDrawable, pGC, x, y, count, chars);
damageRegionProcessPending(pDrawable); damageRegionProcessPending(pDrawable);
DAMAGE_GC_OP_EPILOGUE(pGC, pDrawable); DAMAGE_GC_OP_EPILOGUE(pGC, pDrawable);
@ -1434,12 +1357,9 @@ damageImageText16(DrawablePtr pDrawable,
GCPtr pGC, int x, int y, int count, unsigned short *chars) GCPtr pGC, int x, int y, int count, unsigned short *chars)
{ {
DAMAGE_GC_OP_PROLOGUE(pGC, pDrawable); DAMAGE_GC_OP_PROLOGUE(pGC, pDrawable);
if (checkGCDamage(pDrawable, pGC))
damageText(pDrawable, pGC, x, y, (unsigned long) count, (char *) chars, damageText(pDrawable, pGC, x, y, (unsigned long) count, (char *) chars,
FONTLASTROW(pGC->font) == 0 ? Linear16Bit : TwoD16Bit, FONTLASTROW(pGC->font) == 0 ? Linear16Bit : TwoD16Bit,
TT_IMAGE16); TT_IMAGE16);
else
(*pGC->ops->ImageText16) (pDrawable, pGC, x, y, count, chars); (*pGC->ops->ImageText16) (pDrawable, pGC, x, y, count, chars);
damageRegionProcessPending(pDrawable); damageRegionProcessPending(pDrawable);
DAMAGE_GC_OP_EPILOGUE(pGC, pDrawable); DAMAGE_GC_OP_EPILOGUE(pGC, pDrawable);
@ -1637,7 +1557,6 @@ damageDestroyWindow(WindowPtr pWindow)
damageScrPriv(pScreen); damageScrPriv(pScreen);
while ((pDamage = damageGetWinPriv(pWindow))) { while ((pDamage = damageGetWinPriv(pWindow))) {
DamageUnregister(&pWindow->drawable, pDamage);
DamageDestroy(pDamage); DamageDestroy(pDamage);
} }
unwrap(pScrPriv, pScreen, DestroyWindow); unwrap(pScrPriv, pScreen, DestroyWindow);
@ -1786,9 +1705,7 @@ DamageCreate(DamageReportFunc damageReport,
pDamage->reportAfter = FALSE; pDamage->reportAfter = FALSE;
pDamage->damageReport = damageReport; pDamage->damageReport = damageReport;
pDamage->damageReportPostRendering = NULL;
pDamage->damageDestroy = damageDestroy; pDamage->damageDestroy = damageDestroy;
pDamage->damageMarker = NULL;
pDamage->pScreen = pScreen; pDamage->pScreen = pScreen;
(*pScrPriv->funcs.Create) (pDamage); (*pScrPriv->funcs.Create) (pDamage);
@ -1844,8 +1761,9 @@ DamageDrawInternal(ScreenPtr pScreen, Bool enable)
} }
void void
DamageUnregister(DrawablePtr pDrawable, DamagePtr pDamage) DamageUnregister(DamagePtr pDamage)
{ {
DrawablePtr pDrawable = pDamage->pDrawable;
ScreenPtr pScreen = pDrawable->pScreen; ScreenPtr pScreen = pDrawable->pScreen;
damageScrPriv(pScreen); damageScrPriv(pScreen);
@ -1888,6 +1806,9 @@ DamageDestroy(DamagePtr pDamage)
damageScrPriv(pScreen); damageScrPriv(pScreen);
if (pDamage->pDrawable)
DamageUnregister(pDamage);
if (pDamage->damageDestroy) if (pDamage->damageDestroy)
(*pDamage->damageDestroy) (pDamage, pDamage->closure); (*pDamage->damageDestroy) (pDamage, pDamage->closure);
(*pScrPriv->funcs.Destroy) (pDamage); (*pScrPriv->funcs.Destroy) (pDamage);
@ -1956,17 +1877,6 @@ DamageRegionProcessPending(DrawablePtr pDrawable)
damageRegionProcessPending(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. */ /* This call is very odd, i'm leaving it intact for API sake, but please don't use it. */
void void
DamageDamageRegion(DrawablePtr pDrawable, RegionPtr pRegion) DamageDamageRegion(DrawablePtr pDrawable, RegionPtr pRegion)
@ -1986,15 +1896,6 @@ DamageSetReportAfterOp(DamagePtr pDamage, Bool reportAfter)
pDamage->reportAfter = reportAfter; pDamage->reportAfter = reportAfter;
} }
void
DamageSetPostRenderingFunctions(DamagePtr pDamage,
DamageReportFunc damageReportPostRendering,
DamageMarkerFunc damageMarker)
{
pDamage->damageReportPostRendering = damageReportPostRendering;
pDamage->damageMarker = damageMarker;
}
DamageScreenFuncsPtr DamageScreenFuncsPtr
DamageGetScreenFuncs(ScreenPtr pScreen) DamageGetScreenFuncs(ScreenPtr pScreen)
{ {

View File

@ -41,12 +41,6 @@ typedef void (*DamageReportFunc) (DamagePtr pDamage, RegionPtr pRegion,
void *closure); void *closure);
typedef void (*DamageDestroyFunc) (DamagePtr pDamage, 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 (*DamageScreenCreateFunc) (DamagePtr);
typedef void (*DamageScreenRegisterFunc) (DrawablePtr, DamagePtr); typedef void (*DamageScreenRegisterFunc) (DrawablePtr, DamagePtr);
typedef void (*DamageScreenUnregisterFunc) (DrawablePtr, DamagePtr); typedef void (*DamageScreenUnregisterFunc) (DrawablePtr, DamagePtr);
@ -80,7 +74,7 @@ extern _X_EXPORT void
DamageRegister(DrawablePtr pDrawable, DamagePtr pDamage); DamageRegister(DrawablePtr pDrawable, DamagePtr pDamage);
extern _X_EXPORT void extern _X_EXPORT void
DamageUnregister(DrawablePtr pDrawable, DamagePtr pDamage); DamageUnregister(DamagePtr pDamage);
extern _X_EXPORT void extern _X_EXPORT void
DamageDestroy(DamagePtr pDamage); DamageDestroy(DamagePtr pDamage);
@ -105,12 +99,6 @@ extern _X_EXPORT void
extern _X_EXPORT void extern _X_EXPORT void
DamageRegionProcessPending(DrawablePtr pDrawable); 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). */ /* Call this when you create a new Damage and you wish to send an initial damage message (to it). */
extern _X_EXPORT void extern _X_EXPORT void
DamageReportDamage(DamagePtr pDamage, RegionPtr pDamageRegion); DamageReportDamage(DamagePtr pDamage, RegionPtr pDamageRegion);
@ -122,12 +110,6 @@ extern _X_EXPORT void
extern _X_EXPORT void extern _X_EXPORT void
DamageSetReportAfterOp(DamagePtr pDamage, Bool reportAfter); DamageSetReportAfterOp(DamagePtr pDamage, Bool reportAfter);
extern _X_EXPORT void
DamageSetPostRenderingFunctions(DamagePtr pDamage,
DamageReportFunc damageReportPostRendering,
DamageMarkerFunc damageMarker);
extern _X_EXPORT DamageScreenFuncsPtr DamageGetScreenFuncs(ScreenPtr); extern _X_EXPORT DamageScreenFuncsPtr DamageGetScreenFuncs(ScreenPtr);
#endif /* _DAMAGE_H_ */ #endif /* _DAMAGE_H_ */

View File

@ -44,13 +44,10 @@ typedef struct _damage {
DrawablePtr pDrawable; DrawablePtr pDrawable;
DamageReportFunc damageReport; DamageReportFunc damageReport;
DamageReportFunc damageReportPostRendering;
DamageDestroyFunc damageDestroy; DamageDestroyFunc damageDestroy;
DamageMarkerFunc damageMarker;
Bool reportAfter; Bool reportAfter;
RegionRec pendingDamage; /* will be flushed post submission at the latest */ RegionRec pendingDamage; /* will be flushed post submission at the latest */
RegionRec backupDamage; /* for use with damageMarker */
ScreenPtr pScreen; ScreenPtr pScreen;
PrivateRec *devPrivates; PrivateRec *devPrivates;
} DamageRec; } DamageRec;

View File

@ -219,7 +219,7 @@ shadowRemove(ScreenPtr pScreen, PixmapPtr pPixmap)
shadowBuf(pScreen); shadowBuf(pScreen);
if (pBuf->pPixmap) { if (pBuf->pPixmap) {
DamageUnregister(&pBuf->pPixmap->drawable, pBuf->pDamage); DamageUnregister(pBuf->pDamage);
pBuf->update = 0; pBuf->update = 0;
pBuf->window = 0; pBuf->window = 0;
pBuf->randr = 0; pBuf->randr = 0;

View File

@ -182,20 +182,21 @@ miSyncSetup(ScreenPtr pScreen)
&miSyncScreenDestroyFence &miSyncScreenDestroyFence
}; };
if (dixPrivateKeyRegistered(syncScreenPrivateKey)) if (!dixPrivateKeyRegistered(syncScreenPrivateKey)) {
return TRUE;
if (!dixRegisterPrivateKey(syncScreenPrivateKey, PRIVATE_SCREEN, if (!dixRegisterPrivateKey(syncScreenPrivateKey, PRIVATE_SCREEN,
sizeof(SyncScreenPrivRec))) sizeof(SyncScreenPrivRec)))
return FALSE; return FALSE;
}
pScreenPriv = SYNC_SCREEN_PRIV(pScreen); pScreenPriv = SYNC_SCREEN_PRIV(pScreen);
if (pScreenPriv->funcs.CreateFence) {
pScreenPriv->funcs = miSyncScreenFuncs; pScreenPriv->funcs = miSyncScreenFuncs;
/* Wrap CloseScreen to clean up */ /* Wrap CloseScreen to clean up */
pScreenPriv->CloseScreen = pScreen->CloseScreen; pScreenPriv->CloseScreen = pScreen->CloseScreen;
pScreen->CloseScreen = SyncCloseScreen; pScreen->CloseScreen = SyncCloseScreen;
}
return TRUE; return TRUE;
} }

67
os/io.c
View File

@ -206,6 +206,32 @@ YieldControlDeath(void)
timesThisConnection = 0; timesThisConnection = 0;
} }
/* 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)
{
if (AvailableInput) {
if (AvailableInput != oc) {
ConnectionInputPtr aci = AvailableInput->input;
if (aci->size > BUFWATERMARK) {
free(aci->buffer);
free(aci);
}
else {
aci->next = FreeInputs;
FreeInputs = aci;
}
AvailableInput->input = NULL;
}
AvailableInput = NULL;
}
}
int int
ReadRequestFromClient(ClientPtr client) ReadRequestFromClient(ClientPtr client)
{ {
@ -218,28 +244,7 @@ ReadRequestFromClient(ClientPtr client)
Bool need_header; Bool need_header;
Bool move_header; Bool move_header;
/* If an input buffer was empty, either free it if it is too big NextAvailableInput(oc);
* 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;
if (aci->size > BUFWATERMARK) {
free(aci->buffer);
free(aci);
}
else {
aci->next = FreeInputs;
FreeInputs = aci;
}
AvailableInput->input = (ConnectionInputPtr) NULL;
}
AvailableInput = (OsCommPtr) NULL;
}
/* make sure we have an input buffer */ /* make sure we have an input buffer */
@ -494,22 +499,8 @@ InsertFakeRequest(ClientPtr client, char *data, int count)
int fd = oc->fd; int fd = oc->fd;
int gotnow, moveup; int gotnow, moveup;
if (AvailableInput) { NextAvailableInput(oc);
if (AvailableInput != oc) {
ConnectionInputPtr aci = AvailableInput->input;
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) {
if ((oci = FreeInputs)) if ((oci = FreeInputs))
FreeInputs = oci->next; FreeInputs = oci->next;
@ -814,7 +805,7 @@ WriteToClient(ClientPtr who, int count, const void *__buf)
} }
} }
#endif #endif
if (oco->count + count + padBytes > oco->size) { if (oco->count == 0 || oco->count + count + padBytes > oco->size) {
FD_CLR(oc->fd, &OutputPending); FD_CLR(oc->fd, &OutputPending);
if (!XFD_ANYSET(&OutputPending)) { if (!XFD_ANYSET(&OutputPending)) {
CriticalOutputPending = FALSE; CriticalOutputPending = FALSE;

View File

@ -169,9 +169,7 @@ Bool noXFree86DRIExtension = FALSE;
#ifdef XF86VIDMODE #ifdef XF86VIDMODE
Bool noXFree86VidModeExtension = FALSE; Bool noXFree86VidModeExtension = FALSE;
#endif #endif
#ifdef XFIXES
Bool noXFixesExtension = FALSE; Bool noXFixesExtension = FALSE;
#endif
#ifdef PANORAMIX #ifdef PANORAMIX
/* Xinerama is disabled by default unless enabled via +xinerama */ /* Xinerama is disabled by default unless enabled via +xinerama */
Bool noPanoramiXExtension = TRUE; Bool noPanoramiXExtension = TRUE;

View File

@ -82,7 +82,7 @@ RRPointerToNearestCrtc(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y,
else else
dx = 0; dx = 0;
if (y < crtc->y) if (y < crtc->y)
dy = crtc->y - x; dy = crtc->y - y;
else if (y > crtc->y + scan_height) else if (y > crtc->y + scan_height)
dy = y - (crtc->y + scan_height); dy = y - (crtc->y + scan_height);
else else