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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -143,6 +143,20 @@ typedef struct _DbeWindowPrivRec {
*/
XID initIDs[DBE_INIT_MAX_IDS];
/* Pointer to a drawable that contains the contents of the back buffer.
*/
PixmapPtr pBackBuffer;
/* Pointer to a drawable that contains the contents of the front buffer.
* This pointer is only used for the XdbeUntouched swap action. For that
* swap action, we need to copy the front buffer (window) contents into
* this drawable, copy the contents of current back buffer drawable (the
* back buffer) into the window, swap the front and back drawable pointers,
* and then swap the drawable/resource associations in the resource
* database.
*/
PixmapPtr pFrontBuffer;
/* Device-specific private information.
*/
PrivateRec *devPrivates;
@ -180,16 +194,9 @@ typedef struct _DbeScreenPrivRec {
int * /*pNumWindows */ ,
DbeSwapInfoPtr /*swapInfo */
);
void (*BeginIdiom) (ClientPtr /*client */
);
void (*EndIdiom) (ClientPtr /*client */
);
void (*WinPrivDelete) (DbeWindowPrivPtr /*pDbeWindowPriv */ ,
XID /*bufId */
);
void (*ResetProc) (ScreenPtr /*pScreen */
);
} DbeScreenPrivRec, *DbeScreenPrivPtr;
#endif /* DBE_STRUCT_H */

View File

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

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

View File

@ -1974,7 +1974,7 @@ ProcPutImage(ClientPtr client)
static int
DoGetImage(ClientPtr client, int format, Drawable drawable,
int x, int y, int width, int height,
Mask planemask, xGetImageReply ** im_return)
Mask planemask)
{
DrawablePtr pDraw, pBoundingDraw;
int nlines, linesPerBuf, rc;
@ -2074,46 +2074,32 @@ DoGetImage(ClientPtr client, int format, Drawable drawable,
xgi.length = length;
if (im_return) {
pBuf = calloc(1, sz_xGetImageReply + length);
if (!pBuf)
return BadAlloc;
if (widthBytesLine == 0)
linesPerBuf = 0;
else
linesPerBuf = height;
*im_return = (xGetImageReply *) pBuf;
*(xGetImageReply *) pBuf = xgi;
pBuf += sz_xGetImageReply;
}
xgi.length = bytes_to_int32(xgi.length);
if (widthBytesLine == 0 || height == 0)
linesPerBuf = 0;
else if (widthBytesLine >= IMAGE_BUFSIZE)
linesPerBuf = 1;
else {
xgi.length = bytes_to_int32(xgi.length);
if (widthBytesLine == 0 || height == 0)
linesPerBuf = 0;
else if (widthBytesLine >= IMAGE_BUFSIZE)
linesPerBuf = 1;
else {
linesPerBuf = IMAGE_BUFSIZE / widthBytesLine;
if (linesPerBuf > height)
linesPerBuf = height;
}
length = linesPerBuf * widthBytesLine;
if (linesPerBuf < height) {
/* we have to make sure intermediate buffers don't need padding */
while ((linesPerBuf > 1) &&
(length & ((1L << LOG2_BYTES_PER_SCANLINE_PAD) - 1))) {
linesPerBuf--;
length -= widthBytesLine;
}
while (length & ((1L << LOG2_BYTES_PER_SCANLINE_PAD) - 1)) {
linesPerBuf++;
length += widthBytesLine;
}
}
if (!(pBuf = calloc(1, length)))
return BadAlloc;
WriteReplyToClient(client, sizeof(xGetImageReply), &xgi);
linesPerBuf = IMAGE_BUFSIZE / widthBytesLine;
if (linesPerBuf > height)
linesPerBuf = height;
}
length = linesPerBuf * widthBytesLine;
if (linesPerBuf < height) {
/* we have to make sure intermediate buffers don't need padding */
while ((linesPerBuf > 1) &&
(length & ((1L << LOG2_BYTES_PER_SCANLINE_PAD) - 1))) {
linesPerBuf--;
length -= widthBytesLine;
}
while (length & ((1L << LOG2_BYTES_PER_SCANLINE_PAD) - 1)) {
linesPerBuf++;
length += widthBytesLine;
}
}
if (!(pBuf = calloc(1, length)))
return BadAlloc;
WriteReplyToClient(client, sizeof(xGetImageReply), &xgi);
if (pDraw->type == DRAWABLE_WINDOW) {
pVisibleRegion = NotClippedByChildren((WindowPtr) pDraw);
@ -2142,13 +2128,10 @@ DoGetImage(ClientPtr client, int format, Drawable drawable,
/* Note that this is NOT a call to WriteSwappedDataToClient,
as we do NOT byte swap */
if (!im_return) {
ReformatImage(pBuf, (int) (nlines * widthBytesLine),
BitsPerPixel(pDraw->depth), ClientOrder(client));
ReformatImage(pBuf, (int) (nlines * widthBytesLine),
BitsPerPixel(pDraw->depth), ClientOrder(client));
/* Don't split me, gcc pukes when you do */
WriteToClient(client, (int) (nlines * widthBytesLine), pBuf);
}
WriteToClient(client, (int) (nlines * widthBytesLine), pBuf);
linesDone += nlines;
}
}
@ -2173,18 +2156,10 @@ DoGetImage(ClientPtr client, int format, Drawable drawable,
/* Note: NOT a call to WriteSwappedDataToClient,
as we do NOT byte swap */
if (im_return) {
pBuf += nlines * widthBytesLine;
}
else {
ReformatImage(pBuf,
(int) (nlines * widthBytesLine),
1, ClientOrder(client));
ReformatImage(pBuf, (int) (nlines * widthBytesLine),
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;
}
}
@ -2192,8 +2167,7 @@ DoGetImage(ClientPtr client, int format, Drawable drawable,
}
if (pVisibleRegion)
RegionDestroy(pVisibleRegion);
if (!im_return)
free(pBuf);
free(pBuf);
return Success;
}
@ -2207,7 +2181,7 @@ ProcGetImage(ClientPtr client)
return DoGetImage(client, stuff->format, stuff->drawable,
stuff->x, stuff->y,
(int) stuff->width, (int) stuff->height,
stuff->planeMask, (xGetImageReply **) NULL);
stuff->planeMask);
}
int

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) {
if (ent->src == src && ent->slave_dst == slave_dst) {
DamageUnregister(&src->drawable, ent->damage);
DamageDestroy(ent->damage);
xorg_list_del(&ent->ent);
free(ent);

View File

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

View File

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

View File

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

View File

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

View File

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

34
fb/fb.h
View File

@ -1111,17 +1111,6 @@ fbInitVisuals(VisualPtr * visualp,
* fbcopy.c
*/
/* Compatibility definition, to be removed at next ABI change. */
typedef void (*fbCopyProc) (DrawablePtr pSrcDrawable,
DrawablePtr pDstDrawable,
GCPtr pGC,
BoxPtr pDstBox,
int nbox,
int dx,
int dy,
Bool reverse,
Bool upsidedown, Pixel bitplane, void *closure);
extern _X_EXPORT void
fbCopyNtoN(DrawablePtr pSrcDrawable,
@ -1133,29 +1122,6 @@ fbCopyNtoN(DrawablePtr pSrcDrawable,
int dy,
Bool reverse, Bool upsidedown, Pixel bitplane, void *closure);
/* Compatibility wrapper, to be removed at next ABI change. */
extern _X_EXPORT void
fbCopyRegion(DrawablePtr pSrcDrawable,
DrawablePtr pDstDrawable,
GCPtr pGC,
RegionPtr pDstRegion,
int dx,
int dy, fbCopyProc copyProc, Pixel bitPlane, void *closure);
/* Compatibility wrapper, to be removed at next ABI change. */
extern _X_EXPORT RegionPtr
fbDoCopy(DrawablePtr pSrcDrawable,
DrawablePtr pDstDrawable,
GCPtr pGC,
int xIn,
int yIn,
int widthSrc,
int heightSrc,
int xOut,
int yOut, fbCopyProc copyProc, Pixel bitplane, void *closure);
extern _X_EXPORT void
fbCopy1toN(DrawablePtr pSrcDrawable,

View File

@ -28,33 +28,6 @@
#include "fb.h"
/* Compatibility wrapper, to be removed at next ABI change. */
void
fbCopyRegion(DrawablePtr pSrcDrawable,
DrawablePtr pDstDrawable,
GCPtr pGC,
RegionPtr pDstRegion,
int dx, int dy, fbCopyProc copyProc, Pixel bitPlane, void *closure)
{
miCopyRegion(pSrcDrawable, pDstDrawable, pGC, pDstRegion, dx, dy, copyProc,
bitPlane, closure);
}
/* Compatibility wrapper, to be removed at next ABI change. */
RegionPtr
fbDoCopy(DrawablePtr pSrcDrawable,
DrawablePtr pDstDrawable,
GCPtr pGC,
int xIn,
int yIn,
int widthSrc,
int heightSrc,
int xOut, int yOut, fbCopyProc copyProc, Pixel bitPlane, void *closure)
{
return miDoCopy(pSrcDrawable, pDstDrawable, pGC, xIn, yIn, widthSrc,
heightSrc, xOut, yOut, copyProc, bitPlane, closure);
}
void
fbCopyNtoN(DrawablePtr pSrcDrawable,
DrawablePtr pDstDrawable,

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -82,8 +82,6 @@ DMXScreenInfo *dmxScreens;
int dmxNumInputs;
DMXInputInfo *dmxInputs;
int dmxShadowFB = FALSE;
XErrorEvent dmxLastErrorEvent;
Bool dmxErrorOccurred = FALSE;
@ -854,9 +852,6 @@ InitOutput(ScreenInfo * pScreenInfo, int argc, char *argv[])
/* Initialized things that need timer hooks */
dmxStatInit();
dmxSyncInit(); /* Calls RegisterBlockAndWakeupHandlers */
dmxLog(dmxInfo, "Shadow framebuffer support %s\n",
dmxShadowFB ? "enabled" : "disabled");
}
/* RATS: Assuming the fp string (which comes from the command-line argv
@ -951,10 +946,6 @@ ddxProcessArgument(int argc, char *argv[], int i)
retval = 2;
}
else if (!strcmp(argv[i], "-noshadowfb")) {
dmxLog(dmxWarning,
"-noshadowfb has been deprecated "
"since it is now the default\n");
dmxShadowFB = FALSE;
retval = 1;
}
else if (!strcmp(argv[i], "-nomulticursor")) {
@ -962,7 +953,6 @@ ddxProcessArgument(int argc, char *argv[], int i)
retval = 1;
}
else if (!strcmp(argv[i], "-shadowfb")) {
dmxShadowFB = TRUE;
retval = 1;
}
else if (!strcmp(argv[i], "-configfile")) {

View File

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

View File

@ -41,7 +41,6 @@
#include "dmx.h"
#include "dmxsync.h"
#include "dmxshadow.h"
#include "dmxscrinit.h"
#include "dmxcursor.h"
#include "dmxgc.h"
@ -159,37 +158,18 @@ dmxBEScreenInit(ScreenPtr pScreen)
XMapWindow(dmxScreen->beDisplay, dmxScreen->scrnWin);
if (dmxShadowFB) {
mask = (GCFunction | GCPlaneMask | GCClipMask);
gcvals.function = GXcopy;
gcvals.plane_mask = AllPlanes;
gcvals.clip_mask = None;
dmxScreen->shadowGC = XCreateGC(dmxScreen->beDisplay,
dmxScreen->scrnWin, mask, &gcvals);
dmxScreen->shadowFBImage =
XCreateImage(dmxScreen->beDisplay,
dmxScreen->beVisuals[dmxScreen->beDefVisualIndex].
visual, dmxScreen->beDepth, ZPixmap, 0,
(char *) dmxScreen->shadow, dmxScreen->scrnWidth,
dmxScreen->scrnHeight, dmxScreen->beBPP,
PixmapBytePad(dmxScreen->scrnWidth, dmxScreen->beBPP));
}
else {
/* Create default drawables (used during GC creation) */
for (i = 0; i < dmxScreen->beNumPixmapFormats; i++)
for (j = 0; j < dmxScreen->beNumDepths; j++)
if ((dmxScreen->bePixmapFormats[i].depth == 1) ||
(dmxScreen->bePixmapFormats[i].depth ==
dmxScreen->beDepths[j])) {
dmxScreen->scrnDefDrawables[i] = (Drawable)
XCreatePixmap(dmxScreen->beDisplay, dmxScreen->scrnWin,
1, 1,
dmxScreen->bePixmapFormats[i].depth);
break;
}
}
/* Create default drawables (used during GC creation) */
for (i = 0; i < dmxScreen->beNumPixmapFormats; i++)
for (j = 0; j < dmxScreen->beNumDepths; j++)
if ((dmxScreen->bePixmapFormats[i].depth == 1) ||
(dmxScreen->bePixmapFormats[i].depth ==
dmxScreen->beDepths[j])) {
dmxScreen->scrnDefDrawables[i] = (Drawable)
XCreatePixmap(dmxScreen->beDisplay, dmxScreen->scrnWin,
1, 1,
dmxScreen->bePixmapFormats[i].depth);
break;
}
}
/** Initialize screen number \a pScreen->myNum. */
@ -215,19 +195,12 @@ dmxScreenInit(ScreenPtr pScreen, int argc, char *argv[])
dmxGeneration = serverGeneration;
}
if (dmxShadowFB) {
dmxScreen->shadow = shadowAlloc(dmxScreen->scrnWidth,
dmxScreen->scrnHeight,
dmxScreen->beBPP);
}
else {
if (!dmxInitGC(pScreen))
return FALSE;
if (!dmxInitWindow(pScreen))
return FALSE;
if (!dmxInitPixmap(pScreen))
return FALSE;
}
if (!dmxInitGC(pScreen))
return FALSE;
if (!dmxInitWindow(pScreen))
return FALSE;
if (!dmxInitPixmap(pScreen))
return FALSE;
/*
* Initalise the visual types. miSetVisualTypesAndMasks() requires
@ -267,7 +240,7 @@ dmxScreenInit(ScreenPtr pScreen, int argc, char *argv[])
}
fbScreenInit(pScreen,
dmxShadowFB ? dmxScreen->shadow : NULL,
NULL,
dmxScreen->scrnWidth,
dmxScreen->scrnHeight,
dmxScreen->beXDPI,
@ -278,22 +251,14 @@ dmxScreenInit(ScreenPtr pScreen, int argc, char *argv[])
pScreen->GetWindowPixmap = NULL;
pScreen->SetWindowPixmap = NULL;
if (dmxShadowFB && !shadowInit(pScreen, dmxShadowUpdateProc, NULL))
return FALSE;
MAXSCREENSALLOC(dmxCursorGeneration);
if (dmxCursorGeneration[pScreen->myNum] != serverGeneration) {
if (!(miPointerInitialize(pScreen,
&dmxPointerSpriteFuncs,
&dmxPointerCursorFuncs, FALSE)))
return FALSE;
if (dmxShadowFB) {
miDCInitialize(pScreen, &dmxPointerCursorFuncs);
}
else {
MAXSCREENSALLOC(dmxCursorGeneration);
if (dmxCursorGeneration[pScreen->myNum] != serverGeneration) {
if (!(miPointerInitialize(pScreen,
&dmxPointerSpriteFuncs,
&dmxPointerCursorFuncs, FALSE)))
return FALSE;
dmxCursorGeneration[pScreen->myNum] = serverGeneration;
}
dmxCursorGeneration[pScreen->myNum] = serverGeneration;
}
DMX_WRAP(CloseScreen, dmxCloseScreen, dmxScreen, pScreen);
@ -301,49 +266,47 @@ dmxScreenInit(ScreenPtr pScreen, int argc, char *argv[])
dmxBEScreenInit(pScreen);
if (!dmxShadowFB) {
/* Wrap GC functions */
DMX_WRAP(CreateGC, dmxCreateGC, dmxScreen, pScreen);
/* Wrap GC functions */
DMX_WRAP(CreateGC, dmxCreateGC, dmxScreen, pScreen);
/* Wrap Window functions */
DMX_WRAP(CreateWindow, dmxCreateWindow, dmxScreen, pScreen);
DMX_WRAP(DestroyWindow, dmxDestroyWindow, dmxScreen, pScreen);
DMX_WRAP(PositionWindow, dmxPositionWindow, dmxScreen, pScreen);
DMX_WRAP(ChangeWindowAttributes, dmxChangeWindowAttributes, dmxScreen,
pScreen);
DMX_WRAP(RealizeWindow, dmxRealizeWindow, dmxScreen, pScreen);
DMX_WRAP(UnrealizeWindow, dmxUnrealizeWindow, dmxScreen, pScreen);
DMX_WRAP(RestackWindow, dmxRestackWindow, dmxScreen, pScreen);
DMX_WRAP(WindowExposures, dmxWindowExposures, dmxScreen, pScreen);
DMX_WRAP(CopyWindow, dmxCopyWindow, dmxScreen, pScreen);
/* Wrap Window functions */
DMX_WRAP(CreateWindow, dmxCreateWindow, dmxScreen, pScreen);
DMX_WRAP(DestroyWindow, dmxDestroyWindow, dmxScreen, pScreen);
DMX_WRAP(PositionWindow, dmxPositionWindow, dmxScreen, pScreen);
DMX_WRAP(ChangeWindowAttributes, dmxChangeWindowAttributes, dmxScreen,
pScreen);
DMX_WRAP(RealizeWindow, dmxRealizeWindow, dmxScreen, pScreen);
DMX_WRAP(UnrealizeWindow, dmxUnrealizeWindow, dmxScreen, pScreen);
DMX_WRAP(RestackWindow, dmxRestackWindow, dmxScreen, pScreen);
DMX_WRAP(WindowExposures, dmxWindowExposures, dmxScreen, pScreen);
DMX_WRAP(CopyWindow, dmxCopyWindow, dmxScreen, pScreen);
DMX_WRAP(ResizeWindow, dmxResizeWindow, dmxScreen, pScreen);
DMX_WRAP(ReparentWindow, dmxReparentWindow, dmxScreen, pScreen);
DMX_WRAP(ResizeWindow, dmxResizeWindow, dmxScreen, pScreen);
DMX_WRAP(ReparentWindow, dmxReparentWindow, dmxScreen, pScreen);
DMX_WRAP(ChangeBorderWidth, dmxChangeBorderWidth, dmxScreen, pScreen);
DMX_WRAP(ChangeBorderWidth, dmxChangeBorderWidth, dmxScreen, pScreen);
/* Wrap Image functions */
DMX_WRAP(GetImage, dmxGetImage, dmxScreen, pScreen);
DMX_WRAP(GetSpans, dmxGetSpans, dmxScreen, pScreen);
/* Wrap Image functions */
DMX_WRAP(GetImage, dmxGetImage, dmxScreen, pScreen);
DMX_WRAP(GetSpans, dmxGetSpans, dmxScreen, pScreen);
/* Wrap Pixmap functions */
DMX_WRAP(CreatePixmap, dmxCreatePixmap, dmxScreen, pScreen);
DMX_WRAP(DestroyPixmap, dmxDestroyPixmap, dmxScreen, pScreen);
DMX_WRAP(BitmapToRegion, dmxBitmapToRegion, dmxScreen, pScreen);
/* Wrap Pixmap functions */
DMX_WRAP(CreatePixmap, dmxCreatePixmap, dmxScreen, pScreen);
DMX_WRAP(DestroyPixmap, dmxDestroyPixmap, dmxScreen, pScreen);
DMX_WRAP(BitmapToRegion, dmxBitmapToRegion, dmxScreen, pScreen);
/* Wrap Font functions */
DMX_WRAP(RealizeFont, dmxRealizeFont, dmxScreen, pScreen);
DMX_WRAP(UnrealizeFont, dmxUnrealizeFont, dmxScreen, pScreen);
/* Wrap Font functions */
DMX_WRAP(RealizeFont, dmxRealizeFont, dmxScreen, pScreen);
DMX_WRAP(UnrealizeFont, dmxUnrealizeFont, dmxScreen, pScreen);
/* Wrap Colormap functions */
DMX_WRAP(CreateColormap, dmxCreateColormap, dmxScreen, pScreen);
DMX_WRAP(DestroyColormap, dmxDestroyColormap, dmxScreen, pScreen);
DMX_WRAP(InstallColormap, dmxInstallColormap, dmxScreen, pScreen);
DMX_WRAP(StoreColors, dmxStoreColors, dmxScreen, pScreen);
/* Wrap Colormap functions */
DMX_WRAP(CreateColormap, dmxCreateColormap, dmxScreen, pScreen);
DMX_WRAP(DestroyColormap, dmxDestroyColormap, dmxScreen, pScreen);
DMX_WRAP(InstallColormap, dmxInstallColormap, dmxScreen, pScreen);
DMX_WRAP(StoreColors, dmxStoreColors, dmxScreen, pScreen);
/* Wrap Shape functions */
DMX_WRAP(SetShape, dmxSetShape, dmxScreen, pScreen);
}
/* Wrap Shape functions */
DMX_WRAP(SetShape, dmxSetShape, dmxScreen, pScreen);
if (!dmxCreateDefColormap(pScreen))
return FALSE;
@ -370,22 +333,13 @@ dmxBECloseScreen(ScreenPtr pScreen)
XDestroyWindow(dmxScreen->beDisplay, dmxScreen->scrnWin);
dmxScreen->scrnWin = (Window) 0;
if (dmxShadowFB) {
/* Free the shadow GC and image assocated with the back-end server */
XFreeGC(dmxScreen->beDisplay, dmxScreen->shadowGC);
dmxScreen->shadowGC = NULL;
XFree(dmxScreen->shadowFBImage);
dmxScreen->shadowFBImage = NULL;
}
else {
/* Free the default drawables */
for (i = 0; i < dmxScreen->beNumPixmapFormats; i++) {
if (dmxScreen->scrnDefDrawables[i]) {
XFreePixmap(dmxScreen->beDisplay,
dmxScreen->scrnDefDrawables[i]);
dmxScreen->scrnDefDrawables[i] = (Drawable) 0;
}
}
/* Free the default drawables */
for (i = 0; i < dmxScreen->beNumPixmapFormats; i++) {
if (dmxScreen->scrnDefDrawables[i]) {
XFreePixmap(dmxScreen->beDisplay,
dmxScreen->scrnDefDrawables[i]);
dmxScreen->scrnDefDrawables[i] = (Drawable) 0;
}
}
/* Free resources allocated during initialization (in dmxinit.c) */
@ -432,48 +386,41 @@ dmxCloseScreen(ScreenPtr pScreen)
dmxResetFonts();
}
if (dmxShadowFB) {
/* Free the shadow framebuffer */
free(dmxScreen->shadow);
}
else {
/* Unwrap Shape functions */
DMX_UNWRAP(SetShape, dmxScreen, pScreen);
/* Unwrap Shape functions */
DMX_UNWRAP(SetShape, dmxScreen, pScreen);
/* Unwrap the pScreen functions */
DMX_UNWRAP(CreateGC, dmxScreen, pScreen);
/* Unwrap the pScreen functions */
DMX_UNWRAP(CreateGC, dmxScreen, pScreen);
DMX_UNWRAP(CreateWindow, dmxScreen, pScreen);
DMX_UNWRAP(DestroyWindow, dmxScreen, pScreen);
DMX_UNWRAP(PositionWindow, dmxScreen, pScreen);
DMX_UNWRAP(ChangeWindowAttributes, dmxScreen, pScreen);
DMX_UNWRAP(RealizeWindow, dmxScreen, pScreen);
DMX_UNWRAP(UnrealizeWindow, dmxScreen, pScreen);
DMX_UNWRAP(RestackWindow, dmxScreen, pScreen);
DMX_UNWRAP(WindowExposures, dmxScreen, pScreen);
DMX_UNWRAP(CopyWindow, dmxScreen, pScreen);
DMX_UNWRAP(CreateWindow, dmxScreen, pScreen);
DMX_UNWRAP(DestroyWindow, dmxScreen, pScreen);
DMX_UNWRAP(PositionWindow, dmxScreen, pScreen);
DMX_UNWRAP(ChangeWindowAttributes, dmxScreen, pScreen);
DMX_UNWRAP(RealizeWindow, dmxScreen, pScreen);
DMX_UNWRAP(UnrealizeWindow, dmxScreen, pScreen);
DMX_UNWRAP(RestackWindow, dmxScreen, pScreen);
DMX_UNWRAP(WindowExposures, dmxScreen, pScreen);
DMX_UNWRAP(CopyWindow, dmxScreen, pScreen);
DMX_UNWRAP(ResizeWindow, dmxScreen, pScreen);
DMX_UNWRAP(ReparentWindow, dmxScreen, pScreen);
DMX_UNWRAP(ResizeWindow, dmxScreen, pScreen);
DMX_UNWRAP(ReparentWindow, dmxScreen, pScreen);
DMX_UNWRAP(ChangeBorderWidth, dmxScreen, pScreen);
DMX_UNWRAP(ChangeBorderWidth, dmxScreen, pScreen);
DMX_UNWRAP(GetImage, dmxScreen, pScreen);
DMX_UNWRAP(GetSpans, dmxScreen, pScreen);
DMX_UNWRAP(GetImage, dmxScreen, pScreen);
DMX_UNWRAP(GetSpans, dmxScreen, pScreen);
DMX_UNWRAP(CreatePixmap, dmxScreen, pScreen);
DMX_UNWRAP(DestroyPixmap, dmxScreen, pScreen);
DMX_UNWRAP(BitmapToRegion, dmxScreen, pScreen);
DMX_UNWRAP(CreatePixmap, dmxScreen, pScreen);
DMX_UNWRAP(DestroyPixmap, dmxScreen, pScreen);
DMX_UNWRAP(BitmapToRegion, dmxScreen, pScreen);
DMX_UNWRAP(RealizeFont, dmxScreen, pScreen);
DMX_UNWRAP(UnrealizeFont, dmxScreen, pScreen);
DMX_UNWRAP(RealizeFont, dmxScreen, pScreen);
DMX_UNWRAP(UnrealizeFont, dmxScreen, pScreen);
DMX_UNWRAP(CreateColormap, dmxScreen, pScreen);
DMX_UNWRAP(DestroyColormap, dmxScreen, pScreen);
DMX_UNWRAP(InstallColormap, dmxScreen, pScreen);
DMX_UNWRAP(StoreColors, dmxScreen, pScreen);
}
DMX_UNWRAP(CreateColormap, dmxScreen, pScreen);
DMX_UNWRAP(DestroyColormap, dmxScreen, pScreen);
DMX_UNWRAP(InstallColormap, dmxScreen, pScreen);
DMX_UNWRAP(StoreColors, dmxScreen, pScreen);
DMX_UNWRAP(SaveScreen, dmxScreen, pScreen);

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 \
glxswap.c \
glxswap.h \
glxutil.c \
glxutil.h \
glxvendor.c \
glxvendor.h \

View File

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

View File

@ -88,12 +88,6 @@ ResetClientState(int clientIndex)
memset(cl, 0, sizeof(__GLXclientState));
cl->be_displays = keep_be_displays;
/*
** By default, assume that the client supports
** GLX major version 1 minor version 0 protocol.
*/
cl->GLClientmajorVersion = 1;
cl->GLClientminorVersion = 0;
free(cl->GLClientextensions);
memset(cl->be_displays, 0, screenInfo.numScreens * sizeof(Display *));

View File

@ -119,8 +119,6 @@ struct __GLXclientStateRec {
/* Back pointer to X client record */
ClientPtr client;
int GLClientmajorVersion;
int GLClientminorVersion;
char *GLClientextensions;
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.
*/
extern void __glXNop(void);
/* context helper routines */
extern __GLXcontext *__glXLookupContextByTag(__GLXclientState *, GLXContextTag);
extern DrawablePtr __glXLookupDrawableByTag(__GLXclientState * cl,

View File

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

View File

@ -502,11 +502,6 @@ dmxCommonMouOn(DevicePtr pDev)
GETDMXINPUTFROMPRIV;
priv->eventMask |= DMX_POINTER_EVENT_MASK;
if (dmxShadowFB) {
XWarpPointer(priv->display, priv->window, priv->window,
0, 0, 0, 0, priv->initPointerX, priv->initPointerY);
dmxSync(&dmxScreens[dmxInput->scrnIdx], TRUE);
}
if (!priv->be) {
XSelectInput(priv->display, priv->window, priv->eventMask);
AddEnabledDevice(XConnectionNumber(priv->display));

View File

@ -179,16 +179,6 @@ will switch to another VC in local (raw) mode.
.RE
.sp
.TP 8
.BI "-shadowfb"
This option turns on (legacy) support for the shadow frame buffer.
.sp
.TP 8
.BI "-noshadowfb"
This option turns off (legacy) support for the shadow frame buffer.
Note that this option has been deprecated and will be removed in the
next release.
.sp
.TP 8
.BI "-nomulticursor"
This option turns off support for displaying multiple cursors on
overlapped back-end displays. This option is available for testing and

View File

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

View File

@ -28,6 +28,7 @@
#endif
#include "ephyr.h"
#include "ephyrlog.h"
#include "glx_extinit.h"
extern Window EphyrPreExistingHostWin;
extern Bool EphyrWantGrayScale;
@ -47,6 +48,22 @@ extern KdKeyboardDriver LinuxEvdevKeyboardDriver;
void processScreenArg(const char *screen_size, char *parent_id);
static const
ExtensionModule ephyrExtensions[] = {
#ifdef GLXEXT
{GlxExtensionInit, "GLX", &noGlxExtension},
#endif
};
static void
ephyrExtensionInit(void)
{
int i;
for (i = 0; i < ARRAY_SIZE(ephyrExtensions); i++)
LoadExtension(&ephyrExtensions[i], TRUE);
}
void
InitCard(char *name)
{
@ -57,6 +74,9 @@ InitCard(char *name)
void
InitOutput(ScreenInfo * pScreenInfo, int argc, char **argv)
{
if (serverGeneration == 1)
ephyrExtensionInit();
KdInitOutput(pScreenInfo, argc, argv);
}

View File

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

View File

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

View File

@ -257,16 +257,3 @@ xf86LinearVidMem(void)
xf86InitVidMem();
return vidMemInfo.linearSupported;
}
void
xf86MapReadSideEffects(int ScreenNum, int Flags, pointer base,
unsigned long Size)
{
if (!(Flags & VIDMEM_READSIDEEFFECT))
return;
if (!vidMemInfo.initialised || !vidMemInfo.readSideEffects)
return;
vidMemInfo.readSideEffects(ScreenNum, base, Size);
}

View File

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

View File

@ -136,8 +136,6 @@ extern _X_EXPORT _X_DEPRECATED pointer xf86MapVidMem(int, int, unsigned long,
unsigned long);
extern _X_EXPORT _X_DEPRECATED void xf86UnMapVidMem(int, pointer,
unsigned long);
extern _X_EXPORT _X_DEPRECATED void xf86MapReadSideEffects(int, int, pointer,
unsigned long);
extern _X_EXPORT int xf86ReadBIOS(unsigned long, unsigned long, unsigned char *,
int);
extern _X_EXPORT Bool xf86EnableIO(void);

View File

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

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
xnestGetImage(DrawablePtr pDrawable, int x, int y, int w, int h,
unsigned int format, unsigned long planeMask, char *pImage)
{
XImage *ximage;
int length;
int (*old_handler)(Display*, XErrorEvent*);
/* we may get BadMatch error when xnest window is minimized */
XSync(xnestDisplay, False);
old_handler = XSetErrorHandler (xnestIgnoreErrorHandler);
ximage = XGetImage(xnestDisplay, xnestDrawable(pDrawable),
x, y, w, h, planeMask, format);
XSync(xnestDisplay, False);
XSetErrorHandler(old_handler);
if (ximage) {
length = ximage->bytes_per_line * ximage->height;

View File

@ -78,6 +78,21 @@ xnestDestroyPixmap(PixmapPtr pPixmap)
return TRUE;
}
Bool
xnestModifyPixmapHeader(PixmapPtr pPixmap, int width, int height, int depth,
int bitsPerPixel, int devKind, pointer pPixData)
{
if(!xnestPixmapPriv(pPixmap)->pixmap && width > 0 && height > 0) {
xnestPixmapPriv(pPixmap)->pixmap =
XCreatePixmap(xnestDisplay,
xnestDefaultWindows[pPixmap->drawable.pScreen->myNum],
width, height, depth);
}
return miModifyPixmapHeader(pPixmap, width, height, depth,
bitsPerPixel, devKind, pPixData);
}
RegionPtr
xnestPixmapToRegion(PixmapPtr pPixmap)
{

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -61,7 +61,6 @@ typedef enum { ClientStateInitial,
ClientStateGone
} ClientState;
#ifdef XFIXES
typedef struct _saveSet {
struct _Window *windowPtr;
Bool toRoot;
@ -73,16 +72,6 @@ typedef struct _saveSet {
#define SaveSetAssignWindow(ss,w) ((ss).windowPtr = (w))
#define SaveSetAssignToRoot(ss,tr) ((ss).toRoot = (tr))
#define SaveSetAssignMap(ss,m) ((ss).map = (m))
#else
typedef struct _Window *SaveSetElt;
#define SaveSetWindow(ss) (ss)
#define SaveSetToRoot(ss) FALSE
#define SaveSetShouldMap(ss) TRUE
#define SaveSetAssignWindow(ss,w) ((ss) = (w))
#define SaveSetAssignToRoot(ss,tr)
#define SaveSetAssignMap(ss,m)
#endif
typedef struct _Client {
pointer requestBuffer;

View File

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

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.
*/
static inline Bool
static inline int
xorg_list_is_empty(struct xorg_list *head)
{
return head->next == head;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -119,51 +119,6 @@ getDrawableDamageRef(DrawablePtr pDrawable)
DamagePtr *pPrev = (DamagePtr *) \
dixLookupPrivateAddr(&(pWindow)->devPrivates, damageWinPrivateKey)
static void
damageReportDamagePostRendering(DamagePtr pDamage, RegionPtr pOldDamage,
RegionPtr pDamageRegion)
{
BoxRec tmpBox;
RegionRec tmpRegion, newDamage;
Bool was_empty;
RegionUnion(&newDamage, pOldDamage, pDamageRegion);
switch (pDamage->damageLevel) {
case DamageReportRawRegion:
(*pDamage->damageReportPostRendering) (pDamage, pDamageRegion,
pDamage->closure);
break;
case DamageReportDeltaRegion:
RegionNull(&tmpRegion);
RegionSubtract(&tmpRegion, pDamageRegion, pOldDamage);
if (RegionNotEmpty(&tmpRegion)) {
(*pDamage->damageReportPostRendering) (pDamage, &tmpRegion,
pDamage->closure);
}
RegionUninit(&tmpRegion);
break;
case DamageReportBoundingBox:
tmpBox = *RegionExtents(pOldDamage);
if (!BOX_SAME(&tmpBox, RegionExtents(&newDamage))) {
(*pDamage->damageReportPostRendering) (pDamage, &newDamage,
pDamage->closure);
}
break;
case DamageReportNonEmpty:
was_empty = !RegionNotEmpty(pOldDamage);
if (was_empty && RegionNotEmpty(&newDamage)) {
(*pDamage->damageReportPostRendering) (pDamage, &newDamage,
pDamage->closure);
}
break;
case DamageReportNone:
break;
}
RegionUninit(&newDamage);
}
#if DAMAGE_DEBUG_ENABLE
static void
_damageRegionAppend(DrawablePtr pDrawable, RegionPtr pRegion, Bool clip,
@ -299,14 +254,10 @@ damageRegionAppend(DrawablePtr pDrawable, RegionPtr pRegion, Bool clip,
RegionTranslate(pDamageRegion, -draw_x, -draw_y);
/* Store damage region if needed after submission. */
if (pDamage->reportAfter || pDamage->damageMarker)
if (pDamage->reportAfter)
RegionUnion(&pDamage->pendingDamage,
&pDamage->pendingDamage, pDamageRegion);
/* Duplicate current damage if needed. */
if (pDamage->damageMarker)
RegionCopy(&pDamage->backupDamage, &pDamage->damage);
/* Report damage now, if desired. */
if (!pDamage->reportAfter) {
if (pDamage->damageReport)
@ -335,12 +286,6 @@ damageRegionProcessPending(DrawablePtr pDrawable)
drawableDamage(pDrawable);
for (; pDamage != NULL; pDamage = pDamage->pNext) {
/* submit damage marker whenever possible. */
if (pDamage->damageMarker)
(*pDamage->damageMarker) (pDrawable, pDamage,
&pDamage->backupDamage,
&pDamage->pendingDamage,
pDamage->closure);
if (pDamage->reportAfter) {
/* It's possible that there is only interest in postRendering reporting. */
if (pDamage->damageReport)
@ -350,10 +295,8 @@ damageRegionProcessPending(DrawablePtr pDrawable)
&pDamage->pendingDamage);
}
if (pDamage->reportAfter || pDamage->damageMarker)
if (pDamage->reportAfter)
RegionEmpty(&pDamage->pendingDamage);
if (pDamage->damageMarker)
RegionEmpty(&pDamage->backupDamage);
}
}
@ -1336,7 +1279,7 @@ damageDamageChars(DrawablePtr pDrawable,
#define TT_POLY16 2
#define TT_IMAGE16 3
static int
static void
damageText(DrawablePtr pDrawable,
GCPtr pGC,
int x,
@ -1345,39 +1288,29 @@ damageText(DrawablePtr pDrawable,
char *chars, FontEncoding fontEncoding, Bool textType)
{
CharInfoPtr *charinfo;
CharInfoPtr *info;
unsigned long i;
unsigned int n;
int w;
Bool imageblt;
imageblt = (textType == TT_IMAGE8) || (textType == TT_IMAGE16);
if (!checkGCDamage(pDrawable, pGC))
return;
charinfo = malloc(count * sizeof(CharInfoPtr));
if (!charinfo)
return x;
return;
GetGlyphs(pGC->font, count, (unsigned char *) chars,
fontEncoding, &i, charinfo);
n = (unsigned int) i;
w = 0;
if (!imageblt)
for (info = charinfo; i--; info++)
w += (*info)->metrics.characterWidth;
if (n != 0) {
damageDamageChars(pDrawable, pGC->font, x + pDrawable->x,
y + pDrawable->y, n, charinfo, imageblt,
pGC->subWindowMode);
if (imageblt)
(*pGC->ops->ImageGlyphBlt) (pDrawable, pGC, x, y, n, charinfo,
FONTGLYPHS(pGC->font));
else
(*pGC->ops->PolyGlyphBlt) (pDrawable, pGC, x, y, n, charinfo,
FONTGLYPHS(pGC->font));
}
free(charinfo);
return x + w;
}
static int
@ -1385,12 +1318,9 @@ damagePolyText8(DrawablePtr pDrawable,
GCPtr pGC, int x, int y, int count, char *chars)
{
DAMAGE_GC_OP_PROLOGUE(pGC, pDrawable);
if (checkGCDamage(pDrawable, pGC))
x = damageText(pDrawable, pGC, x, y, (unsigned long) count, chars,
Linear8Bit, TT_POLY8);
else
x = (*pGC->ops->PolyText8) (pDrawable, pGC, x, y, count, chars);
damageText(pDrawable, pGC, x, y, (unsigned long) count, chars, Linear8Bit,
TT_POLY8);
x = (*pGC->ops->PolyText8) (pDrawable, pGC, x, y, count, chars);
damageRegionProcessPending(pDrawable);
DAMAGE_GC_OP_EPILOGUE(pGC, pDrawable);
return x;
@ -1401,14 +1331,10 @@ damagePolyText16(DrawablePtr pDrawable,
GCPtr pGC, int x, int y, int count, unsigned short *chars)
{
DAMAGE_GC_OP_PROLOGUE(pGC, pDrawable);
if (checkGCDamage(pDrawable, pGC))
x = damageText(pDrawable, pGC, x, y, (unsigned long) count,
(char *) chars,
FONTLASTROW(pGC->font) == 0 ? Linear16Bit : TwoD16Bit,
TT_POLY16);
else
x = (*pGC->ops->PolyText16) (pDrawable, pGC, x, y, count, chars);
damageText(pDrawable, pGC, x, y, (unsigned long) count, (char *) chars,
FONTLASTROW(pGC->font) == 0 ? Linear16Bit : TwoD16Bit,
TT_POLY16);
x = (*pGC->ops->PolyText16) (pDrawable, pGC, x, y, count, chars);
damageRegionProcessPending(pDrawable);
DAMAGE_GC_OP_EPILOGUE(pGC, pDrawable);
return x;
@ -1419,12 +1345,9 @@ damageImageText8(DrawablePtr pDrawable,
GCPtr pGC, int x, int y, int count, char *chars)
{
DAMAGE_GC_OP_PROLOGUE(pGC, pDrawable);
if (checkGCDamage(pDrawable, pGC))
damageText(pDrawable, pGC, x, y, (unsigned long) count, chars,
Linear8Bit, TT_IMAGE8);
else
(*pGC->ops->ImageText8) (pDrawable, pGC, x, y, count, chars);
damageText(pDrawable, pGC, x, y, (unsigned long) count, chars, Linear8Bit,
TT_IMAGE8);
(*pGC->ops->ImageText8) (pDrawable, pGC, x, y, count, chars);
damageRegionProcessPending(pDrawable);
DAMAGE_GC_OP_EPILOGUE(pGC, pDrawable);
}
@ -1434,13 +1357,10 @@ damageImageText16(DrawablePtr pDrawable,
GCPtr pGC, int x, int y, int count, unsigned short *chars)
{
DAMAGE_GC_OP_PROLOGUE(pGC, pDrawable);
if (checkGCDamage(pDrawable, pGC))
damageText(pDrawable, pGC, x, y, (unsigned long) count, (char *) chars,
FONTLASTROW(pGC->font) == 0 ? Linear16Bit : TwoD16Bit,
TT_IMAGE16);
else
(*pGC->ops->ImageText16) (pDrawable, pGC, x, y, count, chars);
damageText(pDrawable, pGC, x, y, (unsigned long) count, (char *) chars,
FONTLASTROW(pGC->font) == 0 ? Linear16Bit : TwoD16Bit,
TT_IMAGE16);
(*pGC->ops->ImageText16) (pDrawable, pGC, x, y, count, chars);
damageRegionProcessPending(pDrawable);
DAMAGE_GC_OP_EPILOGUE(pGC, pDrawable);
}
@ -1637,7 +1557,6 @@ damageDestroyWindow(WindowPtr pWindow)
damageScrPriv(pScreen);
while ((pDamage = damageGetWinPriv(pWindow))) {
DamageUnregister(&pWindow->drawable, pDamage);
DamageDestroy(pDamage);
}
unwrap(pScrPriv, pScreen, DestroyWindow);
@ -1786,9 +1705,7 @@ DamageCreate(DamageReportFunc damageReport,
pDamage->reportAfter = FALSE;
pDamage->damageReport = damageReport;
pDamage->damageReportPostRendering = NULL;
pDamage->damageDestroy = damageDestroy;
pDamage->damageMarker = NULL;
pDamage->pScreen = pScreen;
(*pScrPriv->funcs.Create) (pDamage);
@ -1844,8 +1761,9 @@ DamageDrawInternal(ScreenPtr pScreen, Bool enable)
}
void
DamageUnregister(DrawablePtr pDrawable, DamagePtr pDamage)
DamageUnregister(DamagePtr pDamage)
{
DrawablePtr pDrawable = pDamage->pDrawable;
ScreenPtr pScreen = pDrawable->pScreen;
damageScrPriv(pScreen);
@ -1888,6 +1806,9 @@ DamageDestroy(DamagePtr pDamage)
damageScrPriv(pScreen);
if (pDamage->pDrawable)
DamageUnregister(pDamage);
if (pDamage->damageDestroy)
(*pDamage->damageDestroy) (pDamage, pDamage->closure);
(*pScrPriv->funcs.Destroy) (pDamage);
@ -1956,17 +1877,6 @@ DamageRegionProcessPending(DrawablePtr pDrawable)
damageRegionProcessPending(pDrawable);
}
/* If a damage marker is provided, then this function must be called after rendering is done. */
/* Please do call back so any future enhancements can assume this function is called. */
/* There are no strict timing requirements for calling this function, just as soon as (is cheaply) possible. */
void
DamageRegionRendered(DrawablePtr pDrawable, DamagePtr pDamage,
RegionPtr pOldDamage, RegionPtr pRegion)
{
if (pDamage->damageReportPostRendering)
damageReportDamagePostRendering(pDamage, pOldDamage, pRegion);
}
/* This call is very odd, i'm leaving it intact for API sake, but please don't use it. */
void
DamageDamageRegion(DrawablePtr pDrawable, RegionPtr pRegion)
@ -1986,15 +1896,6 @@ DamageSetReportAfterOp(DamagePtr pDamage, Bool reportAfter)
pDamage->reportAfter = reportAfter;
}
void
DamageSetPostRenderingFunctions(DamagePtr pDamage,
DamageReportFunc damageReportPostRendering,
DamageMarkerFunc damageMarker)
{
pDamage->damageReportPostRendering = damageReportPostRendering;
pDamage->damageMarker = damageMarker;
}
DamageScreenFuncsPtr
DamageGetScreenFuncs(ScreenPtr pScreen)
{

View File

@ -41,12 +41,6 @@ typedef void (*DamageReportFunc) (DamagePtr pDamage, RegionPtr pRegion,
void *closure);
typedef void (*DamageDestroyFunc) (DamagePtr pDamage, void *closure);
/* It's the responsibility of the driver to duplicate both regions. */
/* At some point DamageRegionRendered() must be called. */
typedef void (*DamageMarkerFunc) (DrawablePtr pDrawable, DamagePtr pDamage,
RegionPtr pOldDamage, RegionPtr pRegion,
void *closure);
typedef void (*DamageScreenCreateFunc) (DamagePtr);
typedef void (*DamageScreenRegisterFunc) (DrawablePtr, DamagePtr);
typedef void (*DamageScreenUnregisterFunc) (DrawablePtr, DamagePtr);
@ -80,7 +74,7 @@ extern _X_EXPORT void
DamageRegister(DrawablePtr pDrawable, DamagePtr pDamage);
extern _X_EXPORT void
DamageUnregister(DrawablePtr pDrawable, DamagePtr pDamage);
DamageUnregister(DamagePtr pDamage);
extern _X_EXPORT void
DamageDestroy(DamagePtr pDamage);
@ -105,12 +99,6 @@ extern _X_EXPORT void
extern _X_EXPORT void
DamageRegionProcessPending(DrawablePtr pDrawable);
/* Call this some time after rendering is done, only relevant when a damageMarker is provided. */
extern _X_EXPORT void
DamageRegionRendered(DrawablePtr pDrawable, DamagePtr pDamage,
RegionPtr pOldDamage, RegionPtr pRegion);
/* Call this when you create a new Damage and you wish to send an initial damage message (to it). */
extern _X_EXPORT void
DamageReportDamage(DamagePtr pDamage, RegionPtr pDamageRegion);
@ -122,12 +110,6 @@ extern _X_EXPORT void
extern _X_EXPORT void
DamageSetReportAfterOp(DamagePtr pDamage, Bool reportAfter);
extern _X_EXPORT void
DamageSetPostRenderingFunctions(DamagePtr pDamage,
DamageReportFunc damageReportPostRendering,
DamageMarkerFunc damageMarker);
extern _X_EXPORT DamageScreenFuncsPtr DamageGetScreenFuncs(ScreenPtr);
#endif /* _DAMAGE_H_ */

View File

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

View File

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

View File

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

67
os/io.c
View File

@ -206,6 +206,32 @@ YieldControlDeath(void)
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
ReadRequestFromClient(ClientPtr client)
{
@ -218,28 +244,7 @@ ReadRequestFromClient(ClientPtr client)
Bool need_header;
Bool move_header;
/* If an input buffer was empty, either free it if it is too big
* or link it into our list of free input buffers. This means that
* different clients can share the same input buffer (at different
* times). This was done to save memory.
*/
if (AvailableInput) {
if (AvailableInput != oc) {
register ConnectionInputPtr aci = AvailableInput->input;
if (aci->size > BUFWATERMARK) {
free(aci->buffer);
free(aci);
}
else {
aci->next = FreeInputs;
FreeInputs = aci;
}
AvailableInput->input = (ConnectionInputPtr) NULL;
}
AvailableInput = (OsCommPtr) NULL;
}
NextAvailableInput(oc);
/* make sure we have an input buffer */
@ -494,22 +499,8 @@ InsertFakeRequest(ClientPtr client, char *data, int count)
int fd = oc->fd;
int gotnow, moveup;
if (AvailableInput) {
if (AvailableInput != oc) {
ConnectionInputPtr aci = AvailableInput->input;
NextAvailableInput(oc);
if (aci->size > BUFWATERMARK) {
free(aci->buffer);
free(aci);
}
else {
aci->next = FreeInputs;
FreeInputs = aci;
}
AvailableInput->input = (ConnectionInputPtr) NULL;
}
AvailableInput = (OsCommPtr) NULL;
}
if (!oci) {
if ((oci = FreeInputs))
FreeInputs = oci->next;
@ -814,7 +805,7 @@ WriteToClient(ClientPtr who, int count, const void *__buf)
}
}
#endif
if (oco->count + count + padBytes > oco->size) {
if (oco->count == 0 || oco->count + count + padBytes > oco->size) {
FD_CLR(oc->fd, &OutputPending);
if (!XFD_ANYSET(&OutputPending)) {
CriticalOutputPending = FALSE;

View File

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

View File

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