Merge branch 'master' into input-api
Conflicts: config/udev.c hw/xfree86/common/xf86Helper.c hw/xfree86/common/xf86Module.h hw/xfree86/common/xf86Xinput.h hw/xfree86/os-support/linux/lnx_init.c Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
commit
eaf0b6a4d8
|
@ -56,8 +56,6 @@ DISTCHECK_CONFIGURE_FLAGS=\
|
||||||
--with-xkb-bin-directory=$(XKB_BIN_DIRECTORY) \
|
--with-xkb-bin-directory=$(XKB_BIN_DIRECTORY) \
|
||||||
--with-xkb-output='$${datadir}/X11/xkb/compiled'
|
--with-xkb-output='$${datadir}/X11/xkb/compiled'
|
||||||
|
|
||||||
DISTCLEANFILES = doltcompile doltlibtool
|
|
||||||
|
|
||||||
.PHONY: ChangeLog INSTALL
|
.PHONY: ChangeLog INSTALL
|
||||||
|
|
||||||
INSTALL:
|
INSTALL:
|
||||||
|
|
|
@ -40,18 +40,8 @@ from The Open Group.
|
||||||
#include "opaque.h"
|
#include "opaque.h"
|
||||||
#include "modinit.h"
|
#include "modinit.h"
|
||||||
|
|
||||||
static DISPATCH_PROC(ProcBigReqDispatch);
|
|
||||||
|
|
||||||
void BigReqExtensionInit(INITARGS);
|
void BigReqExtensionInit(INITARGS);
|
||||||
|
|
||||||
void
|
|
||||||
BigReqExtensionInit(INITARGS)
|
|
||||||
{
|
|
||||||
AddExtension(XBigReqExtensionName, 0, 0,
|
|
||||||
ProcBigReqDispatch, ProcBigReqDispatch,
|
|
||||||
NULL, StandardMinorOpcode);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
ProcBigReqDispatch (ClientPtr client)
|
ProcBigReqDispatch (ClientPtr client)
|
||||||
{
|
{
|
||||||
|
@ -78,3 +68,11 @@ ProcBigReqDispatch (ClientPtr client)
|
||||||
WriteToClient(client, sizeof(xBigReqEnableReply), (char *)&rep);
|
WriteToClient(client, sizeof(xBigReqEnableReply), (char *)&rep);
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
BigReqExtensionInit(INITARGS)
|
||||||
|
{
|
||||||
|
AddExtension(XBigReqExtensionName, 0, 0,
|
||||||
|
ProcBigReqDispatch, ProcBigReqDispatch,
|
||||||
|
NULL, StandardMinorOpcode);
|
||||||
|
}
|
||||||
|
|
|
@ -28,7 +28,6 @@
|
||||||
#endif
|
#endif
|
||||||
#include "windowstr.h"
|
#include "windowstr.h"
|
||||||
#include <X11/extensions/ge.h>
|
#include <X11/extensions/ge.h>
|
||||||
#include "registry.h"
|
|
||||||
|
|
||||||
#include "geint.h"
|
#include "geint.h"
|
||||||
#include "geext.h"
|
#include "geext.h"
|
||||||
|
|
88
Xext/saver.c
88
Xext/saver.c
|
@ -62,20 +62,6 @@ in this Software without prior written authorization from the X Consortium.
|
||||||
|
|
||||||
static int ScreenSaverEventBase = 0;
|
static int ScreenSaverEventBase = 0;
|
||||||
|
|
||||||
static DISPATCH_PROC(ProcScreenSaverQueryInfo);
|
|
||||||
static DISPATCH_PROC(ProcScreenSaverDispatch);
|
|
||||||
static DISPATCH_PROC(ProcScreenSaverQueryVersion);
|
|
||||||
static DISPATCH_PROC(ProcScreenSaverSelectInput);
|
|
||||||
static DISPATCH_PROC(ProcScreenSaverSetAttributes);
|
|
||||||
static DISPATCH_PROC(ProcScreenSaverUnsetAttributes);
|
|
||||||
static DISPATCH_PROC(ProcScreenSaverSuspend);
|
|
||||||
static DISPATCH_PROC(SProcScreenSaverDispatch);
|
|
||||||
static DISPATCH_PROC(SProcScreenSaverQueryInfo);
|
|
||||||
static DISPATCH_PROC(SProcScreenSaverQueryVersion);
|
|
||||||
static DISPATCH_PROC(SProcScreenSaverSelectInput);
|
|
||||||
static DISPATCH_PROC(SProcScreenSaverSetAttributes);
|
|
||||||
static DISPATCH_PROC(SProcScreenSaverUnsetAttributes);
|
|
||||||
static DISPATCH_PROC(SProcScreenSaverSuspend);
|
|
||||||
|
|
||||||
static Bool ScreenSaverHandle (
|
static Bool ScreenSaverHandle (
|
||||||
ScreenPtr /* pScreen */,
|
ScreenPtr /* pScreen */,
|
||||||
|
@ -237,45 +223,6 @@ static DevPrivateKeyRec ScreenPrivateKeyRec;
|
||||||
|
|
||||||
#define New(t) (malloc(sizeof (t)))
|
#define New(t) (malloc(sizeof (t)))
|
||||||
|
|
||||||
/****************
|
|
||||||
* ScreenSaverExtensionInit
|
|
||||||
*
|
|
||||||
* Called from InitExtensions in main() or from QueryExtension() if the
|
|
||||||
* extension is dynamically loaded.
|
|
||||||
*
|
|
||||||
****************/
|
|
||||||
|
|
||||||
void
|
|
||||||
ScreenSaverExtensionInit(INITARGS)
|
|
||||||
{
|
|
||||||
ExtensionEntry *extEntry;
|
|
||||||
int i;
|
|
||||||
ScreenPtr pScreen;
|
|
||||||
|
|
||||||
if (!dixRegisterPrivateKey(&ScreenPrivateKeyRec, PRIVATE_SCREEN, 0))
|
|
||||||
return;
|
|
||||||
|
|
||||||
AttrType = CreateNewResourceType(ScreenSaverFreeAttr, "SaverAttr");
|
|
||||||
SaverEventType = CreateNewResourceType(ScreenSaverFreeEvents,
|
|
||||||
"SaverEvent");
|
|
||||||
SuspendType = CreateNewResourceType(ScreenSaverFreeSuspend,
|
|
||||||
"SaverSuspend");
|
|
||||||
|
|
||||||
for (i = 0; i < screenInfo.numScreens; i++)
|
|
||||||
{
|
|
||||||
pScreen = screenInfo.screens[i];
|
|
||||||
SetScreenPrivate (pScreen, NULL);
|
|
||||||
}
|
|
||||||
if (AttrType && SaverEventType && SuspendType &&
|
|
||||||
(extEntry = AddExtension(ScreenSaverName, ScreenSaverNumberEvents, 0,
|
|
||||||
ProcScreenSaverDispatch, SProcScreenSaverDispatch,
|
|
||||||
NULL, StandardMinorOpcode)))
|
|
||||||
{
|
|
||||||
ScreenSaverEventBase = extEntry->eventBase;
|
|
||||||
EventSwapVector[ScreenSaverEventBase] = (EventSwapPtr) SScreenSaverNotifyEvent;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
CheckScreenPrivate (ScreenPtr pScreen)
|
CheckScreenPrivate (ScreenPtr pScreen)
|
||||||
{
|
{
|
||||||
|
@ -1412,7 +1359,7 @@ ProcScreenSaverSuspend (ClientPtr client)
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
static DISPATCH_PROC((*NormalVector[])) = {
|
static int (*NormalVector[]) (ClientPtr /* client */) = {
|
||||||
ProcScreenSaverQueryVersion,
|
ProcScreenSaverQueryVersion,
|
||||||
ProcScreenSaverQueryInfo,
|
ProcScreenSaverQueryInfo,
|
||||||
ProcScreenSaverSelectInput,
|
ProcScreenSaverSelectInput,
|
||||||
|
@ -1513,7 +1460,7 @@ SProcScreenSaverSuspend (ClientPtr client)
|
||||||
return ProcScreenSaverSuspend (client);
|
return ProcScreenSaverSuspend (client);
|
||||||
}
|
}
|
||||||
|
|
||||||
static DISPATCH_PROC((*SwappedVector[])) = {
|
static int (*SwappedVector[]) (ClientPtr /* client */) = {
|
||||||
SProcScreenSaverQueryVersion,
|
SProcScreenSaverQueryVersion,
|
||||||
SProcScreenSaverQueryInfo,
|
SProcScreenSaverQueryInfo,
|
||||||
SProcScreenSaverSelectInput,
|
SProcScreenSaverSelectInput,
|
||||||
|
@ -1531,3 +1478,34 @@ SProcScreenSaverDispatch (ClientPtr client)
|
||||||
return (*SwappedVector[stuff->data])(client);
|
return (*SwappedVector[stuff->data])(client);
|
||||||
return BadRequest;
|
return BadRequest;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ScreenSaverExtensionInit(INITARGS)
|
||||||
|
{
|
||||||
|
ExtensionEntry *extEntry;
|
||||||
|
int i;
|
||||||
|
ScreenPtr pScreen;
|
||||||
|
|
||||||
|
if (!dixRegisterPrivateKey(&ScreenPrivateKeyRec, PRIVATE_SCREEN, 0))
|
||||||
|
return;
|
||||||
|
|
||||||
|
AttrType = CreateNewResourceType(ScreenSaverFreeAttr, "SaverAttr");
|
||||||
|
SaverEventType = CreateNewResourceType(ScreenSaverFreeEvents,
|
||||||
|
"SaverEvent");
|
||||||
|
SuspendType = CreateNewResourceType(ScreenSaverFreeSuspend,
|
||||||
|
"SaverSuspend");
|
||||||
|
|
||||||
|
for (i = 0; i < screenInfo.numScreens; i++)
|
||||||
|
{
|
||||||
|
pScreen = screenInfo.screens[i];
|
||||||
|
SetScreenPrivate (pScreen, NULL);
|
||||||
|
}
|
||||||
|
if (AttrType && SaverEventType && SuspendType &&
|
||||||
|
(extEntry = AddExtension(ScreenSaverName, ScreenSaverNumberEvents, 0,
|
||||||
|
ProcScreenSaverDispatch, SProcScreenSaverDispatch,
|
||||||
|
NULL, StandardMinorOpcode)))
|
||||||
|
{
|
||||||
|
ScreenSaverEventBase = extEntry->eventBase;
|
||||||
|
EventSwapVector[ScreenSaverEventBase] = (EventSwapPtr) SScreenSaverNotifyEvent;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
54
Xext/shape.c
54
Xext/shape.c
|
@ -68,26 +68,6 @@ static void SShapeNotifyEvent(
|
||||||
* externally by the Xfixes extension and are now defined in window.h
|
* externally by the Xfixes extension and are now defined in window.h
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static DISPATCH_PROC(ProcShapeCombine);
|
|
||||||
static DISPATCH_PROC(ProcShapeDispatch);
|
|
||||||
static DISPATCH_PROC(ProcShapeGetRectangles);
|
|
||||||
static DISPATCH_PROC(ProcShapeInputSelected);
|
|
||||||
static DISPATCH_PROC(ProcShapeMask);
|
|
||||||
static DISPATCH_PROC(ProcShapeOffset);
|
|
||||||
static DISPATCH_PROC(ProcShapeQueryExtents);
|
|
||||||
static DISPATCH_PROC(ProcShapeQueryVersion);
|
|
||||||
static DISPATCH_PROC(ProcShapeRectangles);
|
|
||||||
static DISPATCH_PROC(ProcShapeSelectInput);
|
|
||||||
static DISPATCH_PROC(SProcShapeCombine);
|
|
||||||
static DISPATCH_PROC(SProcShapeDispatch);
|
|
||||||
static DISPATCH_PROC(SProcShapeGetRectangles);
|
|
||||||
static DISPATCH_PROC(SProcShapeInputSelected);
|
|
||||||
static DISPATCH_PROC(SProcShapeMask);
|
|
||||||
static DISPATCH_PROC(SProcShapeOffset);
|
|
||||||
static DISPATCH_PROC(SProcShapeQueryExtents);
|
|
||||||
static DISPATCH_PROC(SProcShapeQueryVersion);
|
|
||||||
static DISPATCH_PROC(SProcShapeRectangles);
|
|
||||||
static DISPATCH_PROC(SProcShapeSelectInput);
|
|
||||||
|
|
||||||
#ifdef PANORAMIX
|
#ifdef PANORAMIX
|
||||||
#include "panoramiX.h"
|
#include "panoramiX.h"
|
||||||
|
@ -122,23 +102,6 @@ typedef struct _ShapeEvent {
|
||||||
*
|
*
|
||||||
****************/
|
****************/
|
||||||
|
|
||||||
void
|
|
||||||
ShapeExtensionInit(void)
|
|
||||||
{
|
|
||||||
ExtensionEntry *extEntry;
|
|
||||||
|
|
||||||
ClientType = CreateNewResourceType(ShapeFreeClient, "ShapeClient");
|
|
||||||
ShapeEventType = CreateNewResourceType(ShapeFreeEvents, "ShapeEvent");
|
|
||||||
if (ClientType && ShapeEventType &&
|
|
||||||
(extEntry = AddExtension(SHAPENAME, ShapeNumberEvents, 0,
|
|
||||||
ProcShapeDispatch, SProcShapeDispatch,
|
|
||||||
NULL, StandardMinorOpcode)))
|
|
||||||
{
|
|
||||||
ShapeEventBase = extEntry->eventBase;
|
|
||||||
EventSwapVector[ShapeEventBase] = (EventSwapPtr) SShapeNotifyEvent;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
RegionOperate (
|
RegionOperate (
|
||||||
ClientPtr client,
|
ClientPtr client,
|
||||||
|
@ -1278,3 +1241,20 @@ SProcShapeDispatch (ClientPtr client)
|
||||||
return BadRequest;
|
return BadRequest;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ShapeExtensionInit(void)
|
||||||
|
{
|
||||||
|
ExtensionEntry *extEntry;
|
||||||
|
|
||||||
|
ClientType = CreateNewResourceType(ShapeFreeClient, "ShapeClient");
|
||||||
|
ShapeEventType = CreateNewResourceType(ShapeFreeEvents, "ShapeEvent");
|
||||||
|
if (ClientType && ShapeEventType &&
|
||||||
|
(extEntry = AddExtension(SHAPENAME, ShapeNumberEvents, 0,
|
||||||
|
ProcShapeDispatch, SProcShapeDispatch,
|
||||||
|
NULL, StandardMinorOpcode)))
|
||||||
|
{
|
||||||
|
ShapeEventBase = extEntry->eventBase;
|
||||||
|
EventSwapVector[ShapeEventBase] = (EventSwapPtr) SShapeNotifyEvent;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
557
Xext/shm.c
557
Xext/shm.c
|
@ -120,20 +120,6 @@ static void SShmCompletionEvent(
|
||||||
|
|
||||||
static Bool ShmDestroyPixmap (PixmapPtr pPixmap);
|
static Bool ShmDestroyPixmap (PixmapPtr pPixmap);
|
||||||
|
|
||||||
static DISPATCH_PROC(ProcShmAttach);
|
|
||||||
static DISPATCH_PROC(ProcShmCreatePixmap);
|
|
||||||
static DISPATCH_PROC(ProcShmDetach);
|
|
||||||
static DISPATCH_PROC(ProcShmDispatch);
|
|
||||||
static DISPATCH_PROC(ProcShmGetImage);
|
|
||||||
static DISPATCH_PROC(ProcShmPutImage);
|
|
||||||
static DISPATCH_PROC(ProcShmQueryVersion);
|
|
||||||
static DISPATCH_PROC(SProcShmAttach);
|
|
||||||
static DISPATCH_PROC(SProcShmCreatePixmap);
|
|
||||||
static DISPATCH_PROC(SProcShmDetach);
|
|
||||||
static DISPATCH_PROC(SProcShmDispatch);
|
|
||||||
static DISPATCH_PROC(SProcShmGetImage);
|
|
||||||
static DISPATCH_PROC(SProcShmPutImage);
|
|
||||||
static DISPATCH_PROC(SProcShmQueryVersion);
|
|
||||||
|
|
||||||
static unsigned char ShmReqCode;
|
static unsigned char ShmReqCode;
|
||||||
int ShmCompletionCode;
|
int ShmCompletionCode;
|
||||||
|
@ -254,56 +240,6 @@ ShmRegisterPrivates(void)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
ShmExtensionInit(INITARGS)
|
|
||||||
{
|
|
||||||
ExtensionEntry *extEntry;
|
|
||||||
int i;
|
|
||||||
|
|
||||||
#ifdef MUST_CHECK_FOR_SHM_SYSCALL
|
|
||||||
if (!CheckForShmSyscall())
|
|
||||||
{
|
|
||||||
ErrorF("MIT-SHM extension disabled due to lack of kernel support\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (!ShmRegisterPrivates())
|
|
||||||
return;
|
|
||||||
|
|
||||||
sharedPixmaps = xFalse;
|
|
||||||
{
|
|
||||||
sharedPixmaps = xTrue;
|
|
||||||
for (i = 0; i < screenInfo.numScreens; i++)
|
|
||||||
{
|
|
||||||
ShmScrPrivateRec *screen_priv = ShmInitScreenPriv(screenInfo.screens[i]);
|
|
||||||
if (!screen_priv->shmFuncs)
|
|
||||||
screen_priv->shmFuncs = &miFuncs;
|
|
||||||
if (!screen_priv->shmFuncs->CreatePixmap)
|
|
||||||
sharedPixmaps = xFalse;
|
|
||||||
}
|
|
||||||
if (sharedPixmaps)
|
|
||||||
for (i = 0; i < screenInfo.numScreens; i++)
|
|
||||||
{
|
|
||||||
ShmScrPrivateRec *screen_priv = ShmGetScreenPriv(screenInfo.screens[i]);
|
|
||||||
screen_priv->destroyPixmap = screenInfo.screens[i]->DestroyPixmap;
|
|
||||||
screenInfo.screens[i]->DestroyPixmap = ShmDestroyPixmap;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ShmSegType = CreateNewResourceType(ShmDetachSegment, "ShmSeg");
|
|
||||||
if (ShmSegType &&
|
|
||||||
(extEntry = AddExtension(SHMNAME, ShmNumberEvents, ShmNumberErrors,
|
|
||||||
ProcShmDispatch, SProcShmDispatch,
|
|
||||||
ShmResetProc, StandardMinorOpcode)))
|
|
||||||
{
|
|
||||||
ShmReqCode = (unsigned char)extEntry->base;
|
|
||||||
ShmCompletionCode = extEntry->eventBase;
|
|
||||||
BadShmSegCode = extEntry->errorBase;
|
|
||||||
SetResourceTypeErrorValue(ShmSegType, BadShmSegCode);
|
|
||||||
EventSwapVector[ShmCompletionCode] = (EventSwapPtr) SShmCompletionEvent;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*ARGSUSED*/
|
/*ARGSUSED*/
|
||||||
static void
|
static void
|
||||||
ShmResetProc(ExtensionEntry *extEntry)
|
ShmResetProc(ExtensionEntry *extEntry)
|
||||||
|
@ -581,6 +517,226 @@ doShmPutImage(DrawablePtr dst, GCPtr pGC,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
ProcShmPutImage(ClientPtr client)
|
||||||
|
{
|
||||||
|
GCPtr pGC;
|
||||||
|
DrawablePtr pDraw;
|
||||||
|
long length;
|
||||||
|
ShmDescPtr shmdesc;
|
||||||
|
REQUEST(xShmPutImageReq);
|
||||||
|
|
||||||
|
REQUEST_SIZE_MATCH(xShmPutImageReq);
|
||||||
|
VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, DixWriteAccess);
|
||||||
|
VERIFY_SHMPTR(stuff->shmseg, stuff->offset, FALSE, shmdesc, client);
|
||||||
|
if ((stuff->sendEvent != xTrue) && (stuff->sendEvent != xFalse))
|
||||||
|
return BadValue;
|
||||||
|
if (stuff->format == XYBitmap)
|
||||||
|
{
|
||||||
|
if (stuff->depth != 1)
|
||||||
|
return BadMatch;
|
||||||
|
length = PixmapBytePad(stuff->totalWidth, 1);
|
||||||
|
}
|
||||||
|
else if (stuff->format == XYPixmap)
|
||||||
|
{
|
||||||
|
if (pDraw->depth != stuff->depth)
|
||||||
|
return BadMatch;
|
||||||
|
length = PixmapBytePad(stuff->totalWidth, 1);
|
||||||
|
length *= stuff->depth;
|
||||||
|
}
|
||||||
|
else if (stuff->format == ZPixmap)
|
||||||
|
{
|
||||||
|
if (pDraw->depth != stuff->depth)
|
||||||
|
return BadMatch;
|
||||||
|
length = PixmapBytePad(stuff->totalWidth, stuff->depth);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
client->errorValue = stuff->format;
|
||||||
|
return BadValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* There's a potential integer overflow in this check:
|
||||||
|
* VERIFY_SHMSIZE(shmdesc, stuff->offset, length * stuff->totalHeight,
|
||||||
|
* client);
|
||||||
|
* the version below ought to avoid it
|
||||||
|
*/
|
||||||
|
if (stuff->totalHeight != 0 &&
|
||||||
|
length > (shmdesc->size - stuff->offset)/stuff->totalHeight) {
|
||||||
|
client->errorValue = stuff->totalWidth;
|
||||||
|
return BadValue;
|
||||||
|
}
|
||||||
|
if (stuff->srcX > stuff->totalWidth)
|
||||||
|
{
|
||||||
|
client->errorValue = stuff->srcX;
|
||||||
|
return BadValue;
|
||||||
|
}
|
||||||
|
if (stuff->srcY > stuff->totalHeight)
|
||||||
|
{
|
||||||
|
client->errorValue = stuff->srcY;
|
||||||
|
return BadValue;
|
||||||
|
}
|
||||||
|
if ((stuff->srcX + stuff->srcWidth) > stuff->totalWidth)
|
||||||
|
{
|
||||||
|
client->errorValue = stuff->srcWidth;
|
||||||
|
return BadValue;
|
||||||
|
}
|
||||||
|
if ((stuff->srcY + stuff->srcHeight) > stuff->totalHeight)
|
||||||
|
{
|
||||||
|
client->errorValue = stuff->srcHeight;
|
||||||
|
return BadValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((((stuff->format == ZPixmap) && (stuff->srcX == 0)) ||
|
||||||
|
((stuff->format != ZPixmap) &&
|
||||||
|
(stuff->srcX < screenInfo.bitmapScanlinePad) &&
|
||||||
|
((stuff->format == XYBitmap) ||
|
||||||
|
((stuff->srcY == 0) &&
|
||||||
|
(stuff->srcHeight == stuff->totalHeight))))) &&
|
||||||
|
((stuff->srcX + stuff->srcWidth) == stuff->totalWidth))
|
||||||
|
(*pGC->ops->PutImage) (pDraw, pGC, stuff->depth,
|
||||||
|
stuff->dstX, stuff->dstY,
|
||||||
|
stuff->totalWidth, stuff->srcHeight,
|
||||||
|
stuff->srcX, stuff->format,
|
||||||
|
shmdesc->addr + stuff->offset +
|
||||||
|
(stuff->srcY * length));
|
||||||
|
else
|
||||||
|
doShmPutImage(pDraw, pGC, stuff->depth, stuff->format,
|
||||||
|
stuff->totalWidth, stuff->totalHeight,
|
||||||
|
stuff->srcX, stuff->srcY,
|
||||||
|
stuff->srcWidth, stuff->srcHeight,
|
||||||
|
stuff->dstX, stuff->dstY,
|
||||||
|
shmdesc->addr + stuff->offset);
|
||||||
|
|
||||||
|
if (stuff->sendEvent)
|
||||||
|
{
|
||||||
|
xShmCompletionEvent ev;
|
||||||
|
|
||||||
|
ev.type = ShmCompletionCode;
|
||||||
|
ev.drawable = stuff->drawable;
|
||||||
|
ev.minorEvent = X_ShmPutImage;
|
||||||
|
ev.majorEvent = ShmReqCode;
|
||||||
|
ev.shmseg = stuff->shmseg;
|
||||||
|
ev.offset = stuff->offset;
|
||||||
|
WriteEventsToClient(client, 1, (xEvent *) &ev);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Success;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
ProcShmGetImage(ClientPtr client)
|
||||||
|
{
|
||||||
|
DrawablePtr pDraw;
|
||||||
|
long lenPer = 0, length;
|
||||||
|
Mask plane = 0;
|
||||||
|
xShmGetImageReply xgi;
|
||||||
|
ShmDescPtr shmdesc;
|
||||||
|
int n, rc;
|
||||||
|
|
||||||
|
REQUEST(xShmGetImageReq);
|
||||||
|
|
||||||
|
REQUEST_SIZE_MATCH(xShmGetImageReq);
|
||||||
|
if ((stuff->format != XYPixmap) && (stuff->format != ZPixmap))
|
||||||
|
{
|
||||||
|
client->errorValue = stuff->format;
|
||||||
|
return BadValue;
|
||||||
|
}
|
||||||
|
rc = dixLookupDrawable(&pDraw, stuff->drawable, client, 0,
|
||||||
|
DixReadAccess);
|
||||||
|
if (rc != Success)
|
||||||
|
return rc;
|
||||||
|
VERIFY_SHMPTR(stuff->shmseg, stuff->offset, TRUE, shmdesc, client);
|
||||||
|
if (pDraw->type == DRAWABLE_WINDOW)
|
||||||
|
{
|
||||||
|
if( /* check for being viewable */
|
||||||
|
!((WindowPtr) pDraw)->realized ||
|
||||||
|
/* check for being on screen */
|
||||||
|
pDraw->x + stuff->x < 0 ||
|
||||||
|
pDraw->x + stuff->x + (int)stuff->width > pDraw->pScreen->width ||
|
||||||
|
pDraw->y + stuff->y < 0 ||
|
||||||
|
pDraw->y + stuff->y + (int)stuff->height > pDraw->pScreen->height ||
|
||||||
|
/* check for being inside of border */
|
||||||
|
stuff->x < - wBorderWidth((WindowPtr)pDraw) ||
|
||||||
|
stuff->x + (int)stuff->width >
|
||||||
|
wBorderWidth((WindowPtr)pDraw) + (int)pDraw->width ||
|
||||||
|
stuff->y < -wBorderWidth((WindowPtr)pDraw) ||
|
||||||
|
stuff->y + (int)stuff->height >
|
||||||
|
wBorderWidth((WindowPtr)pDraw) + (int)pDraw->height
|
||||||
|
)
|
||||||
|
return BadMatch;
|
||||||
|
xgi.visual = wVisual(((WindowPtr)pDraw));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (stuff->x < 0 ||
|
||||||
|
stuff->x+(int)stuff->width > pDraw->width ||
|
||||||
|
stuff->y < 0 ||
|
||||||
|
stuff->y+(int)stuff->height > pDraw->height
|
||||||
|
)
|
||||||
|
return BadMatch;
|
||||||
|
xgi.visual = None;
|
||||||
|
}
|
||||||
|
xgi.type = X_Reply;
|
||||||
|
xgi.length = 0;
|
||||||
|
xgi.sequenceNumber = client->sequence;
|
||||||
|
xgi.depth = pDraw->depth;
|
||||||
|
if(stuff->format == ZPixmap)
|
||||||
|
{
|
||||||
|
length = PixmapBytePad(stuff->width, pDraw->depth) * stuff->height;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
lenPer = PixmapBytePad(stuff->width, 1) * stuff->height;
|
||||||
|
plane = ((Mask)1) << (pDraw->depth - 1);
|
||||||
|
/* only planes asked for */
|
||||||
|
length = lenPer * Ones(stuff->planeMask & (plane | (plane - 1)));
|
||||||
|
}
|
||||||
|
|
||||||
|
VERIFY_SHMSIZE(shmdesc, stuff->offset, length, client);
|
||||||
|
xgi.size = length;
|
||||||
|
|
||||||
|
if (length == 0)
|
||||||
|
{
|
||||||
|
/* nothing to do */
|
||||||
|
}
|
||||||
|
else if (stuff->format == ZPixmap)
|
||||||
|
{
|
||||||
|
(*pDraw->pScreen->GetImage)(pDraw, stuff->x, stuff->y,
|
||||||
|
stuff->width, stuff->height,
|
||||||
|
stuff->format, stuff->planeMask,
|
||||||
|
shmdesc->addr + stuff->offset);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
|
||||||
|
length = stuff->offset;
|
||||||
|
for (; plane; plane >>= 1)
|
||||||
|
{
|
||||||
|
if (stuff->planeMask & plane)
|
||||||
|
{
|
||||||
|
(*pDraw->pScreen->GetImage)(pDraw,
|
||||||
|
stuff->x, stuff->y,
|
||||||
|
stuff->width, stuff->height,
|
||||||
|
stuff->format, plane,
|
||||||
|
shmdesc->addr + length);
|
||||||
|
length += lenPer;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (client->swapped) {
|
||||||
|
swaps(&xgi.sequenceNumber, n);
|
||||||
|
swapl(&xgi.length, n);
|
||||||
|
swapl(&xgi.visual, n);
|
||||||
|
swapl(&xgi.size, n);
|
||||||
|
}
|
||||||
|
WriteToClient(client, sizeof(xShmGetImageReply), (char *)&xgi);
|
||||||
|
|
||||||
|
return Success;
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef PANORAMIX
|
#ifdef PANORAMIX
|
||||||
static int
|
static int
|
||||||
ProcPanoramiXShmPutImage(ClientPtr client)
|
ProcPanoramiXShmPutImage(ClientPtr client)
|
||||||
|
@ -858,231 +1014,8 @@ CreatePmap:
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static int
|
|
||||||
ProcShmPutImage(ClientPtr client)
|
|
||||||
{
|
|
||||||
GCPtr pGC;
|
|
||||||
DrawablePtr pDraw;
|
|
||||||
long length;
|
|
||||||
ShmDescPtr shmdesc;
|
|
||||||
REQUEST(xShmPutImageReq);
|
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xShmPutImageReq);
|
|
||||||
VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, DixWriteAccess);
|
|
||||||
VERIFY_SHMPTR(stuff->shmseg, stuff->offset, FALSE, shmdesc, client);
|
|
||||||
if ((stuff->sendEvent != xTrue) && (stuff->sendEvent != xFalse))
|
|
||||||
return BadValue;
|
|
||||||
if (stuff->format == XYBitmap)
|
|
||||||
{
|
|
||||||
if (stuff->depth != 1)
|
|
||||||
return BadMatch;
|
|
||||||
length = PixmapBytePad(stuff->totalWidth, 1);
|
|
||||||
}
|
|
||||||
else if (stuff->format == XYPixmap)
|
|
||||||
{
|
|
||||||
if (pDraw->depth != stuff->depth)
|
|
||||||
return BadMatch;
|
|
||||||
length = PixmapBytePad(stuff->totalWidth, 1);
|
|
||||||
length *= stuff->depth;
|
|
||||||
}
|
|
||||||
else if (stuff->format == ZPixmap)
|
|
||||||
{
|
|
||||||
if (pDraw->depth != stuff->depth)
|
|
||||||
return BadMatch;
|
|
||||||
length = PixmapBytePad(stuff->totalWidth, stuff->depth);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
client->errorValue = stuff->format;
|
|
||||||
return BadValue;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* There's a potential integer overflow in this check:
|
|
||||||
* VERIFY_SHMSIZE(shmdesc, stuff->offset, length * stuff->totalHeight,
|
|
||||||
* client);
|
|
||||||
* the version below ought to avoid it
|
|
||||||
*/
|
|
||||||
if (stuff->totalHeight != 0 &&
|
|
||||||
length > (shmdesc->size - stuff->offset)/stuff->totalHeight) {
|
|
||||||
client->errorValue = stuff->totalWidth;
|
|
||||||
return BadValue;
|
|
||||||
}
|
|
||||||
if (stuff->srcX > stuff->totalWidth)
|
|
||||||
{
|
|
||||||
client->errorValue = stuff->srcX;
|
|
||||||
return BadValue;
|
|
||||||
}
|
|
||||||
if (stuff->srcY > stuff->totalHeight)
|
|
||||||
{
|
|
||||||
client->errorValue = stuff->srcY;
|
|
||||||
return BadValue;
|
|
||||||
}
|
|
||||||
if ((stuff->srcX + stuff->srcWidth) > stuff->totalWidth)
|
|
||||||
{
|
|
||||||
client->errorValue = stuff->srcWidth;
|
|
||||||
return BadValue;
|
|
||||||
}
|
|
||||||
if ((stuff->srcY + stuff->srcHeight) > stuff->totalHeight)
|
|
||||||
{
|
|
||||||
client->errorValue = stuff->srcHeight;
|
|
||||||
return BadValue;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((((stuff->format == ZPixmap) && (stuff->srcX == 0)) ||
|
|
||||||
((stuff->format != ZPixmap) &&
|
|
||||||
(stuff->srcX < screenInfo.bitmapScanlinePad) &&
|
|
||||||
((stuff->format == XYBitmap) ||
|
|
||||||
((stuff->srcY == 0) &&
|
|
||||||
(stuff->srcHeight == stuff->totalHeight))))) &&
|
|
||||||
((stuff->srcX + stuff->srcWidth) == stuff->totalWidth))
|
|
||||||
(*pGC->ops->PutImage) (pDraw, pGC, stuff->depth,
|
|
||||||
stuff->dstX, stuff->dstY,
|
|
||||||
stuff->totalWidth, stuff->srcHeight,
|
|
||||||
stuff->srcX, stuff->format,
|
|
||||||
shmdesc->addr + stuff->offset +
|
|
||||||
(stuff->srcY * length));
|
|
||||||
else
|
|
||||||
doShmPutImage(pDraw, pGC, stuff->depth, stuff->format,
|
|
||||||
stuff->totalWidth, stuff->totalHeight,
|
|
||||||
stuff->srcX, stuff->srcY,
|
|
||||||
stuff->srcWidth, stuff->srcHeight,
|
|
||||||
stuff->dstX, stuff->dstY,
|
|
||||||
shmdesc->addr + stuff->offset);
|
|
||||||
|
|
||||||
if (stuff->sendEvent)
|
|
||||||
{
|
|
||||||
xShmCompletionEvent ev;
|
|
||||||
|
|
||||||
ev.type = ShmCompletionCode;
|
|
||||||
ev.drawable = stuff->drawable;
|
|
||||||
ev.minorEvent = X_ShmPutImage;
|
|
||||||
ev.majorEvent = ShmReqCode;
|
|
||||||
ev.shmseg = stuff->shmseg;
|
|
||||||
ev.offset = stuff->offset;
|
|
||||||
WriteEventsToClient(client, 1, (xEvent *) &ev);
|
|
||||||
}
|
|
||||||
|
|
||||||
return Success;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static int
|
|
||||||
ProcShmGetImage(ClientPtr client)
|
|
||||||
{
|
|
||||||
DrawablePtr pDraw;
|
|
||||||
long lenPer = 0, length;
|
|
||||||
Mask plane = 0;
|
|
||||||
xShmGetImageReply xgi;
|
|
||||||
ShmDescPtr shmdesc;
|
|
||||||
int n, rc;
|
|
||||||
|
|
||||||
REQUEST(xShmGetImageReq);
|
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xShmGetImageReq);
|
|
||||||
if ((stuff->format != XYPixmap) && (stuff->format != ZPixmap))
|
|
||||||
{
|
|
||||||
client->errorValue = stuff->format;
|
|
||||||
return BadValue;
|
|
||||||
}
|
|
||||||
rc = dixLookupDrawable(&pDraw, stuff->drawable, client, 0,
|
|
||||||
DixReadAccess);
|
|
||||||
if (rc != Success)
|
|
||||||
return rc;
|
|
||||||
VERIFY_SHMPTR(stuff->shmseg, stuff->offset, TRUE, shmdesc, client);
|
|
||||||
if (pDraw->type == DRAWABLE_WINDOW)
|
|
||||||
{
|
|
||||||
if( /* check for being viewable */
|
|
||||||
!((WindowPtr) pDraw)->realized ||
|
|
||||||
/* check for being on screen */
|
|
||||||
pDraw->x + stuff->x < 0 ||
|
|
||||||
pDraw->x + stuff->x + (int)stuff->width > pDraw->pScreen->width ||
|
|
||||||
pDraw->y + stuff->y < 0 ||
|
|
||||||
pDraw->y + stuff->y + (int)stuff->height > pDraw->pScreen->height ||
|
|
||||||
/* check for being inside of border */
|
|
||||||
stuff->x < - wBorderWidth((WindowPtr)pDraw) ||
|
|
||||||
stuff->x + (int)stuff->width >
|
|
||||||
wBorderWidth((WindowPtr)pDraw) + (int)pDraw->width ||
|
|
||||||
stuff->y < -wBorderWidth((WindowPtr)pDraw) ||
|
|
||||||
stuff->y + (int)stuff->height >
|
|
||||||
wBorderWidth((WindowPtr)pDraw) + (int)pDraw->height
|
|
||||||
)
|
|
||||||
return BadMatch;
|
|
||||||
xgi.visual = wVisual(((WindowPtr)pDraw));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (stuff->x < 0 ||
|
|
||||||
stuff->x+(int)stuff->width > pDraw->width ||
|
|
||||||
stuff->y < 0 ||
|
|
||||||
stuff->y+(int)stuff->height > pDraw->height
|
|
||||||
)
|
|
||||||
return BadMatch;
|
|
||||||
xgi.visual = None;
|
|
||||||
}
|
|
||||||
xgi.type = X_Reply;
|
|
||||||
xgi.length = 0;
|
|
||||||
xgi.sequenceNumber = client->sequence;
|
|
||||||
xgi.depth = pDraw->depth;
|
|
||||||
if(stuff->format == ZPixmap)
|
|
||||||
{
|
|
||||||
length = PixmapBytePad(stuff->width, pDraw->depth) * stuff->height;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
lenPer = PixmapBytePad(stuff->width, 1) * stuff->height;
|
|
||||||
plane = ((Mask)1) << (pDraw->depth - 1);
|
|
||||||
/* only planes asked for */
|
|
||||||
length = lenPer * Ones(stuff->planeMask & (plane | (plane - 1)));
|
|
||||||
}
|
|
||||||
|
|
||||||
VERIFY_SHMSIZE(shmdesc, stuff->offset, length, client);
|
|
||||||
xgi.size = length;
|
|
||||||
|
|
||||||
if (length == 0)
|
|
||||||
{
|
|
||||||
/* nothing to do */
|
|
||||||
}
|
|
||||||
else if (stuff->format == ZPixmap)
|
|
||||||
{
|
|
||||||
(*pDraw->pScreen->GetImage)(pDraw, stuff->x, stuff->y,
|
|
||||||
stuff->width, stuff->height,
|
|
||||||
stuff->format, stuff->planeMask,
|
|
||||||
shmdesc->addr + stuff->offset);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
|
|
||||||
length = stuff->offset;
|
|
||||||
for (; plane; plane >>= 1)
|
|
||||||
{
|
|
||||||
if (stuff->planeMask & plane)
|
|
||||||
{
|
|
||||||
(*pDraw->pScreen->GetImage)(pDraw,
|
|
||||||
stuff->x, stuff->y,
|
|
||||||
stuff->width, stuff->height,
|
|
||||||
stuff->format, plane,
|
|
||||||
shmdesc->addr + length);
|
|
||||||
length += lenPer;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (client->swapped) {
|
|
||||||
swaps(&xgi.sequenceNumber, n);
|
|
||||||
swapl(&xgi.length, n);
|
|
||||||
swapl(&xgi.visual, n);
|
|
||||||
swapl(&xgi.size, n);
|
|
||||||
}
|
|
||||||
WriteToClient(client, sizeof(xShmGetImageReply), (char *)&xgi);
|
|
||||||
|
|
||||||
return Success;
|
|
||||||
}
|
|
||||||
|
|
||||||
static PixmapPtr
|
static PixmapPtr
|
||||||
fbShmCreatePixmap (ScreenPtr pScreen,
|
fbShmCreatePixmap (ScreenPtr pScreen,
|
||||||
int width, int height, int depth, char *addr)
|
int width, int height, int depth, char *addr)
|
||||||
|
@ -1342,3 +1275,53 @@ SProcShmDispatch (ClientPtr client)
|
||||||
return BadRequest;
|
return BadRequest;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ShmExtensionInit(INITARGS)
|
||||||
|
{
|
||||||
|
ExtensionEntry *extEntry;
|
||||||
|
int i;
|
||||||
|
|
||||||
|
#ifdef MUST_CHECK_FOR_SHM_SYSCALL
|
||||||
|
if (!CheckForShmSyscall())
|
||||||
|
{
|
||||||
|
ErrorF("MIT-SHM extension disabled due to lack of kernel support\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
if (!ShmRegisterPrivates())
|
||||||
|
return;
|
||||||
|
|
||||||
|
sharedPixmaps = xFalse;
|
||||||
|
{
|
||||||
|
sharedPixmaps = xTrue;
|
||||||
|
for (i = 0; i < screenInfo.numScreens; i++)
|
||||||
|
{
|
||||||
|
ShmScrPrivateRec *screen_priv = ShmInitScreenPriv(screenInfo.screens[i]);
|
||||||
|
if (!screen_priv->shmFuncs)
|
||||||
|
screen_priv->shmFuncs = &miFuncs;
|
||||||
|
if (!screen_priv->shmFuncs->CreatePixmap)
|
||||||
|
sharedPixmaps = xFalse;
|
||||||
|
}
|
||||||
|
if (sharedPixmaps)
|
||||||
|
for (i = 0; i < screenInfo.numScreens; i++)
|
||||||
|
{
|
||||||
|
ShmScrPrivateRec *screen_priv = ShmGetScreenPriv(screenInfo.screens[i]);
|
||||||
|
screen_priv->destroyPixmap = screenInfo.screens[i]->DestroyPixmap;
|
||||||
|
screenInfo.screens[i]->DestroyPixmap = ShmDestroyPixmap;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ShmSegType = CreateNewResourceType(ShmDetachSegment, "ShmSeg");
|
||||||
|
if (ShmSegType &&
|
||||||
|
(extEntry = AddExtension(SHMNAME, ShmNumberEvents, ShmNumberErrors,
|
||||||
|
ProcShmDispatch, SProcShmDispatch,
|
||||||
|
ShmResetProc, StandardMinorOpcode)))
|
||||||
|
{
|
||||||
|
ShmReqCode = (unsigned char)extEntry->base;
|
||||||
|
ShmCompletionCode = extEntry->eventBase;
|
||||||
|
BadShmSegCode = extEntry->errorBase;
|
||||||
|
SetResourceTypeErrorValue(ShmSegType, BadShmSegCode);
|
||||||
|
EventSwapVector[ShmCompletionCode] = (EventSwapPtr) SShmCompletionEvent;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
30
Xext/sync.c
30
Xext/sync.c
|
@ -100,36 +100,6 @@ static void SyncInitServerTime(void);
|
||||||
|
|
||||||
static void SyncInitIdleTime(void);
|
static void SyncInitIdleTime(void);
|
||||||
|
|
||||||
static DISPATCH_PROC(ProcSyncAwait);
|
|
||||||
static DISPATCH_PROC(ProcSyncChangeAlarm);
|
|
||||||
static DISPATCH_PROC(ProcSyncChangeCounter);
|
|
||||||
static DISPATCH_PROC(ProcSyncCreateAlarm);
|
|
||||||
static DISPATCH_PROC(ProcSyncCreateCounter);
|
|
||||||
static DISPATCH_PROC(ProcSyncDestroyAlarm);
|
|
||||||
static DISPATCH_PROC(ProcSyncDestroyCounter);
|
|
||||||
static DISPATCH_PROC(ProcSyncDispatch);
|
|
||||||
static DISPATCH_PROC(ProcSyncGetPriority);
|
|
||||||
static DISPATCH_PROC(ProcSyncInitialize);
|
|
||||||
static DISPATCH_PROC(ProcSyncListSystemCounters);
|
|
||||||
static DISPATCH_PROC(ProcSyncQueryAlarm);
|
|
||||||
static DISPATCH_PROC(ProcSyncQueryCounter);
|
|
||||||
static DISPATCH_PROC(ProcSyncSetCounter);
|
|
||||||
static DISPATCH_PROC(ProcSyncSetPriority);
|
|
||||||
static DISPATCH_PROC(SProcSyncAwait);
|
|
||||||
static DISPATCH_PROC(SProcSyncChangeAlarm);
|
|
||||||
static DISPATCH_PROC(SProcSyncChangeCounter);
|
|
||||||
static DISPATCH_PROC(SProcSyncCreateAlarm);
|
|
||||||
static DISPATCH_PROC(SProcSyncCreateCounter);
|
|
||||||
static DISPATCH_PROC(SProcSyncDestroyAlarm);
|
|
||||||
static DISPATCH_PROC(SProcSyncDestroyCounter);
|
|
||||||
static DISPATCH_PROC(SProcSyncDispatch);
|
|
||||||
static DISPATCH_PROC(SProcSyncGetPriority);
|
|
||||||
static DISPATCH_PROC(SProcSyncInitialize);
|
|
||||||
static DISPATCH_PROC(SProcSyncListSystemCounters);
|
|
||||||
static DISPATCH_PROC(SProcSyncQueryAlarm);
|
|
||||||
static DISPATCH_PROC(SProcSyncQueryCounter);
|
|
||||||
static DISPATCH_PROC(SProcSyncSetCounter);
|
|
||||||
static DISPATCH_PROC(SProcSyncSetPriority);
|
|
||||||
|
|
||||||
/* Each counter maintains a simple linked list of triggers that are
|
/* Each counter maintains a simple linked list of triggers that are
|
||||||
* interested in the counter. The two functions below are used to
|
* interested in the counter. The two functions below are used to
|
||||||
|
|
|
@ -46,24 +46,6 @@ from The Open Group.
|
||||||
#define UINT32_MAX 0xffffffffU
|
#define UINT32_MAX 0xffffffffU
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static DISPATCH_PROC(ProcXCMiscDispatch);
|
|
||||||
static DISPATCH_PROC(ProcXCMiscGetVersion);
|
|
||||||
static DISPATCH_PROC(ProcXCMiscGetXIDList);
|
|
||||||
static DISPATCH_PROC(ProcXCMiscGetXIDRange);
|
|
||||||
static DISPATCH_PROC(SProcXCMiscDispatch);
|
|
||||||
static DISPATCH_PROC(SProcXCMiscGetVersion);
|
|
||||||
static DISPATCH_PROC(SProcXCMiscGetXIDList);
|
|
||||||
static DISPATCH_PROC(SProcXCMiscGetXIDRange);
|
|
||||||
|
|
||||||
void XCMiscExtensionInit(INITARGS);
|
|
||||||
|
|
||||||
void
|
|
||||||
XCMiscExtensionInit(INITARGS)
|
|
||||||
{
|
|
||||||
AddExtension(XCMiscExtensionName, 0, 0,
|
|
||||||
ProcXCMiscDispatch, SProcXCMiscDispatch,
|
|
||||||
NULL, StandardMinorOpcode);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
ProcXCMiscGetVersion(ClientPtr client)
|
ProcXCMiscGetVersion(ClientPtr client)
|
||||||
|
@ -215,3 +197,11 @@ SProcXCMiscDispatch (ClientPtr client)
|
||||||
return BadRequest;
|
return BadRequest;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
XCMiscExtensionInit(INITARGS)
|
||||||
|
{
|
||||||
|
AddExtension(XCMiscExtensionName, 0, 0,
|
||||||
|
ProcXCMiscDispatch, SProcXCMiscDispatch,
|
||||||
|
NULL, StandardMinorOpcode);
|
||||||
|
}
|
||||||
|
|
|
@ -80,12 +80,6 @@ static void XF86BigfontResetProc(
|
||||||
ExtensionEntry * /* extEntry */
|
ExtensionEntry * /* extEntry */
|
||||||
);
|
);
|
||||||
|
|
||||||
static DISPATCH_PROC(ProcXF86BigfontDispatch);
|
|
||||||
static DISPATCH_PROC(ProcXF86BigfontQueryVersion);
|
|
||||||
static DISPATCH_PROC(ProcXF86BigfontQueryFont);
|
|
||||||
static DISPATCH_PROC(SProcXF86BigfontDispatch);
|
|
||||||
static DISPATCH_PROC(SProcXF86BigfontQueryVersion);
|
|
||||||
static DISPATCH_PROC(SProcXF86BigfontQueryFont);
|
|
||||||
|
|
||||||
#ifdef HAS_SHM
|
#ifdef HAS_SHM
|
||||||
|
|
||||||
|
|
29
Xext/xtest.c
29
Xext/xtest.c
|
@ -84,26 +84,6 @@ static int XTestSwapFakeInput(
|
||||||
xReq * /* req */
|
xReq * /* req */
|
||||||
);
|
);
|
||||||
|
|
||||||
static DISPATCH_PROC(ProcXTestCompareCursor);
|
|
||||||
static DISPATCH_PROC(ProcXTestDispatch);
|
|
||||||
static DISPATCH_PROC(ProcXTestFakeInput);
|
|
||||||
static DISPATCH_PROC(ProcXTestGetVersion);
|
|
||||||
static DISPATCH_PROC(ProcXTestGrabControl);
|
|
||||||
static DISPATCH_PROC(SProcXTestCompareCursor);
|
|
||||||
static DISPATCH_PROC(SProcXTestDispatch);
|
|
||||||
static DISPATCH_PROC(SProcXTestFakeInput);
|
|
||||||
static DISPATCH_PROC(SProcXTestGetVersion);
|
|
||||||
static DISPATCH_PROC(SProcXTestGrabControl);
|
|
||||||
|
|
||||||
void
|
|
||||||
XTestExtensionInit(INITARGS)
|
|
||||||
{
|
|
||||||
AddExtension(XTestExtensionName, 0, 0,
|
|
||||||
ProcXTestDispatch, SProcXTestDispatch,
|
|
||||||
NULL, StandardMinorOpcode);
|
|
||||||
|
|
||||||
xtest_evlist = InitEventList(GetMaximumEventsNum());
|
|
||||||
}
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
ProcXTestGetVersion(ClientPtr client)
|
ProcXTestGetVersion(ClientPtr client)
|
||||||
|
@ -699,3 +679,12 @@ GetXTestDevice(DeviceIntPtr master)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
XTestExtensionInit(INITARGS)
|
||||||
|
{
|
||||||
|
AddExtension(XTestExtensionName, 0, 0,
|
||||||
|
ProcXTestDispatch, SProcXTestDispatch,
|
||||||
|
NULL, StandardMinorOpcode);
|
||||||
|
|
||||||
|
xtest_evlist = InitEventList(GetMaximumEventsNum());
|
||||||
|
}
|
||||||
|
|
|
@ -1154,8 +1154,7 @@ void
|
||||||
AssignTypeAndName(DeviceIntPtr dev, Atom type, char *name)
|
AssignTypeAndName(DeviceIntPtr dev, Atom type, char *name)
|
||||||
{
|
{
|
||||||
dev->xinput_type = type;
|
dev->xinput_type = type;
|
||||||
dev->name = (char *)malloc(strlen(name) + 1);
|
dev->name = strdup(name);
|
||||||
strcpy(dev->name, name);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
|
|
|
@ -639,10 +639,9 @@ compWindowFormat (WindowPtr pWin)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
compWindowUpdateAutomatic (WindowPtr pWin)
|
compWindowUpdateAutomatic (WindowPtr pWin, ScreenPtr pScreen)
|
||||||
{
|
{
|
||||||
CompWindowPtr cw = GetCompWindow (pWin);
|
CompWindowPtr cw = GetCompWindow (pWin);
|
||||||
ScreenPtr pScreen = pWin->drawable.pScreen;
|
|
||||||
WindowPtr pParent = pWin->parent;
|
WindowPtr pParent = pWin->parent;
|
||||||
PixmapPtr pSrcPixmap = (*pScreen->GetWindowPixmap) (pWin);
|
PixmapPtr pSrcPixmap = (*pScreen->GetWindowPixmap) (pWin);
|
||||||
PictFormatPtr pSrcFormat = compWindowFormat (pWin);
|
PictFormatPtr pSrcFormat = compWindowFormat (pWin);
|
||||||
|
@ -665,8 +664,7 @@ compWindowUpdateAutomatic (WindowPtr pWin)
|
||||||
/*
|
/*
|
||||||
* First move the region from window to screen coordinates
|
* First move the region from window to screen coordinates
|
||||||
*/
|
*/
|
||||||
RegionTranslate(pRegion,
|
RegionTranslate(pRegion, pWin->drawable.x, pWin->drawable.y);
|
||||||
pWin->drawable.x, pWin->drawable.y);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Clip against the "real" border clip
|
* Clip against the "real" border clip
|
||||||
|
@ -676,8 +674,7 @@ compWindowUpdateAutomatic (WindowPtr pWin)
|
||||||
/*
|
/*
|
||||||
* Now translate from screen to dest coordinates
|
* Now translate from screen to dest coordinates
|
||||||
*/
|
*/
|
||||||
RegionTranslate(pRegion,
|
RegionTranslate(pRegion, -pParent->drawable.x, -pParent->drawable.y);
|
||||||
-pParent->drawable.x, -pParent->drawable.y);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Clip the picture
|
* Clip the picture
|
||||||
|
@ -706,23 +703,26 @@ compWindowUpdateAutomatic (WindowPtr pWin)
|
||||||
DamageEmpty (cw->damage);
|
DamageEmpty (cw->damage);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
static int
|
||||||
compWindowUpdate (WindowPtr pWin)
|
compWindowUpdateVisit(WindowPtr pWin, void *data)
|
||||||
{
|
{
|
||||||
WindowPtr pChild;
|
|
||||||
|
|
||||||
for (pChild = pWin->lastChild; pChild; pChild = pChild->prevSib)
|
|
||||||
compWindowUpdate (pChild);
|
|
||||||
if (pWin->redirectDraw != RedirectDrawNone)
|
if (pWin->redirectDraw != RedirectDrawNone)
|
||||||
{
|
{
|
||||||
CompWindowPtr cw = GetCompWindow(pWin);
|
CompWindowPtr cw = GetCompWindow(pWin);
|
||||||
|
|
||||||
if (cw->damaged)
|
if (cw->damaged)
|
||||||
{
|
{
|
||||||
compWindowUpdateAutomatic (pWin);
|
compWindowUpdateAutomatic(pWin, data);
|
||||||
cw->damaged = FALSE;
|
cw->damaged = FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return WT_WALKCHILDREN;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
compWindowUpdate (WindowPtr pWin)
|
||||||
|
{
|
||||||
|
TraverseTree(pWin, compWindowUpdateVisit, pWin->drawable.pScreen);
|
||||||
}
|
}
|
||||||
|
|
||||||
WindowPtr
|
WindowPtr
|
||||||
|
|
|
@ -58,7 +58,6 @@ device_added(struct udev_device *udev_device)
|
||||||
char *config_info = NULL;
|
char *config_info = NULL;
|
||||||
const char *syspath;
|
const char *syspath;
|
||||||
const char *tags_prop;
|
const char *tags_prop;
|
||||||
const char *usb_vendor = NULL, *usb_model = NULL;
|
|
||||||
const char *key, *value, *tmp;
|
const char *key, *value, *tmp;
|
||||||
InputOption *options = NULL, *tmpo;
|
InputOption *options = NULL, *tmpo;
|
||||||
InputAttributes attrs = {};
|
InputAttributes attrs = {};
|
||||||
|
@ -94,6 +93,8 @@ device_added(struct udev_device *udev_device)
|
||||||
parent = udev_device_get_parent(udev_device);
|
parent = udev_device_get_parent(udev_device);
|
||||||
if (parent) {
|
if (parent) {
|
||||||
const char *ppath = udev_device_get_devnode(parent);
|
const char *ppath = udev_device_get_devnode(parent);
|
||||||
|
const char *product = udev_device_get_property_value(parent, "PRODUCT");
|
||||||
|
unsigned int usb_vendor, usb_model;
|
||||||
|
|
||||||
name = udev_device_get_sysattr_value(parent, "name");
|
name = udev_device_get_sysattr_value(parent, "name");
|
||||||
LOG_SYSATTR(ppath, "name", name);
|
LOG_SYSATTR(ppath, "name", name);
|
||||||
|
@ -104,6 +105,13 @@ device_added(struct udev_device *udev_device)
|
||||||
|
|
||||||
attrs.pnp_id = udev_device_get_sysattr_value(parent, "id");
|
attrs.pnp_id = udev_device_get_sysattr_value(parent, "id");
|
||||||
LOG_SYSATTR(ppath, "id", attrs.pnp_id);
|
LOG_SYSATTR(ppath, "id", attrs.pnp_id);
|
||||||
|
|
||||||
|
/* construct USB ID in lowercase hex - "0000:ffff" */
|
||||||
|
if (product && sscanf(product, "%*x/%4x/%4x/%*x", &usb_vendor, &usb_model) == 2) {
|
||||||
|
attrs.usb_id = Xprintf("%04x:%04x", usb_vendor, usb_model);
|
||||||
|
if (attrs.usb_id)
|
||||||
|
LOG_PROPERTY(path, "PRODUCT", product);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (!name)
|
if (!name)
|
||||||
name = "(unnamed)";
|
name = "(unnamed)";
|
||||||
|
@ -152,12 +160,6 @@ device_added(struct udev_device *udev_device)
|
||||||
} else if (!strcmp(key, "ID_VENDOR")) {
|
} else if (!strcmp(key, "ID_VENDOR")) {
|
||||||
LOG_PROPERTY(path, key, value);
|
LOG_PROPERTY(path, key, value);
|
||||||
attrs.vendor = value;
|
attrs.vendor = value;
|
||||||
} else if (!strcmp(key, "ID_VENDOR_ID")) {
|
|
||||||
LOG_PROPERTY(path, key, value);
|
|
||||||
usb_vendor = value;
|
|
||||||
} else if (!strcmp(key, "ID_VENDOR_MODEL")) {
|
|
||||||
LOG_PROPERTY(path, key, value);
|
|
||||||
usb_model = value;
|
|
||||||
} else if (!strcmp(key, "ID_INPUT_KEY")) {
|
} else if (!strcmp(key, "ID_INPUT_KEY")) {
|
||||||
LOG_PROPERTY(path, key, value);
|
LOG_PROPERTY(path, key, value);
|
||||||
attrs.flags |= ATTR_KEYBOARD;
|
attrs.flags |= ATTR_KEYBOARD;
|
||||||
|
@ -179,16 +181,6 @@ device_added(struct udev_device *udev_device)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* construct USB ID in lowercase hex - "0000:ffff" */
|
|
||||||
if (usb_vendor && usb_model) {
|
|
||||||
attrs.usb_id = Xprintf("%s:%s", usb_vendor, usb_model);
|
|
||||||
if (attrs.usb_id) {
|
|
||||||
char *cur;
|
|
||||||
for (cur = attrs.usb_id; *cur; cur++)
|
|
||||||
*cur = tolower(*cur);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
add_option(&options, "config_info", config_info);
|
add_option(&options, "config_info", config_info);
|
||||||
|
|
||||||
LogMessage(X_INFO, "config/udev: Adding input device %s (%s)\n",
|
LogMessage(X_INFO, "config/udev: Adding input device %s (%s)\n",
|
||||||
|
|
13
configure.ac
13
configure.ac
|
@ -26,8 +26,8 @@ dnl
|
||||||
dnl Process this file with autoconf to create configure.
|
dnl Process this file with autoconf to create configure.
|
||||||
|
|
||||||
AC_PREREQ(2.57)
|
AC_PREREQ(2.57)
|
||||||
AC_INIT([xorg-server], 1.9.0, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
|
AC_INIT([xorg-server], 1.9.99.1, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
|
||||||
RELEASE_DATE="2010-08-20"
|
RELEASE_DATE="2010-10-01"
|
||||||
AC_CONFIG_SRCDIR([Makefile.am])
|
AC_CONFIG_SRCDIR([Makefile.am])
|
||||||
AM_INIT_AUTOMAKE([foreign dist-bzip2])
|
AM_INIT_AUTOMAKE([foreign dist-bzip2])
|
||||||
AM_MAINTAINER_MODE
|
AM_MAINTAINER_MODE
|
||||||
|
@ -71,7 +71,6 @@ AC_PROG_LN_S
|
||||||
AC_LIBTOOL_WIN32_DLL
|
AC_LIBTOOL_WIN32_DLL
|
||||||
AC_DISABLE_STATIC
|
AC_DISABLE_STATIC
|
||||||
AC_PROG_LIBTOOL
|
AC_PROG_LIBTOOL
|
||||||
DOLT
|
|
||||||
AC_PROG_MAKE_SET
|
AC_PROG_MAKE_SET
|
||||||
PKG_PROG_PKG_CONFIG
|
PKG_PROG_PKG_CONFIG
|
||||||
AC_PROG_LEX
|
AC_PROG_LEX
|
||||||
|
@ -601,9 +600,6 @@ AC_ARG_ENABLE(pc98, AC_HELP_STRING([--enable-pc98], [Enable PC98 support in
|
||||||
[SUPPORT_PC98=auto])
|
[SUPPORT_PC98=auto])
|
||||||
|
|
||||||
dnl GLX build options
|
dnl GLX build options
|
||||||
AC_ARG_WITH(dri-driver-path, AS_HELP_STRING([--with-dri-driver-path=PATH], [Path to DRI drivers (default: ${libdir}/dri)]),
|
|
||||||
[ DRI_DRIVER_PATH="$withval" ],
|
|
||||||
[ DRI_DRIVER_PATH="${libdir}/dri" ])
|
|
||||||
AC_ARG_ENABLE(aiglx, AS_HELP_STRING([--enable-aiglx], [Build accelerated indirect GLX (default: enabled)]),
|
AC_ARG_ENABLE(aiglx, AS_HELP_STRING([--enable-aiglx], [Build accelerated indirect GLX (default: enabled)]),
|
||||||
[AIGLX=$enableval],
|
[AIGLX=$enableval],
|
||||||
[AIGLX=yes])
|
[AIGLX=yes])
|
||||||
|
@ -1258,7 +1254,8 @@ AC_DEFINE_DIR(COMPILEDDEFAULTFONTPATH, FONTPATH, [Default font path])
|
||||||
AC_DEFINE_DIR(PCI_TXT_IDS_PATH, PCI_TXT_IDS_DIR, [Default PCI text file ID path])
|
AC_DEFINE_DIR(PCI_TXT_IDS_PATH, PCI_TXT_IDS_DIR, [Default PCI text file ID path])
|
||||||
AC_DEFINE_DIR(SERVER_MISC_CONFIG_PATH, SERVERCONFIG, [Server miscellaneous config path])
|
AC_DEFINE_DIR(SERVER_MISC_CONFIG_PATH, SERVERCONFIG, [Server miscellaneous config path])
|
||||||
AC_DEFINE_DIR(BASE_FONT_PATH, FONTROOTDIR, [Default base font path])
|
AC_DEFINE_DIR(BASE_FONT_PATH, FONTROOTDIR, [Default base font path])
|
||||||
AC_DEFINE_DIR(DRI_DRIVER_PATH, DRI_DRIVER_PATH, [Default DRI driver path])
|
dridriverdir=`$PKG_CONFIG --variable=dridriverdir dri`
|
||||||
|
AC_DEFINE_DIR(DRI_DRIVER_PATH, dridriverdir, [Default DRI driver path])
|
||||||
AC_DEFINE_UNQUOTED(XVENDORNAME, ["$VENDOR_NAME"], [Vendor name])
|
AC_DEFINE_UNQUOTED(XVENDORNAME, ["$VENDOR_NAME"], [Vendor name])
|
||||||
AC_DEFINE_UNQUOTED(XVENDORNAMESHORT, ["$VENDOR_NAME_SHORT"], [Short vendor name])
|
AC_DEFINE_UNQUOTED(XVENDORNAMESHORT, ["$VENDOR_NAME_SHORT"], [Short vendor name])
|
||||||
AC_DEFINE_UNQUOTED(XORG_DATE, ["$RELEASE_DATE"], [Vendor release])
|
AC_DEFINE_UNQUOTED(XORG_DATE, ["$RELEASE_DATE"], [Vendor release])
|
||||||
|
@ -1926,7 +1923,7 @@ if test "x$XQUARTZ" = xyes; then
|
||||||
|
|
||||||
AC_CHECK_LIB([Xplugin],[xp_init],[:])
|
AC_CHECK_LIB([Xplugin],[xp_init],[:])
|
||||||
|
|
||||||
CFLAGS="${CFLAGS} -DROOTLESS_WORKAROUND -DROOTLESS_SAFEALPHA -DNO_ALLOCA"
|
CFLAGS="${CFLAGS} -DROOTLESS_SAFEALPHA -DNO_ALLOCA"
|
||||||
|
|
||||||
PKG_CHECK_MODULES(XPBPROXY, $APPLEWMPROTO $LIBAPPLEWM xfixes x11)
|
PKG_CHECK_MODULES(XPBPROXY, $APPLEWMPROTO $LIBAPPLEWM xfixes x11)
|
||||||
|
|
||||||
|
|
|
@ -2008,8 +2008,9 @@ ProcChangeKeyboardControl (ClientPtr client)
|
||||||
keyboard = PickKeyboard(client);
|
keyboard = PickKeyboard(client);
|
||||||
|
|
||||||
for (pDev = inputInfo.devices; pDev; pDev = pDev->next) {
|
for (pDev = inputInfo.devices; pDev; pDev = pDev->next) {
|
||||||
if ((pDev == keyboard || (!IsMaster(pDev) && pDev->u.master == keyboard)) &&
|
if ((pDev == keyboard ||
|
||||||
pDev->kbdfeed && pDev->kbdfeed->CtrlProc) {
|
(!IsMaster(pDev) && GetMaster(pDev, MASTER_KEYBOARD) == keyboard))
|
||||||
|
&& pDev->kbdfeed && pDev->kbdfeed->CtrlProc) {
|
||||||
ret = XaceHook(XACE_DEVICE_ACCESS, client, pDev, DixManageAccess);
|
ret = XaceHook(XACE_DEVICE_ACCESS, client, pDev, DixManageAccess);
|
||||||
if (ret != Success)
|
if (ret != Success)
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -2017,8 +2018,9 @@ ProcChangeKeyboardControl (ClientPtr client)
|
||||||
}
|
}
|
||||||
|
|
||||||
for (pDev = inputInfo.devices; pDev; pDev = pDev->next) {
|
for (pDev = inputInfo.devices; pDev; pDev = pDev->next) {
|
||||||
if ((pDev == keyboard || (!IsMaster(pDev) && pDev->u.master == keyboard)) &&
|
if ((pDev == keyboard ||
|
||||||
pDev->kbdfeed && pDev->kbdfeed->CtrlProc) {
|
(!IsMaster(pDev) && GetMaster(pDev, MASTER_KEYBOARD) == keyboard))
|
||||||
|
&& pDev->kbdfeed && pDev->kbdfeed->CtrlProc) {
|
||||||
ret = DoChangeKeyboardControl(client, pDev, vlist, vmask);
|
ret = DoChangeKeyboardControl(client, pDev, vlist, vmask);
|
||||||
if (ret != Success)
|
if (ret != Success)
|
||||||
error = ret;
|
error = ret;
|
||||||
|
@ -2078,7 +2080,8 @@ ProcBell(ClientPtr client)
|
||||||
newpercent = base - newpercent + stuff->percent;
|
newpercent = base - newpercent + stuff->percent;
|
||||||
|
|
||||||
for (dev = inputInfo.devices; dev; dev = dev->next) {
|
for (dev = inputInfo.devices; dev; dev = dev->next) {
|
||||||
if ((dev == keybd || (!IsMaster(dev) && dev->u.master == keybd)) &&
|
if ((dev == keybd ||
|
||||||
|
(!IsMaster(dev) && GetMaster(dev, MASTER_KEYBOARD) == keybd)) &&
|
||||||
dev->kbdfeed && dev->kbdfeed->BellProc) {
|
dev->kbdfeed && dev->kbdfeed->BellProc) {
|
||||||
|
|
||||||
rc = XaceHook(XACE_DEVICE_ACCESS, client, dev, DixBellAccess);
|
rc = XaceHook(XACE_DEVICE_ACCESS, client, dev, DixBellAccess);
|
||||||
|
@ -2147,7 +2150,8 @@ ProcChangePointerControl(ClientPtr client)
|
||||||
}
|
}
|
||||||
|
|
||||||
for (dev = inputInfo.devices; dev; dev = dev->next) {
|
for (dev = inputInfo.devices; dev; dev = dev->next) {
|
||||||
if ((dev == mouse || (!IsMaster(dev) && dev->u.master == mouse)) &&
|
if ((dev == mouse ||
|
||||||
|
(!IsMaster(dev) && GetMaster(dev, MASTER_POINTER) == mouse)) &&
|
||||||
dev->ptrfeed) {
|
dev->ptrfeed) {
|
||||||
rc = XaceHook(XACE_DEVICE_ACCESS, client, dev, DixManageAccess);
|
rc = XaceHook(XACE_DEVICE_ACCESS, client, dev, DixManageAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
|
@ -2156,7 +2160,8 @@ ProcChangePointerControl(ClientPtr client)
|
||||||
}
|
}
|
||||||
|
|
||||||
for (dev = inputInfo.devices; dev; dev = dev->next) {
|
for (dev = inputInfo.devices; dev; dev = dev->next) {
|
||||||
if ((dev == mouse || (!IsMaster(dev) && dev->u.master == mouse)) &&
|
if ((dev == mouse ||
|
||||||
|
(!IsMaster(dev) && GetMaster(dev, MASTER_POINTER) == mouse)) &&
|
||||||
dev->ptrfeed) {
|
dev->ptrfeed) {
|
||||||
dev->ptrfeed->ctrl = ctrl;
|
dev->ptrfeed->ctrl = ctrl;
|
||||||
}
|
}
|
||||||
|
@ -2326,7 +2331,7 @@ RecalculateMasterButtons(DeviceIntPtr slave)
|
||||||
maxbuttons = max(maxbuttons, dev->button->numButtons);
|
maxbuttons = max(maxbuttons, dev->button->numButtons);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (master->button->numButtons != maxbuttons)
|
if (master->button && master->button->numButtons != maxbuttons)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
DeviceChangedEvent event;
|
DeviceChangedEvent event;
|
||||||
|
@ -2337,7 +2342,7 @@ RecalculateMasterButtons(DeviceIntPtr slave)
|
||||||
|
|
||||||
event.header = ET_Internal;
|
event.header = ET_Internal;
|
||||||
event.type = ET_DeviceChanged;
|
event.type = ET_DeviceChanged;
|
||||||
event.time = CurrentTime;
|
event.time = GetTimeInMillis();
|
||||||
event.deviceid = master->id;
|
event.deviceid = master->id;
|
||||||
event.flags = DEVCHANGE_POINTER_EVENT | DEVCHANGE_DEVICE_CHANGE;
|
event.flags = DEVCHANGE_POINTER_EVENT | DEVCHANGE_DEVICE_CHANGE;
|
||||||
event.buttons.num_buttons = maxbuttons;
|
event.buttons.num_buttons = maxbuttons;
|
||||||
|
@ -2415,7 +2420,7 @@ AttachDevice(ClientPtr client, DeviceIntPtr dev, DeviceIntPtr master)
|
||||||
WindowPtr currentRoot;
|
WindowPtr currentRoot;
|
||||||
|
|
||||||
if (dev->spriteInfo->sprite)
|
if (dev->spriteInfo->sprite)
|
||||||
currentRoot = dev->spriteInfo->sprite->spriteTrace[0];
|
currentRoot = GetCurrentRootWindow(dev);
|
||||||
else /* new device auto-set to floating */
|
else /* new device auto-set to floating */
|
||||||
currentRoot = screenInfo.screens[0]->root;
|
currentRoot = screenInfo.screens[0]->root;
|
||||||
|
|
||||||
|
|
|
@ -238,7 +238,6 @@ long SmartLastPrint;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void Dispatch(void);
|
void Dispatch(void);
|
||||||
void InitProcVectors(void);
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
SmartScheduleClient (int *clientReady, int nready)
|
SmartScheduleClient (int *clientReady, int nready)
|
||||||
|
@ -917,23 +916,14 @@ GetGeometry(ClientPtr client, xGetGeometryReply *rep)
|
||||||
rep->width = pDraw->width;
|
rep->width = pDraw->width;
|
||||||
rep->height = pDraw->height;
|
rep->height = pDraw->height;
|
||||||
|
|
||||||
/* XXX - Because the pixmap-implementation of the multibuffer extension
|
if (WindowDrawable(pDraw->type))
|
||||||
* may have the buffer-id's drawable resource value be a pointer
|
|
||||||
* to the buffer's window instead of the buffer itself
|
|
||||||
* (this happens if the buffer is the displayed buffer),
|
|
||||||
* we also have to check that the id matches before we can
|
|
||||||
* truly say that it is a DRAWABLE_WINDOW.
|
|
||||||
*/
|
|
||||||
|
|
||||||
if ((pDraw->type == UNDRAWABLE_WINDOW) ||
|
|
||||||
((pDraw->type == DRAWABLE_WINDOW) && (stuff->id == pDraw->id)))
|
|
||||||
{
|
{
|
||||||
WindowPtr pWin = (WindowPtr)pDraw;
|
WindowPtr pWin = (WindowPtr)pDraw;
|
||||||
rep->x = pWin->origin.x - wBorderWidth (pWin);
|
rep->x = pWin->origin.x - wBorderWidth (pWin);
|
||||||
rep->y = pWin->origin.y - wBorderWidth (pWin);
|
rep->y = pWin->origin.y - wBorderWidth (pWin);
|
||||||
rep->borderWidth = pWin->borderWidth;
|
rep->borderWidth = pWin->borderWidth;
|
||||||
}
|
}
|
||||||
else /* DRAWABLE_PIXMAP or DRAWABLE_BUFFER */
|
else /* DRAWABLE_PIXMAP */
|
||||||
{
|
{
|
||||||
rep->x = rep->y = rep->borderWidth = 0;
|
rep->x = rep->y = rep->borderWidth = 0;
|
||||||
}
|
}
|
||||||
|
@ -3387,25 +3377,6 @@ int ProcNoOperation(ClientPtr client)
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
InitProcVectors(void)
|
|
||||||
{
|
|
||||||
int i;
|
|
||||||
for (i = 0; i<256; i++)
|
|
||||||
{
|
|
||||||
if(!ProcVector[i])
|
|
||||||
{
|
|
||||||
ProcVector[i] = SwappedProcVector[i] = ProcBadRequest;
|
|
||||||
ReplySwapVector[i] = ReplyNotSwappd;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
for(i = LASTEvent; i < 128; i++)
|
|
||||||
{
|
|
||||||
EventSwapVector[i] = NotImplemented;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**********************
|
/**********************
|
||||||
* CloseDownClient
|
* CloseDownClient
|
||||||
*
|
*
|
||||||
|
|
211
dix/dispatch.h
211
dix/dispatch.h
|
@ -36,111 +36,110 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
#ifndef DISPATCH_H
|
#ifndef DISPATCH_H
|
||||||
#define DISPATCH_H 1
|
#define DISPATCH_H 1
|
||||||
|
|
||||||
DISPATCH_PROC(InitClientPrivates);
|
int ProcAllocColor(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcAllocColor);
|
int ProcAllocColorCells(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcAllocColorCells);
|
int ProcAllocColorPlanes(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcAllocColorPlanes);
|
int ProcAllocNamedColor(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcAllocNamedColor);
|
int ProcBell(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcBell);
|
int ProcChangeAccessControl(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcChangeAccessControl);
|
int ProcChangeCloseDownMode(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcChangeCloseDownMode);
|
int ProcChangeGC(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcChangeGC);
|
int ProcChangeHosts(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcChangeHosts);
|
int ProcChangeKeyboardControl(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcChangeKeyboardControl);
|
int ProcChangeKeyboardMapping(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcChangeKeyboardMapping);
|
int ProcChangePointerControl(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcChangePointerControl);
|
int ProcChangeProperty(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcChangeProperty);
|
int ProcChangeSaveSet(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcChangeSaveSet);
|
int ProcChangeWindowAttributes(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcChangeWindowAttributes);
|
int ProcCirculateWindow(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcCirculateWindow);
|
int ProcClearToBackground(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcClearToBackground);
|
int ProcCloseFont(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcCloseFont);
|
int ProcConfigureWindow(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcConfigureWindow);
|
int ProcConvertSelection(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcConvertSelection);
|
int ProcCopyArea(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcCopyArea);
|
int ProcCopyColormapAndFree(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcCopyColormapAndFree);
|
int ProcCopyGC(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcCopyGC);
|
int ProcCopyPlane(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcCopyPlane);
|
int ProcCreateColormap(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcCreateColormap);
|
int ProcCreateCursor(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcCreateCursor);
|
int ProcCreateGC(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcCreateGC);
|
int ProcCreateGlyphCursor(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcCreateGlyphCursor);
|
int ProcCreatePixmap(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcCreatePixmap);
|
int ProcCreateWindow(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcCreateWindow);
|
int ProcDeleteProperty(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcDeleteProperty);
|
int ProcDestroySubwindows(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcDestroySubwindows);
|
int ProcDestroyWindow(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcDestroyWindow);
|
int ProcEstablishConnection(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcEstablishConnection);
|
int ProcFillPoly(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcFillPoly);
|
int ProcForceScreenSaver(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcForceScreenSaver);
|
int ProcFreeColormap(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcFreeColormap);
|
int ProcFreeColors(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcFreeColors);
|
int ProcFreeCursor(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcFreeCursor);
|
int ProcFreeGC(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcFreeGC);
|
int ProcFreePixmap(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcFreePixmap);
|
int ProcGetAtomName(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcGetAtomName);
|
int ProcGetFontPath(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcGetFontPath);
|
int ProcGetGeometry(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcGetGeometry);
|
int ProcGetImage(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcGetImage);
|
int ProcGetKeyboardControl(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcGetKeyboardControl);
|
int ProcGetKeyboardMapping(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcGetKeyboardMapping);
|
int ProcGetModifierMapping(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcGetModifierMapping);
|
int ProcGetMotionEvents(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcGetMotionEvents);
|
int ProcGetPointerControl(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcGetPointerControl);
|
int ProcGetPointerMapping(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcGetPointerMapping);
|
int ProcGetProperty(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcGetProperty);
|
int ProcGetScreenSaver(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcGetScreenSaver);
|
int ProcGetSelectionOwner(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcGetSelectionOwner);
|
int ProcGetWindowAttributes(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcGetWindowAttributes);
|
int ProcGrabServer(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcGrabServer);
|
int ProcImageText16(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcImageText16);
|
int ProcImageText8(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcImageText8);
|
int ProcInitialConnection(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcInitialConnection);
|
int ProcInstallColormap(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcInstallColormap);
|
int ProcInternAtom(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcInternAtom);
|
int ProcKillClient(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcKillClient);
|
int ProcListExtensions(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcListExtensions);
|
int ProcListFonts(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcListFonts);
|
int ProcListFontsWithInfo(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcListFontsWithInfo);
|
int ProcListHosts(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcListHosts);
|
int ProcListInstalledColormaps(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcListInstalledColormaps);
|
int ProcListProperties(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcListProperties);
|
int ProcLookupColor(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcLookupColor);
|
int ProcMapSubwindows(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcMapSubwindows);
|
int ProcMapWindow(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcMapWindow);
|
int ProcNoOperation(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcNoOperation);
|
int ProcOpenFont(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcOpenFont);
|
int ProcPolyArc(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcPolyArc);
|
int ProcPolyFillArc(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcPolyFillArc);
|
int ProcPolyFillRectangle(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcPolyFillRectangle);
|
int ProcPolyLine(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcPolyLine);
|
int ProcPolyPoint(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcPolyPoint);
|
int ProcPolyRectangle(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcPolyRectangle);
|
int ProcPolySegment(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcPolySegment);
|
int ProcPolyText(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcPolyText);
|
int ProcPutImage(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcPutImage);
|
int ProcQueryBestSize(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcQueryBestSize);
|
int ProcQueryColors(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcQueryColors);
|
int ProcQueryExtension(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcQueryExtension);
|
int ProcQueryFont(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcQueryFont);
|
int ProcQueryKeymap(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcQueryKeymap);
|
int ProcQueryTextExtents(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcQueryTextExtents);
|
int ProcQueryTree(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcQueryTree);
|
int ProcReparentWindow(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcReparentWindow);
|
int ProcRotateProperties(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcRotateProperties);
|
int ProcSetClipRectangles(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcSetClipRectangles);
|
int ProcSetDashes(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcSetDashes);
|
int ProcSetFontPath(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcSetFontPath);
|
int ProcSetModifierMapping(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcSetModifierMapping);
|
int ProcSetPointerMapping(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcSetPointerMapping);
|
int ProcSetScreenSaver(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcSetScreenSaver);
|
int ProcSetSelectionOwner(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcSetSelectionOwner);
|
int ProcStoreColors(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcStoreColors);
|
int ProcStoreNamedColor(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcStoreNamedColor);
|
int ProcTranslateCoords(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcTranslateCoords);
|
int ProcUngrabServer(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcUngrabServer);
|
int ProcUninstallColormap(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcUninstallColormap);
|
int ProcUnmapSubwindows(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcUnmapSubwindows);
|
int ProcUnmapWindow(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcUnmapWindow);
|
|
||||||
|
|
||||||
#endif /* DISPATCH_H */
|
#endif /* DISPATCH_H */
|
||||||
|
|
|
@ -1170,6 +1170,7 @@ doPolyText(ClientPtr client, PTclosurePtr c)
|
||||||
enum { NEVER_SLEPT, START_SLEEP, SLEEPING } client_state = NEVER_SLEPT;
|
enum { NEVER_SLEPT, START_SLEEP, SLEEPING } client_state = NEVER_SLEPT;
|
||||||
FontPathElementPtr fpe;
|
FontPathElementPtr fpe;
|
||||||
GC *origGC = NULL;
|
GC *origGC = NULL;
|
||||||
|
int itemSize = c->reqType == X_PolyText8 ? 1 : 2;
|
||||||
|
|
||||||
if (client->clientGone)
|
if (client->clientGone)
|
||||||
{
|
{
|
||||||
|
@ -1255,10 +1256,6 @@ doPolyText(ClientPtr client, PTclosurePtr c)
|
||||||
val.ptr = pFont;
|
val.ptr = pFont;
|
||||||
ChangeGC(NullClient, c->pGC, GCFont, &val);
|
ChangeGC(NullClient, c->pGC, GCFont, &val);
|
||||||
ValidateGC(c->pDraw, c->pGC);
|
ValidateGC(c->pDraw, c->pGC);
|
||||||
if (c->reqType == X_PolyText8)
|
|
||||||
c->polyText = (PolyTextPtr) c->pGC->ops->PolyText8;
|
|
||||||
else
|
|
||||||
c->polyText = (PolyTextPtr) c->pGC->ops->PolyText16;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Undo the refcnt++ we performed when going to sleep */
|
/* Undo the refcnt++ we performed when going to sleep */
|
||||||
|
@ -1270,7 +1267,7 @@ doPolyText(ClientPtr client, PTclosurePtr c)
|
||||||
else /* print a string */
|
else /* print a string */
|
||||||
{
|
{
|
||||||
unsigned char *pNextElt;
|
unsigned char *pNextElt;
|
||||||
pNextElt = c->pElt + TextEltHeader + (*c->pElt)*c->itemSize;
|
pNextElt = c->pElt + TextEltHeader + (*c->pElt) * itemSize;
|
||||||
if ( pNextElt > c->endReq)
|
if ( pNextElt > c->endReq)
|
||||||
{
|
{
|
||||||
err = BadLength;
|
err = BadLength;
|
||||||
|
@ -1283,7 +1280,7 @@ doPolyText(ClientPtr client, PTclosurePtr c)
|
||||||
}
|
}
|
||||||
if (c->pDraw)
|
if (c->pDraw)
|
||||||
{
|
{
|
||||||
lgerr = LoadGlyphs(client, c->pGC->font, *c->pElt, c->itemSize,
|
lgerr = LoadGlyphs(client, c->pGC->font, *c->pElt, itemSize,
|
||||||
c->pElt + TextEltHeader);
|
c->pElt + TextEltHeader);
|
||||||
}
|
}
|
||||||
else lgerr = Successful;
|
else lgerr = Successful;
|
||||||
|
@ -1381,8 +1378,12 @@ doPolyText(ClientPtr client, PTclosurePtr c)
|
||||||
if (c->pDraw)
|
if (c->pDraw)
|
||||||
{
|
{
|
||||||
c->xorg += *((INT8 *)(c->pElt + 1)); /* must be signed */
|
c->xorg += *((INT8 *)(c->pElt + 1)); /* must be signed */
|
||||||
c->xorg = (* c->polyText)(c->pDraw, c->pGC, c->xorg, c->yorg,
|
if (c->reqType == X_PolyText8)
|
||||||
*c->pElt, c->pElt + TextEltHeader);
|
c->xorg = (* c->pGC->ops->PolyText8)(c->pDraw, c->pGC, c->xorg, c->yorg,
|
||||||
|
*c->pElt, (char *) (c->pElt + TextEltHeader));
|
||||||
|
else
|
||||||
|
c->xorg = (* c->pGC->ops->PolyText16)(c->pDraw, c->pGC, c->xorg, c->yorg,
|
||||||
|
*c->pElt, (unsigned short *) (c->pElt + TextEltHeader));
|
||||||
}
|
}
|
||||||
c->pElt = pNextElt;
|
c->pElt = pNextElt;
|
||||||
}
|
}
|
||||||
|
@ -1442,16 +1443,7 @@ PolyText(ClientPtr client, DrawablePtr pDraw, GC *pGC, unsigned char *pElt,
|
||||||
local_closure.pDraw = pDraw;
|
local_closure.pDraw = pDraw;
|
||||||
local_closure.xorg = xorg;
|
local_closure.xorg = xorg;
|
||||||
local_closure.yorg = yorg;
|
local_closure.yorg = yorg;
|
||||||
if ((local_closure.reqType = reqType) == X_PolyText8)
|
local_closure.reqType = reqType;
|
||||||
{
|
|
||||||
local_closure.polyText = (PolyTextPtr) pGC->ops->PolyText8;
|
|
||||||
local_closure.itemSize = 1;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
local_closure.polyText = (PolyTextPtr) pGC->ops->PolyText16;
|
|
||||||
local_closure.itemSize = 2;
|
|
||||||
}
|
|
||||||
local_closure.pGC = pGC;
|
local_closure.pGC = pGC;
|
||||||
local_closure.did = did;
|
local_closure.did = did;
|
||||||
local_closure.err = Success;
|
local_closure.err = Success;
|
||||||
|
@ -1469,6 +1461,7 @@ doImageText(ClientPtr client, ITclosurePtr c)
|
||||||
{
|
{
|
||||||
int err = Success, lgerr; /* err is in X error, not font error, space */
|
int err = Success, lgerr; /* err is in X error, not font error, space */
|
||||||
FontPathElementPtr fpe;
|
FontPathElementPtr fpe;
|
||||||
|
int itemSize = c->reqType == X_ImageText8 ? 1 : 2;
|
||||||
|
|
||||||
if (client->clientGone)
|
if (client->clientGone)
|
||||||
{
|
{
|
||||||
|
@ -1493,7 +1486,7 @@ doImageText(ClientPtr client, ITclosurePtr c)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
lgerr = LoadGlyphs(client, c->pGC->font, c->nChars, c->itemSize, c->data);
|
lgerr = LoadGlyphs(client, c->pGC->font, c->nChars, itemSize, c->data);
|
||||||
if (lgerr == Suspended)
|
if (lgerr == Suspended)
|
||||||
{
|
{
|
||||||
if (!ClientIsAsleep(client)) {
|
if (!ClientIsAsleep(client)) {
|
||||||
|
@ -1515,14 +1508,14 @@ doImageText(ClientPtr client, ITclosurePtr c)
|
||||||
*new_closure = *c;
|
*new_closure = *c;
|
||||||
c = new_closure;
|
c = new_closure;
|
||||||
|
|
||||||
data = malloc(c->nChars * c->itemSize);
|
data = malloc(c->nChars * itemSize);
|
||||||
if (!data)
|
if (!data)
|
||||||
{
|
{
|
||||||
free(c);
|
free(c);
|
||||||
err = BadAlloc;
|
err = BadAlloc;
|
||||||
goto bail;
|
goto bail;
|
||||||
}
|
}
|
||||||
memmove(data, c->data, c->nChars * c->itemSize);
|
memmove(data, c->data, c->nChars * itemSize);
|
||||||
c->data = data;
|
c->data = data;
|
||||||
|
|
||||||
pGC = GetScratchGC(c->pGC->depth, c->pGC->pScreen);
|
pGC = GetScratchGC(c->pGC->depth, c->pGC->pScreen);
|
||||||
|
@ -1562,8 +1555,12 @@ doImageText(ClientPtr client, ITclosurePtr c)
|
||||||
}
|
}
|
||||||
if (c->pDraw)
|
if (c->pDraw)
|
||||||
{
|
{
|
||||||
(* c->imageText)(c->pDraw, c->pGC, c->xorg, c->yorg,
|
if (c->reqType == X_ImageText8)
|
||||||
c->nChars, c->data);
|
(* c->pGC->ops->ImageText8)(c->pDraw, c->pGC, c->xorg, c->yorg,
|
||||||
|
c->nChars, (char *) c->data);
|
||||||
|
else
|
||||||
|
(* c->pGC->ops->ImageText16)(c->pDraw, c->pGC, c->xorg, c->yorg,
|
||||||
|
c->nChars, (unsigned short *) c->data);
|
||||||
}
|
}
|
||||||
|
|
||||||
bail:
|
bail:
|
||||||
|
@ -1601,16 +1598,7 @@ ImageText(ClientPtr client, DrawablePtr pDraw, GC *pGC, int nChars,
|
||||||
local_closure.data = data;
|
local_closure.data = data;
|
||||||
local_closure.xorg = xorg;
|
local_closure.xorg = xorg;
|
||||||
local_closure.yorg = yorg;
|
local_closure.yorg = yorg;
|
||||||
if ((local_closure.reqType = reqType) == X_ImageText8)
|
local_closure.reqType = reqType;
|
||||||
{
|
|
||||||
local_closure.imageText = (ImageTextPtr) pGC->ops->ImageText8;
|
|
||||||
local_closure.itemSize = 1;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
local_closure.imageText = (ImageTextPtr) pGC->ops->ImageText16;
|
|
||||||
local_closure.itemSize = 2;
|
|
||||||
}
|
|
||||||
local_closure.did = did;
|
local_closure.did = did;
|
||||||
|
|
||||||
(void) doImageText(client, &local_closure);
|
(void) doImageText(client, &local_closure);
|
||||||
|
|
|
@ -729,7 +729,7 @@ _DeleteCallback(
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
void
|
||||||
_CallCallbacks(
|
_CallCallbacks(
|
||||||
CallbackListPtr *pcbl,
|
CallbackListPtr *pcbl,
|
||||||
pointer call_data)
|
pointer call_data)
|
||||||
|
@ -870,13 +870,6 @@ DeleteCallback(CallbackListPtr *pcbl, CallbackProcPtr callback, pointer data)
|
||||||
return _DeleteCallback(pcbl, callback, data);
|
return _DeleteCallback(pcbl, callback, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
CallCallbacks(CallbackListPtr *pcbl, pointer call_data)
|
|
||||||
{
|
|
||||||
if (!pcbl || !*pcbl) return;
|
|
||||||
_CallCallbacks(pcbl, call_data);
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
DeleteCallbackList(CallbackListPtr *pcbl)
|
DeleteCallbackList(CallbackListPtr *pcbl)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1251,11 +1251,6 @@ CoreFocusEvents(DeviceIntPtr dev,
|
||||||
SetFocusIn(dev, to);
|
SetFocusIn(dev, to);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* The root window the given device is currently on.
|
|
||||||
*/
|
|
||||||
#define RootWindow(dev) dev->spriteInfo->sprite->spriteTrace[0]
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
DeviceFocusEvents(DeviceIntPtr dev,
|
DeviceFocusEvents(DeviceIntPtr dev,
|
||||||
WindowPtr from,
|
WindowPtr from,
|
||||||
|
@ -1284,7 +1279,7 @@ DeviceFocusEvents(DeviceIntPtr dev,
|
||||||
if ((from == NullWindow) || (from == PointerRootWin))
|
if ((from == NullWindow) || (from == PointerRootWin))
|
||||||
{
|
{
|
||||||
if (from == PointerRootWin)
|
if (from == PointerRootWin)
|
||||||
DeviceFocusOutEvents(dev, sprite->win, RootWindow(dev), mode,
|
DeviceFocusOutEvents(dev, sprite->win, GetCurrentRootWindow(dev), mode,
|
||||||
NotifyPointer);
|
NotifyPointer);
|
||||||
/* Notify all the roots */
|
/* Notify all the roots */
|
||||||
for (i = 0; i < nscreens; i++)
|
for (i = 0; i < nscreens; i++)
|
||||||
|
@ -1304,19 +1299,19 @@ DeviceFocusEvents(DeviceIntPtr dev,
|
||||||
for (i = 0; i < nscreens; i++)
|
for (i = 0; i < nscreens; i++)
|
||||||
DeviceFocusEvent(dev, XI_FocusIn, mode, in, screenInfo.screens[i]->root);
|
DeviceFocusEvent(dev, XI_FocusIn, mode, in, screenInfo.screens[i]->root);
|
||||||
if (to == PointerRootWin)
|
if (to == PointerRootWin)
|
||||||
DeviceFocusInEvents(dev, RootWindow(dev), sprite->win, mode, NotifyPointer);
|
DeviceFocusInEvents(dev, GetCurrentRootWindow(dev), sprite->win, mode, NotifyPointer);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ((from == NullWindow) || (from == PointerRootWin))
|
if ((from == NullWindow) || (from == PointerRootWin))
|
||||||
{
|
{
|
||||||
if (from == PointerRootWin)
|
if (from == PointerRootWin)
|
||||||
DeviceFocusOutEvents(dev, sprite->win, RootWindow(dev), mode,
|
DeviceFocusOutEvents(dev, sprite->win, GetCurrentRootWindow(dev), mode,
|
||||||
NotifyPointer);
|
NotifyPointer);
|
||||||
for (i = 0; i < nscreens; i++)
|
for (i = 0; i < nscreens; i++)
|
||||||
DeviceFocusEvent(dev, XI_FocusOut, mode, out, screenInfo.screens[i]->root);
|
DeviceFocusEvent(dev, XI_FocusOut, mode, out, screenInfo.screens[i]->root);
|
||||||
if (to->parent != NullWindow)
|
if (to->parent != NullWindow)
|
||||||
DeviceFocusInEvents(dev, RootWindow(dev), to, mode, NotifyNonlinearVirtual);
|
DeviceFocusInEvents(dev, GetCurrentRootWindow(dev), to, mode, NotifyNonlinearVirtual);
|
||||||
DeviceFocusEvent(dev, XI_FocusIn, mode, NotifyNonlinear, to);
|
DeviceFocusEvent(dev, XI_FocusIn, mode, NotifyNonlinear, to);
|
||||||
if (IsParent(to, sprite->win))
|
if (IsParent(to, sprite->win))
|
||||||
DeviceFocusInEvents(dev, to, sprite->win, mode, NotifyPointer);
|
DeviceFocusInEvents(dev, to, sprite->win, mode, NotifyPointer);
|
||||||
|
|
|
@ -102,6 +102,15 @@ EventToCore(InternalEvent *event, xEvent *core)
|
||||||
switch(event->any.type)
|
switch(event->any.type)
|
||||||
{
|
{
|
||||||
case ET_Motion:
|
case ET_Motion:
|
||||||
|
{
|
||||||
|
DeviceEvent *e = &event->device_event;
|
||||||
|
/* Don't create core motion event if neither x nor y are
|
||||||
|
* present */
|
||||||
|
if (!BitIsOn(e->valuators.mask, 0) &&
|
||||||
|
!BitIsOn(e->valuators.mask, 1))
|
||||||
|
return BadMatch;
|
||||||
|
}
|
||||||
|
/* fallthrough */
|
||||||
case ET_ButtonPress:
|
case ET_ButtonPress:
|
||||||
case ET_ButtonRelease:
|
case ET_ButtonRelease:
|
||||||
case ET_KeyPress:
|
case ET_KeyPress:
|
||||||
|
|
76
dix/events.c
76
dix/events.c
|
@ -1276,7 +1276,6 @@ static void
|
||||||
ComputeFreezes(void)
|
ComputeFreezes(void)
|
||||||
{
|
{
|
||||||
DeviceIntPtr replayDev = syncEvents.replayDev;
|
DeviceIntPtr replayDev = syncEvents.replayDev;
|
||||||
int i;
|
|
||||||
WindowPtr w;
|
WindowPtr w;
|
||||||
GrabPtr grab;
|
GrabPtr grab;
|
||||||
DeviceIntPtr dev;
|
DeviceIntPtr dev;
|
||||||
|
@ -1294,29 +1293,15 @@ ComputeFreezes(void)
|
||||||
syncEvents.replayDev = (DeviceIntPtr)NULL;
|
syncEvents.replayDev = (DeviceIntPtr)NULL;
|
||||||
|
|
||||||
w = XYToWindow(replayDev, event->root_x, event->root_y);
|
w = XYToWindow(replayDev, event->root_x, event->root_y);
|
||||||
for (i = 0; i < replayDev->spriteInfo->sprite->spriteTraceGood; i++)
|
if (!CheckDeviceGrabs(replayDev, event, syncEvents.replayWin))
|
||||||
{
|
{
|
||||||
if (syncEvents.replayWin ==
|
if (replayDev->focus && !IsPointerEvent((InternalEvent*)event))
|
||||||
replayDev->spriteInfo->sprite->spriteTrace[i])
|
DeliverFocusedEvent(replayDev, (InternalEvent*)event, w);
|
||||||
{
|
else
|
||||||
if (!CheckDeviceGrabs(replayDev, event, i+1)) {
|
DeliverDeviceEvents(w, (InternalEvent*)event, NullGrab,
|
||||||
if (replayDev->focus && !IsPointerEvent((InternalEvent*)event))
|
NullWindow, replayDev);
|
||||||
DeliverFocusedEvent(replayDev, (InternalEvent*)event, w);
|
}
|
||||||
else
|
|
||||||
DeliverDeviceEvents(w, (InternalEvent*)event, NullGrab,
|
|
||||||
NullWindow, replayDev);
|
|
||||||
}
|
|
||||||
goto playmore;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/* must not still be in the same stack */
|
|
||||||
if (replayDev->focus && !IsPointerEvent((InternalEvent*)event))
|
|
||||||
DeliverFocusedEvent(replayDev, (InternalEvent*)event, w);
|
|
||||||
else
|
|
||||||
DeliverDeviceEvents(w, (InternalEvent*)event, NullGrab,
|
|
||||||
NullWindow, replayDev);
|
|
||||||
}
|
}
|
||||||
playmore:
|
|
||||||
for (dev = inputInfo.devices; dev; dev = dev->next)
|
for (dev = inputInfo.devices; dev; dev = dev->next)
|
||||||
{
|
{
|
||||||
if (!dev->deviceGrab.sync.frozen)
|
if (!dev->deviceGrab.sync.frozen)
|
||||||
|
@ -2648,11 +2633,11 @@ ActivateFocusInGrab(DeviceIntPtr dev, WindowPtr old, WindowPtr win)
|
||||||
BOOL rc = FALSE;
|
BOOL rc = FALSE;
|
||||||
DeviceEvent event;
|
DeviceEvent event;
|
||||||
|
|
||||||
if (dev->deviceGrab.grab &&
|
if (dev->deviceGrab.grab)
|
||||||
dev->deviceGrab.fromPassiveGrab &&
|
|
||||||
dev->deviceGrab.grab->type == XI_Enter)
|
|
||||||
{
|
{
|
||||||
if (dev->deviceGrab.grab->window == win ||
|
if (!dev->deviceGrab.fromPassiveGrab ||
|
||||||
|
dev->deviceGrab.grab->type != XI_Enter ||
|
||||||
|
dev->deviceGrab.grab->window == win ||
|
||||||
IsParent(dev->deviceGrab.grab->window, win))
|
IsParent(dev->deviceGrab.grab->window, win))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
DoEnterLeaveEvents(dev, dev->id, old, win, XINotifyPassiveUngrab);
|
DoEnterLeaveEvents(dev, dev->id, old, win, XINotifyPassiveUngrab);
|
||||||
|
@ -2688,11 +2673,11 @@ ActivateEnterGrab(DeviceIntPtr dev, WindowPtr old, WindowPtr win)
|
||||||
BOOL rc = FALSE;
|
BOOL rc = FALSE;
|
||||||
DeviceEvent event;
|
DeviceEvent event;
|
||||||
|
|
||||||
if (dev->deviceGrab.grab &&
|
if (dev->deviceGrab.grab)
|
||||||
dev->deviceGrab.fromPassiveGrab &&
|
|
||||||
dev->deviceGrab.grab->type == XI_Enter)
|
|
||||||
{
|
{
|
||||||
if (dev->deviceGrab.grab->window == win ||
|
if (!dev->deviceGrab.fromPassiveGrab ||
|
||||||
|
dev->deviceGrab.grab->type != XI_Enter ||
|
||||||
|
dev->deviceGrab.grab->window == win ||
|
||||||
IsParent(dev->deviceGrab.grab->window, win))
|
IsParent(dev->deviceGrab.grab->window, win))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
DoEnterLeaveEvents(dev, dev->id, old, win, XINotifyPassiveUngrab);
|
DoEnterLeaveEvents(dev, dev->id, old, win, XINotifyPassiveUngrab);
|
||||||
|
@ -3403,9 +3388,6 @@ CheckPassiveGrabsOnWindow(
|
||||||
#define XI2_MATCH 0x4
|
#define XI2_MATCH 0x4
|
||||||
int match = 0;
|
int match = 0;
|
||||||
|
|
||||||
if (device->deviceGrab.grab)
|
|
||||||
return FALSE;
|
|
||||||
|
|
||||||
if (!grab)
|
if (!grab)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
/* Fill out the grab details, but leave the type for later before
|
/* Fill out the grab details, but leave the type for later before
|
||||||
|
@ -3614,7 +3596,7 @@ CheckPassiveGrabsOnWindow(
|
||||||
*/
|
*/
|
||||||
|
|
||||||
Bool
|
Bool
|
||||||
CheckDeviceGrabs(DeviceIntPtr device, DeviceEvent *event, int checkFirst)
|
CheckDeviceGrabs(DeviceIntPtr device, DeviceEvent *event, WindowPtr ancestor)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
WindowPtr pWin = NULL;
|
WindowPtr pWin = NULL;
|
||||||
|
@ -3629,30 +3611,38 @@ CheckDeviceGrabs(DeviceIntPtr device, DeviceEvent *event, int checkFirst)
|
||||||
&& (device->button->buttonsDown != 1))
|
&& (device->button->buttonsDown != 1))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
i = checkFirst;
|
if (device->deviceGrab.grab)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
i = 0;
|
||||||
|
if (ancestor)
|
||||||
|
{
|
||||||
|
while (i < device->spriteInfo->sprite->spriteTraceGood)
|
||||||
|
if (device->spriteInfo->sprite->spriteTrace[i++] == ancestor)
|
||||||
|
break;
|
||||||
|
if (i == device->spriteInfo->sprite->spriteTraceGood)
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
if (focus)
|
if (focus)
|
||||||
{
|
{
|
||||||
for (; i < focus->traceGood; i++)
|
for (; i < focus->traceGood; i++)
|
||||||
{
|
{
|
||||||
pWin = focus->trace[i];
|
pWin = focus->trace[i];
|
||||||
if (pWin->optional &&
|
if (CheckPassiveGrabsOnWindow(pWin, device, event, sendCore))
|
||||||
CheckPassiveGrabsOnWindow(pWin, device, event, sendCore))
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((focus->win == NoneWin) ||
|
if ((focus->win == NoneWin) ||
|
||||||
(i >= device->spriteInfo->sprite->spriteTraceGood) ||
|
(i >= device->spriteInfo->sprite->spriteTraceGood) ||
|
||||||
((i > checkFirst) &&
|
(pWin && pWin != device->spriteInfo->sprite->spriteTrace[i-1]))
|
||||||
(pWin != device->spriteInfo->sprite->spriteTrace[i-1])))
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (; i < device->spriteInfo->sprite->spriteTraceGood; i++)
|
for (; i < device->spriteInfo->sprite->spriteTraceGood; i++)
|
||||||
{
|
{
|
||||||
pWin = device->spriteInfo->sprite->spriteTrace[i];
|
pWin = device->spriteInfo->sprite->spriteTrace[i];
|
||||||
if (pWin->optional &&
|
if (CheckPassiveGrabsOnWindow(pWin, device, event, sendCore))
|
||||||
CheckPassiveGrabsOnWindow(pWin, device, event, sendCore))
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5065,7 +5055,7 @@ ProcSendEvent(ClientPtr client)
|
||||||
/* If the input focus is PointerRootWin, send the event to where
|
/* If the input focus is PointerRootWin, send the event to where
|
||||||
the pointer is if possible, then perhaps propogate up to root. */
|
the pointer is if possible, then perhaps propogate up to root. */
|
||||||
if (inputFocus == PointerRootWin)
|
if (inputFocus == PointerRootWin)
|
||||||
inputFocus = pSprite->spriteTrace[0]; /* Root window! */
|
inputFocus = RootWindow(dev);
|
||||||
|
|
||||||
if (IsParent(inputFocus, pSprite->win))
|
if (IsParent(inputFocus, pSprite->win))
|
||||||
{
|
{
|
||||||
|
|
|
@ -96,7 +96,7 @@ AddExtension(char *name, int NumEvents, int NumErrors,
|
||||||
free(ext);
|
free(ext);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
ext->name = malloc(strlen(name) + 1);
|
ext->name = strdup(name);
|
||||||
ext->num_aliases = 0;
|
ext->num_aliases = 0;
|
||||||
ext->aliases = (char **)NULL;
|
ext->aliases = (char **)NULL;
|
||||||
if (!ext->name)
|
if (!ext->name)
|
||||||
|
@ -105,7 +105,6 @@ AddExtension(char *name, int NumEvents, int NumErrors,
|
||||||
free(ext);
|
free(ext);
|
||||||
return((ExtensionEntry *) NULL);
|
return((ExtensionEntry *) NULL);
|
||||||
}
|
}
|
||||||
strcpy(ext->name, name);
|
|
||||||
i = NumExtensions;
|
i = NumExtensions;
|
||||||
newexts = (ExtensionEntry **) realloc(extensions,
|
newexts = (ExtensionEntry **) realloc(extensions,
|
||||||
(i + 1) * sizeof(ExtensionEntry *));
|
(i + 1) * sizeof(ExtensionEntry *));
|
||||||
|
@ -164,10 +163,9 @@ Bool AddExtensionAlias(char *alias, ExtensionEntry *ext)
|
||||||
if (!aliases)
|
if (!aliases)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
ext->aliases = aliases;
|
ext->aliases = aliases;
|
||||||
name = malloc(strlen(alias) + 1);
|
name = strdup(alias);
|
||||||
if (!name)
|
if (!name)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
strcpy(name, alias);
|
|
||||||
ext->aliases[ext->num_aliases] = name;
|
ext->aliases[ext->num_aliases] = name;
|
||||||
ext->num_aliases++;
|
ext->num_aliases++;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
6
dix/gc.c
6
dix/gc.c
|
@ -527,8 +527,6 @@ CreateGC(DrawablePtr pDrawable, BITS32 mask, XID *pval, int *pStatus,
|
||||||
pGC->numInDashList = 2;
|
pGC->numInDashList = 2;
|
||||||
pGC->dash = DefaultDash;
|
pGC->dash = DefaultDash;
|
||||||
pGC->dashOffset = 0;
|
pGC->dashOffset = 0;
|
||||||
pGC->lastWinOrg.x = 0;
|
|
||||||
pGC->lastWinOrg.y = 0;
|
|
||||||
|
|
||||||
/* use the default font and stipple */
|
/* use the default font and stipple */
|
||||||
pGC->font = defaultFont;
|
pGC->font = defaultFont;
|
||||||
|
@ -801,7 +799,7 @@ is what fills the default tile. (maybe this comment should
|
||||||
go with CreateGC() or ChangeGC().)
|
go with CreateGC() or ChangeGC().)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
GCPtr
|
static GCPtr
|
||||||
CreateScratchGC(ScreenPtr pScreen, unsigned depth)
|
CreateScratchGC(ScreenPtr pScreen, unsigned depth)
|
||||||
{
|
{
|
||||||
GCPtr pGC;
|
GCPtr pGC;
|
||||||
|
@ -841,8 +839,6 @@ CreateScratchGC(ScreenPtr pScreen, unsigned depth)
|
||||||
pGC->dashOffset = 0;
|
pGC->dashOffset = 0;
|
||||||
pGC->numInDashList = 2;
|
pGC->numInDashList = 2;
|
||||||
pGC->dash = DefaultDash;
|
pGC->dash = DefaultDash;
|
||||||
pGC->lastWinOrg.x = 0;
|
|
||||||
pGC->lastWinOrg.y = 0;
|
|
||||||
|
|
||||||
/* scratch GCs in the GCperDepth pool start off unused */
|
/* scratch GCs in the GCperDepth pool start off unused */
|
||||||
pGC->scratch_inuse = FALSE;
|
pGC->scratch_inuse = FALSE;
|
||||||
|
|
|
@ -286,7 +286,7 @@ int generate_modkeymap(ClientPtr client, DeviceIntPtr dev,
|
||||||
{
|
{
|
||||||
CARD8 keys_per_mod[8];
|
CARD8 keys_per_mod[8];
|
||||||
int max_keys_per_mod;
|
int max_keys_per_mod;
|
||||||
KeyCode *modkeymap;
|
KeyCode *modkeymap = NULL;
|
||||||
int i, j, ret;
|
int i, j, ret;
|
||||||
|
|
||||||
ret = XaceHook(XACE_DEVICE_ACCESS, client, dev, DixGetAttrAccess);
|
ret = XaceHook(XACE_DEVICE_ACCESS, client, dev, DixGetAttrAccess);
|
||||||
|
@ -310,18 +310,20 @@ int generate_modkeymap(ClientPtr client, DeviceIntPtr dev,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
modkeymap = calloc(max_keys_per_mod * 8, sizeof(KeyCode));
|
if (max_keys_per_mod != 0) {
|
||||||
if (!modkeymap)
|
modkeymap = calloc(max_keys_per_mod * 8, sizeof(KeyCode));
|
||||||
return BadAlloc;
|
if (!modkeymap)
|
||||||
|
return BadAlloc;
|
||||||
|
|
||||||
for (i = 0; i < 8; i++)
|
for (i = 0; i < 8; i++)
|
||||||
keys_per_mod[i] = 0;
|
keys_per_mod[i] = 0;
|
||||||
|
|
||||||
for (i = 8; i < MAP_LENGTH; i++) {
|
for (i = 8; i < MAP_LENGTH; i++) {
|
||||||
for (j = 0; j < 8; j++) {
|
for (j = 0; j < 8; j++) {
|
||||||
if (dev->key->xkbInfo->desc->map->modmap[i] & (1 << j)) {
|
if (dev->key->xkbInfo->desc->map->modmap[i] & (1 << j)) {
|
||||||
modkeymap[(j * max_keys_per_mod) + keys_per_mod[j]] = i;
|
modkeymap[(j * max_keys_per_mod) + keys_per_mod[j]] = i;
|
||||||
keys_per_mod[j]++;
|
keys_per_mod[j]++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -108,7 +108,6 @@ Equipment Corporation.
|
||||||
#include "panoramiXsrv.h"
|
#include "panoramiXsrv.h"
|
||||||
#else
|
#else
|
||||||
#include "dixevents.h" /* InitEvents() */
|
#include "dixevents.h" /* InitEvents() */
|
||||||
#include "dispatch.h" /* InitProcVectors() */
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef DPMSExtension
|
#ifdef DPMSExtension
|
||||||
|
@ -118,8 +117,6 @@ Equipment Corporation.
|
||||||
|
|
||||||
extern void Dispatch(void);
|
extern void Dispatch(void);
|
||||||
|
|
||||||
extern void InitProcVectors(void);
|
|
||||||
|
|
||||||
#ifdef XQUARTZ
|
#ifdef XQUARTZ
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
|
|
||||||
|
@ -171,7 +168,6 @@ int main(int argc, char *argv[], char *envp[])
|
||||||
if(serverGeneration == 1)
|
if(serverGeneration == 1)
|
||||||
{
|
{
|
||||||
CreateWellKnownSockets();
|
CreateWellKnownSockets();
|
||||||
InitProcVectors();
|
|
||||||
for (i=1; i<MAXCLIENTS; i++)
|
for (i=1; i<MAXCLIENTS; i++)
|
||||||
clients[i] = NullClient;
|
clients[i] = NullClient;
|
||||||
serverClient = calloc(sizeof(ClientRec), 1);
|
serverClient = calloc(sizeof(ClientRec), 1);
|
||||||
|
|
|
@ -71,6 +71,7 @@ static struct {
|
||||||
} keys[PRIVATE_LAST];
|
} keys[PRIVATE_LAST];
|
||||||
|
|
||||||
static const Bool xselinux_private[PRIVATE_LAST] = {
|
static const Bool xselinux_private[PRIVATE_LAST] = {
|
||||||
|
[PRIVATE_SCREEN] = TRUE,
|
||||||
[PRIVATE_CLIENT] = TRUE,
|
[PRIVATE_CLIENT] = TRUE,
|
||||||
[PRIVATE_WINDOW] = TRUE,
|
[PRIVATE_WINDOW] = TRUE,
|
||||||
[PRIVATE_PIXMAP] = TRUE,
|
[PRIVATE_PIXMAP] = TRUE,
|
||||||
|
@ -236,28 +237,35 @@ dixRegisterPrivateKey(DevPrivateKey key, DevPrivateType type, unsigned size)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
Bool
|
||||||
* Allocate a new private key.
|
dixRegisterScreenPrivateKey(DevScreenPrivateKey screenKey, ScreenPtr pScreen, DevPrivateType type, unsigned size)
|
||||||
*
|
|
||||||
* This manages the storage of the key object itself, freeing it when the
|
|
||||||
* privates system is restarted at server reset time. All other keys
|
|
||||||
* are expected to be statically allocated as the privates must be
|
|
||||||
* reset after all objects have been freed
|
|
||||||
*/
|
|
||||||
DevPrivateKey
|
|
||||||
dixCreatePrivateKey(DevPrivateType type, unsigned size)
|
|
||||||
{
|
{
|
||||||
DevPrivateKey key;
|
DevPrivateKey key;
|
||||||
|
|
||||||
|
if (!dixRegisterPrivateKey(&screenKey->screenKey, PRIVATE_SCREEN, 0))
|
||||||
|
return FALSE;
|
||||||
|
key = dixGetPrivate(&pScreen->devPrivates, &screenKey->screenKey);
|
||||||
|
if (key != NULL) {
|
||||||
|
assert(key->size == size);
|
||||||
|
assert(key->type == type);
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
key = calloc(sizeof (DevPrivateKeyRec), 1);
|
key = calloc(sizeof (DevPrivateKeyRec), 1);
|
||||||
if (!key)
|
if (!key)
|
||||||
return NULL;
|
return FALSE;
|
||||||
if (!dixRegisterPrivateKey(key, type, size)) {
|
if (!dixRegisterPrivateKey(key, type, size)) {
|
||||||
free(key);
|
free(key);
|
||||||
return NULL;
|
return FALSE;
|
||||||
}
|
}
|
||||||
key->allocated = TRUE;
|
key->allocated = TRUE;
|
||||||
return key;
|
dixSetPrivate(&pScreen->devPrivates, &screenKey->screenKey, key);
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
DevPrivateKey
|
||||||
|
_dixGetScreenPrivateKey(const DevScreenPrivateKey key, ScreenPtr pScreen)
|
||||||
|
{
|
||||||
|
return dixGetPrivate(&pScreen->devPrivates, &key->screenKey);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -284,7 +284,6 @@ dixChangeWindowProperty(ClientPtr pClient, WindowPtr pWin, Atom property,
|
||||||
pProp->format = format;
|
pProp->format = format;
|
||||||
pProp->data = data;
|
pProp->data = data;
|
||||||
pProp->size = len;
|
pProp->size = len;
|
||||||
pProp->devPrivates = NULL;
|
|
||||||
rc = XaceHookPropertyAccess(pClient, pWin, &pProp,
|
rc = XaceHookPropertyAccess(pClient, pWin, &pProp,
|
||||||
DixCreateAccess|DixWriteAccess);
|
DixCreateAccess|DixWriteAccess);
|
||||||
if (rc != Success) {
|
if (rc != Success) {
|
||||||
|
|
|
@ -196,12 +196,11 @@ ProcSetSelectionOwner(ClientPtr client)
|
||||||
/*
|
/*
|
||||||
* It doesn't exist, so add it...
|
* It doesn't exist, so add it...
|
||||||
*/
|
*/
|
||||||
pSel = malloc(sizeof(Selection));
|
pSel = dixAllocateObjectWithPrivates(Selection, PRIVATE_SELECTION);
|
||||||
if (!pSel)
|
if (!pSel)
|
||||||
return BadAlloc;
|
return BadAlloc;
|
||||||
|
|
||||||
pSel->selection = stuff->selection;
|
pSel->selection = stuff->selection;
|
||||||
pSel->devPrivates = NULL;
|
|
||||||
|
|
||||||
/* security creation/labeling check */
|
/* security creation/labeling check */
|
||||||
rc = XaceHookSelectionAccess(client, &pSel,
|
rc = XaceHookSelectionAccess(client, &pSel,
|
||||||
|
|
508
dix/tables.c
508
dix/tables.c
|
@ -192,14 +192,142 @@ int (* ProcVector[256]) (
|
||||||
ProcGetPointerMapping,
|
ProcGetPointerMapping,
|
||||||
ProcSetModifierMapping,
|
ProcSetModifierMapping,
|
||||||
ProcGetModifierMapping,
|
ProcGetModifierMapping,
|
||||||
0, /* 120 */
|
ProcBadRequest, /* 120 */
|
||||||
0,
|
ProcBadRequest,
|
||||||
0,
|
ProcBadRequest,
|
||||||
0,
|
ProcBadRequest,
|
||||||
0,
|
ProcBadRequest,
|
||||||
0, /* 125 */
|
ProcBadRequest, /* 125 */
|
||||||
0,
|
ProcBadRequest,
|
||||||
ProcNoOperation
|
ProcNoOperation,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest
|
||||||
};
|
};
|
||||||
|
|
||||||
int (* SwappedProcVector[256]) (
|
int (* SwappedProcVector[256]) (
|
||||||
|
@ -326,14 +454,142 @@ int (* SwappedProcVector[256]) (
|
||||||
SProcSimpleReq, /* GetPointerMapping, */
|
SProcSimpleReq, /* GetPointerMapping, */
|
||||||
SProcSimpleReq, /* SetModifierMapping, */
|
SProcSimpleReq, /* SetModifierMapping, */
|
||||||
SProcSimpleReq, /* GetModifierMapping, */
|
SProcSimpleReq, /* GetModifierMapping, */
|
||||||
0, /* 120 */
|
ProcBadRequest, /* 120 */
|
||||||
0,
|
ProcBadRequest,
|
||||||
0,
|
ProcBadRequest,
|
||||||
0,
|
ProcBadRequest,
|
||||||
0,
|
ProcBadRequest,
|
||||||
0, /* 125 */
|
ProcBadRequest, /* 125 */
|
||||||
0,
|
ProcBadRequest,
|
||||||
SProcNoOperation
|
SProcNoOperation,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest,
|
||||||
|
ProcBadRequest
|
||||||
};
|
};
|
||||||
|
|
||||||
EventSwapPtr EventSwapVector[128] =
|
EventSwapPtr EventSwapVector[128] =
|
||||||
|
@ -373,6 +629,99 @@ EventSwapPtr EventSwapVector[128] =
|
||||||
SColormapEvent,
|
SColormapEvent,
|
||||||
SClientMessageEvent,
|
SClientMessageEvent,
|
||||||
SMappingEvent,
|
SMappingEvent,
|
||||||
|
NotImplemented,
|
||||||
|
NotImplemented,
|
||||||
|
NotImplemented,
|
||||||
|
NotImplemented,
|
||||||
|
NotImplemented,
|
||||||
|
NotImplemented,
|
||||||
|
NotImplemented,
|
||||||
|
NotImplemented,
|
||||||
|
NotImplemented,
|
||||||
|
NotImplemented,
|
||||||
|
NotImplemented,
|
||||||
|
NotImplemented,
|
||||||
|
NotImplemented,
|
||||||
|
NotImplemented,
|
||||||
|
NotImplemented,
|
||||||
|
NotImplemented,
|
||||||
|
NotImplemented,
|
||||||
|
NotImplemented,
|
||||||
|
NotImplemented,
|
||||||
|
NotImplemented,
|
||||||
|
NotImplemented,
|
||||||
|
NotImplemented,
|
||||||
|
NotImplemented,
|
||||||
|
NotImplemented,
|
||||||
|
NotImplemented,
|
||||||
|
NotImplemented,
|
||||||
|
NotImplemented,
|
||||||
|
NotImplemented,
|
||||||
|
NotImplemented,
|
||||||
|
NotImplemented,
|
||||||
|
NotImplemented,
|
||||||
|
NotImplemented,
|
||||||
|
NotImplemented,
|
||||||
|
NotImplemented,
|
||||||
|
NotImplemented,
|
||||||
|
NotImplemented,
|
||||||
|
NotImplemented,
|
||||||
|
NotImplemented,
|
||||||
|
NotImplemented,
|
||||||
|
NotImplemented,
|
||||||
|
NotImplemented,
|
||||||
|
NotImplemented,
|
||||||
|
NotImplemented,
|
||||||
|
NotImplemented,
|
||||||
|
NotImplemented,
|
||||||
|
NotImplemented,
|
||||||
|
NotImplemented,
|
||||||
|
NotImplemented,
|
||||||
|
NotImplemented,
|
||||||
|
NotImplemented,
|
||||||
|
NotImplemented,
|
||||||
|
NotImplemented,
|
||||||
|
NotImplemented,
|
||||||
|
NotImplemented,
|
||||||
|
NotImplemented,
|
||||||
|
NotImplemented,
|
||||||
|
NotImplemented,
|
||||||
|
NotImplemented,
|
||||||
|
NotImplemented,
|
||||||
|
NotImplemented,
|
||||||
|
NotImplemented,
|
||||||
|
NotImplemented,
|
||||||
|
NotImplemented,
|
||||||
|
NotImplemented,
|
||||||
|
NotImplemented,
|
||||||
|
NotImplemented,
|
||||||
|
NotImplemented,
|
||||||
|
NotImplemented,
|
||||||
|
NotImplemented,
|
||||||
|
NotImplemented,
|
||||||
|
NotImplemented,
|
||||||
|
NotImplemented,
|
||||||
|
NotImplemented,
|
||||||
|
NotImplemented,
|
||||||
|
NotImplemented,
|
||||||
|
NotImplemented,
|
||||||
|
NotImplemented,
|
||||||
|
NotImplemented,
|
||||||
|
NotImplemented,
|
||||||
|
NotImplemented,
|
||||||
|
NotImplemented,
|
||||||
|
NotImplemented,
|
||||||
|
NotImplemented,
|
||||||
|
NotImplemented,
|
||||||
|
NotImplemented,
|
||||||
|
NotImplemented,
|
||||||
|
NotImplemented,
|
||||||
|
NotImplemented,
|
||||||
|
NotImplemented,
|
||||||
|
NotImplemented,
|
||||||
|
NotImplemented,
|
||||||
|
NotImplemented,
|
||||||
|
NotImplemented
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -506,5 +855,132 @@ ReplySwapPtr ReplySwapVector[256] =
|
||||||
ReplyNotSwappd, /* 125 */
|
ReplyNotSwappd, /* 125 */
|
||||||
ReplyNotSwappd, /* 126 */
|
ReplyNotSwappd, /* 126 */
|
||||||
ReplyNotSwappd, /* NoOperation */
|
ReplyNotSwappd, /* NoOperation */
|
||||||
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd,
|
||||||
ReplyNotSwappd
|
ReplyNotSwappd
|
||||||
};
|
};
|
||||||
|
|
|
@ -4831,16 +4831,16 @@ If the function is called more than once on the same key, all calls must use
|
||||||
the same value for <type>size</type> or the server will abort.</para>
|
the same value for <type>size</type> or the server will abort.</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
To request private space and have the server manage the key, use
|
To request per-screen private space in an object, use
|
||||||
<blockquote><programlisting>
|
<blockquote><programlisting>
|
||||||
DevPrivateKey dixCreatePrivateKey(DevPrivateType type, unsigned size);
|
Bool dixRegisterScreenPrivateKey(DevScreenPrivateKey key, ScreenPtr pScreen, DevPrivateType type, unsigned size);
|
||||||
</programlisting></blockquote>
|
</programlisting></blockquote>
|
||||||
The <parameter>type</parameter> and <parameter>size</parameter> arguments are
|
The <parameter>type</parameter> and <parameter>size</parameter> arguments are
|
||||||
the same as those to <function>dixRegisterPrivateKey</function> but this
|
the same as those to <function>dixRegisterPrivateKey</function> but this
|
||||||
function allocates a <type>DevPrivateKeyRec</type> and returns a pointer to it
|
function ensures the given <parameter>key</parameter> exists on objects of
|
||||||
instead of requiring the caller to pass a pointer to an existing structure.
|
the specified type with distinct storage for the given
|
||||||
The server will free it automatically when the privates system is restarted
|
<parameter>pScreen</parameter>. The key is usable on ScreenPrivate variants
|
||||||
at server reset time.</para>
|
that are otherwise equivalent to the following Private functions.</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
To attach a piece of private data to an object, use:
|
To attach a piece of private data to an object, use:
|
||||||
|
|
1
fb/fb.h
1
fb/fb.h
|
@ -666,7 +666,6 @@ typedef struct {
|
||||||
FbBits bgand, bgxor; /* for stipples */
|
FbBits bgand, bgxor; /* for stipples */
|
||||||
FbBits fg, bg, pm; /* expanded and filled */
|
FbBits fg, bg, pm; /* expanded and filled */
|
||||||
unsigned int dashLength; /* total of all dash elements */
|
unsigned int dashLength; /* total of all dash elements */
|
||||||
unsigned char oneRect; /* clip list is single rectangle */
|
|
||||||
unsigned char evenStipple; /* stipple is even */
|
unsigned char evenStipple; /* stipple is even */
|
||||||
unsigned char bpp; /* current drawable bpp */
|
unsigned char bpp; /* current drawable bpp */
|
||||||
} FbGCPrivRec, *FbGCPrivPtr;
|
} FbGCPrivRec, *FbGCPrivPtr;
|
||||||
|
|
12
fb/fbgc.c
12
fb/fbgc.c
|
@ -64,19 +64,13 @@ const GCOps fbGCOps = {
|
||||||
Bool
|
Bool
|
||||||
fbCreateGC(GCPtr pGC)
|
fbCreateGC(GCPtr pGC)
|
||||||
{
|
{
|
||||||
pGC->clientClip = NULL;
|
|
||||||
pGC->clientClipType = CT_NONE;
|
|
||||||
|
|
||||||
pGC->ops = (GCOps *) &fbGCOps;
|
pGC->ops = (GCOps *) &fbGCOps;
|
||||||
pGC->funcs = (GCFuncs *) &fbGCFuncs;
|
pGC->funcs = (GCFuncs *) &fbGCFuncs;
|
||||||
|
|
||||||
/* fb wants to translate before scan conversion */
|
/* fb wants to translate before scan conversion */
|
||||||
pGC->miTranslate = 1;
|
pGC->miTranslate = 1;
|
||||||
|
pGC->fExpose = 1;
|
||||||
|
|
||||||
fbGetRotatedPixmap(pGC) = 0;
|
|
||||||
fbGetExpose(pGC) = 1;
|
|
||||||
fbGetFreeCompClip(pGC) = 0;
|
|
||||||
fbGetCompositeClip(pGC) = 0;
|
|
||||||
fbGetGCPrivate(pGC)->bpp = BitsPerPixel (pGC->depth);
|
fbGetGCPrivate(pGC)->bpp = BitsPerPixel (pGC->depth);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
@ -199,9 +193,6 @@ fbValidateGC(GCPtr pGC, unsigned long changes, DrawablePtr pDrawable)
|
||||||
FbGCPrivPtr pPriv = fbGetGCPrivate(pGC);
|
FbGCPrivPtr pPriv = fbGetGCPrivate(pGC);
|
||||||
FbBits mask;
|
FbBits mask;
|
||||||
|
|
||||||
pGC->lastWinOrg.x = pDrawable->x;
|
|
||||||
pGC->lastWinOrg.y = pDrawable->y;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* if the client clip is different or moved OR the subwindowMode has
|
* if the client clip is different or moved OR the subwindowMode has
|
||||||
* changed OR the window's clip has changed since the last validation
|
* changed OR the window's clip has changed since the last validation
|
||||||
|
@ -213,7 +204,6 @@ fbValidateGC(GCPtr pGC, unsigned long changes, DrawablePtr pDrawable)
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
miComputeCompositeClip (pGC, pDrawable);
|
miComputeCompositeClip (pGC, pDrawable);
|
||||||
pPriv->oneRect = RegionNumRects(fbGetCompositeClip(pGC)) == 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef FB_24_32BIT
|
#ifdef FB_24_32BIT
|
||||||
|
|
|
@ -155,8 +155,6 @@
|
||||||
#define fbReduceRasterOp wfbReduceRasterOp
|
#define fbReduceRasterOp wfbReduceRasterOp
|
||||||
#define fbReplicatePixel wfbReplicatePixel
|
#define fbReplicatePixel wfbReplicatePixel
|
||||||
#define fbResolveColor wfbResolveColor
|
#define fbResolveColor wfbResolveColor
|
||||||
#define fbRestoreAreas wfbRestoreAreas
|
|
||||||
#define fbSaveAreas wfbSaveAreas
|
|
||||||
#define fbScreenPrivateKeyRec wfbScreenPrivateKeyRec
|
#define fbScreenPrivateKeyRec wfbScreenPrivateKeyRec
|
||||||
#define fbSegment wfbSegment
|
#define fbSegment wfbSegment
|
||||||
#define fbSelectBres wfbSelectBres
|
#define fbSelectBres wfbSelectBres
|
||||||
|
|
|
@ -99,8 +99,8 @@ __glXDRIdrawableDestroy(__GLXdrawable *drawable)
|
||||||
|
|
||||||
(*core->destroyDrawable)(private->driDrawable);
|
(*core->destroyDrawable)(private->driDrawable);
|
||||||
|
|
||||||
FreeScratchGC(private->gc);
|
FreeGC(private->gc, (GContext)0);
|
||||||
FreeScratchGC(private->swapgc);
|
FreeGC(private->swapgc, (GContext)0);
|
||||||
|
|
||||||
__glXDrawableRelease(drawable);
|
__glXDrawableRelease(drawable);
|
||||||
|
|
||||||
|
@ -301,13 +301,12 @@ __glXDRIscreenCreateDrawable(ClientPtr client,
|
||||||
XID glxDrawId,
|
XID glxDrawId,
|
||||||
__GLXconfig *glxConfig)
|
__GLXconfig *glxConfig)
|
||||||
{
|
{
|
||||||
ChangeGCVal gcvals[2];
|
XID gcvals[2];
|
||||||
|
int status;
|
||||||
__GLXDRIscreen *driScreen = (__GLXDRIscreen *) screen;
|
__GLXDRIscreen *driScreen = (__GLXDRIscreen *) screen;
|
||||||
__GLXDRIconfig *config = (__GLXDRIconfig *) glxConfig;
|
__GLXDRIconfig *config = (__GLXDRIconfig *) glxConfig;
|
||||||
__GLXDRIdrawable *private;
|
__GLXDRIdrawable *private;
|
||||||
|
|
||||||
ScreenPtr pScreen = driScreen->base.pScreen;
|
|
||||||
|
|
||||||
private = calloc(1, sizeof *private);
|
private = calloc(1, sizeof *private);
|
||||||
if (private == NULL)
|
if (private == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -323,13 +322,10 @@ __glXDRIscreenCreateDrawable(ClientPtr client,
|
||||||
private->base.swapBuffers = __glXDRIdrawableSwapBuffers;
|
private->base.swapBuffers = __glXDRIdrawableSwapBuffers;
|
||||||
private->base.copySubBuffer = __glXDRIdrawableCopySubBuffer;
|
private->base.copySubBuffer = __glXDRIdrawableCopySubBuffer;
|
||||||
|
|
||||||
private->gc = CreateScratchGC(pScreen, pDraw->depth);
|
gcvals[0] = GXcopy;
|
||||||
private->swapgc = CreateScratchGC(pScreen, pDraw->depth);
|
private->gc = CreateGC(pDraw, GCFunction, gcvals, &status, (XID)0, serverClient);
|
||||||
|
gcvals[1] = FALSE;
|
||||||
gcvals[0].val = GXcopy;
|
private->swapgc = CreateGC(pDraw, GCFunction | GCGraphicsExposures, gcvals, &status, (XID)0, serverClient);
|
||||||
ChangeGC(NullClient, private->gc, GCFunction, gcvals);
|
|
||||||
gcvals[1].val = FALSE;
|
|
||||||
ChangeGC(NullClient, private->swapgc, GCFunction | GCGraphicsExposures, gcvals);
|
|
||||||
|
|
||||||
private->driDrawable =
|
private->driDrawable =
|
||||||
(*driScreen->swrast->createNewDrawable)(driScreen->driScreen,
|
(*driScreen->swrast->createNewDrawable)(driScreen->driScreen,
|
||||||
|
|
11
glx/glxext.c
11
glx/glxext.c
|
@ -124,7 +124,7 @@ static int glxBlockClients;
|
||||||
*/
|
*/
|
||||||
static Bool DrawableGone(__GLXdrawable *glxPriv, XID xid)
|
static Bool DrawableGone(__GLXdrawable *glxPriv, XID xid)
|
||||||
{
|
{
|
||||||
__GLXcontext *c;
|
__GLXcontext *c, *next;
|
||||||
|
|
||||||
/* If this drawable was created using glx 1.3 drawable
|
/* If this drawable was created using glx 1.3 drawable
|
||||||
* constructors, we added it as a glx drawable resource under both
|
* constructors, we added it as a glx drawable resource under both
|
||||||
|
@ -137,7 +137,8 @@ static Bool DrawableGone(__GLXdrawable *glxPriv, XID xid)
|
||||||
FreeResourceByType(glxPriv->drawId, __glXDrawableRes, TRUE);
|
FreeResourceByType(glxPriv->drawId, __glXDrawableRes, TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (c = glxAllContexts; c; c = c->next) {
|
for (c = glxAllContexts; c; c = next) {
|
||||||
|
next = c->next;
|
||||||
if (c->isCurrent && (c->drawPriv == glxPriv || c->readPriv == glxPriv)) {
|
if (c->isCurrent && (c->drawPriv == glxPriv || c->readPriv == glxPriv)) {
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
@ -160,15 +161,13 @@ static Bool DrawableGone(__GLXdrawable *glxPriv, XID xid)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!c->idExists) {
|
|
||||||
__glXFreeContext(c);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (c->drawPriv == glxPriv)
|
if (c->drawPriv == glxPriv)
|
||||||
c->drawPriv = NULL;
|
c->drawPriv = NULL;
|
||||||
if (c->readPriv == glxPriv)
|
if (c->readPriv == glxPriv)
|
||||||
c->readPriv = NULL;
|
c->readPriv = NULL;
|
||||||
|
if (!c->idExists && !c->isCurrent)
|
||||||
|
__glXFreeContext(c);
|
||||||
}
|
}
|
||||||
|
|
||||||
glxPriv->destroy(glxPriv);
|
glxPriv->destroy(glxPriv);
|
||||||
|
|
54
hw/dmx/dmx.c
54
hw/dmx/dmx.c
|
@ -69,39 +69,7 @@ extern void DMXExtensionInit(void);
|
||||||
|
|
||||||
static unsigned char DMXCode;
|
static unsigned char DMXCode;
|
||||||
|
|
||||||
static DISPATCH_PROC(ProcDMXDispatch);
|
|
||||||
static DISPATCH_PROC(ProcDMXQueryVersion);
|
|
||||||
static DISPATCH_PROC(ProcDMXSync);
|
|
||||||
static DISPATCH_PROC(ProcDMXForceWindowCreation);
|
|
||||||
static DISPATCH_PROC(ProcDMXGetScreenCount);
|
|
||||||
static DISPATCH_PROC(ProcDMXGetScreenAttributes);
|
|
||||||
static DISPATCH_PROC(ProcDMXChangeScreensAttributes);
|
|
||||||
static DISPATCH_PROC(ProcDMXAddScreen);
|
|
||||||
static DISPATCH_PROC(ProcDMXRemoveScreen);
|
|
||||||
static DISPATCH_PROC(ProcDMXGetWindowAttributes);
|
|
||||||
static DISPATCH_PROC(ProcDMXGetDesktopAttributes);
|
|
||||||
static DISPATCH_PROC(ProcDMXChangeDesktopAttributes);
|
|
||||||
static DISPATCH_PROC(ProcDMXGetInputCount);
|
|
||||||
static DISPATCH_PROC(ProcDMXGetInputAttributes);
|
|
||||||
static DISPATCH_PROC(ProcDMXAddInput);
|
|
||||||
static DISPATCH_PROC(ProcDMXRemoveInput);
|
|
||||||
|
|
||||||
static DISPATCH_PROC(SProcDMXDispatch);
|
|
||||||
static DISPATCH_PROC(SProcDMXQueryVersion);
|
|
||||||
static DISPATCH_PROC(SProcDMXSync);
|
|
||||||
static DISPATCH_PROC(SProcDMXForceWindowCreation);
|
|
||||||
static DISPATCH_PROC(SProcDMXGetScreenCount);
|
|
||||||
static DISPATCH_PROC(SProcDMXGetScreenAttributes);
|
|
||||||
static DISPATCH_PROC(SProcDMXChangeScreensAttributes);
|
|
||||||
static DISPATCH_PROC(SProcDMXAddScreen);
|
|
||||||
static DISPATCH_PROC(SProcDMXRemoveScreen);
|
|
||||||
static DISPATCH_PROC(SProcDMXGetWindowAttributes);
|
|
||||||
static DISPATCH_PROC(SProcDMXGetDesktopAttributes);
|
|
||||||
static DISPATCH_PROC(SProcDMXChangeDesktopAttributes);
|
|
||||||
static DISPATCH_PROC(SProcDMXGetInputCount);
|
|
||||||
static DISPATCH_PROC(SProcDMXGetInputAttributes);
|
|
||||||
static DISPATCH_PROC(SProcDMXAddInput);
|
|
||||||
static DISPATCH_PROC(SProcDMXRemoveInput);
|
|
||||||
|
|
||||||
static int _DMXXineramaActive(void)
|
static int _DMXXineramaActive(void)
|
||||||
{
|
{
|
||||||
|
@ -111,17 +79,6 @@ static int _DMXXineramaActive(void)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Initialize the extension. */
|
|
||||||
void DMXExtensionInit(void)
|
|
||||||
{
|
|
||||||
ExtensionEntry *extEntry;
|
|
||||||
|
|
||||||
if ((extEntry = AddExtension(DMX_EXTENSION_NAME, 0, 0,
|
|
||||||
ProcDMXDispatch, SProcDMXDispatch,
|
|
||||||
NULL, StandardMinorOpcode)))
|
|
||||||
DMXCode = extEntry->base;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void dmxSetScreenAttribute(int bit, DMXScreenAttributesPtr attr,
|
static void dmxSetScreenAttribute(int bit, DMXScreenAttributesPtr attr,
|
||||||
CARD32 value)
|
CARD32 value)
|
||||||
{
|
{
|
||||||
|
@ -1125,3 +1082,14 @@ static int SProcDMXDispatch (ClientPtr client)
|
||||||
default: return BadRequest;
|
default: return BadRequest;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Initialize the extension. */
|
||||||
|
void DMXExtensionInit(void)
|
||||||
|
{
|
||||||
|
ExtensionEntry *extEntry;
|
||||||
|
|
||||||
|
if ((extEntry = AddExtension(DMX_EXTENSION_NAME, 0, 0,
|
||||||
|
ProcDMXDispatch, SProcDMXDispatch,
|
||||||
|
NULL, StandardMinorOpcode)))
|
||||||
|
DMXCode = extEntry->base;
|
||||||
|
}
|
||||||
|
|
|
@ -69,12 +69,6 @@
|
||||||
#include "dmx_glxvisuals.h"
|
#include "dmx_glxvisuals.h"
|
||||||
#include <X11/extensions/Xext.h>
|
#include <X11/extensions/Xext.h>
|
||||||
#include <X11/extensions/extutil.h>
|
#include <X11/extensions/extutil.h>
|
||||||
|
|
||||||
extern void GlxSetVisualConfigs(
|
|
||||||
int nconfigs,
|
|
||||||
__GLXvisualConfig *configs,
|
|
||||||
void **configprivs
|
|
||||||
);
|
|
||||||
#endif /* GLXEXT */
|
#endif /* GLXEXT */
|
||||||
|
|
||||||
/* Global variables available to all Xserver/hw/dmx routines. */
|
/* Global variables available to all Xserver/hw/dmx routines. */
|
||||||
|
@ -768,9 +762,6 @@ void InitOutput(ScreenInfo *pScreenInfo, int argc, char *argv[])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Hand out the glx configs to glx extension */
|
|
||||||
GlxSetVisualConfigs(nconfigs, configs, (void**)configprivs);
|
|
||||||
|
|
||||||
XFlush(dmxScreen->beDisplay);
|
XFlush(dmxScreen->beDisplay);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,11 +38,6 @@
|
||||||
#include "dmxfont.h"
|
#include "dmxfont.h"
|
||||||
#include "dmxsync.h"
|
#include "dmxsync.h"
|
||||||
|
|
||||||
#undef Xmalloc
|
|
||||||
#undef Xcalloc
|
|
||||||
#undef Xrealloc
|
|
||||||
#undef Xfree
|
|
||||||
|
|
||||||
#include "glxserver.h"
|
#include "glxserver.h"
|
||||||
#include <GL/glxtokens.h>
|
#include <GL/glxtokens.h>
|
||||||
#include "g_disptab.h"
|
#include "g_disptab.h"
|
||||||
|
@ -144,7 +139,7 @@ static int CreateContext(__GLXclientState *cl,
|
||||||
/*
|
/*
|
||||||
** Allocate memory for the new context
|
** Allocate memory for the new context
|
||||||
*/
|
*/
|
||||||
glxc = __glXCalloc(1, sizeof(__GLXcontext));
|
glxc = calloc(1, sizeof(__GLXcontext));
|
||||||
if (!glxc) {
|
if (!glxc) {
|
||||||
return BadAlloc;
|
return BadAlloc;
|
||||||
}
|
}
|
||||||
|
@ -156,7 +151,7 @@ static int CreateContext(__GLXclientState *cl,
|
||||||
glxc->pFBConfig = glxLookupFBConfig( fbconfigId );
|
glxc->pFBConfig = glxLookupFBConfig( fbconfigId );
|
||||||
if (!glxc->pFBConfig) {
|
if (!glxc->pFBConfig) {
|
||||||
client->errorValue = fbconfigId;
|
client->errorValue = fbconfigId;
|
||||||
__glXFree( glxc );
|
free( glxc );
|
||||||
return BadValue;
|
return BadValue;
|
||||||
}
|
}
|
||||||
visual = glxc->pFBConfig->associatedVisualId;
|
visual = glxc->pFBConfig->associatedVisualId;
|
||||||
|
@ -177,7 +172,7 @@ static int CreateContext(__GLXclientState *cl,
|
||||||
}
|
}
|
||||||
if (i == pScreen->numVisuals) {
|
if (i == pScreen->numVisuals) {
|
||||||
client->errorValue = visual;
|
client->errorValue = visual;
|
||||||
__glXFree( glxc );
|
free( glxc );
|
||||||
return BadValue;
|
return BadValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -192,7 +187,7 @@ static int CreateContext(__GLXclientState *cl,
|
||||||
** Visual not support on this screen by this OpenGL implementation.
|
** Visual not support on this screen by this OpenGL implementation.
|
||||||
*/
|
*/
|
||||||
client->errorValue = visual;
|
client->errorValue = visual;
|
||||||
__glXFree( glxc );
|
free( glxc );
|
||||||
return BadValue;
|
return BadValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -203,7 +198,7 @@ static int CreateContext(__GLXclientState *cl,
|
||||||
/*
|
/*
|
||||||
* visual does not have an FBConfig ???
|
* visual does not have an FBConfig ???
|
||||||
client->errorValue = visual;
|
client->errorValue = visual;
|
||||||
__glXFree( glxc );
|
free( glxc );
|
||||||
return BadValue;
|
return BadValue;
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
|
@ -223,11 +218,11 @@ static int CreateContext(__GLXclientState *cl,
|
||||||
* allocate memory for back-end servers info
|
* allocate memory for back-end servers info
|
||||||
*/
|
*/
|
||||||
num_be_screens = to_screen - from_screen + 1;
|
num_be_screens = to_screen - from_screen + 1;
|
||||||
glxc->real_ids = (XID *)__glXMalloc(sizeof(XID) * num_be_screens);
|
glxc->real_ids = (XID *)malloc(sizeof(XID) * num_be_screens);
|
||||||
if (!glxc->real_ids) {
|
if (!glxc->real_ids) {
|
||||||
return BadAlloc;
|
return BadAlloc;
|
||||||
}
|
}
|
||||||
glxc->real_vids = (XID *)__glXMalloc(sizeof(XID) * num_be_screens);
|
glxc->real_vids = (XID *)malloc(sizeof(XID) * num_be_screens);
|
||||||
if (!glxc->real_vids) {
|
if (!glxc->real_vids) {
|
||||||
return BadAlloc;
|
return BadAlloc;
|
||||||
}
|
}
|
||||||
|
@ -252,9 +247,9 @@ static int CreateContext(__GLXclientState *cl,
|
||||||
|
|
||||||
if (!be_vid) {
|
if (!be_vid) {
|
||||||
/* visual is not supported on the back-end server */
|
/* visual is not supported on the back-end server */
|
||||||
__glXFree( glxc->real_ids );
|
free( glxc->real_ids );
|
||||||
__glXFree( glxc->real_vids );
|
free( glxc->real_vids );
|
||||||
__glXFree( glxc );
|
free( glxc );
|
||||||
return BadValue;
|
return BadValue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -346,9 +341,9 @@ static int CreateContext(__GLXclientState *cl,
|
||||||
** Register this context as a resource.
|
** Register this context as a resource.
|
||||||
*/
|
*/
|
||||||
if (!AddResource(gcId, __glXContextRes, (pointer)glxc)) {
|
if (!AddResource(gcId, __glXContextRes, (pointer)glxc)) {
|
||||||
__glXFree( glxc->real_ids );
|
free( glxc->real_ids );
|
||||||
__glXFree( glxc->real_vids );
|
free( glxc->real_vids );
|
||||||
__glXFree( glxc );
|
free( glxc );
|
||||||
client->errorValue = gcId;
|
client->errorValue = gcId;
|
||||||
return BadAlloc;
|
return BadAlloc;
|
||||||
}
|
}
|
||||||
|
@ -585,16 +580,16 @@ static int AddCurrentContext(__GLXclientState *cl, __GLXcontext *glxc, DrawableP
|
||||||
** Didn't find a free slot, so we'll have to grow the table.
|
** Didn't find a free slot, so we'll have to grow the table.
|
||||||
*/
|
*/
|
||||||
if (!num) {
|
if (!num) {
|
||||||
table = (__GLXcontext **) __glXMalloc(sizeof(__GLXcontext *));
|
table = (__GLXcontext **) malloc(sizeof(__GLXcontext *));
|
||||||
cl->currentDrawables = (DrawablePtr *) __glXMalloc(sizeof(DrawablePtr));
|
cl->currentDrawables = (DrawablePtr *) malloc(sizeof(DrawablePtr));
|
||||||
cl->be_currentCTag = (GLXContextTag *) __glXMalloc(screenInfo.numScreens *sizeof(GLXContextTag));
|
cl->be_currentCTag = (GLXContextTag *) malloc(screenInfo.numScreens *sizeof(GLXContextTag));
|
||||||
} else {
|
} else {
|
||||||
table = (__GLXcontext **) __glXRealloc(table,
|
table = (__GLXcontext **) realloc(table,
|
||||||
(num+1)*sizeof(__GLXcontext *));
|
(num+1)*sizeof(__GLXcontext *));
|
||||||
cl->currentDrawables = (DrawablePtr *) __glXRealloc(
|
cl->currentDrawables = (DrawablePtr *) realloc(
|
||||||
cl->currentDrawables ,
|
cl->currentDrawables ,
|
||||||
(num+1)*sizeof(DrawablePtr));
|
(num+1)*sizeof(DrawablePtr));
|
||||||
cl->be_currentCTag = (GLXContextTag *) __glXRealloc(cl->be_currentCTag,
|
cl->be_currentCTag = (GLXContextTag *) realloc(cl->be_currentCTag,
|
||||||
(num+1)*screenInfo.numScreens*sizeof(GLXContextTag));
|
(num+1)*screenInfo.numScreens*sizeof(GLXContextTag));
|
||||||
}
|
}
|
||||||
table[num] = glxc;
|
table[num] = glxc;
|
||||||
|
@ -1721,13 +1716,13 @@ static int CreateGLXPixmap(__GLXclientState *cl,
|
||||||
pGlxVisual = NULL;
|
pGlxVisual = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
pGlxPixmap = (__GLXpixmap *) __glXMalloc(sizeof(__GLXpixmap));
|
pGlxPixmap = (__GLXpixmap *) malloc(sizeof(__GLXpixmap));
|
||||||
if (!pGlxPixmap) {
|
if (!pGlxPixmap) {
|
||||||
return BadAlloc;
|
return BadAlloc;
|
||||||
}
|
}
|
||||||
pGlxPixmap->be_xids = (XID *) __glXMalloc(sizeof(XID) * screenInfo.numScreens);
|
pGlxPixmap->be_xids = (XID *) malloc(sizeof(XID) * screenInfo.numScreens);
|
||||||
if (!pGlxPixmap->be_xids) {
|
if (!pGlxPixmap->be_xids) {
|
||||||
__glXFree( pGlxPixmap );
|
free( pGlxPixmap );
|
||||||
return BadAlloc;
|
return BadAlloc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1832,7 +1827,7 @@ static int CreateGLXPixmap(__GLXclientState *cl,
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
client->errorValue = ( visual ? visual : fbconfigId );
|
client->errorValue = ( visual ? visual : fbconfigId );
|
||||||
__glXFree( pGlxPixmap );
|
free( pGlxPixmap );
|
||||||
return BadValue;
|
return BadValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1840,7 +1835,7 @@ static int CreateGLXPixmap(__GLXclientState *cl,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(AddResource(glxpixmapId, __glXPixmapRes, pGlxPixmap))) {
|
if (!(AddResource(glxpixmapId, __glXPixmapRes, pGlxPixmap))) {
|
||||||
__glXFree( pGlxPixmap );
|
free( pGlxPixmap );
|
||||||
return BadAlloc;
|
return BadAlloc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2570,7 +2565,7 @@ int __glXClientInfo(__GLXclientState *cl, GLbyte *pc)
|
||||||
|
|
||||||
cl->GLClientmajorVersion = req->major;
|
cl->GLClientmajorVersion = req->major;
|
||||||
cl->GLClientminorVersion = req->minor;
|
cl->GLClientminorVersion = req->minor;
|
||||||
if (cl->GLClientextensions) __glXFree(cl->GLClientextensions);
|
if (cl->GLClientextensions) free(cl->GLClientextensions);
|
||||||
buf = (const char *)(req+1);
|
buf = (const char *)(req+1);
|
||||||
cl->GLClientextensions = strdup(buf);
|
cl->GLClientextensions = strdup(buf);
|
||||||
|
|
||||||
|
|
|
@ -702,9 +702,9 @@ int __glXSwapRenderLarge(__GLXclientState *cl, GLbyte *pc)
|
||||||
*/
|
*/
|
||||||
if (cl->largeCmdBufSize < hdr->length) {
|
if (cl->largeCmdBufSize < hdr->length) {
|
||||||
if (!cl->largeCmdBuf) {
|
if (!cl->largeCmdBuf) {
|
||||||
cl->largeCmdBuf = (GLbyte *) __glXMalloc(hdr->length);
|
cl->largeCmdBuf = (GLbyte *) malloc(hdr->length);
|
||||||
} else {
|
} else {
|
||||||
cl->largeCmdBuf = (GLbyte *) __glXRealloc(cl->largeCmdBuf, hdr->length);
|
cl->largeCmdBuf = (GLbyte *) realloc(cl->largeCmdBuf, hdr->length);
|
||||||
}
|
}
|
||||||
if (!cl->largeCmdBuf) {
|
if (!cl->largeCmdBuf) {
|
||||||
cl->largeCmdRequestsTotal = 0;
|
cl->largeCmdRequestsTotal = 0;
|
||||||
|
|
|
@ -77,10 +77,10 @@ static void ResetClientState(int clientIndex)
|
||||||
Display **keep_be_displays;
|
Display **keep_be_displays;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if (cl->returnBuf) __glXFree(cl->returnBuf);
|
if (cl->returnBuf) free(cl->returnBuf);
|
||||||
if (cl->currentContexts) __glXFree(cl->currentContexts);
|
if (cl->currentContexts) free(cl->currentContexts);
|
||||||
if (cl->currentDrawables) __glXFree(cl->currentDrawables);
|
if (cl->currentDrawables) free(cl->currentDrawables);
|
||||||
if (cl->largeCmdBuf) __glXFree(cl->largeCmdBuf);
|
if (cl->largeCmdBuf) free(cl->largeCmdBuf);
|
||||||
|
|
||||||
for (i=0; i< screenInfo.numScreens; i++) {
|
for (i=0; i< screenInfo.numScreens; i++) {
|
||||||
if (cl->be_displays[i])
|
if (cl->be_displays[i])
|
||||||
|
@ -97,7 +97,7 @@ static void ResetClientState(int clientIndex)
|
||||||
*/
|
*/
|
||||||
cl->GLClientmajorVersion = 1;
|
cl->GLClientmajorVersion = 1;
|
||||||
cl->GLClientminorVersion = 0;
|
cl->GLClientminorVersion = 0;
|
||||||
if (cl->GLClientextensions) __glXFree(cl->GLClientextensions);
|
if (cl->GLClientextensions) free(cl->GLClientextensions);
|
||||||
|
|
||||||
memset(cl->be_displays, 0, screenInfo.numScreens * sizeof(Display *));
|
memset(cl->be_displays, 0, screenInfo.numScreens * sizeof(Display *));
|
||||||
}
|
}
|
||||||
|
@ -167,8 +167,8 @@ void __glXFreeGLXPixmap( __GLXpixmap *pGlxPixmap )
|
||||||
** only if it's zero.
|
** only if it's zero.
|
||||||
*/
|
*/
|
||||||
(*pGlxPixmap->pScreen->DestroyPixmap)(pPixmap);
|
(*pGlxPixmap->pScreen->DestroyPixmap)(pPixmap);
|
||||||
__glXFree(pGlxPixmap->be_xids);
|
free(pGlxPixmap->be_xids);
|
||||||
__glXFree(pGlxPixmap);
|
free(pGlxPixmap);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -222,10 +222,10 @@ GLboolean __glXFreeContext(__GLXcontext *cx)
|
||||||
{
|
{
|
||||||
if (cx->idExists || cx->isCurrent) return GL_FALSE;
|
if (cx->idExists || cx->isCurrent) return GL_FALSE;
|
||||||
|
|
||||||
if (cx->feedbackBuf) __glXFree(cx->feedbackBuf);
|
if (cx->feedbackBuf) free(cx->feedbackBuf);
|
||||||
if (cx->selectBuf) __glXFree(cx->selectBuf);
|
if (cx->selectBuf) free(cx->selectBuf);
|
||||||
if (cx->real_ids) __glXFree(cx->real_ids);
|
if (cx->real_ids) free(cx->real_ids);
|
||||||
if (cx->real_vids) __glXFree(cx->real_vids);
|
if (cx->real_vids) free(cx->real_vids);
|
||||||
|
|
||||||
if (cx->pGlxPixmap) {
|
if (cx->pGlxPixmap) {
|
||||||
/*
|
/*
|
||||||
|
@ -263,7 +263,7 @@ GLboolean __glXFreeContext(__GLXcontext *cx)
|
||||||
cx->pGlxReadWindow = 0;
|
cx->pGlxReadWindow = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
__glXFree(cx);
|
free(cx);
|
||||||
|
|
||||||
if (cx == __glXLastContext) {
|
if (cx == __glXLastContext) {
|
||||||
__glXFlushContextCache();
|
__glXFlushContextCache();
|
||||||
|
@ -367,46 +367,6 @@ Bool __glXCoreType(void)
|
||||||
|
|
||||||
/************************************************************************/
|
/************************************************************************/
|
||||||
|
|
||||||
void GlxSetVisualConfigs(int nconfigs,
|
|
||||||
__GLXvisualConfig *configs, void **privates)
|
|
||||||
{
|
|
||||||
glxSetVisualConfigs(nconfigs, configs, privates);
|
|
||||||
}
|
|
||||||
|
|
||||||
static miInitVisualsProcPtr saveInitVisualsProc;
|
|
||||||
|
|
||||||
Bool GlxInitVisuals(VisualPtr *visualp, DepthPtr *depthp,
|
|
||||||
int *nvisualp, int *ndepthp,
|
|
||||||
int *rootDepthp, VisualID *defaultVisp,
|
|
||||||
unsigned long sizes, int bitsPerRGB,
|
|
||||||
int preferredVis)
|
|
||||||
{
|
|
||||||
Bool ret;
|
|
||||||
|
|
||||||
if (saveInitVisualsProc) {
|
|
||||||
ret = saveInitVisualsProc(visualp, depthp, nvisualp, ndepthp,
|
|
||||||
rootDepthp, defaultVisp, sizes, bitsPerRGB,
|
|
||||||
preferredVis);
|
|
||||||
if (!ret)
|
|
||||||
return False;
|
|
||||||
}
|
|
||||||
|
|
||||||
glxInitVisuals(nvisualp, visualp, defaultVisp, *ndepthp, *depthp,*rootDepthp);
|
|
||||||
|
|
||||||
return True;
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
GlxWrapInitVisuals(miInitVisualsProcPtr *initVisProc)
|
|
||||||
{
|
|
||||||
if (dmxGLXProxy) {
|
|
||||||
saveInitVisualsProc = *initVisProc;
|
|
||||||
*initVisProc = GlxInitVisuals;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/************************************************************************/
|
|
||||||
|
|
||||||
void __glXFlushContextCache(void)
|
void __glXFlushContextCache(void)
|
||||||
{
|
{
|
||||||
__glXLastContext = 0;
|
__glXLastContext = 0;
|
||||||
|
@ -427,15 +387,15 @@ static int __glXDispatch(ClientPtr client)
|
||||||
opcode = stuff->glxCode;
|
opcode = stuff->glxCode;
|
||||||
cl = __glXClients[client->index];
|
cl = __glXClients[client->index];
|
||||||
if (!cl) {
|
if (!cl) {
|
||||||
cl = __glXCalloc(1, sizeof(__GLXclientState));
|
cl = calloc(1, sizeof(__GLXclientState));
|
||||||
__glXClients[client->index] = cl;
|
__glXClients[client->index] = cl;
|
||||||
if (!cl) {
|
if (!cl) {
|
||||||
return BadAlloc;
|
return BadAlloc;
|
||||||
}
|
}
|
||||||
|
|
||||||
cl->be_displays = __glXCalloc(screenInfo.numScreens, sizeof(Display *));
|
cl->be_displays = calloc(screenInfo.numScreens, sizeof(Display *));
|
||||||
if (!cl->be_displays) {
|
if (!cl->be_displays) {
|
||||||
__glXFree( cl );
|
free( cl );
|
||||||
return BadAlloc;
|
return BadAlloc;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -479,15 +439,15 @@ static int __glXSwapDispatch(ClientPtr client)
|
||||||
opcode = stuff->glxCode;
|
opcode = stuff->glxCode;
|
||||||
cl = __glXClients[client->index];
|
cl = __glXClients[client->index];
|
||||||
if (!cl) {
|
if (!cl) {
|
||||||
cl = __glXCalloc(1, sizeof(__GLXclientState));
|
cl = calloc(1, sizeof(__GLXclientState));
|
||||||
__glXClients[client->index] = cl;
|
__glXClients[client->index] = cl;
|
||||||
if (!cl) {
|
if (!cl) {
|
||||||
return BadAlloc;
|
return BadAlloc;
|
||||||
}
|
}
|
||||||
|
|
||||||
cl->be_displays = __glXCalloc(screenInfo.numScreens, sizeof(Display *));
|
cl->be_displays = calloc(screenInfo.numScreens, sizeof(Display *));
|
||||||
if (!cl->be_displays) {
|
if (!cl->be_displays) {
|
||||||
__glXFree( cl );
|
free( cl );
|
||||||
return BadAlloc;
|
return BadAlloc;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -74,19 +74,5 @@ extern void GlxExtensionInit(void);
|
||||||
|
|
||||||
extern Bool __glXCoreType(void);
|
extern Bool __glXCoreType(void);
|
||||||
|
|
||||||
extern int GlxInitVisuals(
|
|
||||||
#if NeedFunctionPrototypes
|
|
||||||
VisualPtr * visualp,
|
|
||||||
DepthPtr * depthp,
|
|
||||||
int * nvisualp,
|
|
||||||
int * ndepthp,
|
|
||||||
int * rootDepthp,
|
|
||||||
VisualID * defaultVisp,
|
|
||||||
unsigned long sizes,
|
|
||||||
int bitsPerRGB,
|
|
||||||
int preferredVis
|
|
||||||
#endif
|
|
||||||
);
|
|
||||||
|
|
||||||
#endif /* _glxext_h_ */
|
#endif /* _glxext_h_ */
|
||||||
|
|
||||||
|
|
|
@ -35,11 +35,6 @@
|
||||||
#include "dmx.h"
|
#include "dmx.h"
|
||||||
#include "dmxlog.h"
|
#include "dmxlog.h"
|
||||||
|
|
||||||
#undef Xmalloc
|
|
||||||
#undef Xcalloc
|
|
||||||
#undef Xrealloc
|
|
||||||
#undef Xfree
|
|
||||||
|
|
||||||
#include "glxserver.h"
|
#include "glxserver.h"
|
||||||
|
|
||||||
#include <windowstr.h>
|
#include <windowstr.h>
|
||||||
|
|
|
@ -39,11 +39,6 @@
|
||||||
#include "dmxfont.h"
|
#include "dmxfont.h"
|
||||||
#include "dmxcb.h"
|
#include "dmxcb.h"
|
||||||
|
|
||||||
#undef Xmalloc
|
|
||||||
#undef Xcalloc
|
|
||||||
#undef Xrealloc
|
|
||||||
#undef Xfree
|
|
||||||
|
|
||||||
#include "glxserver.h"
|
#include "glxserver.h"
|
||||||
#include "glxext.h"
|
#include "glxext.h"
|
||||||
#include "g_disptab.h"
|
#include "g_disptab.h"
|
||||||
|
|
|
@ -29,81 +29,6 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "glxserver.h"
|
#include "glxserver.h"
|
||||||
#include <GL/glxtokens.h>
|
|
||||||
#include <pixmapstr.h>
|
|
||||||
#include <windowstr.h>
|
|
||||||
#include "glxutil.h"
|
#include "glxutil.h"
|
||||||
#include <stdlib.h>
|
|
||||||
|
|
||||||
/************************************************************************/
|
|
||||||
|
|
||||||
void __glXNop(void) {}
|
void __glXNop(void) {}
|
||||||
|
|
||||||
/************************************************************************/
|
|
||||||
|
|
||||||
/* Memory Allocation for GLX */
|
|
||||||
|
|
||||||
void *
|
|
||||||
__glXMalloc(size_t size)
|
|
||||||
{
|
|
||||||
void *addr;
|
|
||||||
|
|
||||||
if (size == 0) {
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
addr = malloc(size);
|
|
||||||
if (addr == NULL) {
|
|
||||||
/* XXX: handle out of memory error */
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
return addr;
|
|
||||||
}
|
|
||||||
|
|
||||||
void *
|
|
||||||
__glXCalloc(size_t numElements, size_t elementSize)
|
|
||||||
{
|
|
||||||
void *addr;
|
|
||||||
size_t size;
|
|
||||||
|
|
||||||
if ((numElements == 0) || (elementSize == 0)) {
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
addr = calloc(numElements, elementSize);
|
|
||||||
if (addr == NULL) {
|
|
||||||
/* XXX: handle out of memory error */
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
return addr;
|
|
||||||
}
|
|
||||||
|
|
||||||
void *
|
|
||||||
__glXRealloc(void *addr, size_t newSize)
|
|
||||||
{
|
|
||||||
void *newAddr;
|
|
||||||
|
|
||||||
if (addr) {
|
|
||||||
if (newSize == 0) {
|
|
||||||
free(addr);
|
|
||||||
return NULL;
|
|
||||||
} else {
|
|
||||||
newAddr = realloc(addr, newSize);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (newSize == 0) {
|
|
||||||
return NULL;
|
|
||||||
} else {
|
|
||||||
newAddr = malloc(newSize);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (newAddr == NULL) {
|
|
||||||
return NULL; /* XXX: out of memory */
|
|
||||||
}
|
|
||||||
|
|
||||||
return newAddr;
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
__glXFree(void *addr)
|
|
||||||
{
|
|
||||||
free(addr);
|
|
||||||
}
|
|
||||||
|
|
|
@ -33,12 +33,6 @@
|
||||||
|
|
||||||
extern void __glXNop(void);
|
extern void __glXNop(void);
|
||||||
|
|
||||||
/* memory management */
|
|
||||||
extern void *__glXMalloc(size_t size);
|
|
||||||
extern void *__glXCalloc(size_t numElements, size_t elementSize);
|
|
||||||
extern void *__glXRealloc(void *addr, size_t newSize);
|
|
||||||
extern void __glXFree(void *ptr);
|
|
||||||
|
|
||||||
/* context helper routines */
|
/* context helper routines */
|
||||||
extern __GLXcontext *__glXLookupContextByTag(__GLXclientState*, GLXContextTag);
|
extern __GLXcontext *__glXLookupContextByTag(__GLXclientState*, GLXContextTag);
|
||||||
extern DrawablePtr __glXLookupDrawableByTag(__GLXclientState *cl, GLXContextTag tag);
|
extern DrawablePtr __glXLookupDrawableByTag(__GLXclientState *cl, GLXContextTag tag);
|
||||||
|
|
|
@ -38,11 +38,6 @@
|
||||||
#include "dmxpixmap.h"
|
#include "dmxpixmap.h"
|
||||||
#include "dmxfont.h"
|
#include "dmxfont.h"
|
||||||
|
|
||||||
#undef Xmalloc
|
|
||||||
#undef Xcalloc
|
|
||||||
#undef Xrealloc
|
|
||||||
#undef Xfree
|
|
||||||
|
|
||||||
#include "glxserver.h"
|
#include "glxserver.h"
|
||||||
#include "glxext.h"
|
#include "glxext.h"
|
||||||
#include "g_disptab.h"
|
#include "g_disptab.h"
|
||||||
|
|
|
@ -32,16 +32,8 @@
|
||||||
#include <dmx-config.h>
|
#include <dmx-config.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <assert.h>
|
|
||||||
#include "dmx.h"
|
|
||||||
#include "glxserver.h"
|
#include "glxserver.h"
|
||||||
#include "glxutil.h"
|
#include "glxvisuals.h"
|
||||||
#include "dmx_glxvisuals.h"
|
|
||||||
#include <stdlib.h>
|
|
||||||
|
|
||||||
static int numConfigs = 0;
|
|
||||||
static __GLXvisualConfig *visualConfigs = NULL;
|
|
||||||
static void **visualPrivates = NULL;
|
|
||||||
|
|
||||||
int glxVisualsMatch( __GLXvisualConfig *v1, __GLXvisualConfig *v2 )
|
int glxVisualsMatch( __GLXvisualConfig *v1, __GLXvisualConfig *v2 )
|
||||||
{
|
{
|
||||||
|
@ -158,381 +150,3 @@ VisualPtr glxMatchVisual( ScreenPtr pScreen, VisualPtr pVisual, ScreenPtr pMatch
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void glxSetVisualConfigs(int nconfigs, __GLXvisualConfig *configs,
|
|
||||||
void **privates)
|
|
||||||
{
|
|
||||||
numConfigs = nconfigs;
|
|
||||||
visualConfigs = configs;
|
|
||||||
visualPrivates = privates;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int count_bits(unsigned int n)
|
|
||||||
{
|
|
||||||
int bits = 0;
|
|
||||||
|
|
||||||
while (n > 0) {
|
|
||||||
if (n & 1) bits++;
|
|
||||||
n >>= 1;
|
|
||||||
}
|
|
||||||
return bits;
|
|
||||||
}
|
|
||||||
|
|
||||||
static VisualID FindClosestVisual( VisualPtr pVisual, int rootDepth,
|
|
||||||
DepthPtr pdepth, int ndepths,
|
|
||||||
VisualPtr pNewVisual, int numNewVisuals)
|
|
||||||
{
|
|
||||||
int d, v;
|
|
||||||
VisualPtr vis;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* find the first visual with the same or deeper depth
|
|
||||||
* of the same class.
|
|
||||||
*/
|
|
||||||
for (d=0; d<ndepths; d++) {
|
|
||||||
if (pdepth[d].depth >= rootDepth) {
|
|
||||||
for (v=0; v<pdepth[d].numVids; v++) {
|
|
||||||
|
|
||||||
/* find the new visual structure */
|
|
||||||
vis = pNewVisual;
|
|
||||||
while( pdepth[d].vids[v] != vis->vid ) vis++;
|
|
||||||
|
|
||||||
if (vis->class == pVisual->class) {
|
|
||||||
return pdepth[d].vids[v];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* did not find any.
|
|
||||||
* try to look for the same class only.
|
|
||||||
*/
|
|
||||||
for (d=0; d<ndepths; d++) {
|
|
||||||
for (v=0; v<pdepth[d].numVids; v++) {
|
|
||||||
|
|
||||||
/* find the new visual structure */
|
|
||||||
vis = pNewVisual;
|
|
||||||
while( pdepth[d].vids[v] != vis->vid ) vis++;
|
|
||||||
|
|
||||||
if (vis->class == pVisual->class) {
|
|
||||||
return pdepth[d].vids[v];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* if not found - just take the first visual
|
|
||||||
*/
|
|
||||||
return pdepth[0].vids[0];
|
|
||||||
}
|
|
||||||
|
|
||||||
Bool glxInitVisuals(int *nvisualp, VisualPtr *visualp,
|
|
||||||
VisualID *defaultVisp,
|
|
||||||
int ndepth, DepthPtr pdepth,
|
|
||||||
int rootDepth)
|
|
||||||
{
|
|
||||||
int numRGBconfigs;
|
|
||||||
int numCIconfigs;
|
|
||||||
int numVisuals = *nvisualp;
|
|
||||||
int numNewVisuals;
|
|
||||||
int numNewConfigs;
|
|
||||||
VisualPtr pVisual = *visualp;
|
|
||||||
VisualPtr pVisualNew = NULL;
|
|
||||||
VisualID *orig_vid = NULL;
|
|
||||||
__GLXvisualConfig *glXVisualPtr = NULL;
|
|
||||||
__GLXvisualConfig *pNewVisualConfigs = NULL;
|
|
||||||
void **glXVisualPriv;
|
|
||||||
dmxGlxVisualPrivate **pNewVisualPriv;
|
|
||||||
int found_default;
|
|
||||||
int i, j, k;
|
|
||||||
int numGLXvis = 0;
|
|
||||||
GLint *isGLXvis;
|
|
||||||
|
|
||||||
if (numConfigs > 0)
|
|
||||||
numNewConfigs = numConfigs;
|
|
||||||
else
|
|
||||||
return False;
|
|
||||||
|
|
||||||
MAXSCREENSALLOC(__glXActiveScreens);
|
|
||||||
if (!__glXActiveScreens)
|
|
||||||
return False;
|
|
||||||
|
|
||||||
/* Alloc space for the list of new GLX visuals */
|
|
||||||
pNewVisualConfigs = (__GLXvisualConfig *)
|
|
||||||
__glXMalloc(numNewConfigs * sizeof(__GLXvisualConfig));
|
|
||||||
if (!pNewVisualConfigs) {
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Alloc space for the list of new GLX visual privates */
|
|
||||||
pNewVisualPriv = (dmxGlxVisualPrivate **) __glXMalloc(numNewConfigs * sizeof(dmxGlxVisualPrivate *));
|
|
||||||
if (!pNewVisualPriv) {
|
|
||||||
__glXFree(pNewVisualConfigs);
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* copy driver's visual config info */
|
|
||||||
for (i = 0; i < numConfigs; i++) {
|
|
||||||
pNewVisualConfigs[i] = visualConfigs[i];
|
|
||||||
pNewVisualPriv[i] = (dmxGlxVisualPrivate *)visualPrivates[i];
|
|
||||||
}
|
|
||||||
|
|
||||||
#if 1
|
|
||||||
/* FIXME: This is a hack to workaround a hang in xtest caused by a
|
|
||||||
* mismatch between what the front end (i.e., DMX) server calculates
|
|
||||||
* for the visual configs and what the back-end servers have.
|
|
||||||
*/
|
|
||||||
{
|
|
||||||
int numTCRGBconfigs = 0;
|
|
||||||
int numDCRGBconfigs = 0;
|
|
||||||
|
|
||||||
numRGBconfigs = 0;
|
|
||||||
numCIconfigs = 0;
|
|
||||||
|
|
||||||
for (i = 0; i < numNewConfigs; i++) {
|
|
||||||
if (pNewVisualConfigs[i].rgba) {
|
|
||||||
if (pNewVisualConfigs[i].class == TrueColor)
|
|
||||||
numTCRGBconfigs++;
|
|
||||||
else
|
|
||||||
numDCRGBconfigs++;
|
|
||||||
numRGBconfigs++;
|
|
||||||
} else
|
|
||||||
numCIconfigs++;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Count the total number of visuals to compute */
|
|
||||||
numNewVisuals = 0;
|
|
||||||
for (i = 0; i < numVisuals; i++) {
|
|
||||||
numNewVisuals +=
|
|
||||||
(pVisual[i].class == TrueColor) ? numTCRGBconfigs :
|
|
||||||
(pVisual[i].class == DirectColor) ? numDCRGBconfigs :
|
|
||||||
numCIconfigs;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
/* Count the number of RGB and CI visual configs */
|
|
||||||
numRGBconfigs = 0;
|
|
||||||
numCIconfigs = 0;
|
|
||||||
for (i = 0; i < numNewConfigs; i++) {
|
|
||||||
if (pNewVisualConfigs[i].rgba)
|
|
||||||
numRGBconfigs++;
|
|
||||||
else
|
|
||||||
numCIconfigs++;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Count the total number of visuals to compute */
|
|
||||||
numNewVisuals = 0;
|
|
||||||
for (i = 0; i < numVisuals; i++) {
|
|
||||||
numNewVisuals +=
|
|
||||||
(pVisual[i].class == TrueColor || pVisual[i].class == DirectColor)
|
|
||||||
? numRGBconfigs : numCIconfigs;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Reset variables for use with the next screen/driver's visual configs */
|
|
||||||
visualConfigs = NULL;
|
|
||||||
numConfigs = 0;
|
|
||||||
|
|
||||||
/* Alloc temp space for the list of orig VisualIDs for each new visual */
|
|
||||||
orig_vid = (VisualID *)__glXMalloc(numNewVisuals * sizeof(VisualID));
|
|
||||||
if (!orig_vid) {
|
|
||||||
__glXFree(pNewVisualPriv);
|
|
||||||
__glXFree(pNewVisualConfigs);
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Alloc space for the list of glXVisuals */
|
|
||||||
glXVisualPtr = (__GLXvisualConfig *)__glXMalloc(numNewVisuals *
|
|
||||||
sizeof(__GLXvisualConfig));
|
|
||||||
if (!glXVisualPtr) {
|
|
||||||
__glXFree(orig_vid);
|
|
||||||
__glXFree(pNewVisualPriv);
|
|
||||||
__glXFree(pNewVisualConfigs);
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Alloc space for the list of glXVisualPrivates */
|
|
||||||
glXVisualPriv = (void **)__glXMalloc(numNewVisuals * sizeof(void *));
|
|
||||||
if (!glXVisualPriv) {
|
|
||||||
__glXFree(glXVisualPtr);
|
|
||||||
__glXFree(orig_vid);
|
|
||||||
__glXFree(pNewVisualPriv);
|
|
||||||
__glXFree(pNewVisualConfigs);
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Alloc space for the new list of the X server's visuals */
|
|
||||||
pVisualNew = (VisualPtr)__glXMalloc(numNewVisuals * sizeof(VisualRec));
|
|
||||||
if (!pVisualNew) {
|
|
||||||
__glXFree(glXVisualPriv);
|
|
||||||
__glXFree(glXVisualPtr);
|
|
||||||
__glXFree(orig_vid);
|
|
||||||
__glXFree(pNewVisualPriv);
|
|
||||||
__glXFree(pNewVisualConfigs);
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
isGLXvis = (GLint *) __glXMalloc(numNewVisuals * sizeof(GLint));
|
|
||||||
if (!isGLXvis) {
|
|
||||||
__glXFree(glXVisualPriv);
|
|
||||||
__glXFree(glXVisualPtr);
|
|
||||||
__glXFree(orig_vid);
|
|
||||||
__glXFree(pNewVisualPriv);
|
|
||||||
__glXFree(pNewVisualConfigs);
|
|
||||||
__glXFree(pVisualNew);
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Initialize the new visuals */
|
|
||||||
found_default = FALSE;
|
|
||||||
for (i = j = 0; i < numVisuals; i++) {
|
|
||||||
|
|
||||||
for (k = 0; k < numNewConfigs; k++) {
|
|
||||||
|
|
||||||
int new_depth;
|
|
||||||
int depth;
|
|
||||||
int d,v;
|
|
||||||
|
|
||||||
/* find the depth of the new visual config */
|
|
||||||
new_depth = pNewVisualPriv[k]->x_visual_depth;
|
|
||||||
|
|
||||||
/* find the depth of the original visual */
|
|
||||||
depth = 0;
|
|
||||||
d = 0;
|
|
||||||
while( (depth==0) && (d < ndepth) ) {
|
|
||||||
v = 0;
|
|
||||||
while( (depth==0) && (v < pdepth[d].numVids) ) {
|
|
||||||
if (pdepth[d].vids[v] == pVisual[i].vid) {
|
|
||||||
depth = pdepth[d].depth;
|
|
||||||
}
|
|
||||||
v++;
|
|
||||||
}
|
|
||||||
d++;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* check that the visual has the same class and depth
|
|
||||||
* as the new config
|
|
||||||
*/
|
|
||||||
if ( pVisual[i].class != pNewVisualPriv[k]->x_visual_class ||
|
|
||||||
(depth != new_depth) )
|
|
||||||
continue;
|
|
||||||
|
|
||||||
/* Initialize the new visual */
|
|
||||||
pVisualNew[j] = pVisual[i];
|
|
||||||
pVisualNew[j].vid = FakeClientID(0);
|
|
||||||
|
|
||||||
/* Check for the default visual */
|
|
||||||
if (!found_default && pVisual[i].vid == *defaultVisp) {
|
|
||||||
*defaultVisp = pVisualNew[j].vid;
|
|
||||||
found_default = TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Save the old VisualID */
|
|
||||||
orig_vid[j] = pVisual[i].vid;
|
|
||||||
|
|
||||||
/* Initialize the glXVisual */
|
|
||||||
glXVisualPtr[j] = pNewVisualConfigs[k];
|
|
||||||
glXVisualPtr[j].vid = pVisualNew[j].vid;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* If the class is -1, then assume the X visual information
|
|
||||||
* is identical to what GLX needs, and take them from the X
|
|
||||||
* visual. NOTE: if class != -1, then all other fields MUST
|
|
||||||
* be initialized.
|
|
||||||
*/
|
|
||||||
if (glXVisualPtr[j].class == -1) {
|
|
||||||
glXVisualPtr[j].class = pVisual[i].class;
|
|
||||||
glXVisualPtr[j].redSize = count_bits(pVisual[i].redMask);
|
|
||||||
glXVisualPtr[j].greenSize = count_bits(pVisual[i].greenMask);
|
|
||||||
glXVisualPtr[j].blueSize = count_bits(pVisual[i].blueMask);
|
|
||||||
glXVisualPtr[j].alphaSize = glXVisualPtr[j].alphaSize;
|
|
||||||
glXVisualPtr[j].redMask = pVisual[i].redMask;
|
|
||||||
glXVisualPtr[j].greenMask = pVisual[i].greenMask;
|
|
||||||
glXVisualPtr[j].blueMask = pVisual[i].blueMask;
|
|
||||||
glXVisualPtr[j].alphaMask = glXVisualPtr[j].alphaMask;
|
|
||||||
glXVisualPtr[j].bufferSize = rootDepth;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Save the device-dependent private for this visual */
|
|
||||||
glXVisualPriv[j] = pNewVisualPriv[k];
|
|
||||||
|
|
||||||
isGLXvis[j] = glxMatchGLXVisualInConfigList( &glXVisualPtr[j],
|
|
||||||
dmxScreens[screenInfo.numScreens-1].glxVisuals,
|
|
||||||
dmxScreens[screenInfo.numScreens-1].numGlxVisuals );
|
|
||||||
if (isGLXvis[j]) numGLXvis++;
|
|
||||||
|
|
||||||
j++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
assert(j <= numNewVisuals);
|
|
||||||
numNewVisuals = j; /* correct number of new visuals */
|
|
||||||
|
|
||||||
/* Save the GLX visuals in the screen structure */
|
|
||||||
__glXActiveScreens[screenInfo.numScreens-1].numVisuals = numNewVisuals;
|
|
||||||
__glXActiveScreens[screenInfo.numScreens-1].numGLXVisuals = numGLXvis;
|
|
||||||
__glXActiveScreens[screenInfo.numScreens-1].isGLXvis = isGLXvis;
|
|
||||||
__glXActiveScreens[screenInfo.numScreens-1].pGlxVisual = glXVisualPtr;
|
|
||||||
|
|
||||||
|
|
||||||
/* Set up depth's VisualIDs */
|
|
||||||
for (i = 0; i < ndepth; i++) {
|
|
||||||
int numVids = 0;
|
|
||||||
VisualID *pVids = NULL;
|
|
||||||
int k, n = 0;
|
|
||||||
|
|
||||||
/* Count the new number of VisualIDs at this depth */
|
|
||||||
for (j = 0; j < pdepth[i].numVids; j++)
|
|
||||||
for (k = 0; k < numNewVisuals; k++)
|
|
||||||
if (pdepth[i].vids[j] == orig_vid[k])
|
|
||||||
numVids++;
|
|
||||||
|
|
||||||
/* Allocate a new list of VisualIDs for this depth */
|
|
||||||
pVids = (VisualID *)__glXMalloc(numVids * sizeof(VisualID));
|
|
||||||
|
|
||||||
/* Initialize the new list of VisualIDs for this depth */
|
|
||||||
for (j = 0; j < pdepth[i].numVids; j++)
|
|
||||||
for (k = 0; k < numNewVisuals; k++)
|
|
||||||
if (pdepth[i].vids[j] == orig_vid[k])
|
|
||||||
pVids[n++] = pVisualNew[k].vid;
|
|
||||||
|
|
||||||
/* Update this depth's list of VisualIDs */
|
|
||||||
__glXFree(pdepth[i].vids);
|
|
||||||
pdepth[i].vids = pVids;
|
|
||||||
pdepth[i].numVids = numVids;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* if the default visual was rejected - need to choose new
|
|
||||||
* default visual !
|
|
||||||
*/
|
|
||||||
if ( !found_default ) {
|
|
||||||
|
|
||||||
for (i=0; i<numVisuals; i++)
|
|
||||||
if (pVisual[i].vid == *defaultVisp)
|
|
||||||
break;
|
|
||||||
|
|
||||||
if (i < numVisuals) {
|
|
||||||
*defaultVisp = FindClosestVisual( &pVisual[i], rootDepth, pdepth, ndepth, pVisualNew, numNewVisuals );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Update the X server's visuals */
|
|
||||||
*nvisualp = numNewVisuals;
|
|
||||||
*visualp = pVisualNew;
|
|
||||||
|
|
||||||
/* Free the old list of the X server's visuals */
|
|
||||||
__glXFree(pVisual);
|
|
||||||
|
|
||||||
/* Clean up temporary allocations */
|
|
||||||
__glXFree(orig_vid);
|
|
||||||
__glXFree(pNewVisualPriv);
|
|
||||||
__glXFree(pNewVisualConfigs);
|
|
||||||
|
|
||||||
/* Free the private list created by DDX HW driver */
|
|
||||||
free(visualPrivates);
|
|
||||||
visualPrivates = NULL;
|
|
||||||
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
|
@ -39,12 +39,4 @@ VisualID glxMatchVisualInConfigList( ScreenPtr pScreen, VisualPtr pVisual, __GLX
|
||||||
|
|
||||||
VisualPtr glxMatchVisual( ScreenPtr pScreen, VisualPtr pVisual, ScreenPtr pMatchScreen );
|
VisualPtr glxMatchVisual( ScreenPtr pScreen, VisualPtr pVisual, ScreenPtr pMatchScreen );
|
||||||
|
|
||||||
void glxSetVisualConfigs(int nconfigs, __GLXvisualConfig *configs,
|
|
||||||
void **privates);
|
|
||||||
|
|
||||||
Bool glxInitVisuals(int *nvisualp, VisualPtr *visualp,
|
|
||||||
VisualID *defaultVisp,
|
|
||||||
int ndepth, DepthPtr pdepth,
|
|
||||||
int rootDepth);
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -72,23 +72,7 @@ typedef EphyrDRIScreenPrivRec* EphyrDRIScreenPrivPtr;
|
||||||
|
|
||||||
static int DRIErrorBase;
|
static int DRIErrorBase;
|
||||||
|
|
||||||
static DISPATCH_PROC(ProcXF86DRIQueryVersion);
|
|
||||||
static DISPATCH_PROC(ProcXF86DRIQueryDirectRenderingCapable);
|
|
||||||
static DISPATCH_PROC(ProcXF86DRIOpenConnection);
|
|
||||||
static DISPATCH_PROC(ProcXF86DRICloseConnection);
|
|
||||||
static DISPATCH_PROC(ProcXF86DRIGetClientDriverName);
|
|
||||||
static DISPATCH_PROC(ProcXF86DRICreateContext);
|
|
||||||
static DISPATCH_PROC(ProcXF86DRIDestroyContext);
|
|
||||||
static DISPATCH_PROC(ProcXF86DRICreateDrawable);
|
|
||||||
static DISPATCH_PROC(ProcXF86DRIDestroyDrawable);
|
|
||||||
static DISPATCH_PROC(ProcXF86DRIGetDrawableInfo);
|
|
||||||
static DISPATCH_PROC(ProcXF86DRIGetDeviceInfo);
|
|
||||||
static DISPATCH_PROC(ProcXF86DRIDispatch);
|
|
||||||
static DISPATCH_PROC(ProcXF86DRIAuthConnection);
|
|
||||||
|
|
||||||
static DISPATCH_PROC(SProcXF86DRIQueryVersion);
|
|
||||||
static DISPATCH_PROC(SProcXF86DRIQueryDirectRenderingCapable);
|
|
||||||
static DISPATCH_PROC(SProcXF86DRIDispatch);
|
|
||||||
|
|
||||||
static Bool ephyrDRIScreenInit (ScreenPtr a_screen) ;
|
static Bool ephyrDRIScreenInit (ScreenPtr a_screen) ;
|
||||||
static Bool ephyrDRICreateWindow (WindowPtr a_win) ;
|
static Bool ephyrDRICreateWindow (WindowPtr a_win) ;
|
||||||
|
@ -119,65 +103,6 @@ static DevPrivateKeyRec ephyrDRIScreenKeyRec;
|
||||||
#define GET_EPHYR_DRI_SCREEN_PRIV(screen) ((EphyrDRIScreenPrivPtr) \
|
#define GET_EPHYR_DRI_SCREEN_PRIV(screen) ((EphyrDRIScreenPrivPtr) \
|
||||||
dixLookupPrivate(&(screen)->devPrivates, ephyrDRIScreenKey))
|
dixLookupPrivate(&(screen)->devPrivates, ephyrDRIScreenKey))
|
||||||
|
|
||||||
|
|
||||||
Bool
|
|
||||||
ephyrDRIExtensionInit (ScreenPtr a_screen)
|
|
||||||
{
|
|
||||||
Bool is_ok=FALSE ;
|
|
||||||
ExtensionEntry* extEntry=NULL;
|
|
||||||
EphyrDRIScreenPrivPtr screen_priv=NULL ;
|
|
||||||
|
|
||||||
EPHYR_LOG ("enter\n") ;
|
|
||||||
if (!hostx_has_dri ()) {
|
|
||||||
EPHYR_LOG ("host does not have DRI extension\n") ;
|
|
||||||
goto out ;
|
|
||||||
}
|
|
||||||
EPHYR_LOG ("host X does have DRI extension\n") ;
|
|
||||||
if (!hostx_has_xshape ()) {
|
|
||||||
EPHYR_LOG ("host does not have XShape extension\n") ;
|
|
||||||
goto out ;
|
|
||||||
}
|
|
||||||
EPHYR_LOG ("host X does have XShape extension\n") ;
|
|
||||||
|
|
||||||
#ifdef XF86DRI_EVENTS
|
|
||||||
EventType = CreateNewResourceType (XF86DRIFreeEvents, "DRIEvents");
|
|
||||||
if (!EventType) {
|
|
||||||
EPHYR_LOG_ERROR ("failed to register DRI event resource type\n") ;
|
|
||||||
goto out ;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if ((extEntry = AddExtension(XF86DRINAME,
|
|
||||||
XF86DRINumberEvents,
|
|
||||||
XF86DRINumberErrors,
|
|
||||||
ProcXF86DRIDispatch,
|
|
||||||
SProcXF86DRIDispatch,
|
|
||||||
NULL,
|
|
||||||
StandardMinorOpcode))) {
|
|
||||||
DRIReqCode = (unsigned char)extEntry->base;
|
|
||||||
DRIErrorBase = extEntry->errorBase;
|
|
||||||
} else {
|
|
||||||
EPHYR_LOG_ERROR ("failed to register DRI extension\n") ;
|
|
||||||
goto out ;
|
|
||||||
}
|
|
||||||
screen_priv = calloc(1, sizeof (EphyrDRIScreenPrivRec)) ;
|
|
||||||
if (!screen_priv) {
|
|
||||||
EPHYR_LOG_ERROR ("failed to allocate screen_priv\n") ;
|
|
||||||
goto out ;
|
|
||||||
}
|
|
||||||
dixSetPrivate(&a_screen->devPrivates, ephyrDRIScreenKey, screen_priv);
|
|
||||||
|
|
||||||
if (!ephyrDRIScreenInit (a_screen)) {
|
|
||||||
EPHYR_LOG_ERROR ("ephyrDRIScreenInit() failed\n") ;
|
|
||||||
goto out ;
|
|
||||||
}
|
|
||||||
EphyrMirrorHostVisuals (a_screen) ;
|
|
||||||
is_ok=TRUE ;
|
|
||||||
out:
|
|
||||||
EPHYR_LOG ("leave\n") ;
|
|
||||||
return is_ok ;
|
|
||||||
}
|
|
||||||
|
|
||||||
static Bool
|
static Bool
|
||||||
ephyrDRIScreenInit (ScreenPtr a_screen)
|
ephyrDRIScreenInit (ScreenPtr a_screen)
|
||||||
{
|
{
|
||||||
|
@ -1428,3 +1353,61 @@ SProcXF86DRIDispatch (register ClientPtr client)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Bool
|
||||||
|
ephyrDRIExtensionInit (ScreenPtr a_screen)
|
||||||
|
{
|
||||||
|
Bool is_ok=FALSE ;
|
||||||
|
ExtensionEntry* extEntry=NULL;
|
||||||
|
EphyrDRIScreenPrivPtr screen_priv=NULL ;
|
||||||
|
|
||||||
|
EPHYR_LOG ("enter\n") ;
|
||||||
|
if (!hostx_has_dri ()) {
|
||||||
|
EPHYR_LOG ("host does not have DRI extension\n") ;
|
||||||
|
goto out ;
|
||||||
|
}
|
||||||
|
EPHYR_LOG ("host X does have DRI extension\n") ;
|
||||||
|
if (!hostx_has_xshape ()) {
|
||||||
|
EPHYR_LOG ("host does not have XShape extension\n") ;
|
||||||
|
goto out ;
|
||||||
|
}
|
||||||
|
EPHYR_LOG ("host X does have XShape extension\n") ;
|
||||||
|
|
||||||
|
#ifdef XF86DRI_EVENTS
|
||||||
|
EventType = CreateNewResourceType (XF86DRIFreeEvents, "DRIEvents");
|
||||||
|
if (!EventType) {
|
||||||
|
EPHYR_LOG_ERROR ("failed to register DRI event resource type\n") ;
|
||||||
|
goto out ;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
if ((extEntry = AddExtension(XF86DRINAME,
|
||||||
|
XF86DRINumberEvents,
|
||||||
|
XF86DRINumberErrors,
|
||||||
|
ProcXF86DRIDispatch,
|
||||||
|
SProcXF86DRIDispatch,
|
||||||
|
NULL,
|
||||||
|
StandardMinorOpcode))) {
|
||||||
|
DRIReqCode = (unsigned char)extEntry->base;
|
||||||
|
DRIErrorBase = extEntry->errorBase;
|
||||||
|
} else {
|
||||||
|
EPHYR_LOG_ERROR ("failed to register DRI extension\n") ;
|
||||||
|
goto out ;
|
||||||
|
}
|
||||||
|
screen_priv = calloc(1, sizeof (EphyrDRIScreenPrivRec)) ;
|
||||||
|
if (!screen_priv) {
|
||||||
|
EPHYR_LOG_ERROR ("failed to allocate screen_priv\n") ;
|
||||||
|
goto out ;
|
||||||
|
}
|
||||||
|
dixSetPrivate(&a_screen->devPrivates, ephyrDRIScreenKey, screen_priv);
|
||||||
|
|
||||||
|
if (!ephyrDRIScreenInit (a_screen)) {
|
||||||
|
EPHYR_LOG_ERROR ("ephyrDRIScreenInit() failed\n") ;
|
||||||
|
goto out ;
|
||||||
|
}
|
||||||
|
EphyrMirrorHostVisuals (a_screen) ;
|
||||||
|
is_ok=TRUE ;
|
||||||
|
out:
|
||||||
|
EPHYR_LOG ("leave\n") ;
|
||||||
|
return is_ok ;
|
||||||
|
}
|
||||||
|
|
|
@ -377,8 +377,7 @@ KdXVInitAdaptors(
|
||||||
pa->ddGetPortAttribute = KdXVGetPortAttribute;
|
pa->ddGetPortAttribute = KdXVGetPortAttribute;
|
||||||
pa->ddQueryBestSize = KdXVQueryBestSize;
|
pa->ddQueryBestSize = KdXVQueryBestSize;
|
||||||
pa->ddQueryImageAttributes = KdXVQueryImageAttributes;
|
pa->ddQueryImageAttributes = KdXVQueryImageAttributes;
|
||||||
if((pa->name = malloc(strlen(adaptorPtr->name) + 1)))
|
pa->name = strdup(adaptorPtr->name);
|
||||||
strcpy(pa->name, adaptorPtr->name);
|
|
||||||
|
|
||||||
if(adaptorPtr->nEncodings &&
|
if(adaptorPtr->nEncodings &&
|
||||||
(pEncode = calloc(adaptorPtr->nEncodings, sizeof(XvEncodingRec)))) {
|
(pEncode = calloc(adaptorPtr->nEncodings, sizeof(XvEncodingRec)))) {
|
||||||
|
@ -388,8 +387,7 @@ KdXVInitAdaptors(
|
||||||
{
|
{
|
||||||
pe->id = encodingPtr->id;
|
pe->id = encodingPtr->id;
|
||||||
pe->pScreen = pScreen;
|
pe->pScreen = pScreen;
|
||||||
if((pe->name = malloc(strlen(encodingPtr->name) + 1)))
|
pe->name = strdup(encodingPtr->name);
|
||||||
strcpy(pe->name, encodingPtr->name);
|
|
||||||
pe->width = encodingPtr->width;
|
pe->width = encodingPtr->width;
|
||||||
pe->height = encodingPtr->height;
|
pe->height = encodingPtr->height;
|
||||||
pe->rate.numerator = encodingPtr->rate.numerator;
|
pe->rate.numerator = encodingPtr->rate.numerator;
|
||||||
|
@ -441,8 +439,7 @@ KdXVInitAdaptors(
|
||||||
pat->flags = attributePtr->flags;
|
pat->flags = attributePtr->flags;
|
||||||
pat->min_value = attributePtr->min_value;
|
pat->min_value = attributePtr->min_value;
|
||||||
pat->max_value = attributePtr->max_value;
|
pat->max_value = attributePtr->max_value;
|
||||||
if((pat->name = malloc(strlen(attributePtr->name) + 1)))
|
pat->name = strdup(attributePtr->name);
|
||||||
strcpy(pat->name, attributePtr->name);
|
|
||||||
}
|
}
|
||||||
pa->nAttributes = adaptorPtr->nAttributes;
|
pa->nAttributes = adaptorPtr->nAttributes;
|
||||||
pa->pAttributes = pAttribute;
|
pa->pAttributes = pAttribute;
|
||||||
|
|
|
@ -103,7 +103,7 @@
|
||||||
# if defined(NO_INLINE) || defined(DO_PROTOTYPES)
|
# if defined(NO_INLINE) || defined(DO_PROTOTYPES)
|
||||||
|
|
||||||
# if !defined(__arm__)
|
# if !defined(__arm__)
|
||||||
# if !defined(__sparc__) && !defined(__sparc) && !defined(__arm32__) \
|
# if !defined(__sparc__) && !defined(__sparc) && !defined(__arm32__) && !defined(__nds32__) \
|
||||||
&& !(defined(__alpha__) && defined(linux)) \
|
&& !(defined(__alpha__) && defined(linux)) \
|
||||||
&& !(defined(__ia64__) && defined(linux)) \
|
&& !(defined(__ia64__) && defined(linux)) \
|
||||||
|
|
||||||
|
@ -114,7 +114,7 @@ extern _X_EXPORT unsigned int inb(unsigned short);
|
||||||
extern _X_EXPORT unsigned int inw(unsigned short);
|
extern _X_EXPORT unsigned int inw(unsigned short);
|
||||||
extern _X_EXPORT unsigned int inl(unsigned short);
|
extern _X_EXPORT unsigned int inl(unsigned short);
|
||||||
|
|
||||||
# else /* __sparc__, __arm32__, __alpha__*/
|
# else /* __sparc__, __arm32__, __alpha__, __nds32__ */
|
||||||
|
|
||||||
extern _X_EXPORT void outb(unsigned long, unsigned char);
|
extern _X_EXPORT void outb(unsigned long, unsigned char);
|
||||||
extern _X_EXPORT void outw(unsigned long, unsigned short);
|
extern _X_EXPORT void outw(unsigned long, unsigned short);
|
||||||
|
@ -123,7 +123,7 @@ extern _X_EXPORT unsigned int inb(unsigned long);
|
||||||
extern _X_EXPORT unsigned int inw(unsigned long);
|
extern _X_EXPORT unsigned int inw(unsigned long);
|
||||||
extern _X_EXPORT unsigned int inl(unsigned long);
|
extern _X_EXPORT unsigned int inl(unsigned long);
|
||||||
|
|
||||||
# endif /* __sparc__, __arm32__, __alpha__ */
|
# endif /* __sparc__, __arm32__, __alpha__, __nds32__ */
|
||||||
# endif /* __arm__ */
|
# endif /* __arm__ */
|
||||||
|
|
||||||
# if defined(__powerpc__) && !defined(__OpenBSD__)
|
# if defined(__powerpc__) && !defined(__OpenBSD__)
|
||||||
|
@ -1018,6 +1018,355 @@ xf_outl(unsigned short port, unsigned int val)
|
||||||
#define outw xf_outw
|
#define outw xf_outw
|
||||||
#define outl xf_outl
|
#define outl xf_outl
|
||||||
|
|
||||||
|
# elif defined(__nds32__)
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Assume all port access are aligned. We need to revise this implementation
|
||||||
|
* if there is unaligned port access. For ldq_u, ldl_u, ldw_u, stq_u, stl_u and
|
||||||
|
* stw_u, they are assumed unaligned.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define barrier() /* no barrier */
|
||||||
|
|
||||||
|
#define PORT_SIZE long
|
||||||
|
|
||||||
|
static __inline__ unsigned char
|
||||||
|
xf86ReadMmio8(__volatile__ void *base, const unsigned long offset)
|
||||||
|
{
|
||||||
|
return *(volatile unsigned char *)((unsigned char *)base + offset) ;
|
||||||
|
}
|
||||||
|
|
||||||
|
static __inline__ void
|
||||||
|
xf86WriteMmio8(__volatile__ void *base, const unsigned long offset,
|
||||||
|
const unsigned int val)
|
||||||
|
{
|
||||||
|
*(volatile unsigned char *)((unsigned char *)base + offset) = val ;
|
||||||
|
barrier();
|
||||||
|
}
|
||||||
|
|
||||||
|
static __inline__ void
|
||||||
|
xf86WriteMmio8NB(__volatile__ void *base, const unsigned long offset,
|
||||||
|
const unsigned int val)
|
||||||
|
{
|
||||||
|
*(volatile unsigned char *)((unsigned char *)base + offset) = val ;
|
||||||
|
}
|
||||||
|
|
||||||
|
static __inline__ unsigned short
|
||||||
|
xf86ReadMmio16Swap(__volatile__ void *base, const unsigned long offset)
|
||||||
|
{
|
||||||
|
unsigned long addr = ((unsigned long)base) + offset;
|
||||||
|
unsigned short ret;
|
||||||
|
|
||||||
|
__asm__ __volatile__(
|
||||||
|
"lhi %0, [%1];\n\t"
|
||||||
|
"wsbh %0, %0;\n\t"
|
||||||
|
: "=r" (ret)
|
||||||
|
: "r" (addr));
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
static __inline__ unsigned short
|
||||||
|
xf86ReadMmio16(__volatile__ void *base, const unsigned long offset)
|
||||||
|
{
|
||||||
|
return *(volatile unsigned short *)((char *)base + offset) ;
|
||||||
|
}
|
||||||
|
|
||||||
|
static __inline__ void
|
||||||
|
xf86WriteMmio16Swap(__volatile__ void *base, const unsigned long offset,
|
||||||
|
const unsigned int val)
|
||||||
|
{
|
||||||
|
unsigned long addr = ((unsigned long)base) + offset;
|
||||||
|
|
||||||
|
__asm__ __volatile__(
|
||||||
|
"wsbh %0, %0;\n\t"
|
||||||
|
"shi %0, [%1];\n\t"
|
||||||
|
: /* No outputs */
|
||||||
|
: "r" (val), "r" (addr));
|
||||||
|
barrier();
|
||||||
|
}
|
||||||
|
|
||||||
|
static __inline__ void
|
||||||
|
xf86WriteMmio16(__volatile__ void *base, const unsigned long offset,
|
||||||
|
const unsigned int val)
|
||||||
|
{
|
||||||
|
*(volatile unsigned short *)((unsigned char *)base + offset) = val ;
|
||||||
|
barrier();
|
||||||
|
}
|
||||||
|
|
||||||
|
static __inline__ void
|
||||||
|
xf86WriteMmio16SwapNB(__volatile__ void *base, const unsigned long offset,
|
||||||
|
const unsigned int val)
|
||||||
|
{
|
||||||
|
unsigned long addr = ((unsigned long)base) + offset;
|
||||||
|
|
||||||
|
__asm__ __volatile__(
|
||||||
|
"wsbh %0, %0;\n\t"
|
||||||
|
"shi %0, [%1];\n\t"
|
||||||
|
: /* No outputs */
|
||||||
|
: "r" (val), "r" (addr));
|
||||||
|
}
|
||||||
|
|
||||||
|
static __inline__ void
|
||||||
|
xf86WriteMmio16NB(__volatile__ void *base, const unsigned long offset,
|
||||||
|
const unsigned int val)
|
||||||
|
{
|
||||||
|
*(volatile unsigned short *)((unsigned char *)base + offset) = val ;
|
||||||
|
}
|
||||||
|
|
||||||
|
static __inline__ unsigned int
|
||||||
|
xf86ReadMmio32Swap(__volatile__ void *base, const unsigned long offset)
|
||||||
|
{
|
||||||
|
unsigned long addr = ((unsigned long)base) + offset;
|
||||||
|
unsigned int ret;
|
||||||
|
|
||||||
|
__asm__ __volatile__(
|
||||||
|
"lwi %0, [%1];\n\t"
|
||||||
|
"wsbh %0, %0;\n\t"
|
||||||
|
"rotri %0, %0, 16;\n\t"
|
||||||
|
: "=r" (ret)
|
||||||
|
: "r" (addr));
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
static __inline__ unsigned int
|
||||||
|
xf86ReadMmio32(__volatile__ void *base, const unsigned long offset)
|
||||||
|
{
|
||||||
|
return *(volatile unsigned int *)((unsigned char *)base + offset) ;
|
||||||
|
}
|
||||||
|
|
||||||
|
static __inline__ void
|
||||||
|
xf86WriteMmio32Swap(__volatile__ void *base, const unsigned long offset,
|
||||||
|
const unsigned int val)
|
||||||
|
{
|
||||||
|
unsigned long addr = ((unsigned long)base) + offset;
|
||||||
|
|
||||||
|
__asm__ __volatile__(
|
||||||
|
"wsbh %0, %0;\n\t"
|
||||||
|
"rotri %0, %0, 16;\n\t"
|
||||||
|
"swi %0, [%1];\n\t"
|
||||||
|
: /* No outputs */
|
||||||
|
: "r" (val), "r" (addr));
|
||||||
|
barrier();
|
||||||
|
}
|
||||||
|
|
||||||
|
static __inline__ void
|
||||||
|
xf86WriteMmio32(__volatile__ void *base, const unsigned long offset,
|
||||||
|
const unsigned int val)
|
||||||
|
{
|
||||||
|
*(volatile unsigned int *)((unsigned char *)base + offset) = val ;
|
||||||
|
barrier();
|
||||||
|
}
|
||||||
|
|
||||||
|
static __inline__ void
|
||||||
|
xf86WriteMmio32SwapNB(__volatile__ void *base, const unsigned long offset,
|
||||||
|
const unsigned int val)
|
||||||
|
{
|
||||||
|
unsigned long addr = ((unsigned long)base) + offset;
|
||||||
|
|
||||||
|
__asm__ __volatile__(
|
||||||
|
"wsbh %0, %0;\n\t"
|
||||||
|
"rotri %0, %0, 16;\n\t"
|
||||||
|
"swi %0, [%1];\n\t"
|
||||||
|
: /* No outputs */
|
||||||
|
: "r" (val), "r" (addr));
|
||||||
|
}
|
||||||
|
|
||||||
|
static __inline__ void
|
||||||
|
xf86WriteMmio32NB(__volatile__ void *base, const unsigned long offset,
|
||||||
|
const unsigned int val)
|
||||||
|
{
|
||||||
|
*(volatile unsigned int *)((unsigned char *)base + offset) = val ;
|
||||||
|
}
|
||||||
|
|
||||||
|
# if defined(NDS32_MMIO_SWAP)
|
||||||
|
static __inline__ void
|
||||||
|
outb(unsigned PORT_SIZE port, unsigned char val)
|
||||||
|
{
|
||||||
|
xf86WriteMmio8(IOPortBase, port, val);
|
||||||
|
}
|
||||||
|
|
||||||
|
static __inline__ void
|
||||||
|
outw(unsigned PORT_SIZE port, unsigned short val)
|
||||||
|
{
|
||||||
|
xf86WriteMmio16Swap(IOPortBase, port, val);
|
||||||
|
}
|
||||||
|
|
||||||
|
static __inline__ void
|
||||||
|
outl(unsigned PORT_SIZE port, unsigned int val)
|
||||||
|
{
|
||||||
|
xf86WriteMmio32Swap(IOPortBase, port, val);
|
||||||
|
}
|
||||||
|
|
||||||
|
static __inline__ unsigned int
|
||||||
|
inb(unsigned PORT_SIZE port)
|
||||||
|
{
|
||||||
|
return xf86ReadMmio8(IOPortBase, port);
|
||||||
|
}
|
||||||
|
|
||||||
|
static __inline__ unsigned int
|
||||||
|
inw(unsigned PORT_SIZE port)
|
||||||
|
{
|
||||||
|
return xf86ReadMmio16Swap(IOPortBase, port);
|
||||||
|
}
|
||||||
|
|
||||||
|
static __inline__ unsigned int
|
||||||
|
inl(unsigned PORT_SIZE port)
|
||||||
|
{
|
||||||
|
return xf86ReadMmio32Swap(IOPortBase, port);
|
||||||
|
}
|
||||||
|
|
||||||
|
static __inline__ unsigned long ldq_u(unsigned long *p)
|
||||||
|
{
|
||||||
|
unsigned long addr = (unsigned long)p;
|
||||||
|
unsigned int ret;
|
||||||
|
|
||||||
|
__asm__ __volatile__(
|
||||||
|
"lmw.bi %0, [%1], %0, 0;\n\t"
|
||||||
|
"wsbh %0, %0;\n\t"
|
||||||
|
"rotri %0, %0, 16;\n\t"
|
||||||
|
: "=r" (ret)
|
||||||
|
: "r" (addr));
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
static __inline__ unsigned long ldl_u(unsigned int *p)
|
||||||
|
{
|
||||||
|
unsigned long addr = (unsigned long)p;
|
||||||
|
unsigned int ret;
|
||||||
|
|
||||||
|
__asm__ __volatile__(
|
||||||
|
"lmw.bi %0, [%1], %0, 0;\n\t"
|
||||||
|
"wsbh %0, %0;\n\t"
|
||||||
|
"rotri %0, %0, 16;\n\t"
|
||||||
|
: "=r" (ret)
|
||||||
|
: "r" (addr));
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
static __inline__ void stq_u(unsigned long val, unsigned long *p)
|
||||||
|
{
|
||||||
|
unsigned long addr = (unsigned long)p;
|
||||||
|
|
||||||
|
__asm__ __volatile__(
|
||||||
|
"wsbh %0, %0;\n\t"
|
||||||
|
"rotri %0, %0, 16;\n\t"
|
||||||
|
"smw.bi %0, [%1], %0, 0;\n\t"
|
||||||
|
: /* No outputs */
|
||||||
|
: "r" (val), "r" (addr));
|
||||||
|
}
|
||||||
|
|
||||||
|
static __inline__ void stl_u(unsigned long val, unsigned int *p)
|
||||||
|
{
|
||||||
|
unsigned long addr = (unsigned long)p;
|
||||||
|
|
||||||
|
__asm__ __volatile__(
|
||||||
|
"wsbh %0, %0;\n\t"
|
||||||
|
"rotri %0, %0, 16;\n\t"
|
||||||
|
"smw.bi %0, [%1], %0, 0;\n\t"
|
||||||
|
: /* No outputs */
|
||||||
|
: "r" (val), "r" (addr));
|
||||||
|
}
|
||||||
|
|
||||||
|
# else /* !NDS32_MMIO_SWAP */
|
||||||
|
static __inline__ void
|
||||||
|
outb(unsigned PORT_SIZE port, unsigned char val)
|
||||||
|
{
|
||||||
|
*(volatile unsigned char*)(((unsigned PORT_SIZE)(port))) = val;
|
||||||
|
barrier();
|
||||||
|
}
|
||||||
|
|
||||||
|
static __inline__ void
|
||||||
|
outw(unsigned PORT_SIZE port, unsigned short val)
|
||||||
|
{
|
||||||
|
*(volatile unsigned short*)(((unsigned PORT_SIZE)(port))) = val;
|
||||||
|
barrier();
|
||||||
|
}
|
||||||
|
|
||||||
|
static __inline__ void
|
||||||
|
outl(unsigned PORT_SIZE port, unsigned int val)
|
||||||
|
{
|
||||||
|
*(volatile unsigned int*)(((unsigned PORT_SIZE)(port))) = val;
|
||||||
|
barrier();
|
||||||
|
}
|
||||||
|
static __inline__ unsigned int
|
||||||
|
inb(unsigned PORT_SIZE port)
|
||||||
|
{
|
||||||
|
return *(volatile unsigned char*)(((unsigned PORT_SIZE)(port)));
|
||||||
|
}
|
||||||
|
|
||||||
|
static __inline__ unsigned int
|
||||||
|
inw(unsigned PORT_SIZE port)
|
||||||
|
{
|
||||||
|
return *(volatile unsigned short*)(((unsigned PORT_SIZE)(port)));
|
||||||
|
}
|
||||||
|
|
||||||
|
static __inline__ unsigned int
|
||||||
|
inl(unsigned PORT_SIZE port)
|
||||||
|
{
|
||||||
|
return *(volatile unsigned int*)(((unsigned PORT_SIZE)(port)));
|
||||||
|
}
|
||||||
|
|
||||||
|
static __inline__ unsigned long ldq_u(unsigned long *p)
|
||||||
|
{
|
||||||
|
unsigned long addr = (unsigned long)p;
|
||||||
|
unsigned int ret;
|
||||||
|
|
||||||
|
__asm__ __volatile__(
|
||||||
|
"lmw.bi %0, [%1], %0, 0;\n\t"
|
||||||
|
: "=r" (ret)
|
||||||
|
: "r" (addr));
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
static __inline__ unsigned long ldl_u(unsigned int *p)
|
||||||
|
{
|
||||||
|
unsigned long addr = (unsigned long)p;
|
||||||
|
unsigned int ret;
|
||||||
|
|
||||||
|
__asm__ __volatile__(
|
||||||
|
"lmw.bi %0, [%1], %0, 0;\n\t"
|
||||||
|
: "=r" (ret)
|
||||||
|
: "r" (addr));
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static __inline__ void stq_u(unsigned long val, unsigned long *p)
|
||||||
|
{
|
||||||
|
unsigned long addr = (unsigned long)p;
|
||||||
|
|
||||||
|
__asm__ __volatile__(
|
||||||
|
"smw.bi %0, [%1], %0, 0;\n\t"
|
||||||
|
: /* No outputs */
|
||||||
|
: "r" (val), "r" (addr));
|
||||||
|
}
|
||||||
|
|
||||||
|
static __inline__ void stl_u(unsigned long val, unsigned int *p)
|
||||||
|
{
|
||||||
|
unsigned long addr = (unsigned long)p;
|
||||||
|
|
||||||
|
__asm__ __volatile__(
|
||||||
|
"smw.bi %0, [%1], %0, 0;\n\t"
|
||||||
|
: /* No outputs */
|
||||||
|
: "r" (val), "r" (addr));
|
||||||
|
}
|
||||||
|
# endif /* NDS32_MMIO_SWAP */
|
||||||
|
|
||||||
|
# if (((X_BYTE_ORDER == X_BIG_ENDIAN) && !defined(NDS32_MMIO_SWAP)) || ((X_BYTE_ORDER != X_BIG_ENDIAN) && defined(NDS32_MMIO_SWAP)))
|
||||||
|
# define ldw_u(p) ((*(unsigned char *)(p)) << 8 | \
|
||||||
|
(*((unsigned char *)(p)+1)))
|
||||||
|
# define stw_u(v,p) (*(unsigned char *)(p)) = ((v) >> 8); \
|
||||||
|
(*((unsigned char *)(p)+1)) = (v)
|
||||||
|
# else
|
||||||
|
# define ldw_u(p) ((*(unsigned char *)(p)) | \
|
||||||
|
(*((unsigned char *)(p)+1)<<8))
|
||||||
|
# define stw_u(v,p) (*(unsigned char *)(p)) = (v); \
|
||||||
|
(*((unsigned char *)(p)+1)) = ((v) >> 8)
|
||||||
|
# endif
|
||||||
|
|
||||||
|
# define mem_barrier() /* XXX: nop for now */
|
||||||
|
# define write_mem_barrier() /* XXX: nop for now */
|
||||||
|
|
||||||
# else /* ix86 */
|
# else /* ix86 */
|
||||||
|
|
||||||
# if !defined(__SUNPRO_C)
|
# if !defined(__SUNPRO_C)
|
||||||
|
@ -1338,6 +1687,67 @@ extern _X_EXPORT void xf86SlowBCopyToBus(unsigned char *, unsigned char *, int);
|
||||||
# define MMIO_MOVE32(base, offset, val) \
|
# define MMIO_MOVE32(base, offset, val) \
|
||||||
xf86WriteMmio32Be(base, offset, (CARD32)(val))
|
xf86WriteMmio32Be(base, offset, (CARD32)(val))
|
||||||
|
|
||||||
|
# elif defined(__nds32__)
|
||||||
|
/*
|
||||||
|
* we provide byteswapping and no byteswapping functions here
|
||||||
|
* with no byteswapping as default; when endianness of CPU core
|
||||||
|
* and I/O devices don't match, byte swapping is necessary
|
||||||
|
* drivers that need byteswapping should define NDS32_MMIO_SWAP
|
||||||
|
*/
|
||||||
|
# define MMIO_IN8(base, offset) xf86ReadMmio8(base, offset)
|
||||||
|
# define MMIO_OUT8(base, offset, val) \
|
||||||
|
xf86WriteMmio8(base, offset, (CARD8)(val))
|
||||||
|
# define MMIO_ONB8(base, offset, val) \
|
||||||
|
xf86WriteMmioNB8(base, offset, (CARD8)(val))
|
||||||
|
|
||||||
|
# if defined(NDS32_MMIO_SWAP) /* byteswapping */
|
||||||
|
# define MMIO_IN16(base, offset) xf86ReadMmio16Swap(base, offset)
|
||||||
|
# define MMIO_IN32(base, offset) xf86ReadMmio32Swap(base, offset)
|
||||||
|
# define MMIO_OUT16(base, offset, val) \
|
||||||
|
xf86WriteMmio16Swap(base, offset, (CARD16)(val))
|
||||||
|
# define MMIO_OUT32(base, offset, val) \
|
||||||
|
xf86WriteMmio32Swap(base, offset, (CARD32)(val))
|
||||||
|
# define MMIO_ONB16(base, offset, val) \
|
||||||
|
xf86WriteMmioNB16Swap(base, offset, (CARD16)(val))
|
||||||
|
# define MMIO_ONB32(base, offset, val) \
|
||||||
|
xf86WriteMmioNB32Swap(base, offset, (CARD32)(val))
|
||||||
|
# else /* no byteswapping is the default */
|
||||||
|
# define MMIO_IN16(base, offset) xf86ReadMmio16(base, offset)
|
||||||
|
# define MMIO_IN32(base, offset) xf86ReadMmio32(base, offset)
|
||||||
|
# define MMIO_OUT16(base, offset, val) \
|
||||||
|
xf86WriteMmio16(base, offset, (CARD16)(val))
|
||||||
|
# define MMIO_OUT32(base, offset, val) \
|
||||||
|
xf86WriteMmio32(base, offset, (CARD32)(val))
|
||||||
|
# define MMIO_ONB16(base, offset, val) \
|
||||||
|
xf86WriteMmioNB16(base, offset, (CARD16)(val))
|
||||||
|
# define MMIO_ONB32(base, offset, val) \
|
||||||
|
xf86WriteMmioNB32(base, offset, (CARD32)(val))
|
||||||
|
# endif
|
||||||
|
|
||||||
|
# define MMIO_MOVE32(base, offset, val) \
|
||||||
|
xf86WriteMmio32(base, offset, (CARD32)(val))
|
||||||
|
|
||||||
|
#ifdef N1213_HC /* for NDS32 N1213 hardcore */
|
||||||
|
static __inline__ void nds32_flush_icache(char *addr)
|
||||||
|
{
|
||||||
|
__asm__ volatile (
|
||||||
|
"isync %0;"
|
||||||
|
"msync;"
|
||||||
|
"isb;"
|
||||||
|
"cctl %0,L1I_VA_INVAL;"
|
||||||
|
"isb;"
|
||||||
|
: : "r"(addr) : "memory");
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
static __inline__ void nds32_flush_icache(char *addr)
|
||||||
|
{
|
||||||
|
__asm__ volatile (
|
||||||
|
"isync %0;"
|
||||||
|
"isb;"
|
||||||
|
: : "r"(addr) : "memory");
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
# else /* !__alpha__ && !__powerpc__ && !__sparc__ */
|
# else /* !__alpha__ && !__powerpc__ && !__sparc__ */
|
||||||
|
|
||||||
# define MMIO_IN8(base, offset) \
|
# define MMIO_IN8(base, offset) \
|
||||||
|
|
|
@ -60,7 +60,7 @@
|
||||||
#include "configProcs.h"
|
#include "configProcs.h"
|
||||||
#include "globals.h"
|
#include "globals.h"
|
||||||
#include "extension.h"
|
#include "extension.h"
|
||||||
#include "Pci.h"
|
#include "xf86pciBus.h"
|
||||||
|
|
||||||
#include "xf86Xinput.h"
|
#include "xf86Xinput.h"
|
||||||
|
|
||||||
|
@ -2511,18 +2511,11 @@ xf86HandleConfigFile(Bool autoconfig)
|
||||||
scanptr = xf86ConfigLayout.screens->screen->device->busID;
|
scanptr = xf86ConfigLayout.screens->screen->device->busID;
|
||||||
}
|
}
|
||||||
if (scanptr) {
|
if (scanptr) {
|
||||||
int bus, device, func;
|
|
||||||
if (strncmp(scanptr, "PCI:", 4) != 0) {
|
if (strncmp(scanptr, "PCI:", 4) != 0) {
|
||||||
xf86Msg(X_WARNING, "Bus types other than PCI not yet isolable.\n"
|
xf86Msg(X_WARNING, "Bus types other than PCI not yet isolable.\n"
|
||||||
"\tIgnoring IsolateDevice option.\n");
|
"\tIgnoring IsolateDevice option.\n");
|
||||||
} else if (sscanf(scanptr, "PCI:%d:%d:%d", &bus, &device, &func) == 3) {
|
} else
|
||||||
xf86IsolateDevice.domain = PCI_DOM_FROM_BUS(bus);
|
xf86PciIsolateDevice(scanptr);
|
||||||
xf86IsolateDevice.bus = PCI_BUS_NO_DOMAIN(bus);
|
|
||||||
xf86IsolateDevice.dev = device;
|
|
||||||
xf86IsolateDevice.func = func;
|
|
||||||
xf86Msg(X_INFO,
|
|
||||||
"Isolating PCI bus \"%d:%d:%d\"\n", bus, device, func);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Now process everything else */
|
/* Now process everything else */
|
||||||
|
|
|
@ -34,6 +34,7 @@
|
||||||
#define IN_XSERVER
|
#define IN_XSERVER
|
||||||
#include "Configint.h"
|
#include "Configint.h"
|
||||||
#include "xf86DDC.h"
|
#include "xf86DDC.h"
|
||||||
|
#include "xf86pciBus.h"
|
||||||
#if (defined(__sparc__) || defined(__sparc)) && !defined(__OpenBSD__)
|
#if (defined(__sparc__) || defined(__sparc)) && !defined(__OpenBSD__)
|
||||||
#include "xf86Bus.h"
|
#include "xf86Bus.h"
|
||||||
#include "xf86Sbus.h"
|
#include "xf86Sbus.h"
|
||||||
|
@ -71,85 +72,6 @@ static char *DFLT_MOUSE_DEV = "/dev/mouse";
|
||||||
static char *DFLT_MOUSE_PROTO = "auto";
|
static char *DFLT_MOUSE_PROTO = "auto";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static Bool
|
|
||||||
bus_pci_configure(void *busData)
|
|
||||||
{
|
|
||||||
int i;
|
|
||||||
struct pci_device * pVideo = NULL;
|
|
||||||
|
|
||||||
pVideo = (struct pci_device *) busData;
|
|
||||||
for (i = 0; i < nDevToConfig; i++)
|
|
||||||
if (DevToConfig[i].pVideo &&
|
|
||||||
(DevToConfig[i].pVideo->domain == pVideo->domain) &&
|
|
||||||
(DevToConfig[i].pVideo->bus == pVideo->bus) &&
|
|
||||||
(DevToConfig[i].pVideo->dev == pVideo->dev) &&
|
|
||||||
(DevToConfig[i].pVideo->func == pVideo->func))
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
static Bool
|
|
||||||
bus_sbus_configure(void *busData)
|
|
||||||
{
|
|
||||||
#if (defined(__sparc__) || defined(__sparc)) && !defined(__OpenBSD__)
|
|
||||||
int i;
|
|
||||||
|
|
||||||
for (i = 0; i < nDevToConfig; i++)
|
|
||||||
if (DevToConfig[i].sVideo &&
|
|
||||||
DevToConfig[i].sVideo->fbNum == ((sbusDevicePtr) busData)->fbNum)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
#endif
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
bus_pci_newdev_configure(void *busData, int i, int *chipset)
|
|
||||||
{
|
|
||||||
char busnum[8];
|
|
||||||
struct pci_device * pVideo = NULL;
|
|
||||||
|
|
||||||
pVideo = (struct pci_device *) busData;
|
|
||||||
|
|
||||||
DevToConfig[i].pVideo = pVideo;
|
|
||||||
|
|
||||||
DevToConfig[i].GDev.busID = xnfalloc(16);
|
|
||||||
xf86FormatPciBusNumber(pVideo->bus, busnum);
|
|
||||||
sprintf(DevToConfig[i].GDev.busID, "PCI:%s:%d:%d",
|
|
||||||
busnum, pVideo->dev, pVideo->func);
|
|
||||||
|
|
||||||
DevToConfig[i].GDev.chipID = pVideo->device_id;
|
|
||||||
DevToConfig[i].GDev.chipRev = pVideo->revision;
|
|
||||||
|
|
||||||
if (*chipset < 0) {
|
|
||||||
*chipset = (pVideo->vendor_id << 16) | pVideo->device_id;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
bus_sbus_newdev_configure(void *busData, int i)
|
|
||||||
{
|
|
||||||
#if (defined(__sparc__) || defined(__sparc)) && !defined(__OpenBSD__)
|
|
||||||
char *promPath = NULL;
|
|
||||||
DevToConfig[i].sVideo = (sbusDevicePtr) busData;
|
|
||||||
DevToConfig[i].GDev.identifier = DevToConfig[i].sVideo->descr;
|
|
||||||
if (sparcPromInit() >= 0) {
|
|
||||||
promPath = sparcPromNode2Pathname(&DevToConfig[i].sVideo->node);
|
|
||||||
sparcPromClose();
|
|
||||||
}
|
|
||||||
if (promPath) {
|
|
||||||
DevToConfig[i].GDev.busID = xnfalloc(strlen(promPath) + 6);
|
|
||||||
sprintf(DevToConfig[i].GDev.busID, "SBUS:%s", promPath);
|
|
||||||
free(promPath);
|
|
||||||
} else {
|
|
||||||
DevToConfig[i].GDev.busID = xnfalloc(12);
|
|
||||||
sprintf(DevToConfig[i].GDev.busID, "SBUS:fb%d",
|
|
||||||
DevToConfig[i].sVideo->fbNum);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This is called by the driver, either through xf86Match???Instances() or
|
* This is called by the driver, either through xf86Match???Instances() or
|
||||||
* directly. We allocate a GDevRec and fill it in as much as we can, letting
|
* directly. We allocate a GDevRec and fill it in as much as we can, letting
|
||||||
|
@ -164,20 +86,23 @@ xf86AddBusDeviceToConfigure(const char *driver, BusType bus, void *busData, int
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
/* Check for duplicates */
|
/* Check for duplicates */
|
||||||
switch (bus) {
|
for (i = 0; i < nDevToConfig; i++) {
|
||||||
case BUS_PCI:
|
switch (bus) {
|
||||||
ret = bus_pci_configure(busData);
|
case BUS_PCI:
|
||||||
break;
|
ret = xf86PciConfigure(busData, DevToConfig[i].pVideo);
|
||||||
case BUS_SBUS:
|
break;
|
||||||
ret = bus_sbus_configure(busData);
|
#if (defined(__sparc__) || defined(__sparc)) && !defined(__OpenBSD__)
|
||||||
break;
|
case BUS_SBUS:
|
||||||
default:
|
ret = xf86SbusConfigure(busData, DevToConfig[i].sVideo);
|
||||||
return NULL;
|
break;
|
||||||
|
#endif
|
||||||
|
default:
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
if (ret == 0)
|
||||||
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ret == 0)
|
|
||||||
goto out;
|
|
||||||
|
|
||||||
/* Allocate new structure occurrence */
|
/* Allocate new structure occurrence */
|
||||||
i = nDevToConfig++;
|
i = nDevToConfig++;
|
||||||
DevToConfig =
|
DevToConfig =
|
||||||
|
@ -195,11 +120,15 @@ xf86AddBusDeviceToConfigure(const char *driver, BusType bus, void *busData, int
|
||||||
|
|
||||||
switch (bus) {
|
switch (bus) {
|
||||||
case BUS_PCI:
|
case BUS_PCI:
|
||||||
bus_pci_newdev_configure(busData, i, &chipset);
|
xf86PciConfigureNewDev(busData, DevToConfig[i].pVideo,
|
||||||
|
&DevToConfig[i].GDev, &chipset);
|
||||||
break;
|
break;
|
||||||
|
#if (defined(__sparc__) || defined(__sparc)) && !defined(__OpenBSD__)
|
||||||
case BUS_SBUS:
|
case BUS_SBUS:
|
||||||
bus_sbus_newdev_configure(busData, i);
|
xf86SbusConfigureNewDev(busData, DevToConfig[i].sVideo,
|
||||||
|
&DevToConfig[i].GDev);
|
||||||
break;
|
break;
|
||||||
|
#endif
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1095,7 +1095,7 @@ DGAProcessPointerEvent (ScreenPtr pScreen, DGAEvent *event, DeviceIntPtr mouse)
|
||||||
ev.header = ET_Internal;
|
ev.header = ET_Internal;
|
||||||
ev.length = sizeof(ev);
|
ev.length = sizeof(ev);
|
||||||
ev.type = event->subtype;
|
ev.type = event->subtype;
|
||||||
ev.corestate = butc->state;
|
ev.corestate = butc ? butc->state : 0;
|
||||||
if (master && master->key)
|
if (master && master->key)
|
||||||
ev.corestate |= XkbStateFieldFromRec(&master->key->xkbInfo->state);
|
ev.corestate |= XkbStateFieldFromRec(&master->key->xkbInfo->state);
|
||||||
|
|
||||||
|
|
|
@ -197,7 +197,3 @@ Bool xf86VidModeAllowNonLocal = FALSE;
|
||||||
RootWinPropPtr *xf86RegisteredPropertiesTable = NULL;
|
RootWinPropPtr *xf86RegisteredPropertiesTable = NULL;
|
||||||
Bool xf86inSuspend = FALSE;
|
Bool xf86inSuspend = FALSE;
|
||||||
Bool xorgHWAccess = FALSE;
|
Bool xorgHWAccess = FALSE;
|
||||||
|
|
||||||
struct pci_slot_match xf86IsolateDevice = {
|
|
||||||
PCI_MATCH_ANY, PCI_MATCH_ANY, PCI_MATCH_ANY, PCI_MATCH_ANY, 0
|
|
||||||
};
|
|
||||||
|
|
|
@ -125,7 +125,6 @@ xf86AddInputDriver(InputDriverPtr driver, pointer module, int flags)
|
||||||
xnfalloc(sizeof(InputDriverRec));
|
xnfalloc(sizeof(InputDriverRec));
|
||||||
*xf86InputDriverList[xf86NumInputDrivers - 1] = *driver;
|
*xf86InputDriverList[xf86NumInputDrivers - 1] = *driver;
|
||||||
xf86InputDriverList[xf86NumInputDrivers - 1]->module = module;
|
xf86InputDriverList[xf86NumInputDrivers - 1]->module = module;
|
||||||
xf86InputDriverList[xf86NumInputDrivers - 1]->refCount = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -706,6 +705,9 @@ xf86SetWeight(ScrnInfoPtr scrp, rgb weight, rgb mask)
|
||||||
scrp->weight.red = scrp->weight.blue = 5;
|
scrp->weight.red = scrp->weight.blue = 5;
|
||||||
scrp->weight.green = 6;
|
scrp->weight.green = 6;
|
||||||
break;
|
break;
|
||||||
|
case 18:
|
||||||
|
scrp->weight.red = scrp->weight.green = scrp->weight.blue = 6;
|
||||||
|
break;
|
||||||
case 24:
|
case 24:
|
||||||
scrp->weight.red = scrp->weight.green = scrp->weight.blue = 8;
|
scrp->weight.red = scrp->weight.green = scrp->weight.blue = 8;
|
||||||
break;
|
break;
|
||||||
|
@ -1109,10 +1111,6 @@ xf86EnableDisableFBAccess(int scrnIndex, Bool enable)
|
||||||
pspix = (*pScreen->GetScreenPixmap) (pScreen);
|
pspix = (*pScreen->GetScreenPixmap) (pScreen);
|
||||||
if (enable)
|
if (enable)
|
||||||
{
|
{
|
||||||
/*
|
|
||||||
* Restore the screen pixmap devPrivate field
|
|
||||||
*/
|
|
||||||
pspix->devPrivate = pScrnInfo->pixmapPrivate;
|
|
||||||
/*
|
/*
|
||||||
* Restore all of the clip lists on the screen
|
* Restore all of the clip lists on the screen
|
||||||
*/
|
*/
|
||||||
|
@ -1126,13 +1124,6 @@ xf86EnableDisableFBAccess(int scrnIndex, Bool enable)
|
||||||
* Empty all of the clip lists on the screen
|
* Empty all of the clip lists on the screen
|
||||||
*/
|
*/
|
||||||
xf86SetRootClip (pScreen, FALSE);
|
xf86SetRootClip (pScreen, FALSE);
|
||||||
/*
|
|
||||||
* save the screen pixmap devPrivate field and
|
|
||||||
* replace it with NULL so accidental references
|
|
||||||
* to the frame buffer are caught
|
|
||||||
*/
|
|
||||||
pScrnInfo->pixmapPrivate = pspix->devPrivate;
|
|
||||||
pspix->devPrivate.ptr = NULL;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1234,7 +1225,7 @@ xf86MsgVerb(MessageType type, int verb, const char *format, ...)
|
||||||
va_list ap;
|
va_list ap;
|
||||||
|
|
||||||
va_start(ap, format);
|
va_start(ap, format);
|
||||||
xf86VDrvMsgVerb(-1, type, verb, format, ap);
|
LogVMessageVerb(type, verb, format, ap);
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1245,7 +1236,7 @@ xf86Msg(MessageType type, const char *format, ...)
|
||||||
va_list ap;
|
va_list ap;
|
||||||
|
|
||||||
va_start(ap, format);
|
va_start(ap, format);
|
||||||
xf86VDrvMsgVerb(-1, type, 1, format, ap);
|
LogVMessageVerb(type, 1, format, ap);
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -314,18 +314,10 @@ InstallSignalHandlers(void)
|
||||||
signal(SIGEMT, SIG_DFL);
|
signal(SIGEMT, SIG_DFL);
|
||||||
#endif
|
#endif
|
||||||
signal(SIGFPE, SIG_DFL);
|
signal(SIGFPE, SIG_DFL);
|
||||||
#ifdef SIGBUS
|
|
||||||
signal(SIGBUS, SIG_DFL);
|
signal(SIGBUS, SIG_DFL);
|
||||||
#endif
|
|
||||||
#ifdef SIGSYS
|
|
||||||
signal(SIGSYS, SIG_DFL);
|
signal(SIGSYS, SIG_DFL);
|
||||||
#endif
|
|
||||||
#ifdef SIGXCPU
|
|
||||||
signal(SIGXCPU, SIG_DFL);
|
signal(SIGXCPU, SIG_DFL);
|
||||||
#endif
|
|
||||||
#ifdef SIGXFSZ
|
|
||||||
signal(SIGXFSZ, SIG_DFL);
|
signal(SIGXFSZ, SIG_DFL);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -863,9 +855,7 @@ OsVendorInit(void)
|
||||||
{
|
{
|
||||||
static Bool beenHere = FALSE;
|
static Bool beenHere = FALSE;
|
||||||
|
|
||||||
#ifdef SIGCHLD
|
|
||||||
signal(SIGCHLD, SIG_DFL); /* Need to wait for child processes */
|
signal(SIGCHLD, SIG_DFL); /* Need to wait for child processes */
|
||||||
#endif
|
|
||||||
|
|
||||||
if (!beenHere) {
|
if (!beenHere) {
|
||||||
umask(022);
|
umask(022);
|
||||||
|
@ -1046,11 +1036,6 @@ xf86PrintDefaultLibraryPath(void)
|
||||||
int
|
int
|
||||||
ddxProcessArgument(int argc, char **argv, int i)
|
ddxProcessArgument(int argc, char **argv, int i)
|
||||||
{
|
{
|
||||||
/*
|
|
||||||
* Note: can't use xalloc/xfree here because OsInit() hasn't been called
|
|
||||||
* yet. Use malloc/free instead.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define CHECK_FOR_REQUIRED_ARGUMENT() \
|
#define CHECK_FOR_REQUIRED_ARGUMENT() \
|
||||||
if (((i + 1) >= argc) || (!argv[i + 1])) { \
|
if (((i + 1) >= argc) || (!argv[i + 1])) { \
|
||||||
ErrorF("Required argument to %s not specified\n", argv[i]); \
|
ErrorF("Required argument to %s not specified\n", argv[i]); \
|
||||||
|
@ -1067,10 +1052,9 @@ ddxProcessArgument(int argc, char **argv, int i)
|
||||||
{
|
{
|
||||||
char *mp;
|
char *mp;
|
||||||
CHECK_FOR_REQUIRED_ARGUMENT();
|
CHECK_FOR_REQUIRED_ARGUMENT();
|
||||||
mp = malloc(strlen(argv[i + 1]) + 1);
|
mp = strdup(argv[i + 1]);
|
||||||
if (!mp)
|
if (!mp)
|
||||||
FatalError("Can't allocate memory for ModulePath\n");
|
FatalError("Can't allocate memory for ModulePath\n");
|
||||||
strcpy(mp, argv[i + 1]);
|
|
||||||
xf86ModulePath = mp;
|
xf86ModulePath = mp;
|
||||||
xf86ModPathFrom = X_CMDLINE;
|
xf86ModPathFrom = X_CMDLINE;
|
||||||
return 2;
|
return 2;
|
||||||
|
@ -1079,10 +1063,9 @@ ddxProcessArgument(int argc, char **argv, int i)
|
||||||
{
|
{
|
||||||
char *lf;
|
char *lf;
|
||||||
CHECK_FOR_REQUIRED_ARGUMENT();
|
CHECK_FOR_REQUIRED_ARGUMENT();
|
||||||
lf = malloc(strlen(argv[i + 1]) + 1);
|
lf = strdup(argv[i + 1]);
|
||||||
if (!lf)
|
if (!lf)
|
||||||
FatalError("Can't allocate memory for LogFile\n");
|
FatalError("Can't allocate memory for LogFile\n");
|
||||||
strcpy(lf, argv[i + 1]);
|
|
||||||
xf86LogFile = lf;
|
xf86LogFile = lf;
|
||||||
xf86LogFileFrom = X_CMDLINE;
|
xf86LogFileFrom = X_CMDLINE;
|
||||||
return 2;
|
return 2;
|
||||||
|
|
|
@ -82,7 +82,7 @@ typedef enum {
|
||||||
* mask is 0xFFFF0000.
|
* mask is 0xFFFF0000.
|
||||||
*/
|
*/
|
||||||
#define ABI_ANSIC_VERSION SET_ABI_VERSION(0, 4)
|
#define ABI_ANSIC_VERSION SET_ABI_VERSION(0, 4)
|
||||||
#define ABI_VIDEODRV_VERSION SET_ABI_VERSION(8, 0)
|
#define ABI_VIDEODRV_VERSION SET_ABI_VERSION(9, 0)
|
||||||
#define ABI_XINPUT_VERSION SET_ABI_VERSION(12, 0)
|
#define ABI_XINPUT_VERSION SET_ABI_VERSION(12, 0)
|
||||||
#define ABI_EXTENSION_VERSION SET_ABI_VERSION(4, 0)
|
#define ABI_EXTENSION_VERSION SET_ABI_VERSION(4, 0)
|
||||||
#define ABI_FONT_VERSION SET_ABI_VERSION(0, 6)
|
#define ABI_FONT_VERSION SET_ABI_VERSION(0, 6)
|
||||||
|
|
|
@ -35,8 +35,6 @@
|
||||||
#ifndef _XF86PRIV_H
|
#ifndef _XF86PRIV_H
|
||||||
#define _XF86PRIV_H
|
#define _XF86PRIV_H
|
||||||
|
|
||||||
#include <pciaccess.h>
|
|
||||||
|
|
||||||
#include "xf86Privstr.h"
|
#include "xf86Privstr.h"
|
||||||
#include "propertyst.h"
|
#include "propertyst.h"
|
||||||
#include "input.h"
|
#include "input.h"
|
||||||
|
@ -72,7 +70,6 @@ extern _X_EXPORT rgb xf86Weight;
|
||||||
extern _X_EXPORT Bool xf86FlipPixels;
|
extern _X_EXPORT Bool xf86FlipPixels;
|
||||||
extern _X_EXPORT Gamma xf86Gamma;
|
extern _X_EXPORT Gamma xf86Gamma;
|
||||||
extern _X_EXPORT char *xf86ServerName;
|
extern _X_EXPORT char *xf86ServerName;
|
||||||
extern _X_EXPORT struct pci_slot_match xf86IsolateDevice;
|
|
||||||
|
|
||||||
/* Other parameters */
|
/* Other parameters */
|
||||||
|
|
||||||
|
|
|
@ -53,7 +53,6 @@ static GCOps VGAarbiterGCOps = {
|
||||||
VGAarbiterPolyFillArc, VGAarbiterPolyText8, VGAarbiterPolyText16,
|
VGAarbiterPolyFillArc, VGAarbiterPolyText8, VGAarbiterPolyText16,
|
||||||
VGAarbiterImageText8, VGAarbiterImageText16, VGAarbiterImageGlyphBlt,
|
VGAarbiterImageText8, VGAarbiterImageText16, VGAarbiterImageGlyphBlt,
|
||||||
VGAarbiterPolyGlyphBlt, VGAarbiterPushPixels,
|
VGAarbiterPolyGlyphBlt, VGAarbiterPushPixels,
|
||||||
{NULL} /* devPrivate */
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static miPointerSpriteFuncRec VGAarbiterSpriteFuncs = {
|
static miPointerSpriteFuncRec VGAarbiterSpriteFuncs = {
|
||||||
|
@ -138,11 +137,12 @@ xf86VGAarbiterScrnInit(ScrnInfoPtr pScrn)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
xf86VGAarbiterDeviceDecodes(ScrnInfoPtr pScrn)
|
xf86VGAarbiterDeviceDecodes(ScrnInfoPtr pScrn, int rsrc)
|
||||||
{
|
{
|
||||||
if (vga_no_arb)
|
if (vga_no_arb)
|
||||||
return;
|
return;
|
||||||
pci_device_vgaarb_decodes(VGA_ARB_RSRC_LEGACY_MEM | VGA_ARB_RSRC_LEGACY_IO);
|
pci_device_vgaarb_set_target(pScrn->vgaDev);
|
||||||
|
pci_device_vgaarb_decodes(rsrc);
|
||||||
}
|
}
|
||||||
|
|
||||||
Bool
|
Bool
|
||||||
|
@ -266,7 +266,7 @@ VGAarbiterBlockHandler(int i,
|
||||||
{
|
{
|
||||||
ScreenPtr pScreen = screenInfo.screens[i];
|
ScreenPtr pScreen = screenInfo.screens[i];
|
||||||
SCREEN_PROLOG(BlockHandler);
|
SCREEN_PROLOG(BlockHandler);
|
||||||
VGAGet();
|
VGAGet(pScreen);
|
||||||
pScreen->BlockHandler(i, blockData, pTimeout, pReadmask);
|
pScreen->BlockHandler(i, blockData, pTimeout, pReadmask);
|
||||||
VGAPut();
|
VGAPut();
|
||||||
SCREEN_EPILOG(BlockHandler, VGAarbiterBlockHandler);
|
SCREEN_EPILOG(BlockHandler, VGAarbiterBlockHandler);
|
||||||
|
@ -277,7 +277,7 @@ VGAarbiterWakeupHandler(int i, pointer blockData, unsigned long result, pointer
|
||||||
{
|
{
|
||||||
ScreenPtr pScreen = screenInfo.screens[i];
|
ScreenPtr pScreen = screenInfo.screens[i];
|
||||||
SCREEN_PROLOG(WakeupHandler);
|
SCREEN_PROLOG(WakeupHandler);
|
||||||
VGAGet();
|
VGAGet(pScreen);
|
||||||
pScreen->WakeupHandler(i, blockData, result, pReadmask);
|
pScreen->WakeupHandler(i, blockData, result, pReadmask);
|
||||||
VGAPut();
|
VGAPut();
|
||||||
SCREEN_EPILOG(WakeupHandler, VGAarbiterWakeupHandler);
|
SCREEN_EPILOG(WakeupHandler, VGAarbiterWakeupHandler);
|
||||||
|
@ -295,7 +295,7 @@ VGAarbiterGetImage (
|
||||||
ScreenPtr pScreen = pDrawable->pScreen;
|
ScreenPtr pScreen = pDrawable->pScreen;
|
||||||
SCREEN_PROLOG(GetImage);
|
SCREEN_PROLOG(GetImage);
|
||||||
// if (xf86Screens[pScreen->myNum]->vtSema) {
|
// if (xf86Screens[pScreen->myNum]->vtSema) {
|
||||||
VGAGet();
|
VGAGet(pScreen);
|
||||||
// }
|
// }
|
||||||
(*pScreen->GetImage) (pDrawable, sx, sy, w, h,
|
(*pScreen->GetImage) (pDrawable, sx, sy, w, h,
|
||||||
format, planemask, pdstLine);
|
format, planemask, pdstLine);
|
||||||
|
@ -316,7 +316,7 @@ VGAarbiterGetSpans (
|
||||||
ScreenPtr pScreen = pDrawable->pScreen;
|
ScreenPtr pScreen = pDrawable->pScreen;
|
||||||
|
|
||||||
SCREEN_PROLOG (GetSpans);
|
SCREEN_PROLOG (GetSpans);
|
||||||
VGAGet();
|
VGAGet(pScreen);
|
||||||
(*pScreen->GetSpans) (pDrawable, wMax, ppt, pwidth, nspans, pdstStart);
|
(*pScreen->GetSpans) (pDrawable, wMax, ppt, pwidth, nspans, pdstStart);
|
||||||
VGAPut();
|
VGAPut();
|
||||||
SCREEN_EPILOG (GetSpans, VGAarbiterGetSpans);
|
SCREEN_EPILOG (GetSpans, VGAarbiterGetSpans);
|
||||||
|
@ -329,7 +329,7 @@ VGAarbiterSourceValidate (
|
||||||
{
|
{
|
||||||
ScreenPtr pScreen = pDrawable->pScreen;
|
ScreenPtr pScreen = pDrawable->pScreen;
|
||||||
SCREEN_PROLOG (SourceValidate);
|
SCREEN_PROLOG (SourceValidate);
|
||||||
VGAGet();
|
VGAGet(pScreen);
|
||||||
if (pScreen->SourceValidate)
|
if (pScreen->SourceValidate)
|
||||||
(*pScreen->SourceValidate) (pDrawable, x, y, width, height);
|
(*pScreen->SourceValidate) (pDrawable, x, y, width, height);
|
||||||
VGAPut();
|
VGAPut();
|
||||||
|
@ -345,7 +345,7 @@ VGAarbiterCopyWindow(
|
||||||
ScreenPtr pScreen = pWin->drawable.pScreen;
|
ScreenPtr pScreen = pWin->drawable.pScreen;
|
||||||
|
|
||||||
SCREEN_PROLOG (CopyWindow);
|
SCREEN_PROLOG (CopyWindow);
|
||||||
VGAGet();
|
VGAGet(pScreen);
|
||||||
(*pScreen->CopyWindow) (pWin, ptOldOrg, prgnSrc);
|
(*pScreen->CopyWindow) (pWin, ptOldOrg, prgnSrc);
|
||||||
VGAPut();
|
VGAPut();
|
||||||
SCREEN_EPILOG (CopyWindow, VGAarbiterCopyWindow);
|
SCREEN_EPILOG (CopyWindow, VGAarbiterCopyWindow);
|
||||||
|
@ -361,7 +361,7 @@ VGAarbiterClearToBackground (
|
||||||
ScreenPtr pScreen = pWin->drawable.pScreen;
|
ScreenPtr pScreen = pWin->drawable.pScreen;
|
||||||
|
|
||||||
SCREEN_PROLOG ( ClearToBackground);
|
SCREEN_PROLOG ( ClearToBackground);
|
||||||
VGAGet();
|
VGAGet(pScreen);
|
||||||
(*pScreen->ClearToBackground) (pWin, x, y, w, h, generateExposures);
|
(*pScreen->ClearToBackground) (pWin, x, y, w, h, generateExposures);
|
||||||
VGAPut();
|
VGAPut();
|
||||||
SCREEN_EPILOG (ClearToBackground, VGAarbiterClearToBackground);
|
SCREEN_EPILOG (ClearToBackground, VGAarbiterClearToBackground);
|
||||||
|
@ -373,7 +373,7 @@ VGAarbiterCreatePixmap(ScreenPtr pScreen, int w, int h, int depth, unsigned usag
|
||||||
PixmapPtr pPix;
|
PixmapPtr pPix;
|
||||||
|
|
||||||
SCREEN_PROLOG ( CreatePixmap);
|
SCREEN_PROLOG ( CreatePixmap);
|
||||||
VGAGet();
|
VGAGet(pScreen);
|
||||||
pPix = (*pScreen->CreatePixmap) (pScreen, w, h, depth, usage_hint);
|
pPix = (*pScreen->CreatePixmap) (pScreen, w, h, depth, usage_hint);
|
||||||
VGAPut();
|
VGAPut();
|
||||||
SCREEN_EPILOG (CreatePixmap, VGAarbiterCreatePixmap);
|
SCREEN_EPILOG (CreatePixmap, VGAarbiterCreatePixmap);
|
||||||
|
@ -387,7 +387,7 @@ VGAarbiterSaveScreen(ScreenPtr pScreen, Bool unblank)
|
||||||
Bool val;
|
Bool val;
|
||||||
|
|
||||||
SCREEN_PROLOG (SaveScreen);
|
SCREEN_PROLOG (SaveScreen);
|
||||||
VGAGet();
|
VGAGet(pScreen);
|
||||||
val = (*pScreen->SaveScreen) (pScreen, unblank);
|
val = (*pScreen->SaveScreen) (pScreen, unblank);
|
||||||
VGAPut();
|
VGAPut();
|
||||||
SCREEN_EPILOG (SaveScreen, VGAarbiterSaveScreen);
|
SCREEN_EPILOG (SaveScreen, VGAarbiterSaveScreen);
|
||||||
|
@ -404,7 +404,7 @@ VGAarbiterStoreColors (
|
||||||
ScreenPtr pScreen = pmap->pScreen;
|
ScreenPtr pScreen = pmap->pScreen;
|
||||||
|
|
||||||
SCREEN_PROLOG (StoreColors);
|
SCREEN_PROLOG (StoreColors);
|
||||||
VGAGet();
|
VGAGet(pScreen);
|
||||||
(*pScreen->StoreColors) (pmap,ndef,pdefs);
|
(*pScreen->StoreColors) (pmap,ndef,pdefs);
|
||||||
VGAPut();
|
VGAPut();
|
||||||
SCREEN_EPILOG ( StoreColors, VGAarbiterStoreColors);
|
SCREEN_EPILOG ( StoreColors, VGAarbiterStoreColors);
|
||||||
|
@ -419,7 +419,7 @@ VGAarbiterRecolorCursor (
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
SCREEN_PROLOG (RecolorCursor);
|
SCREEN_PROLOG (RecolorCursor);
|
||||||
VGAGet();
|
VGAGet(pScreen);
|
||||||
(*pScreen->RecolorCursor) (pDev, pScreen, pCurs, displayed);
|
(*pScreen->RecolorCursor) (pDev, pScreen, pCurs, displayed);
|
||||||
VGAPut();
|
VGAPut();
|
||||||
SCREEN_EPILOG ( RecolorCursor, VGAarbiterRecolorCursor);
|
SCREEN_EPILOG ( RecolorCursor, VGAarbiterRecolorCursor);
|
||||||
|
@ -435,7 +435,7 @@ VGAarbiterRealizeCursor (
|
||||||
Bool val;
|
Bool val;
|
||||||
|
|
||||||
SCREEN_PROLOG (RealizeCursor);
|
SCREEN_PROLOG (RealizeCursor);
|
||||||
VGAGet();
|
VGAGet(pScreen);
|
||||||
val = (*pScreen->RealizeCursor) (pDev, pScreen,pCursor);
|
val = (*pScreen->RealizeCursor) (pDev, pScreen,pCursor);
|
||||||
VGAPut();
|
VGAPut();
|
||||||
SCREEN_EPILOG ( RealizeCursor, VGAarbiterRealizeCursor);
|
SCREEN_EPILOG ( RealizeCursor, VGAarbiterRealizeCursor);
|
||||||
|
@ -452,7 +452,7 @@ VGAarbiterUnrealizeCursor (
|
||||||
Bool val;
|
Bool val;
|
||||||
|
|
||||||
SCREEN_PROLOG (UnrealizeCursor);
|
SCREEN_PROLOG (UnrealizeCursor);
|
||||||
VGAGet();
|
VGAGet(pScreen);
|
||||||
val = (*pScreen->UnrealizeCursor) (pDev, pScreen, pCursor);
|
val = (*pScreen->UnrealizeCursor) (pDev, pScreen, pCursor);
|
||||||
VGAPut();
|
VGAPut();
|
||||||
SCREEN_EPILOG ( UnrealizeCursor, VGAarbiterUnrealizeCursor);
|
SCREEN_EPILOG ( UnrealizeCursor, VGAarbiterUnrealizeCursor);
|
||||||
|
@ -469,7 +469,7 @@ VGAarbiterDisplayCursor (
|
||||||
Bool val;
|
Bool val;
|
||||||
|
|
||||||
SCREEN_PROLOG (DisplayCursor);
|
SCREEN_PROLOG (DisplayCursor);
|
||||||
VGAGet();
|
VGAGet(pScreen);
|
||||||
val = (*pScreen->DisplayCursor) (pDev, pScreen, pCursor);
|
val = (*pScreen->DisplayCursor) (pDev, pScreen, pCursor);
|
||||||
VGAPut();
|
VGAPut();
|
||||||
SCREEN_EPILOG ( DisplayCursor, VGAarbiterDisplayCursor);
|
SCREEN_EPILOG ( DisplayCursor, VGAarbiterDisplayCursor);
|
||||||
|
@ -486,7 +486,7 @@ VGAarbiterSetCursorPosition (
|
||||||
Bool val;
|
Bool val;
|
||||||
|
|
||||||
SCREEN_PROLOG (SetCursorPosition);
|
SCREEN_PROLOG (SetCursorPosition);
|
||||||
VGAGet();
|
VGAGet(pScreen);
|
||||||
val = (*pScreen->SetCursorPosition) (pDev, pScreen, x, y, generateEvent);
|
val = (*pScreen->SetCursorPosition) (pDev, pScreen, x, y, generateEvent);
|
||||||
VGAPut();
|
VGAPut();
|
||||||
SCREEN_EPILOG ( SetCursorPosition, VGAarbiterSetCursorPosition);
|
SCREEN_EPILOG ( SetCursorPosition, VGAarbiterSetCursorPosition);
|
||||||
|
@ -500,7 +500,7 @@ VGAarbiterAdjustFrame(int index, int x, int y, int flags)
|
||||||
VGAarbiterScreenPtr pScreenPriv = (VGAarbiterScreenPtr)dixLookupPrivate(
|
VGAarbiterScreenPtr pScreenPriv = (VGAarbiterScreenPtr)dixLookupPrivate(
|
||||||
&pScreen->devPrivates, VGAarbiterScreenKey);
|
&pScreen->devPrivates, VGAarbiterScreenKey);
|
||||||
|
|
||||||
VGAGet();
|
VGAGet(pScreen);
|
||||||
(*pScreenPriv->AdjustFrame)(index, x, y, flags);
|
(*pScreenPriv->AdjustFrame)(index, x, y, flags);
|
||||||
VGAPut();
|
VGAPut();
|
||||||
}
|
}
|
||||||
|
@ -513,7 +513,7 @@ VGAarbiterSwitchMode(int index, DisplayModePtr mode, int flags)
|
||||||
VGAarbiterScreenPtr pScreenPriv = (VGAarbiterScreenPtr)dixLookupPrivate(
|
VGAarbiterScreenPtr pScreenPriv = (VGAarbiterScreenPtr)dixLookupPrivate(
|
||||||
&pScreen->devPrivates, VGAarbiterScreenKey);
|
&pScreen->devPrivates, VGAarbiterScreenKey);
|
||||||
|
|
||||||
VGAGet();
|
VGAGet(pScreen);
|
||||||
val = (*pScreenPriv->SwitchMode)(index, mode, flags);
|
val = (*pScreenPriv->SwitchMode)(index, mode, flags);
|
||||||
VGAPut();
|
VGAPut();
|
||||||
return val;
|
return val;
|
||||||
|
@ -528,7 +528,7 @@ VGAarbiterEnterVT(int index, int flags)
|
||||||
VGAarbiterScreenPtr pScreenPriv = (VGAarbiterScreenPtr)dixLookupPrivate(
|
VGAarbiterScreenPtr pScreenPriv = (VGAarbiterScreenPtr)dixLookupPrivate(
|
||||||
&pScreen->devPrivates, VGAarbiterScreenKey);
|
&pScreen->devPrivates, VGAarbiterScreenKey);
|
||||||
|
|
||||||
VGAGet();
|
VGAGet(pScreen);
|
||||||
pScrn->EnterVT = pScreenPriv->EnterVT;
|
pScrn->EnterVT = pScreenPriv->EnterVT;
|
||||||
val = (*pScrn->EnterVT)(index, flags);
|
val = (*pScrn->EnterVT)(index, flags);
|
||||||
pScreenPriv->EnterVT = pScrn->EnterVT;
|
pScreenPriv->EnterVT = pScrn->EnterVT;
|
||||||
|
@ -545,7 +545,7 @@ VGAarbiterLeaveVT(int index, int flags)
|
||||||
VGAarbiterScreenPtr pScreenPriv = (VGAarbiterScreenPtr)dixLookupPrivate(
|
VGAarbiterScreenPtr pScreenPriv = (VGAarbiterScreenPtr)dixLookupPrivate(
|
||||||
&pScreen->devPrivates, VGAarbiterScreenKey);
|
&pScreen->devPrivates, VGAarbiterScreenKey);
|
||||||
|
|
||||||
VGAGet();
|
VGAGet(pScreen);
|
||||||
pScrn->LeaveVT = pScreenPriv->LeaveVT;
|
pScrn->LeaveVT = pScreenPriv->LeaveVT;
|
||||||
(*pScreenPriv->LeaveVT)(index, flags);
|
(*pScreenPriv->LeaveVT)(index, flags);
|
||||||
pScreenPriv->LeaveVT = pScrn->LeaveVT;
|
pScreenPriv->LeaveVT = pScrn->LeaveVT;
|
||||||
|
@ -560,7 +560,7 @@ VGAarbiterFreeScreen(int index, int flags)
|
||||||
VGAarbiterScreenPtr pScreenPriv = (VGAarbiterScreenPtr)dixLookupPrivate(
|
VGAarbiterScreenPtr pScreenPriv = (VGAarbiterScreenPtr)dixLookupPrivate(
|
||||||
&pScreen->devPrivates, VGAarbiterScreenKey);
|
&pScreen->devPrivates, VGAarbiterScreenKey);
|
||||||
|
|
||||||
VGAGet();
|
VGAGet(pScreen);
|
||||||
(*pScreenPriv->FreeScreen)(index, flags);
|
(*pScreenPriv->FreeScreen)(index, flags);
|
||||||
VGAPut();
|
VGAPut();
|
||||||
}
|
}
|
||||||
|
@ -573,9 +573,7 @@ VGAarbiterCreateGC(GCPtr pGC)
|
||||||
Bool ret;
|
Bool ret;
|
||||||
|
|
||||||
SCREEN_PROLOG(CreateGC);
|
SCREEN_PROLOG(CreateGC);
|
||||||
VGAGet();
|
|
||||||
ret = (*pScreen->CreateGC)(pGC);
|
ret = (*pScreen->CreateGC)(pGC);
|
||||||
VGAPut();
|
|
||||||
GC_WRAP(pGC);
|
GC_WRAP(pGC);
|
||||||
SCREEN_EPILOG(CreateGC,VGAarbiterCreateGC);
|
SCREEN_EPILOG(CreateGC,VGAarbiterCreateGC);
|
||||||
|
|
||||||
|
@ -662,10 +660,11 @@ VGAarbiterFillSpans(
|
||||||
int *pwidthInit,
|
int *pwidthInit,
|
||||||
int fSorted )
|
int fSorted )
|
||||||
{
|
{
|
||||||
|
ScreenPtr pScreen = pGC->pScreen;
|
||||||
GC_UNWRAP(pGC);
|
GC_UNWRAP(pGC);
|
||||||
VGAGet_GC();
|
VGAGet(pScreen);
|
||||||
(*pGC->ops->FillSpans)(pDraw, pGC, nInit, pptInit, pwidthInit, fSorted);
|
(*pGC->ops->FillSpans)(pDraw, pGC, nInit, pptInit, pwidthInit, fSorted);
|
||||||
VGAPut_GC();
|
VGAPut();
|
||||||
GC_WRAP(pGC);
|
GC_WRAP(pGC);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -679,10 +678,11 @@ VGAarbiterSetSpans(
|
||||||
int nspans,
|
int nspans,
|
||||||
int fSorted )
|
int fSorted )
|
||||||
{
|
{
|
||||||
|
ScreenPtr pScreen = pGC->pScreen;
|
||||||
GC_UNWRAP(pGC);
|
GC_UNWRAP(pGC);
|
||||||
VGAGet_GC();
|
VGAGet(pScreen);
|
||||||
(*pGC->ops->SetSpans)(pDraw, pGC, pcharsrc, ppt, pwidth, nspans, fSorted);
|
(*pGC->ops->SetSpans)(pDraw, pGC, pcharsrc, ppt, pwidth, nspans, fSorted);
|
||||||
VGAPut_GC();
|
VGAPut();
|
||||||
GC_WRAP(pGC);
|
GC_WRAP(pGC);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -696,11 +696,12 @@ VGAarbiterPutImage(
|
||||||
int format,
|
int format,
|
||||||
char *pImage )
|
char *pImage )
|
||||||
{
|
{
|
||||||
|
ScreenPtr pScreen = pGC->pScreen;
|
||||||
GC_UNWRAP(pGC);
|
GC_UNWRAP(pGC);
|
||||||
VGAGet_GC();
|
VGAGet(pScreen);
|
||||||
(*pGC->ops->PutImage)(pDraw, pGC, depth, x, y, w, h,
|
(*pGC->ops->PutImage)(pDraw, pGC, depth, x, y, w, h,
|
||||||
leftPad, format, pImage);
|
leftPad, format, pImage);
|
||||||
VGAPut_GC();
|
VGAPut();
|
||||||
GC_WRAP(pGC);
|
GC_WRAP(pGC);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -714,12 +715,12 @@ VGAarbiterCopyArea(
|
||||||
int dstx, int dsty )
|
int dstx, int dsty )
|
||||||
{
|
{
|
||||||
RegionPtr ret;
|
RegionPtr ret;
|
||||||
|
ScreenPtr pScreen = pGC->pScreen;
|
||||||
GC_UNWRAP(pGC);
|
GC_UNWRAP(pGC);
|
||||||
VGAGet_GC();
|
VGAGet(pScreen);
|
||||||
ret = (*pGC->ops->CopyArea)(pSrc, pDst,
|
ret = (*pGC->ops->CopyArea)(pSrc, pDst,
|
||||||
pGC, srcx, srcy, width, height, dstx, dsty);
|
pGC, srcx, srcy, width, height, dstx, dsty);
|
||||||
VGAPut_GC();
|
VGAPut();
|
||||||
GC_WRAP(pGC);
|
GC_WRAP(pGC);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -735,12 +736,12 @@ VGAarbiterCopyPlane(
|
||||||
unsigned long bitPlane )
|
unsigned long bitPlane )
|
||||||
{
|
{
|
||||||
RegionPtr ret;
|
RegionPtr ret;
|
||||||
|
ScreenPtr pScreen = pGC->pScreen;
|
||||||
GC_UNWRAP(pGC);
|
GC_UNWRAP(pGC);
|
||||||
VGAGet_GC();
|
VGAGet(pScreen);
|
||||||
ret = (*pGC->ops->CopyPlane)(pSrc, pDst, pGC, srcx, srcy,
|
ret = (*pGC->ops->CopyPlane)(pSrc, pDst, pGC, srcx, srcy,
|
||||||
width, height, dstx, dsty, bitPlane);
|
width, height, dstx, dsty, bitPlane);
|
||||||
VGAPut_GC();
|
VGAPut();
|
||||||
GC_WRAP(pGC);
|
GC_WRAP(pGC);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -753,10 +754,11 @@ VGAarbiterPolyPoint(
|
||||||
int npt,
|
int npt,
|
||||||
xPoint *pptInit )
|
xPoint *pptInit )
|
||||||
{
|
{
|
||||||
|
ScreenPtr pScreen = pGC->pScreen;
|
||||||
GC_UNWRAP(pGC);
|
GC_UNWRAP(pGC);
|
||||||
VGAGet_GC();
|
VGAGet(pScreen);
|
||||||
(*pGC->ops->PolyPoint)(pDraw, pGC, mode, npt, pptInit);
|
(*pGC->ops->PolyPoint)(pDraw, pGC, mode, npt, pptInit);
|
||||||
VGAPut_GC();
|
VGAPut();
|
||||||
GC_WRAP(pGC);
|
GC_WRAP(pGC);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -769,10 +771,11 @@ VGAarbiterPolylines(
|
||||||
int npt,
|
int npt,
|
||||||
DDXPointPtr pptInit )
|
DDXPointPtr pptInit )
|
||||||
{
|
{
|
||||||
|
ScreenPtr pScreen = pGC->pScreen;
|
||||||
GC_UNWRAP(pGC);
|
GC_UNWRAP(pGC);
|
||||||
VGAGet_GC();
|
VGAGet(pScreen);
|
||||||
(*pGC->ops->Polylines)(pDraw, pGC, mode, npt, pptInit);
|
(*pGC->ops->Polylines)(pDraw, pGC, mode, npt, pptInit);
|
||||||
VGAPut_GC();
|
VGAPut();
|
||||||
GC_WRAP(pGC);
|
GC_WRAP(pGC);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -783,10 +786,11 @@ VGAarbiterPolySegment(
|
||||||
int nseg,
|
int nseg,
|
||||||
xSegment *pSeg )
|
xSegment *pSeg )
|
||||||
{
|
{
|
||||||
|
ScreenPtr pScreen = pGC->pScreen;
|
||||||
GC_UNWRAP(pGC);
|
GC_UNWRAP(pGC);
|
||||||
VGAGet_GC();
|
VGAGet(pScreen);
|
||||||
(*pGC->ops->PolySegment)(pDraw, pGC, nseg, pSeg);
|
(*pGC->ops->PolySegment)(pDraw, pGC, nseg, pSeg);
|
||||||
VGAPut_GC();
|
VGAPut();
|
||||||
GC_WRAP(pGC);
|
GC_WRAP(pGC);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -797,10 +801,11 @@ VGAarbiterPolyRectangle(
|
||||||
int nRectsInit,
|
int nRectsInit,
|
||||||
xRectangle *pRectsInit )
|
xRectangle *pRectsInit )
|
||||||
{
|
{
|
||||||
|
ScreenPtr pScreen = pGC->pScreen;
|
||||||
GC_UNWRAP(pGC);
|
GC_UNWRAP(pGC);
|
||||||
VGAGet_GC();
|
VGAGet(pScreen);
|
||||||
(*pGC->ops->PolyRectangle)(pDraw, pGC, nRectsInit, pRectsInit);
|
(*pGC->ops->PolyRectangle)(pDraw, pGC, nRectsInit, pRectsInit);
|
||||||
VGAPut_GC();
|
VGAPut();
|
||||||
GC_WRAP(pGC);
|
GC_WRAP(pGC);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -811,10 +816,11 @@ VGAarbiterPolyArc(
|
||||||
int narcs,
|
int narcs,
|
||||||
xArc *parcs )
|
xArc *parcs )
|
||||||
{
|
{
|
||||||
|
ScreenPtr pScreen = pGC->pScreen;
|
||||||
GC_UNWRAP(pGC);
|
GC_UNWRAP(pGC);
|
||||||
VGAGet_GC();
|
VGAGet(pScreen);
|
||||||
(*pGC->ops->PolyArc)(pDraw, pGC, narcs, parcs);
|
(*pGC->ops->PolyArc)(pDraw, pGC, narcs, parcs);
|
||||||
VGAPut_GC();
|
VGAPut();
|
||||||
GC_WRAP(pGC);
|
GC_WRAP(pGC);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -827,10 +833,11 @@ VGAarbiterFillPolygon(
|
||||||
int count,
|
int count,
|
||||||
DDXPointPtr ptsIn )
|
DDXPointPtr ptsIn )
|
||||||
{
|
{
|
||||||
|
ScreenPtr pScreen = pGC->pScreen;
|
||||||
GC_UNWRAP(pGC);
|
GC_UNWRAP(pGC);
|
||||||
VGAGet_GC();
|
VGAGet(pScreen);
|
||||||
(*pGC->ops->FillPolygon)(pDraw, pGC, shape, mode, count, ptsIn);
|
(*pGC->ops->FillPolygon)(pDraw, pGC, shape, mode, count, ptsIn);
|
||||||
VGAPut_GC();
|
VGAPut();
|
||||||
GC_WRAP(pGC);
|
GC_WRAP(pGC);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -841,10 +848,11 @@ VGAarbiterPolyFillRect(
|
||||||
int nrectFill,
|
int nrectFill,
|
||||||
xRectangle *prectInit)
|
xRectangle *prectInit)
|
||||||
{
|
{
|
||||||
|
ScreenPtr pScreen = pGC->pScreen;
|
||||||
GC_UNWRAP(pGC);
|
GC_UNWRAP(pGC);
|
||||||
VGAGet_GC();
|
VGAGet(pScreen);
|
||||||
(*pGC->ops->PolyFillRect)(pDraw, pGC, nrectFill, prectInit);
|
(*pGC->ops->PolyFillRect)(pDraw, pGC, nrectFill, prectInit);
|
||||||
VGAPut_GC();
|
VGAPut();
|
||||||
GC_WRAP(pGC);
|
GC_WRAP(pGC);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -855,10 +863,11 @@ VGAarbiterPolyFillArc(
|
||||||
int narcs,
|
int narcs,
|
||||||
xArc *parcs )
|
xArc *parcs )
|
||||||
{
|
{
|
||||||
|
ScreenPtr pScreen = pGC->pScreen;
|
||||||
GC_UNWRAP(pGC);
|
GC_UNWRAP(pGC);
|
||||||
VGAGet_GC();
|
VGAGet(pScreen);
|
||||||
(*pGC->ops->PolyFillArc)(pDraw, pGC, narcs, parcs);
|
(*pGC->ops->PolyFillArc)(pDraw, pGC, narcs, parcs);
|
||||||
VGAPut_GC();
|
VGAPut();
|
||||||
GC_WRAP(pGC);
|
GC_WRAP(pGC);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -872,11 +881,11 @@ VGAarbiterPolyText8(
|
||||||
char *chars )
|
char *chars )
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
ScreenPtr pScreen = pGC->pScreen;
|
||||||
GC_UNWRAP(pGC);
|
GC_UNWRAP(pGC);
|
||||||
VGAGet_GC();
|
VGAGet(pScreen);
|
||||||
ret = (*pGC->ops->PolyText8)(pDraw, pGC, x, y, count, chars);
|
ret = (*pGC->ops->PolyText8)(pDraw, pGC, x, y, count, chars);
|
||||||
VGAPut_GC();
|
VGAPut();
|
||||||
GC_WRAP(pGC);
|
GC_WRAP(pGC);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -891,11 +900,11 @@ VGAarbiterPolyText16(
|
||||||
unsigned short *chars )
|
unsigned short *chars )
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
ScreenPtr pScreen = pGC->pScreen;
|
||||||
GC_UNWRAP(pGC);
|
GC_UNWRAP(pGC);
|
||||||
VGAGet_GC();
|
VGAGet(pScreen);
|
||||||
ret = (*pGC->ops->PolyText16)(pDraw, pGC, x, y, count, chars);
|
ret = (*pGC->ops->PolyText16)(pDraw, pGC, x, y, count, chars);
|
||||||
VGAPut_GC();
|
VGAPut();
|
||||||
GC_WRAP(pGC);
|
GC_WRAP(pGC);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -909,10 +918,11 @@ VGAarbiterImageText8(
|
||||||
int count,
|
int count,
|
||||||
char *chars )
|
char *chars )
|
||||||
{
|
{
|
||||||
|
ScreenPtr pScreen = pGC->pScreen;
|
||||||
GC_UNWRAP(pGC);
|
GC_UNWRAP(pGC);
|
||||||
VGAGet_GC();
|
VGAGet(pScreen);
|
||||||
(*pGC->ops->ImageText8)(pDraw, pGC, x, y, count, chars);
|
(*pGC->ops->ImageText8)(pDraw, pGC, x, y, count, chars);
|
||||||
VGAPut_GC();
|
VGAPut();
|
||||||
GC_WRAP(pGC);
|
GC_WRAP(pGC);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -925,10 +935,11 @@ VGAarbiterImageText16(
|
||||||
int count,
|
int count,
|
||||||
unsigned short *chars )
|
unsigned short *chars )
|
||||||
{
|
{
|
||||||
|
ScreenPtr pScreen = pGC->pScreen;
|
||||||
GC_UNWRAP(pGC);
|
GC_UNWRAP(pGC);
|
||||||
VGAGet_GC();
|
VGAGet(pScreen);
|
||||||
(*pGC->ops->ImageText16)(pDraw, pGC, x, y, count, chars);
|
(*pGC->ops->ImageText16)(pDraw, pGC, x, y, count, chars);
|
||||||
VGAPut_GC();
|
VGAPut();
|
||||||
GC_WRAP(pGC);
|
GC_WRAP(pGC);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -942,11 +953,12 @@ VGAarbiterImageGlyphBlt(
|
||||||
CharInfoPtr *ppci,
|
CharInfoPtr *ppci,
|
||||||
pointer pglyphBase )
|
pointer pglyphBase )
|
||||||
{
|
{
|
||||||
|
ScreenPtr pScreen = pGC->pScreen;
|
||||||
GC_UNWRAP(pGC);
|
GC_UNWRAP(pGC);
|
||||||
VGAGet_GC();
|
VGAGet(pScreen);
|
||||||
(*pGC->ops->ImageGlyphBlt)(pDraw, pGC, xInit, yInit,
|
(*pGC->ops->ImageGlyphBlt)(pDraw, pGC, xInit, yInit,
|
||||||
nglyph, ppci, pglyphBase);
|
nglyph, ppci, pglyphBase);
|
||||||
VGAPut_GC();
|
VGAPut();
|
||||||
GC_WRAP(pGC);
|
GC_WRAP(pGC);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -959,11 +971,12 @@ VGAarbiterPolyGlyphBlt(
|
||||||
CharInfoPtr *ppci,
|
CharInfoPtr *ppci,
|
||||||
pointer pglyphBase )
|
pointer pglyphBase )
|
||||||
{
|
{
|
||||||
|
ScreenPtr pScreen = pGC->pScreen;
|
||||||
GC_UNWRAP(pGC);
|
GC_UNWRAP(pGC);
|
||||||
VGAGet_GC();
|
VGAGet(pScreen);
|
||||||
(*pGC->ops->PolyGlyphBlt)(pDraw, pGC, xInit, yInit,
|
(*pGC->ops->PolyGlyphBlt)(pDraw, pGC, xInit, yInit,
|
||||||
nglyph, ppci, pglyphBase);
|
nglyph, ppci, pglyphBase);
|
||||||
VGAPut_GC();
|
VGAPut();
|
||||||
GC_WRAP(pGC);
|
GC_WRAP(pGC);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -974,10 +987,11 @@ VGAarbiterPushPixels(
|
||||||
DrawablePtr pDraw,
|
DrawablePtr pDraw,
|
||||||
int dx, int dy, int xOrg, int yOrg )
|
int dx, int dy, int xOrg, int yOrg )
|
||||||
{
|
{
|
||||||
|
ScreenPtr pScreen = pGC->pScreen;
|
||||||
GC_UNWRAP(pGC);
|
GC_UNWRAP(pGC);
|
||||||
VGAGet_GC();
|
VGAGet(pScreen);
|
||||||
(*pGC->ops->PushPixels)(pGC, pBitMap, pDraw, dx, dy, xOrg, yOrg);
|
(*pGC->ops->PushPixels)(pGC, pBitMap, pDraw, dx, dy, xOrg, yOrg);
|
||||||
VGAPut_GC();
|
VGAPut();
|
||||||
GC_WRAP(pGC);
|
GC_WRAP(pGC);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -988,7 +1002,7 @@ VGAarbiterSpriteRealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pC
|
||||||
{
|
{
|
||||||
Bool val;
|
Bool val;
|
||||||
SPRITE_PROLOG;
|
SPRITE_PROLOG;
|
||||||
VGAGet();
|
VGAGet(pScreen);
|
||||||
val = PointPriv->spriteFuncs->RealizeCursor(pDev, pScreen, pCur);
|
val = PointPriv->spriteFuncs->RealizeCursor(pDev, pScreen, pCur);
|
||||||
VGAPut();
|
VGAPut();
|
||||||
SPRITE_EPILOG;
|
SPRITE_EPILOG;
|
||||||
|
@ -1000,7 +1014,7 @@ VGAarbiterSpriteUnrealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr
|
||||||
{
|
{
|
||||||
Bool val;
|
Bool val;
|
||||||
SPRITE_PROLOG;
|
SPRITE_PROLOG;
|
||||||
VGAGet();
|
VGAGet(pScreen);
|
||||||
val = PointPriv->spriteFuncs->UnrealizeCursor(pDev, pScreen, pCur);
|
val = PointPriv->spriteFuncs->UnrealizeCursor(pDev, pScreen, pCur);
|
||||||
VGAPut();
|
VGAPut();
|
||||||
SPRITE_EPILOG;
|
SPRITE_EPILOG;
|
||||||
|
@ -1011,7 +1025,7 @@ static void
|
||||||
VGAarbiterSpriteSetCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCur, int x, int y)
|
VGAarbiterSpriteSetCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCur, int x, int y)
|
||||||
{
|
{
|
||||||
SPRITE_PROLOG;
|
SPRITE_PROLOG;
|
||||||
VGAGet();
|
VGAGet(pScreen);
|
||||||
PointPriv->spriteFuncs->SetCursor(pDev, pScreen, pCur, x, y);
|
PointPriv->spriteFuncs->SetCursor(pDev, pScreen, pCur, x, y);
|
||||||
VGAPut();
|
VGAPut();
|
||||||
SPRITE_EPILOG;
|
SPRITE_EPILOG;
|
||||||
|
@ -1021,7 +1035,7 @@ static void
|
||||||
VGAarbiterSpriteMoveCursor(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y)
|
VGAarbiterSpriteMoveCursor(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y)
|
||||||
{
|
{
|
||||||
SPRITE_PROLOG;
|
SPRITE_PROLOG;
|
||||||
VGAGet();
|
VGAGet(pScreen);
|
||||||
PointPriv->spriteFuncs->MoveCursor(pDev, pScreen, x, y);
|
PointPriv->spriteFuncs->MoveCursor(pDev, pScreen, x, y);
|
||||||
VGAPut();
|
VGAPut();
|
||||||
SPRITE_EPILOG;
|
SPRITE_EPILOG;
|
||||||
|
@ -1032,7 +1046,7 @@ VGAarbiterDeviceCursorInitialize(DeviceIntPtr pDev, ScreenPtr pScreen)
|
||||||
{
|
{
|
||||||
Bool val;
|
Bool val;
|
||||||
SPRITE_PROLOG;
|
SPRITE_PROLOG;
|
||||||
VGAGet();
|
VGAGet(pScreen);
|
||||||
val = PointPriv->spriteFuncs->DeviceCursorInitialize(pDev, pScreen);
|
val = PointPriv->spriteFuncs->DeviceCursorInitialize(pDev, pScreen);
|
||||||
VGAPut();
|
VGAPut();
|
||||||
SPRITE_EPILOG;
|
SPRITE_EPILOG;
|
||||||
|
@ -1043,7 +1057,7 @@ static void
|
||||||
VGAarbiterDeviceCursorCleanup(DeviceIntPtr pDev, ScreenPtr pScreen)
|
VGAarbiterDeviceCursorCleanup(DeviceIntPtr pDev, ScreenPtr pScreen)
|
||||||
{
|
{
|
||||||
SPRITE_PROLOG;
|
SPRITE_PROLOG;
|
||||||
VGAGet();
|
VGAGet(pScreen);
|
||||||
PointPriv->spriteFuncs->DeviceCursorCleanup(pDev, pScreen);
|
PointPriv->spriteFuncs->DeviceCursorCleanup(pDev, pScreen);
|
||||||
VGAPut();
|
VGAPut();
|
||||||
SPRITE_EPILOG;
|
SPRITE_EPILOG;
|
||||||
|
@ -1060,7 +1074,7 @@ VGAarbiterComposite(CARD8 op, PicturePtr pSrc, PicturePtr pMask,
|
||||||
|
|
||||||
PICTURE_PROLOGUE(Composite);
|
PICTURE_PROLOGUE(Composite);
|
||||||
|
|
||||||
VGAGet();
|
VGAGet(pScreen);
|
||||||
(*ps->Composite) (op, pSrc, pMask, pDst, xSrc, ySrc, xMask, yMask, xDst,
|
(*ps->Composite) (op, pSrc, pMask, pDst, xSrc, ySrc, xMask, yMask, xDst,
|
||||||
yDst, width, height);
|
yDst, width, height);
|
||||||
VGAPut();
|
VGAPut();
|
||||||
|
@ -1077,7 +1091,7 @@ VGAarbiterGlyphs(CARD8 op, PicturePtr pSrc, PicturePtr pDst,
|
||||||
|
|
||||||
PICTURE_PROLOGUE(Glyphs);
|
PICTURE_PROLOGUE(Glyphs);
|
||||||
|
|
||||||
VGAGet();
|
VGAGet(pScreen);
|
||||||
(*ps->Glyphs)(op, pSrc, pDst, maskFormat, xSrc, ySrc, nlist, list, glyphs);
|
(*ps->Glyphs)(op, pSrc, pDst, maskFormat, xSrc, ySrc, nlist, list, glyphs);
|
||||||
VGAPut();
|
VGAPut();
|
||||||
PICTURE_EPILOGUE (Glyphs, VGAarbiterGlyphs);
|
PICTURE_EPILOGUE (Glyphs, VGAarbiterGlyphs);
|
||||||
|
@ -1092,7 +1106,7 @@ VGAarbiterCompositeRects(CARD8 op, PicturePtr pDst, xRenderColor *color, int nRe
|
||||||
|
|
||||||
PICTURE_PROLOGUE(CompositeRects);
|
PICTURE_PROLOGUE(CompositeRects);
|
||||||
|
|
||||||
VGAGet();
|
VGAGet(pScreen);
|
||||||
(*ps->CompositeRects)(op, pDst, color, nRect, rects);
|
(*ps->CompositeRects)(op, pDst, color, nRect, rects);
|
||||||
VGAPut();
|
VGAPut();
|
||||||
PICTURE_EPILOGUE (CompositeRects, VGAarbiterCompositeRects);
|
PICTURE_EPILOGUE (CompositeRects, VGAarbiterCompositeRects);
|
||||||
|
@ -1106,7 +1120,7 @@ void xf86VGAarbiterLock(ScrnInfoPtr pScrn) {}
|
||||||
void xf86VGAarbiterUnlock(ScrnInfoPtr pScrn) {}
|
void xf86VGAarbiterUnlock(ScrnInfoPtr pScrn) {}
|
||||||
Bool xf86VGAarbiterAllowDRI(ScreenPtr pScreen) { return TRUE; }
|
Bool xf86VGAarbiterAllowDRI(ScreenPtr pScreen) { return TRUE; }
|
||||||
void xf86VGAarbiterScrnInit(ScrnInfoPtr pScrn) {}
|
void xf86VGAarbiterScrnInit(ScrnInfoPtr pScrn) {}
|
||||||
void xf86VGAarbiterDeviceDecodes(ScrnInfoPtr pScrn) {}
|
void xf86VGAarbiterDeviceDecodes(ScrnInfoPtr pScrn, int rsrc) {}
|
||||||
Bool xf86VGAarbiterWrapFunctions(void) { return FALSE; }
|
Bool xf86VGAarbiterWrapFunctions(void) { return FALSE; }
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -40,7 +40,7 @@ extern void xf86VGAarbiterUnlock(ScrnInfoPtr pScrn);
|
||||||
|
|
||||||
/* allow a driver to remove itself from arbiter - really should be
|
/* allow a driver to remove itself from arbiter - really should be
|
||||||
* done in the kernel though */
|
* done in the kernel though */
|
||||||
extern _X_EXPORT void xf86VGAarbiterDeviceDecodes(ScrnInfoPtr pScrn);
|
extern _X_EXPORT void xf86VGAarbiterDeviceDecodes(ScrnInfoPtr pScrn, int rsrc);
|
||||||
/* DRI and arbiter are really not possible together,
|
/* DRI and arbiter are really not possible together,
|
||||||
* you really want to remove the card from arbitration if you can */
|
* you really want to remove the card from arbitration if you can */
|
||||||
extern _X_EXPORT Bool xf86VGAarbiterAllowDRI(ScreenPtr pScreen);
|
extern _X_EXPORT Bool xf86VGAarbiterAllowDRI(ScreenPtr pScreen);
|
||||||
|
|
|
@ -93,23 +93,16 @@
|
||||||
(VGAarbiterGCPtr)dixLookupPrivate(&(x)->devPrivates, VGAarbiterGCKey);\
|
(VGAarbiterGCPtr)dixLookupPrivate(&(x)->devPrivates, VGAarbiterGCKey);\
|
||||||
(x)->ops = pGCPriv->wrapOps; (x)->funcs = pGCPriv->wrapFuncs;
|
(x)->ops = pGCPriv->wrapOps; (x)->funcs = pGCPriv->wrapFuncs;
|
||||||
|
|
||||||
#define GC_SCREEN register ScrnInfoPtr pScrn = \
|
static inline void
|
||||||
xf86Screens[pGC->pScreen->myNum]
|
VGAGet(ScreenPtr pScreen) {
|
||||||
|
pci_device_vgaarb_set_target(xf86Screens[pScreen->myNum]->vgaDev);
|
||||||
#define VGAGet(x)\
|
|
||||||
pci_device_vgaarb_set_target(xf86Screens[pScreen->myNum]->vgaDev); \
|
|
||||||
pci_device_vgaarb_lock();
|
pci_device_vgaarb_lock();
|
||||||
|
}
|
||||||
|
|
||||||
#define VGAGet_GC(x)\
|
static inline void
|
||||||
pci_device_vgaarb_set_target(xf86Screens[pGC->pScreen->myNum]->vgaDev); \
|
VGAPut(void) {
|
||||||
pci_device_vgaarb_lock();
|
|
||||||
|
|
||||||
#define VGAPut(x)\
|
|
||||||
pci_device_vgaarb_unlock();
|
pci_device_vgaarb_unlock();
|
||||||
|
}
|
||||||
#define VGAPut_GC(x)\
|
|
||||||
pci_device_vgaarb_unlock();
|
|
||||||
|
|
||||||
|
|
||||||
typedef struct _VGAarbiterScreen {
|
typedef struct _VGAarbiterScreen {
|
||||||
CreateGCProcPtr CreateGC;
|
CreateGCProcPtr CreateGC;
|
||||||
|
|
|
@ -62,6 +62,7 @@
|
||||||
#include "xf86Optrec.h"
|
#include "xf86Optrec.h"
|
||||||
#include "mipointer.h"
|
#include "mipointer.h"
|
||||||
#include "extinit.h"
|
#include "extinit.h"
|
||||||
|
#include "loaderProcs.h"
|
||||||
|
|
||||||
#include "exevents.h" /* AddInputDevice */
|
#include "exevents.h" /* AddInputDevice */
|
||||||
#include "exglobals.h"
|
#include "exglobals.h"
|
||||||
|
@ -673,7 +674,6 @@ xf86AddInput(InputDriverPtr drv, InputInfoPtr pInfo)
|
||||||
InputInfoPtr *prev = NULL;
|
InputInfoPtr *prev = NULL;
|
||||||
|
|
||||||
pInfo->drv = drv;
|
pInfo->drv = drv;
|
||||||
drv->refCount++;
|
|
||||||
pInfo->module = DuplicateModule(drv->module, NULL);
|
pInfo->module = DuplicateModule(drv->module, NULL);
|
||||||
|
|
||||||
for (prev = &xf86InputDevs; *prev; prev = &(*prev)->next)
|
for (prev = &xf86InputDevs; *prev; prev = &(*prev)->next)
|
||||||
|
@ -699,9 +699,6 @@ xf86DeleteInput(InputInfoPtr pInp, int flags)
|
||||||
if (pInp->module)
|
if (pInp->module)
|
||||||
UnloadModule(pInp->module);
|
UnloadModule(pInp->module);
|
||||||
|
|
||||||
if (pInp->drv)
|
|
||||||
pInp->drv->refCount--;
|
|
||||||
|
|
||||||
/* This should *really* be handled in drv->UnInit(dev) call instead, but
|
/* This should *really* be handled in drv->UnInit(dev) call instead, but
|
||||||
* if the driver forgets about it make sure we free it or at least crash
|
* if the driver forgets about it make sure we free it or at least crash
|
||||||
* with flying colors */
|
* with flying colors */
|
||||||
|
|
|
@ -74,7 +74,6 @@ typedef struct _InputDriverRec {
|
||||||
struct _InputInfoRec *pInfo,
|
struct _InputInfoRec *pInfo,
|
||||||
int flags);
|
int flags);
|
||||||
pointer module;
|
pointer module;
|
||||||
int refCount;
|
|
||||||
char ** default_options;
|
char ** default_options;
|
||||||
} InputDriverRec, *InputDriverPtr;
|
} InputDriverRec, *InputDriverPtr;
|
||||||
|
|
||||||
|
|
|
@ -76,6 +76,11 @@ Bool pciSlotClaimed = FALSE;
|
||||||
(((c) & 0x00ffff00) \
|
(((c) & 0x00ffff00) \
|
||||||
== ((PCI_CLASS_DISPLAY << 16) | (PCI_SUBCLASS_DISPLAY_VGA << 8)))
|
== ((PCI_CLASS_DISPLAY << 16) | (PCI_SUBCLASS_DISPLAY_VGA << 8)))
|
||||||
|
|
||||||
|
|
||||||
|
static struct pci_slot_match xf86IsolateDevice = {
|
||||||
|
PCI_MATCH_ANY, PCI_MATCH_ANY, PCI_MATCH_ANY, PCI_MATCH_ANY, 0
|
||||||
|
};
|
||||||
|
|
||||||
void
|
void
|
||||||
xf86FormatPciBusNumber(int busnum, char *buffer)
|
xf86FormatPciBusNumber(int busnum, char *buffer)
|
||||||
{
|
{
|
||||||
|
@ -1302,15 +1307,10 @@ xf86PciMatchDriver(char* matches[], int nmatches) {
|
||||||
}
|
}
|
||||||
|
|
||||||
pci_iterator_destroy(iter);
|
pci_iterator_destroy(iter);
|
||||||
|
|
||||||
if (!info) {
|
|
||||||
ErrorF("Primary device is not PCI\n");
|
|
||||||
}
|
|
||||||
#ifdef __linux__
|
#ifdef __linux__
|
||||||
else {
|
if (info)
|
||||||
matchDriverFromFiles(matches, info->vendor_id, info->device_id);
|
matchDriverFromFiles(matches, info->vendor_id, info->device_id);
|
||||||
}
|
#endif
|
||||||
#endif /* __linux__ */
|
|
||||||
|
|
||||||
for (i = 0; (i < nmatches) && (matches[i]); i++) {
|
for (i = 0; (i < nmatches) && (matches[i]); i++) {
|
||||||
/* find end of matches list */
|
/* find end of matches list */
|
||||||
|
@ -1322,3 +1322,38 @@ xf86PciMatchDriver(char* matches[], int nmatches) {
|
||||||
|
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Bool
|
||||||
|
xf86PciConfigure(void *busData, struct pci_device *pDev)
|
||||||
|
{
|
||||||
|
struct pci_device * pVideo = NULL;
|
||||||
|
|
||||||
|
pVideo = (struct pci_device *) busData;
|
||||||
|
if (pDev &&
|
||||||
|
(pDev->domain == pVideo->domain) &&
|
||||||
|
(pDev->bus == pVideo->bus) &&
|
||||||
|
(pDev->dev == pVideo->dev) &&
|
||||||
|
(pDev->func == pVideo->func))
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
xf86PciConfigureNewDev(void *busData, struct pci_device *pVideo,
|
||||||
|
GDevRec *GDev, int *chipset)
|
||||||
|
{
|
||||||
|
char busnum[8];
|
||||||
|
|
||||||
|
pVideo = (struct pci_device *) busData;
|
||||||
|
|
||||||
|
GDev->busID = xnfalloc(16);
|
||||||
|
xf86FormatPciBusNumber(pVideo->bus, busnum);
|
||||||
|
sprintf(GDev->busID, "PCI:%s:%d:%d", busnum, pVideo->dev, pVideo->func);
|
||||||
|
|
||||||
|
GDev->chipID = pVideo->device_id;
|
||||||
|
GDev->chipRev = pVideo->revision;
|
||||||
|
|
||||||
|
if (*chipset < 0)
|
||||||
|
*chipset = (pVideo->vendor_id << 16) | pVideo->device_id;
|
||||||
|
}
|
||||||
|
|
|
@ -38,5 +38,8 @@ Bool xf86PciAddMatchingDev(DriverPtr drvp);
|
||||||
Bool xf86PciProbeDev(DriverPtr drvp);
|
Bool xf86PciProbeDev(DriverPtr drvp);
|
||||||
void xf86PciIsolateDevice(char *argument);
|
void xf86PciIsolateDevice(char *argument);
|
||||||
int xf86PciMatchDriver(char* matches[], int nmatches);
|
int xf86PciMatchDriver(char* matches[], int nmatches);
|
||||||
|
Bool xf86PciConfigure(void *busData, struct pci_device *pDev);
|
||||||
|
void xf86PciConfigureNewDev(void *busData, struct pci_device *pVideo,
|
||||||
|
GDevRec *GDev, int *chipset);
|
||||||
|
|
||||||
#endif /* _XF86_PCI_BUS_H */
|
#endif /* _XF86_PCI_BUS_H */
|
||||||
|
|
|
@ -685,3 +685,32 @@ xf86SbusHandleColormaps(ScreenPtr pScreen, sbusDevicePtr psdp)
|
||||||
return xf86HandleColormaps(pScreen, 256, 8,
|
return xf86HandleColormaps(pScreen, 256, 8,
|
||||||
xf86SbusCmapLoadPalette, NULL, 0);
|
xf86SbusCmapLoadPalette, NULL, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Bool
|
||||||
|
xf86SbusConfigure(void *busData, sbusDevicePtr sBus)
|
||||||
|
{
|
||||||
|
if (sBus && sBus->fbNum == ((sbusDevicePtr) busData)->fbNum)
|
||||||
|
return 0;
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
xf86SbusConfigureNewDev(void *busData, sbusDevicePtr sBus, GDevRec *GDev)
|
||||||
|
{
|
||||||
|
char *promPath = NULL;
|
||||||
|
|
||||||
|
sBus = (sbusDevicePtr) busData;
|
||||||
|
GDev->identifier = sBus->descr;
|
||||||
|
if (sparcPromInit() >= 0) {
|
||||||
|
promPath = sparcPromNode2Pathname(&sBus->node);
|
||||||
|
sparcPromClose();
|
||||||
|
}
|
||||||
|
if (promPath) {
|
||||||
|
GDev->busID = xnfalloc(strlen(promPath) + 6);
|
||||||
|
sprintf(GDev->busID, "SBUS:%s", promPath);
|
||||||
|
free(promPath);
|
||||||
|
} else {
|
||||||
|
GDev->busID = xnfalloc(12);
|
||||||
|
sprintf(GDev->busID, "SBUS:fb%d", sBus->fbNum);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -97,4 +97,8 @@ extern _X_EXPORT char * sparcPromNode2Pathname(sbusPromNodePtr pnode);
|
||||||
extern _X_EXPORT int sparcPromPathname2Node(const char *pathName);
|
extern _X_EXPORT int sparcPromPathname2Node(const char *pathName);
|
||||||
extern _X_EXPORT char *sparcDriverName(void);
|
extern _X_EXPORT char *sparcDriverName(void);
|
||||||
|
|
||||||
|
extern Bool xf86SbusConfigure(void *busData, sbusDevicePtr sBus);
|
||||||
|
extern void xf86SbusConfigureNewDev(void *busData, sbusDevicePtr sBus,
|
||||||
|
GDevRec *GDev);
|
||||||
|
|
||||||
#endif /* _XF86_SBUSBUS_H */
|
#endif /* _XF86_SBUSBUS_H */
|
||||||
|
|
|
@ -759,7 +759,6 @@ typedef struct _ScrnInfoRec {
|
||||||
|
|
||||||
/* Allow screens to be enabled/disabled individually */
|
/* Allow screens to be enabled/disabled individually */
|
||||||
Bool vtSema;
|
Bool vtSema;
|
||||||
DevUnion pixmapPrivate; /* saved devPrivate from pixmap */
|
|
||||||
|
|
||||||
/* hw cursor moves at SIGIO time */
|
/* hw cursor moves at SIGIO time */
|
||||||
Bool silkenMouse;
|
Bool silkenMouse;
|
||||||
|
|
|
@ -429,8 +429,7 @@ xf86XVInitAdaptors(
|
||||||
pa->ddGetPortAttribute = xf86XVGetPortAttribute;
|
pa->ddGetPortAttribute = xf86XVGetPortAttribute;
|
||||||
pa->ddQueryBestSize = xf86XVQueryBestSize;
|
pa->ddQueryBestSize = xf86XVQueryBestSize;
|
||||||
pa->ddQueryImageAttributes = xf86XVQueryImageAttributes;
|
pa->ddQueryImageAttributes = xf86XVQueryImageAttributes;
|
||||||
if((pa->name = malloc(strlen(adaptorPtr->name) + 1)))
|
pa->name = strdup(adaptorPtr->name);
|
||||||
strcpy(pa->name, adaptorPtr->name);
|
|
||||||
|
|
||||||
if(adaptorPtr->nEncodings &&
|
if(adaptorPtr->nEncodings &&
|
||||||
(pEncode = calloc(adaptorPtr->nEncodings, sizeof(XvEncodingRec)))) {
|
(pEncode = calloc(adaptorPtr->nEncodings, sizeof(XvEncodingRec)))) {
|
||||||
|
@ -440,8 +439,7 @@ xf86XVInitAdaptors(
|
||||||
{
|
{
|
||||||
pe->id = encodingPtr->id;
|
pe->id = encodingPtr->id;
|
||||||
pe->pScreen = pScreen;
|
pe->pScreen = pScreen;
|
||||||
if((pe->name = malloc(strlen(encodingPtr->name) + 1)))
|
pe->name = strdup(encodingPtr->name);
|
||||||
strcpy(pe->name, encodingPtr->name);
|
|
||||||
pe->width = encodingPtr->width;
|
pe->width = encodingPtr->width;
|
||||||
pe->height = encodingPtr->height;
|
pe->height = encodingPtr->height;
|
||||||
pe->rate.numerator = encodingPtr->rate.numerator;
|
pe->rate.numerator = encodingPtr->rate.numerator;
|
||||||
|
@ -493,8 +491,7 @@ xf86XVInitAdaptors(
|
||||||
pat->flags = attributePtr->flags;
|
pat->flags = attributePtr->flags;
|
||||||
pat->min_value = attributePtr->min_value;
|
pat->min_value = attributePtr->min_value;
|
||||||
pat->max_value = attributePtr->max_value;
|
pat->max_value = attributePtr->max_value;
|
||||||
if((pat->name = malloc(strlen(attributePtr->name) + 1)))
|
pat->name = strdup(attributePtr->name);
|
||||||
strcpy(pat->name, attributePtr->name);
|
|
||||||
}
|
}
|
||||||
pa->nAttributes = adaptorPtr->nAttributes;
|
pa->nAttributes = adaptorPtr->nAttributes;
|
||||||
pa->pAttributes = pAttribute;
|
pa->pAttributes = pAttribute;
|
||||||
|
|
|
@ -4,7 +4,7 @@ extsmoduledir = $(moduledir)/extensions
|
||||||
extsmodule_LTLIBRARIES = libextmod.la
|
extsmodule_LTLIBRARIES = libextmod.la
|
||||||
|
|
||||||
if DGA
|
if DGA
|
||||||
DGA_SRCS = xf86dga2.c dgaproc.h xf86dgaext.h
|
DGA_SRCS = xf86dga2.c dgaproc.h
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if XV
|
if XV
|
||||||
|
|
|
@ -25,7 +25,6 @@
|
||||||
#include <X11/extensions/xf86dgaproto.h>
|
#include <X11/extensions/xf86dgaproto.h>
|
||||||
#include "swaprep.h"
|
#include "swaprep.h"
|
||||||
#include "dgaproc.h"
|
#include "dgaproc.h"
|
||||||
#include "xf86dgaext.h"
|
|
||||||
#include "protocol-versions.h"
|
#include "protocol-versions.h"
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
@ -34,24 +33,6 @@
|
||||||
|
|
||||||
#define DGA_PROTOCOL_OLD_SUPPORT 1
|
#define DGA_PROTOCOL_OLD_SUPPORT 1
|
||||||
|
|
||||||
static DISPATCH_PROC(ProcXDGADispatch);
|
|
||||||
static DISPATCH_PROC(SProcXDGADispatch);
|
|
||||||
static DISPATCH_PROC(ProcXDGAQueryVersion);
|
|
||||||
static DISPATCH_PROC(ProcXDGAQueryModes);
|
|
||||||
static DISPATCH_PROC(ProcXDGASetMode);
|
|
||||||
static DISPATCH_PROC(ProcXDGAOpenFramebuffer);
|
|
||||||
static DISPATCH_PROC(ProcXDGACloseFramebuffer);
|
|
||||||
static DISPATCH_PROC(ProcXDGASetViewport);
|
|
||||||
static DISPATCH_PROC(ProcXDGAInstallColormap);
|
|
||||||
static DISPATCH_PROC(ProcXDGASelectInput);
|
|
||||||
static DISPATCH_PROC(ProcXDGAFillRectangle);
|
|
||||||
static DISPATCH_PROC(ProcXDGACopyArea);
|
|
||||||
static DISPATCH_PROC(ProcXDGACopyTransparentArea);
|
|
||||||
static DISPATCH_PROC(ProcXDGAGetViewportStatus);
|
|
||||||
static DISPATCH_PROC(ProcXDGASync);
|
|
||||||
static DISPATCH_PROC(ProcXDGASetClientVersion);
|
|
||||||
static DISPATCH_PROC(ProcXDGAChangePixmapMode);
|
|
||||||
static DISPATCH_PROC(ProcXDGACreateColormap);
|
|
||||||
|
|
||||||
static void XDGAResetProc(ExtensionEntry *extEntry);
|
static void XDGAResetProc(ExtensionEntry *extEntry);
|
||||||
|
|
||||||
|
@ -85,36 +66,6 @@ typedef struct {
|
||||||
dixSetPrivate(&(c)->devPrivates, DGAClientPrivateKey, p)
|
dixSetPrivate(&(c)->devPrivates, DGAClientPrivateKey, p)
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
XFree86DGAExtensionInit(INITARGS)
|
|
||||||
{
|
|
||||||
ExtensionEntry* extEntry;
|
|
||||||
|
|
||||||
if (!dixRegisterPrivateKey(&DGAClientPrivateKeyRec, PRIVATE_CLIENT, 0))
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (!dixRegisterPrivateKey(&DGAScreenPrivateKeyRec, PRIVATE_SCREEN, 0))
|
|
||||||
return;
|
|
||||||
|
|
||||||
if ((extEntry = AddExtension(XF86DGANAME,
|
|
||||||
XF86DGANumberEvents,
|
|
||||||
XF86DGANumberErrors,
|
|
||||||
ProcXDGADispatch,
|
|
||||||
SProcXDGADispatch,
|
|
||||||
XDGAResetProc,
|
|
||||||
StandardMinorOpcode))) {
|
|
||||||
int i;
|
|
||||||
|
|
||||||
DGAReqCode = (unsigned char)extEntry->base;
|
|
||||||
DGAErrorBase = extEntry->errorBase;
|
|
||||||
DGAEventBase = extEntry->eventBase;
|
|
||||||
for (i = KeyPress; i <= MotionNotify; i++)
|
|
||||||
SetCriticalEvent (DGAEventBase + i);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
XDGAResetProc (ExtensionEntry *extEntry)
|
XDGAResetProc (ExtensionEntry *extEntry)
|
||||||
{
|
{
|
||||||
|
@ -663,15 +614,6 @@ ProcXDGACreateColormap(ClientPtr client)
|
||||||
|
|
||||||
#ifdef DGA_PROTOCOL_OLD_SUPPORT
|
#ifdef DGA_PROTOCOL_OLD_SUPPORT
|
||||||
|
|
||||||
static DISPATCH_PROC(ProcXF86DGADirectVideo);
|
|
||||||
static DISPATCH_PROC(ProcXF86DGAGetVidPage);
|
|
||||||
static DISPATCH_PROC(ProcXF86DGAGetVideoLL);
|
|
||||||
static DISPATCH_PROC(ProcXF86DGAGetViewPortSize);
|
|
||||||
static DISPATCH_PROC(ProcXF86DGASetVidPage);
|
|
||||||
static DISPATCH_PROC(ProcXF86DGASetViewPort);
|
|
||||||
static DISPATCH_PROC(ProcXF86DGAInstallColormap);
|
|
||||||
static DISPATCH_PROC(ProcXF86DGAQueryDirectVideo);
|
|
||||||
static DISPATCH_PROC(ProcXF86DGAViewPortChanged);
|
|
||||||
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
@ -1063,3 +1005,31 @@ XFree86DGARegister(INITARGS)
|
||||||
{
|
{
|
||||||
XDGAEventBase = &DGAEventBase;
|
XDGAEventBase = &DGAEventBase;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
XFree86DGAExtensionInit(INITARGS)
|
||||||
|
{
|
||||||
|
ExtensionEntry* extEntry;
|
||||||
|
|
||||||
|
if (!dixRegisterPrivateKey(&DGAClientPrivateKeyRec, PRIVATE_CLIENT, 0))
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (!dixRegisterPrivateKey(&DGAScreenPrivateKeyRec, PRIVATE_SCREEN, 0))
|
||||||
|
return;
|
||||||
|
|
||||||
|
if ((extEntry = AddExtension(XF86DGANAME,
|
||||||
|
XF86DGANumberEvents,
|
||||||
|
XF86DGANumberErrors,
|
||||||
|
ProcXDGADispatch,
|
||||||
|
SProcXDGADispatch,
|
||||||
|
XDGAResetProc,
|
||||||
|
StandardMinorOpcode))) {
|
||||||
|
int i;
|
||||||
|
|
||||||
|
DGAReqCode = (unsigned char)extEntry->base;
|
||||||
|
DGAErrorBase = extEntry->errorBase;
|
||||||
|
DGAEventBase = extEntry->eventBase;
|
||||||
|
for (i = KeyPress; i <= MotionNotify; i++)
|
||||||
|
SetCriticalEvent (DGAEventBase + i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -1,10 +0,0 @@
|
||||||
#ifdef HAVE_DIX_CONFIG_H
|
|
||||||
#include <dix-config.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef _XF86DGAEXT_H_
|
|
||||||
#define _XF86DGAEXT_H_
|
|
||||||
|
|
||||||
extern DISPATCH_PROC(ProcXF86DGADispatch);
|
|
||||||
|
|
||||||
#endif /* _XF86DGAEXT_H_ */
|
|
|
@ -65,48 +65,6 @@ typedef struct {
|
||||||
#define VM_SETPRIV(c,p) \
|
#define VM_SETPRIV(c,p) \
|
||||||
dixSetPrivate(&(c)->devPrivates, VidModeClientPrivateKey, p)
|
dixSetPrivate(&(c)->devPrivates, VidModeClientPrivateKey, p)
|
||||||
|
|
||||||
static DISPATCH_PROC(ProcXF86VidModeDispatch);
|
|
||||||
static DISPATCH_PROC(ProcXF86VidModeGetAllModeLines);
|
|
||||||
static DISPATCH_PROC(ProcXF86VidModeGetModeLine);
|
|
||||||
static DISPATCH_PROC(ProcXF86VidModeGetMonitor);
|
|
||||||
static DISPATCH_PROC(ProcXF86VidModeLockModeSwitch);
|
|
||||||
static DISPATCH_PROC(ProcXF86VidModeAddModeLine);
|
|
||||||
static DISPATCH_PROC(ProcXF86VidModeDeleteModeLine);
|
|
||||||
static DISPATCH_PROC(ProcXF86VidModeModModeLine);
|
|
||||||
static DISPATCH_PROC(ProcXF86VidModeValidateModeLine);
|
|
||||||
static DISPATCH_PROC(ProcXF86VidModeQueryVersion);
|
|
||||||
static DISPATCH_PROC(ProcXF86VidModeSwitchMode);
|
|
||||||
static DISPATCH_PROC(ProcXF86VidModeSwitchToMode);
|
|
||||||
static DISPATCH_PROC(ProcXF86VidModeGetViewPort);
|
|
||||||
static DISPATCH_PROC(ProcXF86VidModeSetViewPort);
|
|
||||||
static DISPATCH_PROC(ProcXF86VidModeGetDotClocks);
|
|
||||||
static DISPATCH_PROC(ProcXF86VidModeSetGamma);
|
|
||||||
static DISPATCH_PROC(ProcXF86VidModeGetGamma);
|
|
||||||
static DISPATCH_PROC(ProcXF86VidModeSetClientVersion);
|
|
||||||
static DISPATCH_PROC(ProcXF86VidModeGetGammaRamp);
|
|
||||||
static DISPATCH_PROC(ProcXF86VidModeSetGammaRamp);
|
|
||||||
static DISPATCH_PROC(ProcXF86VidModeGetGammaRampSize);
|
|
||||||
static DISPATCH_PROC(SProcXF86VidModeDispatch);
|
|
||||||
static DISPATCH_PROC(SProcXF86VidModeGetAllModeLines);
|
|
||||||
static DISPATCH_PROC(SProcXF86VidModeGetModeLine);
|
|
||||||
static DISPATCH_PROC(SProcXF86VidModeGetMonitor);
|
|
||||||
static DISPATCH_PROC(SProcXF86VidModeLockModeSwitch);
|
|
||||||
static DISPATCH_PROC(SProcXF86VidModeAddModeLine);
|
|
||||||
static DISPATCH_PROC(SProcXF86VidModeDeleteModeLine);
|
|
||||||
static DISPATCH_PROC(SProcXF86VidModeModModeLine);
|
|
||||||
static DISPATCH_PROC(SProcXF86VidModeValidateModeLine);
|
|
||||||
static DISPATCH_PROC(SProcXF86VidModeQueryVersion);
|
|
||||||
static DISPATCH_PROC(SProcXF86VidModeSwitchMode);
|
|
||||||
static DISPATCH_PROC(SProcXF86VidModeSwitchToMode);
|
|
||||||
static DISPATCH_PROC(SProcXF86VidModeGetViewPort);
|
|
||||||
static DISPATCH_PROC(SProcXF86VidModeSetViewPort);
|
|
||||||
static DISPATCH_PROC(SProcXF86VidModeGetDotClocks);
|
|
||||||
static DISPATCH_PROC(SProcXF86VidModeSetGamma);
|
|
||||||
static DISPATCH_PROC(SProcXF86VidModeGetGamma);
|
|
||||||
static DISPATCH_PROC(SProcXF86VidModeSetClientVersion);
|
|
||||||
static DISPATCH_PROC(SProcXF86VidModeGetGammaRamp);
|
|
||||||
static DISPATCH_PROC(SProcXF86VidModeSetGammaRamp);
|
|
||||||
static DISPATCH_PROC(SProcXF86VidModeGetGammaRampSize);
|
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
static unsigned char XF86VidModeReqCode = 0;
|
static unsigned char XF86VidModeReqCode = 0;
|
||||||
|
@ -159,58 +117,6 @@ static DevPrivateKeyRec ScreenPrivateKeyRec;
|
||||||
# define DEBUG_P(x) /**/
|
# define DEBUG_P(x) /**/
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void
|
|
||||||
XFree86VidModeExtensionInit(void)
|
|
||||||
{
|
|
||||||
ExtensionEntry* extEntry;
|
|
||||||
ScreenPtr pScreen;
|
|
||||||
int i;
|
|
||||||
Bool enabled = FALSE;
|
|
||||||
|
|
||||||
DEBUG_P("XFree86VidModeExtensionInit");
|
|
||||||
|
|
||||||
if (!dixRegisterPrivateKey(&VidModeClientPrivateKeyRec, PRIVATE_CLIENT, 0))
|
|
||||||
return;
|
|
||||||
#ifdef XF86VIDMODE_EVENTS
|
|
||||||
if (!dixRegisterPrivateKey(&ScreenPrivateKeyRec, PRIVATE_SCREEN, 0))
|
|
||||||
return;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef XF86VIDMODE_EVENTS
|
|
||||||
EventType = CreateNewResourceType(XF86VidModeFreeEvents, "VidModeEvent");
|
|
||||||
#endif
|
|
||||||
|
|
||||||
for(i = 0; i < screenInfo.numScreens; i++) {
|
|
||||||
pScreen = screenInfo.screens[i];
|
|
||||||
if (VidModeExtensionInit(pScreen))
|
|
||||||
enabled = TRUE;
|
|
||||||
}
|
|
||||||
/* This means that the DDX doesn't want the vidmode extension enabled */
|
|
||||||
if (!enabled)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (
|
|
||||||
#ifdef XF86VIDMODE_EVENTS
|
|
||||||
EventType &&
|
|
||||||
#endif
|
|
||||||
(extEntry = AddExtension(XF86VIDMODENAME,
|
|
||||||
XF86VidModeNumberEvents,
|
|
||||||
XF86VidModeNumberErrors,
|
|
||||||
ProcXF86VidModeDispatch,
|
|
||||||
SProcXF86VidModeDispatch,
|
|
||||||
NULL,
|
|
||||||
StandardMinorOpcode))) {
|
|
||||||
#if 0
|
|
||||||
XF86VidModeReqCode = (unsigned char)extEntry->base;
|
|
||||||
#endif
|
|
||||||
VidModeErrorBase = extEntry->errorBase;
|
|
||||||
#ifdef XF86VIDMODE_EVENTS
|
|
||||||
XF86VidModeEventBase = extEntry->eventBase;
|
|
||||||
EventSwapVector[XF86VidModeEventBase] = (EventSwapPtr)SXF86VidModeNotifyEvent;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
ClientMajorVersion(ClientPtr client)
|
ClientMajorVersion(ClientPtr client)
|
||||||
{
|
{
|
||||||
|
@ -2166,3 +2072,55 @@ SProcXF86VidModeDispatch(ClientPtr client)
|
||||||
return VidModeErrorBase + XF86VidModeClientNotLocal;
|
return VidModeErrorBase + XF86VidModeClientNotLocal;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
XFree86VidModeExtensionInit(void)
|
||||||
|
{
|
||||||
|
ExtensionEntry* extEntry;
|
||||||
|
ScreenPtr pScreen;
|
||||||
|
int i;
|
||||||
|
Bool enabled = FALSE;
|
||||||
|
|
||||||
|
DEBUG_P("XFree86VidModeExtensionInit");
|
||||||
|
|
||||||
|
if (!dixRegisterPrivateKey(&VidModeClientPrivateKeyRec, PRIVATE_CLIENT, 0))
|
||||||
|
return;
|
||||||
|
#ifdef XF86VIDMODE_EVENTS
|
||||||
|
if (!dixRegisterPrivateKey(&ScreenPrivateKeyRec, PRIVATE_SCREEN, 0))
|
||||||
|
return;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef XF86VIDMODE_EVENTS
|
||||||
|
EventType = CreateNewResourceType(XF86VidModeFreeEvents, "VidModeEvent");
|
||||||
|
#endif
|
||||||
|
|
||||||
|
for(i = 0; i < screenInfo.numScreens; i++) {
|
||||||
|
pScreen = screenInfo.screens[i];
|
||||||
|
if (VidModeExtensionInit(pScreen))
|
||||||
|
enabled = TRUE;
|
||||||
|
}
|
||||||
|
/* This means that the DDX doesn't want the vidmode extension enabled */
|
||||||
|
if (!enabled)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (
|
||||||
|
#ifdef XF86VIDMODE_EVENTS
|
||||||
|
EventType &&
|
||||||
|
#endif
|
||||||
|
(extEntry = AddExtension(XF86VIDMODENAME,
|
||||||
|
XF86VidModeNumberEvents,
|
||||||
|
XF86VidModeNumberErrors,
|
||||||
|
ProcXF86VidModeDispatch,
|
||||||
|
SProcXF86VidModeDispatch,
|
||||||
|
NULL,
|
||||||
|
StandardMinorOpcode))) {
|
||||||
|
#if 0
|
||||||
|
XF86VidModeReqCode = (unsigned char)extEntry->base;
|
||||||
|
#endif
|
||||||
|
VidModeErrorBase = extEntry->errorBase;
|
||||||
|
#ifdef XF86VIDMODE_EVENTS
|
||||||
|
XF86VidModeEventBase = extEntry->eventBase;
|
||||||
|
EventSwapVector[XF86VidModeEventBase] = (EventSwapPtr)SXF86VidModeNotifyEvent;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
.\" $XdotOrg: xserver/xorg/hw/xfree86/doc/man/Xorg.man.pre,v 1.3 2005/07/04 18:41:01 ajax Exp $
|
.\" $XdotOrg: xserver/xorg/hw/xfree86/doc/man/Xorg.man.pre,v 1.3 2005/07/04 18:41:01 ajax Exp $
|
||||||
|
.\" shorthand for double quote that works everywhere.
|
||||||
|
.ds q \N'34'
|
||||||
.TH __xservername__ __appmansuffix__ __vendorversion__
|
.TH __xservername__ __appmansuffix__ __vendorversion__
|
||||||
.SH NAME
|
.SH NAME
|
||||||
__xservername__ - X11R7 X server
|
__xservername__ - X11R7 X server
|
||||||
|
@ -440,6 +442,14 @@ Immediately kills the server -- no questions asked. It can be disabled by
|
||||||
setting the
|
setting the
|
||||||
.B DontZap
|
.B DontZap
|
||||||
__xconfigfile__(__filemansuffix__) file option to a TRUE value.
|
__xconfigfile__(__filemansuffix__) file option to a TRUE value.
|
||||||
|
.PP
|
||||||
|
.RS 8
|
||||||
|
It should be noted that zapping is triggered by the
|
||||||
|
.B Terminate_Server
|
||||||
|
action in the keyboard map. This action is not part of the default keymaps
|
||||||
|
but can be enabled with the XKB option
|
||||||
|
.B \*qterminate:ctrl_alt_bksp\*q.
|
||||||
|
.RE
|
||||||
.TP 8
|
.TP 8
|
||||||
.B Ctrl+Alt+Keypad-Plus
|
.B Ctrl+Alt+Keypad-Plus
|
||||||
Change video mode to next one specified in the configuration file.
|
Change video mode to next one specified in the configuration file.
|
||||||
|
|
|
@ -71,8 +71,6 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
#include "inputstr.h"
|
#include "inputstr.h"
|
||||||
#include "xf86VGAarbiter.h"
|
#include "xf86VGAarbiter.h"
|
||||||
|
|
||||||
#define PCI_BUS_NO_DOMAIN(bus) ((bus) & 0xffu)
|
|
||||||
|
|
||||||
static int DRIEntPrivIndex = -1;
|
static int DRIEntPrivIndex = -1;
|
||||||
static DevPrivateKeyRec DRIScreenPrivKeyRec;
|
static DevPrivateKeyRec DRIScreenPrivKeyRec;
|
||||||
#define DRIScreenPrivKey (&DRIScreenPrivKeyRec)
|
#define DRIScreenPrivKey (&DRIScreenPrivKeyRec)
|
||||||
|
|
|
@ -64,23 +64,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
static int DRIErrorBase;
|
static int DRIErrorBase;
|
||||||
|
|
||||||
static DISPATCH_PROC(ProcXF86DRIQueryVersion);
|
|
||||||
static DISPATCH_PROC(ProcXF86DRIQueryDirectRenderingCapable);
|
|
||||||
static DISPATCH_PROC(ProcXF86DRIOpenConnection);
|
|
||||||
static DISPATCH_PROC(ProcXF86DRICloseConnection);
|
|
||||||
static DISPATCH_PROC(ProcXF86DRIGetClientDriverName);
|
|
||||||
static DISPATCH_PROC(ProcXF86DRICreateContext);
|
|
||||||
static DISPATCH_PROC(ProcXF86DRIDestroyContext);
|
|
||||||
static DISPATCH_PROC(ProcXF86DRICreateDrawable);
|
|
||||||
static DISPATCH_PROC(ProcXF86DRIDestroyDrawable);
|
|
||||||
static DISPATCH_PROC(ProcXF86DRIGetDrawableInfo);
|
|
||||||
static DISPATCH_PROC(ProcXF86DRIGetDeviceInfo);
|
|
||||||
static DISPATCH_PROC(ProcXF86DRIDispatch);
|
|
||||||
static DISPATCH_PROC(ProcXF86DRIAuthConnection);
|
|
||||||
|
|
||||||
static DISPATCH_PROC(SProcXF86DRIQueryVersion);
|
|
||||||
static DISPATCH_PROC(SProcXF86DRIQueryDirectRenderingCapable);
|
|
||||||
static DISPATCH_PROC(SProcXF86DRIDispatch);
|
|
||||||
|
|
||||||
static void XF86DRIResetProc(ExtensionEntry* extEntry);
|
static void XF86DRIResetProc(ExtensionEntry* extEntry);
|
||||||
|
|
||||||
|
@ -88,32 +72,6 @@ static unsigned char DRIReqCode = 0;
|
||||||
|
|
||||||
extern void XFree86DRIExtensionInit(void);
|
extern void XFree86DRIExtensionInit(void);
|
||||||
|
|
||||||
void
|
|
||||||
XFree86DRIExtensionInit(void)
|
|
||||||
{
|
|
||||||
ExtensionEntry* extEntry;
|
|
||||||
|
|
||||||
#ifdef XF86DRI_EVENTS
|
|
||||||
EventType = CreateNewResourceType(XF86DRIFreeEvents, "DRIEvent");
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (
|
|
||||||
DRIExtensionInit() &&
|
|
||||||
#ifdef XF86DRI_EVENTS
|
|
||||||
EventType && ScreenPrivateIndex != -1 &&
|
|
||||||
#endif
|
|
||||||
(extEntry = AddExtension(XF86DRINAME,
|
|
||||||
XF86DRINumberEvents,
|
|
||||||
XF86DRINumberErrors,
|
|
||||||
ProcXF86DRIDispatch,
|
|
||||||
SProcXF86DRIDispatch,
|
|
||||||
XF86DRIResetProc,
|
|
||||||
StandardMinorOpcode))) {
|
|
||||||
DRIReqCode = (unsigned char)extEntry->base;
|
|
||||||
DRIErrorBase = extEntry->errorBase;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*ARGSUSED*/
|
/*ARGSUSED*/
|
||||||
static void
|
static void
|
||||||
XF86DRIResetProc (
|
XF86DRIResetProc (
|
||||||
|
@ -677,3 +635,29 @@ SProcXF86DRIDispatch (
|
||||||
return DRIErrorBase + XF86DRIClientNotLocal;
|
return DRIErrorBase + XF86DRIClientNotLocal;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
XFree86DRIExtensionInit(void)
|
||||||
|
{
|
||||||
|
ExtensionEntry* extEntry;
|
||||||
|
|
||||||
|
#ifdef XF86DRI_EVENTS
|
||||||
|
EventType = CreateNewResourceType(XF86DRIFreeEvents, "DRIEvent");
|
||||||
|
#endif
|
||||||
|
|
||||||
|
if (
|
||||||
|
DRIExtensionInit() &&
|
||||||
|
#ifdef XF86DRI_EVENTS
|
||||||
|
EventType && ScreenPrivateIndex != -1 &&
|
||||||
|
#endif
|
||||||
|
(extEntry = AddExtension(XF86DRINAME,
|
||||||
|
XF86DRINumberEvents,
|
||||||
|
XF86DRINumberErrors,
|
||||||
|
ProcXF86DRIDispatch,
|
||||||
|
SProcXF86DRIDispatch,
|
||||||
|
XF86DRIResetProc,
|
||||||
|
StandardMinorOpcode))) {
|
||||||
|
DRIReqCode = (unsigned char)extEntry->base;
|
||||||
|
DRIErrorBase = extEntry->errorBase;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -16,26 +16,11 @@
|
||||||
|
|
||||||
#include "fbdevhw.h"
|
#include "fbdevhw.h"
|
||||||
#include "fbpriv.h"
|
#include "fbpriv.h"
|
||||||
|
|
||||||
#define PAGE_MASK (~(getpagesize() - 1))
|
|
||||||
|
|
||||||
#include "globals.h"
|
#include "globals.h"
|
||||||
#include <X11/extensions/dpmsconst.h>
|
#include <X11/extensions/dpmsconst.h>
|
||||||
|
|
||||||
#define DEBUG 0
|
|
||||||
|
|
||||||
#define PAGE_MASK (~(getpagesize() - 1))
|
#define PAGE_MASK (~(getpagesize() - 1))
|
||||||
|
|
||||||
#if DEBUG
|
|
||||||
# define TRACE_ENTER(str) ErrorF("fbdevHW: " str " %d\n",pScrn->scrnIndex)
|
|
||||||
#else
|
|
||||||
# define TRACE_ENTER(str)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* -------------------------------------------------------------------- */
|
|
||||||
|
|
||||||
static MODULESETUPPROTO(fbdevhwSetup);
|
|
||||||
|
|
||||||
static XF86ModuleVersionInfo fbdevHWVersRec =
|
static XF86ModuleVersionInfo fbdevHWVersRec =
|
||||||
{
|
{
|
||||||
"fbdevhw",
|
"fbdevhw",
|
||||||
|
@ -52,16 +37,10 @@ static XF86ModuleVersionInfo fbdevHWVersRec =
|
||||||
|
|
||||||
_X_EXPORT XF86ModuleData fbdevhwModuleData = {
|
_X_EXPORT XF86ModuleData fbdevhwModuleData = {
|
||||||
&fbdevHWVersRec,
|
&fbdevHWVersRec,
|
||||||
fbdevhwSetup,
|
NULL,
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
static pointer
|
|
||||||
fbdevhwSetup(pointer module, pointer opts, int *errmaj, int *errmin)
|
|
||||||
{
|
|
||||||
return (pointer)1;
|
|
||||||
}
|
|
||||||
|
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <sys/mman.h>
|
#include <sys/mman.h>
|
||||||
|
@ -96,12 +75,6 @@ typedef struct {
|
||||||
/* saved video mode */
|
/* saved video mode */
|
||||||
struct fb_var_screeninfo saved_var;
|
struct fb_var_screeninfo saved_var;
|
||||||
|
|
||||||
/* FIXME: unused??? [geert] */
|
|
||||||
struct fb_cmap saved_cmap;
|
|
||||||
unsigned short *saved_red;
|
|
||||||
unsigned short *saved_green;
|
|
||||||
unsigned short *saved_blue;
|
|
||||||
|
|
||||||
/* buildin video mode */
|
/* buildin video mode */
|
||||||
DisplayModeRec buildin;
|
DisplayModeRec buildin;
|
||||||
|
|
||||||
|
@ -445,8 +418,6 @@ fbdevHWInit(ScrnInfoPtr pScrn, struct pci_device * pPci, char *device)
|
||||||
{
|
{
|
||||||
fbdevHWPtr fPtr;
|
fbdevHWPtr fPtr;
|
||||||
|
|
||||||
TRACE_ENTER("Init");
|
|
||||||
|
|
||||||
fbdevHWGetRec(pScrn);
|
fbdevHWGetRec(pScrn);
|
||||||
fPtr = FBDEVHWPTR(pScrn);
|
fPtr = FBDEVHWPTR(pScrn);
|
||||||
|
|
||||||
|
@ -541,8 +512,6 @@ fbdevHWSetMode(ScrnInfoPtr pScrn, DisplayModePtr mode, Bool check)
|
||||||
{
|
{
|
||||||
fbdevHWPtr fPtr = FBDEVHWPTR(pScrn);
|
fbdevHWPtr fPtr = FBDEVHWPTR(pScrn);
|
||||||
struct fb_var_screeninfo req_var = fPtr->var, set_var;
|
struct fb_var_screeninfo req_var = fPtr->var, set_var;
|
||||||
|
|
||||||
TRACE_ENTER("SetMode");
|
|
||||||
|
|
||||||
xfree2fbdev_fblayout(pScrn, &req_var);
|
xfree2fbdev_fblayout(pScrn, &req_var);
|
||||||
xfree2fbdev_timing(mode, &req_var);
|
xfree2fbdev_timing(mode, &req_var);
|
||||||
|
@ -586,7 +555,6 @@ fbdevHWSetVideoModes(ScrnInfoPtr pScrn)
|
||||||
char **modename;
|
char **modename;
|
||||||
DisplayModePtr mode,this,last = pScrn->modes;
|
DisplayModePtr mode,this,last = pScrn->modes;
|
||||||
|
|
||||||
TRACE_ENTER("VerifyModes");
|
|
||||||
if (NULL == pScrn->display->modes)
|
if (NULL == pScrn->display->modes)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -643,7 +611,6 @@ fbdevHWUseBuildinMode(ScrnInfoPtr pScrn)
|
||||||
{
|
{
|
||||||
fbdevHWPtr fPtr = FBDEVHWPTR(pScrn);
|
fbdevHWPtr fPtr = FBDEVHWPTR(pScrn);
|
||||||
|
|
||||||
TRACE_ENTER("UseBuildinMode");
|
|
||||||
pScrn->modes = &fPtr->buildin;
|
pScrn->modes = &fPtr->buildin;
|
||||||
pScrn->virtualX = pScrn->display->virtualX;
|
pScrn->virtualX = pScrn->display->virtualX;
|
||||||
pScrn->virtualY = pScrn->display->virtualY;
|
pScrn->virtualY = pScrn->display->virtualY;
|
||||||
|
@ -669,7 +636,6 @@ fbdevHWMapVidmem(ScrnInfoPtr pScrn)
|
||||||
{
|
{
|
||||||
fbdevHWPtr fPtr = FBDEVHWPTR(pScrn);
|
fbdevHWPtr fPtr = FBDEVHWPTR(pScrn);
|
||||||
|
|
||||||
TRACE_ENTER("MapVidmem");
|
|
||||||
if (NULL == fPtr->fbmem) {
|
if (NULL == fPtr->fbmem) {
|
||||||
calculateFbmem_len(fPtr);
|
calculateFbmem_len(fPtr);
|
||||||
fPtr->fbmem = mmap(NULL, fPtr->fbmem_len, PROT_READ | PROT_WRITE,
|
fPtr->fbmem = mmap(NULL, fPtr->fbmem_len, PROT_READ | PROT_WRITE,
|
||||||
|
@ -695,7 +661,6 @@ fbdevHWLinearOffset(ScrnInfoPtr pScrn)
|
||||||
{
|
{
|
||||||
fbdevHWPtr fPtr = FBDEVHWPTR(pScrn);
|
fbdevHWPtr fPtr = FBDEVHWPTR(pScrn);
|
||||||
|
|
||||||
TRACE_ENTER("LinearOffset");
|
|
||||||
return fPtr->fboff;
|
return fPtr->fboff;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -704,7 +669,6 @@ fbdevHWUnmapVidmem(ScrnInfoPtr pScrn)
|
||||||
{
|
{
|
||||||
fbdevHWPtr fPtr = FBDEVHWPTR(pScrn);
|
fbdevHWPtr fPtr = FBDEVHWPTR(pScrn);
|
||||||
|
|
||||||
TRACE_ENTER("UnmapVidmem");
|
|
||||||
if (NULL != fPtr->fbmem) {
|
if (NULL != fPtr->fbmem) {
|
||||||
if (-1 == munmap(fPtr->fbmem, fPtr->fbmem_len))
|
if (-1 == munmap(fPtr->fbmem, fPtr->fbmem_len))
|
||||||
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
|
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
|
||||||
|
@ -721,7 +685,6 @@ fbdevHWMapMMIO(ScrnInfoPtr pScrn)
|
||||||
|
|
||||||
fbdevHWPtr fPtr = FBDEVHWPTR(pScrn);
|
fbdevHWPtr fPtr = FBDEVHWPTR(pScrn);
|
||||||
|
|
||||||
TRACE_ENTER("MapMMIO");
|
|
||||||
if (NULL == fPtr->mmio) {
|
if (NULL == fPtr->mmio) {
|
||||||
/* tell the kernel not to use accels to speed up console scrolling */
|
/* tell the kernel not to use accels to speed up console scrolling */
|
||||||
fPtr->var.accel_flags = 0;
|
fPtr->var.accel_flags = 0;
|
||||||
|
@ -752,7 +715,6 @@ fbdevHWUnmapMMIO(ScrnInfoPtr pScrn)
|
||||||
{
|
{
|
||||||
fbdevHWPtr fPtr = FBDEVHWPTR(pScrn);
|
fbdevHWPtr fPtr = FBDEVHWPTR(pScrn);
|
||||||
|
|
||||||
TRACE_ENTER("UnmapMMIO");
|
|
||||||
if (NULL != fPtr->mmio) {
|
if (NULL != fPtr->mmio) {
|
||||||
if (-1 == munmap((void *)((unsigned long)fPtr->mmio & PAGE_MASK), fPtr->mmio_len))
|
if (-1 == munmap((void *)((unsigned long)fPtr->mmio & PAGE_MASK), fPtr->mmio_len))
|
||||||
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
|
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
|
||||||
|
@ -806,14 +768,11 @@ fbdevHWModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
|
||||||
|
|
||||||
/* -------------------------------------------------------------------- */
|
/* -------------------------------------------------------------------- */
|
||||||
/* video mode save/restore */
|
/* video mode save/restore */
|
||||||
|
|
||||||
/* TODO: colormap */
|
|
||||||
void
|
void
|
||||||
fbdevHWSave(ScrnInfoPtr pScrn)
|
fbdevHWSave(ScrnInfoPtr pScrn)
|
||||||
{
|
{
|
||||||
fbdevHWPtr fPtr = FBDEVHWPTR(pScrn);
|
fbdevHWPtr fPtr = FBDEVHWPTR(pScrn);
|
||||||
|
|
||||||
TRACE_ENTER("Save");
|
|
||||||
if (0 != ioctl(fPtr->fd,FBIOGET_VSCREENINFO,(void*)(&fPtr->saved_var)))
|
if (0 != ioctl(fPtr->fd,FBIOGET_VSCREENINFO,(void*)(&fPtr->saved_var)))
|
||||||
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
|
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
|
||||||
"FBIOGET_VSCREENINFO: %s\n", strerror(errno));
|
"FBIOGET_VSCREENINFO: %s\n", strerror(errno));
|
||||||
|
@ -824,7 +783,6 @@ fbdevHWRestore(ScrnInfoPtr pScrn)
|
||||||
{
|
{
|
||||||
fbdevHWPtr fPtr = FBDEVHWPTR(pScrn);
|
fbdevHWPtr fPtr = FBDEVHWPTR(pScrn);
|
||||||
|
|
||||||
TRACE_ENTER("Restore");
|
|
||||||
if (0 != ioctl(fPtr->fd,FBIOPUT_VSCREENINFO,(void*)(&fPtr->saved_var)))
|
if (0 != ioctl(fPtr->fd,FBIOPUT_VSCREENINFO,(void*)(&fPtr->saved_var)))
|
||||||
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
|
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
|
||||||
"FBIOPUT_VSCREENINFO: %s\n", strerror(errno));
|
"FBIOPUT_VSCREENINFO: %s\n", strerror(errno));
|
||||||
|
@ -842,7 +800,6 @@ fbdevHWLoadPalette(ScrnInfoPtr pScrn, int numColors, int *indices,
|
||||||
unsigned short red,green,blue;
|
unsigned short red,green,blue;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
TRACE_ENTER("LoadPalette");
|
|
||||||
cmap.len = 1;
|
cmap.len = 1;
|
||||||
cmap.red = &red;
|
cmap.red = &red;
|
||||||
cmap.green = &green;
|
cmap.green = &green;
|
||||||
|
@ -870,8 +827,6 @@ fbdevHWValidMode(int scrnIndex, DisplayModePtr mode, Bool verbose, int flags)
|
||||||
{
|
{
|
||||||
ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
|
ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
|
||||||
|
|
||||||
TRACE_ENTER("ValidMode");
|
|
||||||
|
|
||||||
if (!fbdevHWSetMode(pScrn, mode, TRUE))
|
if (!fbdevHWSetMode(pScrn, mode, TRUE))
|
||||||
return MODE_BAD;
|
return MODE_BAD;
|
||||||
|
|
||||||
|
@ -883,7 +838,6 @@ fbdevHWSwitchMode(int scrnIndex, DisplayModePtr mode, int flags)
|
||||||
{
|
{
|
||||||
ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
|
ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
|
||||||
|
|
||||||
TRACE_ENTER("SwitchMode");
|
|
||||||
|
|
||||||
if (!fbdevHWSetMode(pScrn, mode, FALSE))
|
if (!fbdevHWSetMode(pScrn, mode, FALSE))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
@ -897,7 +851,6 @@ fbdevHWAdjustFrame(int scrnIndex, int x, int y, int flags)
|
||||||
ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
|
ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
|
||||||
fbdevHWPtr fPtr = FBDEVHWPTR(pScrn);
|
fbdevHWPtr fPtr = FBDEVHWPTR(pScrn);
|
||||||
|
|
||||||
TRACE_ENTER("AdjustFrame");
|
|
||||||
if ( x < 0 || x + fPtr->var.xres > fPtr->var.xres_virtual ||
|
if ( x < 0 || x + fPtr->var.xres > fPtr->var.xres_virtual ||
|
||||||
y < 0 || y + fPtr->var.yres > fPtr->var.yres_virtual )
|
y < 0 || y + fPtr->var.yres > fPtr->var.yres_virtual )
|
||||||
return;
|
return;
|
||||||
|
@ -914,7 +867,6 @@ fbdevHWEnterVT(int scrnIndex, int flags)
|
||||||
{
|
{
|
||||||
ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
|
ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
|
||||||
|
|
||||||
TRACE_ENTER("EnterVT");
|
|
||||||
if (!fbdevHWModeInit(pScrn, pScrn->currentMode))
|
if (!fbdevHWModeInit(pScrn, pScrn->currentMode))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
fbdevHWAdjustFrame(scrnIndex, pScrn->frameX0, pScrn->frameY0, 0);
|
fbdevHWAdjustFrame(scrnIndex, pScrn->frameX0, pScrn->frameY0, 0);
|
||||||
|
@ -926,7 +878,6 @@ fbdevHWLeaveVT(int scrnIndex, int flags)
|
||||||
{
|
{
|
||||||
ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
|
ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
|
||||||
|
|
||||||
TRACE_ENTER("LeaveVT");
|
|
||||||
fbdevHWRestore(pScrn);
|
fbdevHWRestore(pScrn);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -936,7 +887,6 @@ fbdevHWDPMSSet(ScrnInfoPtr pScrn, int mode, int flags)
|
||||||
fbdevHWPtr fPtr = FBDEVHWPTR(pScrn);
|
fbdevHWPtr fPtr = FBDEVHWPTR(pScrn);
|
||||||
unsigned long fbmode;
|
unsigned long fbmode;
|
||||||
|
|
||||||
TRACE_ENTER("DPMSSet");
|
|
||||||
if (!pScrn->vtSema)
|
if (!pScrn->vtSema)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -969,7 +919,6 @@ fbdevHWSaveScreen(ScreenPtr pScreen, int mode)
|
||||||
fbdevHWPtr fPtr = FBDEVHWPTR(pScrn);
|
fbdevHWPtr fPtr = FBDEVHWPTR(pScrn);
|
||||||
unsigned long unblank;
|
unsigned long unblank;
|
||||||
|
|
||||||
TRACE_ENTER("HWSaveScreen");
|
|
||||||
if (!pScrn->vtSema)
|
if (!pScrn->vtSema)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
|
|
|
@ -4,8 +4,6 @@
|
||||||
|
|
||||||
#include "xf86Module.h"
|
#include "xf86Module.h"
|
||||||
|
|
||||||
static MODULESETUPPROTO(bt829Setup);
|
|
||||||
|
|
||||||
static XF86ModuleVersionInfo bt829VersRec =
|
static XF86ModuleVersionInfo bt829VersRec =
|
||||||
{
|
{
|
||||||
"bt829",
|
"bt829",
|
||||||
|
@ -20,9 +18,4 @@ static XF86ModuleVersionInfo bt829VersRec =
|
||||||
{0,0,0,0}
|
{0,0,0,0}
|
||||||
};
|
};
|
||||||
|
|
||||||
_X_EXPORT XF86ModuleData bt829ModuleData = { &bt829VersRec, bt829Setup, NULL };
|
_X_EXPORT XF86ModuleData bt829ModuleData = { &bt829VersRec, NULL, NULL };
|
||||||
|
|
||||||
static pointer
|
|
||||||
bt829Setup(pointer module, pointer opts, int *errmaj, int *errmin) {
|
|
||||||
return (pointer)1;
|
|
||||||
}
|
|
||||||
|
|
|
@ -4,8 +4,6 @@
|
||||||
|
|
||||||
#include "xf86Module.h"
|
#include "xf86Module.h"
|
||||||
|
|
||||||
static MODULESETUPPROTO(fi1236Setup);
|
|
||||||
|
|
||||||
static XF86ModuleVersionInfo fi1236VersRec =
|
static XF86ModuleVersionInfo fi1236VersRec =
|
||||||
{
|
{
|
||||||
"fi1236",
|
"fi1236",
|
||||||
|
@ -22,11 +20,6 @@ static XF86ModuleVersionInfo fi1236VersRec =
|
||||||
|
|
||||||
_X_EXPORT XF86ModuleData fi1236ModuleData = {
|
_X_EXPORT XF86ModuleData fi1236ModuleData = {
|
||||||
&fi1236VersRec,
|
&fi1236VersRec,
|
||||||
fi1236Setup,
|
NULL,
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
static pointer
|
|
||||||
fi1236Setup(pointer module, pointer opts, int *errmaj, int *errmin) {
|
|
||||||
return (pointer)1;
|
|
||||||
}
|
|
||||||
|
|
|
@ -4,8 +4,6 @@
|
||||||
|
|
||||||
#include "xf86Module.h"
|
#include "xf86Module.h"
|
||||||
|
|
||||||
static MODULESETUPPROTO(msp3430Setup);
|
|
||||||
|
|
||||||
static XF86ModuleVersionInfo msp3430VersRec =
|
static XF86ModuleVersionInfo msp3430VersRec =
|
||||||
{
|
{
|
||||||
"msp3430",
|
"msp3430",
|
||||||
|
@ -22,11 +20,6 @@ static XF86ModuleVersionInfo msp3430VersRec =
|
||||||
|
|
||||||
_X_EXPORT XF86ModuleData msp3430ModuleData = {
|
_X_EXPORT XF86ModuleData msp3430ModuleData = {
|
||||||
&msp3430VersRec,
|
&msp3430VersRec,
|
||||||
msp3430Setup,
|
NULL,
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
static pointer
|
|
||||||
msp3430Setup(pointer module, pointer opts, int *errmaj, int *errmin) {
|
|
||||||
return (pointer)1;
|
|
||||||
}
|
|
||||||
|
|
|
@ -4,8 +4,6 @@
|
||||||
|
|
||||||
#include "xf86Module.h"
|
#include "xf86Module.h"
|
||||||
|
|
||||||
static MODULESETUPPROTO(tda8425Setup);
|
|
||||||
|
|
||||||
static XF86ModuleVersionInfo tda8425VersRec =
|
static XF86ModuleVersionInfo tda8425VersRec =
|
||||||
{
|
{
|
||||||
"tda8425",
|
"tda8425",
|
||||||
|
@ -22,11 +20,6 @@ static XF86ModuleVersionInfo tda8425VersRec =
|
||||||
|
|
||||||
_X_EXPORT XF86ModuleData tda8425ModuleData = {
|
_X_EXPORT XF86ModuleData tda8425ModuleData = {
|
||||||
&tda8425VersRec,
|
&tda8425VersRec,
|
||||||
tda8425Setup,
|
NULL,
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
static pointer
|
|
||||||
tda8425Setup(pointer module, pointer opts, int *errmaj, int *errmin) {
|
|
||||||
return (pointer)1;
|
|
||||||
}
|
|
||||||
|
|
|
@ -4,8 +4,6 @@
|
||||||
|
|
||||||
#include "xf86Module.h"
|
#include "xf86Module.h"
|
||||||
|
|
||||||
static MODULESETUPPROTO(tda9850Setup);
|
|
||||||
|
|
||||||
static XF86ModuleVersionInfo tda9850VersRec =
|
static XF86ModuleVersionInfo tda9850VersRec =
|
||||||
{
|
{
|
||||||
"tda9850",
|
"tda9850",
|
||||||
|
@ -22,11 +20,6 @@ static XF86ModuleVersionInfo tda9850VersRec =
|
||||||
|
|
||||||
_X_EXPORT XF86ModuleData tda9850ModuleData = {
|
_X_EXPORT XF86ModuleData tda9850ModuleData = {
|
||||||
&tda9850VersRec,
|
&tda9850VersRec,
|
||||||
tda9850Setup,
|
NULL,
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
static pointer
|
|
||||||
tda9850Setup(pointer module, pointer opts, int *errmaj, int *errmin) {
|
|
||||||
return (pointer)1;
|
|
||||||
}
|
|
||||||
|
|
|
@ -4,8 +4,6 @@
|
||||||
|
|
||||||
#include "xf86Module.h"
|
#include "xf86Module.h"
|
||||||
|
|
||||||
static MODULESETUPPROTO(tda9885Setup);
|
|
||||||
|
|
||||||
static XF86ModuleVersionInfo tda9885VersRec =
|
static XF86ModuleVersionInfo tda9885VersRec =
|
||||||
{
|
{
|
||||||
"tda9885",
|
"tda9885",
|
||||||
|
@ -22,11 +20,6 @@ static XF86ModuleVersionInfo tda9885VersRec =
|
||||||
|
|
||||||
_X_EXPORT XF86ModuleData tda9885ModuleData = {
|
_X_EXPORT XF86ModuleData tda9885ModuleData = {
|
||||||
&tda9885VersRec,
|
&tda9885VersRec,
|
||||||
tda9885Setup,
|
NULL,
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
static pointer
|
|
||||||
tda9885Setup(pointer module, pointer opts, int *errmaj, int *errmin) {
|
|
||||||
return (pointer)1;
|
|
||||||
}
|
|
||||||
|
|
|
@ -4,8 +4,6 @@
|
||||||
|
|
||||||
#include "xf86Module.h"
|
#include "xf86Module.h"
|
||||||
|
|
||||||
static MODULESETUPPROTO(uda1380Setup);
|
|
||||||
|
|
||||||
static XF86ModuleVersionInfo uda1380VersRec =
|
static XF86ModuleVersionInfo uda1380VersRec =
|
||||||
{
|
{
|
||||||
"uda1380",
|
"uda1380",
|
||||||
|
@ -22,11 +20,6 @@ static XF86ModuleVersionInfo uda1380VersRec =
|
||||||
|
|
||||||
_X_EXPORT XF86ModuleData uda1380ModuleData = {
|
_X_EXPORT XF86ModuleData uda1380ModuleData = {
|
||||||
&uda1380VersRec,
|
&uda1380VersRec,
|
||||||
uda1380Setup,
|
NULL,
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
static pointer
|
|
||||||
uda1380Setup(pointer module, pointer opts, int *errmaj, int *errmin) {
|
|
||||||
return (pointer)1;
|
|
||||||
}
|
|
||||||
|
|
|
@ -462,6 +462,11 @@ Mem_wl(CARD32 addr, CARD32 val)
|
||||||
|
|
||||||
static CARD32 PciCfg1Addr = 0;
|
static CARD32 PciCfg1Addr = 0;
|
||||||
|
|
||||||
|
#define PCI_DOM_FROM_TAG(tag) (((tag) >> 24) & (PCI_DOM_MASK))
|
||||||
|
#define PCI_BUS_FROM_TAG(tag) (((tag) >> 16) & (PCI_DOMBUS_MASK))
|
||||||
|
#define PCI_DEV_FROM_TAG(tag) (((tag) & 0x0000f800u) >> 11)
|
||||||
|
#define PCI_FUNC_FROM_TAG(tag) (((tag) & 0x00000700u) >> 8)
|
||||||
|
|
||||||
#define PCI_OFFSET(x) ((x) & 0x000000ff)
|
#define PCI_OFFSET(x) ((x) & 0x000000ff)
|
||||||
#define PCI_TAG(x) ((x) & 0x7fffff00)
|
#define PCI_TAG(x) ((x) & 0x7fffff00)
|
||||||
|
|
||||||
|
|
|
@ -22,8 +22,6 @@
|
||||||
#define combine(a,b) concat(a,b)
|
#define combine(a,b) concat(a,b)
|
||||||
#define NAME(x) combine(MOD_NAME,x)
|
#define NAME(x) combine(MOD_NAME,x)
|
||||||
|
|
||||||
static MODULESETUPPROTO(NAME(Setup));
|
|
||||||
|
|
||||||
static XF86ModuleVersionInfo NAME(VersRec) =
|
static XF86ModuleVersionInfo NAME(VersRec) =
|
||||||
{
|
{
|
||||||
STRING(NAME( )),
|
STRING(NAME( )),
|
||||||
|
@ -40,25 +38,6 @@ static XF86ModuleVersionInfo NAME(VersRec) =
|
||||||
|
|
||||||
_X_EXPORT XF86ModuleData NAME(ModuleData) = {
|
_X_EXPORT XF86ModuleData NAME(ModuleData) = {
|
||||||
&NAME(VersRec),
|
&NAME(VersRec),
|
||||||
NAME(Setup),
|
NULL,
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
static pointer
|
|
||||||
NAME(Setup)(pointer module, pointer opts, int *errmaj, int *errmin)
|
|
||||||
{
|
|
||||||
static Bool setupDone = FALSE;
|
|
||||||
|
|
||||||
if (!setupDone) {
|
|
||||||
setupDone = TRUE;
|
|
||||||
/*
|
|
||||||
* Tell the loader about symbols from other modules that this module
|
|
||||||
* might refer to.
|
|
||||||
*/
|
|
||||||
}
|
|
||||||
/*
|
|
||||||
* The return value must be non-NULL on success even though there
|
|
||||||
* is no TearDownProc.
|
|
||||||
*/
|
|
||||||
return (pointer)1;
|
|
||||||
}
|
|
||||||
|
|
|
@ -8,7 +8,6 @@ INCLUDES = $(XORG_INCS) -I$(srcdir)/../parser -I$(top_srcdir)/miext/cw \
|
||||||
AM_CFLAGS = $(DIX_CFLAGS) $(XORG_CFLAGS)
|
AM_CFLAGS = $(DIX_CFLAGS) $(XORG_CFLAGS)
|
||||||
|
|
||||||
EXTRA_DIST = \
|
EXTRA_DIST = \
|
||||||
dlloader.h \
|
|
||||||
loader.h \
|
loader.h \
|
||||||
loaderProcs.h \
|
loaderProcs.h \
|
||||||
sdksyms.sh
|
sdksyms.sh
|
||||||
|
@ -18,7 +17,6 @@ libloader_la_SOURCES = \
|
||||||
loaderProcs.h \
|
loaderProcs.h \
|
||||||
loadext.c \
|
loadext.c \
|
||||||
loadmod.c \
|
loadmod.c \
|
||||||
dlloader.c \
|
|
||||||
os.c \
|
os.c \
|
||||||
sdksyms.c
|
sdksyms.c
|
||||||
libloader_la_LIBADD = $(DLOPEN_LIBS)
|
libloader_la_LIBADD = $(DLOPEN_LIBS)
|
||||||
|
|
|
@ -1,178 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 1997 The XFree86 Project, Inc.
|
|
||||||
*
|
|
||||||
* Permission to use, copy, modify, distribute, and sell this software
|
|
||||||
* and its documentation for any purpose is hereby granted without
|
|
||||||
* fee, provided that the above copyright notice appear in all copies
|
|
||||||
* and that both that copyright notice and this permission notice
|
|
||||||
* appear in supporting documentation, and that the name of the
|
|
||||||
* XFree86 Project, Inc. not be used in advertising or publicity
|
|
||||||
* pertaining to distribution of the software without specific,
|
|
||||||
* written prior permission. The Xfree86 Project, Inc. makes no
|
|
||||||
* representations about the suitability of this software for any
|
|
||||||
* purpose. It is provided "as is" without express or implied
|
|
||||||
* warranty.
|
|
||||||
*
|
|
||||||
* THE XFREE86 PROJECT, INC. DISCLAIMS ALL WARRANTIES WITH REGARD TO
|
|
||||||
* THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
||||||
* AND FITNESS, IN NO EVENT SHALL THE XFREE86 PROJECT, INC. BE LIABLE
|
|
||||||
* FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
||||||
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
|
|
||||||
* AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
|
|
||||||
* SOFTWARE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Once upon a time, X had multiple loader backends, three of which were
|
|
||||||
* essentially libdl reimplementations. This was nonsense so we chucked
|
|
||||||
* it, but we still retain the factorization between loader API and
|
|
||||||
* platform implementation. This file is the libdl implementation, and
|
|
||||||
* currently the only backend. If you find yourself porting to a platform
|
|
||||||
* without working libdl - hpux, win32, some forsaken a.out host, etc. -
|
|
||||||
* make a new backend rather than hacking up this file.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifdef HAVE_XORG_CONFIG_H
|
|
||||||
#include <xorg-config.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <dlfcn.h>
|
|
||||||
|
|
||||||
#include <X11/Xos.h>
|
|
||||||
#include "os.h"
|
|
||||||
|
|
||||||
#include "loader.h"
|
|
||||||
#include "dlloader.h"
|
|
||||||
|
|
||||||
#if defined(DL_LAZY)
|
|
||||||
#define DLOPEN_LAZY DL_LAZY
|
|
||||||
#elif defined(RTLD_LAZY)
|
|
||||||
#define DLOPEN_LAZY RTLD_LAZY
|
|
||||||
#elif defined(__FreeBSD__)
|
|
||||||
#define DLOPEN_LAZY 1
|
|
||||||
#else
|
|
||||||
#define DLOPEN_LAZY 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(LD_GLOBAL)
|
|
||||||
#define DLOPEN_GLOBAL LD_GLOBAL
|
|
||||||
#elif defined(RTLD_GLOBAL)
|
|
||||||
#define DLOPEN_GLOBAL RTLD_GLOBAL
|
|
||||||
#else
|
|
||||||
#define DLOPEN_GLOBAL 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(CSRG_BASED) && !defined(__ELF__)
|
|
||||||
#define DLSYM_PREFIX "_"
|
|
||||||
#else
|
|
||||||
#define DLSYM_PREFIX ""
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Hooray, yet another open coded linked list! FIXME */
|
|
||||||
typedef struct DLModuleList {
|
|
||||||
void *module;
|
|
||||||
struct DLModuleList *next;
|
|
||||||
} DLModuleList;
|
|
||||||
|
|
||||||
static DLModuleList *dlModuleList = NULL;
|
|
||||||
|
|
||||||
static void *
|
|
||||||
DLFindSymbolLocal(pointer module, const char *name)
|
|
||||||
{
|
|
||||||
void *p;
|
|
||||||
char *n;
|
|
||||||
|
|
||||||
static const char symPrefix[] = DLSYM_PREFIX;
|
|
||||||
|
|
||||||
if (sizeof(symPrefix) > 1) {
|
|
||||||
n = malloc(strlen(symPrefix) + strlen(name) + 1);
|
|
||||||
sprintf(n, "%s%s", symPrefix, name);
|
|
||||||
name = n;
|
|
||||||
}
|
|
||||||
|
|
||||||
p = dlsym(module, name);
|
|
||||||
|
|
||||||
if (sizeof(symPrefix) > 1)
|
|
||||||
free(n);
|
|
||||||
|
|
||||||
return p;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void *global_scope = NULL;
|
|
||||||
|
|
||||||
void *
|
|
||||||
DLFindSymbol(const char *name)
|
|
||||||
{
|
|
||||||
DLModuleList *l;
|
|
||||||
void *p;
|
|
||||||
|
|
||||||
p = dlsym(RTLD_DEFAULT, name);
|
|
||||||
if (p != NULL)
|
|
||||||
return p;
|
|
||||||
|
|
||||||
for (l = dlModuleList; l != NULL; l = l->next) {
|
|
||||||
p = DLFindSymbolLocal(l->module, name);
|
|
||||||
if (p)
|
|
||||||
return p;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!global_scope)
|
|
||||||
global_scope = dlopen(NULL, DLOPEN_LAZY | DLOPEN_GLOBAL);
|
|
||||||
|
|
||||||
if (global_scope)
|
|
||||||
return DLFindSymbolLocal(global_scope, name);
|
|
||||||
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
void *
|
|
||||||
DLLoadModule(loaderPtr modrec, int flags)
|
|
||||||
{
|
|
||||||
void * dlfile;
|
|
||||||
DLModuleList *l;
|
|
||||||
int dlopen_flags;
|
|
||||||
|
|
||||||
if (flags & LD_FLAG_GLOBAL)
|
|
||||||
dlopen_flags = DLOPEN_LAZY | DLOPEN_GLOBAL;
|
|
||||||
else
|
|
||||||
dlopen_flags = DLOPEN_LAZY;
|
|
||||||
dlfile = dlopen(modrec->name, dlopen_flags);
|
|
||||||
if (dlfile == NULL) {
|
|
||||||
ErrorF("dlopen: %s\n", dlerror());
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
l = malloc(sizeof(DLModuleList));
|
|
||||||
l->module = dlfile;
|
|
||||||
l->next = dlModuleList;
|
|
||||||
dlModuleList = l;
|
|
||||||
|
|
||||||
return (void *)dlfile;
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
DLUnloadModule(void *modptr)
|
|
||||||
{
|
|
||||||
DLModuleList *l, *p;
|
|
||||||
|
|
||||||
/* remove it from dlModuleList. */
|
|
||||||
if (dlModuleList->module == modptr) {
|
|
||||||
l = dlModuleList;
|
|
||||||
dlModuleList = l->next;
|
|
||||||
free(l);
|
|
||||||
} else {
|
|
||||||
p = dlModuleList;
|
|
||||||
for (l = dlModuleList->next; l != NULL; l = l->next) {
|
|
||||||
if (l->module == modptr) {
|
|
||||||
p->next = l->next;
|
|
||||||
free(l);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
p = l;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
dlclose(modptr);
|
|
||||||
}
|
|
|
@ -1,33 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright 1997 Metro Link, Inc.
|
|
||||||
* Permission to use, copy, modify, distribute, and sell this software and its
|
|
||||||
* documentation for any purpose is hereby granted without fee, provided that
|
|
||||||
* the above copyright notice appear in all copies and that both that
|
|
||||||
* copyright notice and this permission notice appear in supporting
|
|
||||||
* documentation, and that the name of Metro Link, Inc. not be used in
|
|
||||||
* advertising or publicity pertaining to distribution of the software without
|
|
||||||
* specific, written prior permission. Metro Link, Inc. makes no
|
|
||||||
* representations about the suitability of this software for any purpose.
|
|
||||||
* It is provided "as is" without express or implied warranty.
|
|
||||||
*
|
|
||||||
* METRO LINK, INC. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
|
||||||
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
|
|
||||||
* EVENT SHALL METRO LINK, INC. BE LIABLE FOR ANY SPECIAL, INDIRECT OR
|
|
||||||
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
|
|
||||||
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
|
||||||
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
||||||
* PERFORMANCE OF THIS SOFTWARE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifdef HAVE_XORG_CONFIG_H
|
|
||||||
#include <xorg-config.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef _DLLOADER_H
|
|
||||||
#define _DLLOADER_H
|
|
||||||
|
|
||||||
extern void *DLLoadModule(loaderPtr, int flags);
|
|
||||||
extern void DLUnloadModule(void *);
|
|
||||||
extern void *DLFindSymbol(const char *name);
|
|
||||||
|
|
||||||
#endif
|
|
|
@ -54,18 +54,10 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#if defined(UseMMAP) || (defined(linux) && defined(__ia64__))
|
|
||||||
#include <sys/mman.h>
|
|
||||||
#endif
|
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#if defined(linux) && \
|
|
||||||
(defined(__alpha__) || defined(__powerpc__) || defined(__ia64__) \
|
|
||||||
|| defined(__amd64__))
|
|
||||||
#include <malloc.h>
|
|
||||||
#endif
|
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
|
|
||||||
#include "os.h"
|
#include "os.h"
|
||||||
|
@ -75,45 +67,35 @@
|
||||||
#include "xf86Priv.h"
|
#include "xf86Priv.h"
|
||||||
#include "compiler.h"
|
#include "compiler.h"
|
||||||
|
|
||||||
|
#ifdef HAVE_DLFCN_H
|
||||||
|
|
||||||
|
#include <dlfcn.h>
|
||||||
|
#include <X11/Xos.h>
|
||||||
|
|
||||||
|
#if defined(DL_LAZY)
|
||||||
|
#define DLOPEN_LAZY DL_LAZY
|
||||||
|
#elif defined(RTLD_LAZY)
|
||||||
|
#define DLOPEN_LAZY RTLD_LAZY
|
||||||
|
#elif defined(__FreeBSD__)
|
||||||
|
#define DLOPEN_LAZY 1
|
||||||
|
#else
|
||||||
|
#define DLOPEN_LAZY 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(LD_GLOBAL)
|
||||||
|
#define DLOPEN_GLOBAL LD_GLOBAL
|
||||||
|
#elif defined(RTLD_GLOBAL)
|
||||||
|
#define DLOPEN_GLOBAL RTLD_GLOBAL
|
||||||
|
#else
|
||||||
|
#define DLOPEN_GLOBAL 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#else
|
||||||
|
#error i have no dynamic linker and i must scream
|
||||||
|
#endif
|
||||||
|
|
||||||
extern void *xorg_symbols[];
|
extern void *xorg_symbols[];
|
||||||
|
|
||||||
#define MAX_HANDLE 256
|
|
||||||
static int refCount[MAX_HANDLE];
|
|
||||||
|
|
||||||
static int moduleseq = 0;
|
|
||||||
|
|
||||||
/* Prototypes for static functions. */
|
|
||||||
static loaderPtr listHead = NULL;
|
|
||||||
|
|
||||||
static loaderPtr
|
|
||||||
_LoaderListPush(void)
|
|
||||||
{
|
|
||||||
loaderPtr item = calloc(1, sizeof(struct _loader));
|
|
||||||
|
|
||||||
item->next = listHead;
|
|
||||||
listHead = item;
|
|
||||||
|
|
||||||
return item;
|
|
||||||
}
|
|
||||||
|
|
||||||
static loaderPtr
|
|
||||||
_LoaderListPop(int handle)
|
|
||||||
{
|
|
||||||
loaderPtr item = listHead;
|
|
||||||
loaderPtr *bptr = &listHead; /* pointer to previous node */
|
|
||||||
|
|
||||||
while (item) {
|
|
||||||
if (item->handle == handle) {
|
|
||||||
*bptr = item->next; /* remove this from the list */
|
|
||||||
return item;
|
|
||||||
}
|
|
||||||
bptr = &(item->next);
|
|
||||||
item = item->next;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
LoaderInit(void)
|
LoaderInit(void)
|
||||||
{
|
{
|
||||||
|
@ -149,136 +131,61 @@ LoaderInit(void)
|
||||||
path = uwcrtpath; /* fallback: try to get libcrt.a from the uccs */
|
path = uwcrtpath; /* fallback: try to get libcrt.a from the uccs */
|
||||||
else
|
else
|
||||||
path = xcrtpath; /* get the libcrt.a we compiled with */
|
path = xcrtpath; /* get the libcrt.a we compiled with */
|
||||||
LoaderOpen (path, "libcrt", 0, &errmaj, &errmin, &wasLoaded);
|
LoaderOpen (path, &errmaj, &errmin, &wasLoaded, 0);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Public Interface to the loader. */
|
/* Public Interface to the loader. */
|
||||||
|
|
||||||
int
|
void *
|
||||||
LoaderOpen(const char *module, const char *cname, int handle,
|
LoaderOpen(const char *module, int *errmaj, int *errmin)
|
||||||
int *errmaj, int *errmin, int *wasLoaded, int flags)
|
|
||||||
{
|
{
|
||||||
loaderPtr tmp;
|
void *ret;
|
||||||
int new_handle;
|
|
||||||
|
|
||||||
#if defined(DEBUG)
|
#if defined(DEBUG)
|
||||||
ErrorF("LoaderOpen(%s)\n", module);
|
ErrorF("LoaderOpen(%s)\n", module);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Is the module already loaded? */
|
|
||||||
if (handle >= 0) {
|
|
||||||
tmp = listHead;
|
|
||||||
while (tmp) {
|
|
||||||
#ifdef DEBUGLIST
|
|
||||||
ErrorF("strcmp(%x(%s),{%x} %x(%s))\n", module, module,
|
|
||||||
&(tmp->name), tmp->name, tmp->name);
|
|
||||||
#endif
|
|
||||||
if (!strcmp(module, tmp->name)) {
|
|
||||||
refCount[tmp->handle]++;
|
|
||||||
if (wasLoaded)
|
|
||||||
*wasLoaded = 1;
|
|
||||||
xf86MsgVerb(X_INFO, 2, "Reloading %s\n", module);
|
|
||||||
return tmp->handle;
|
|
||||||
}
|
|
||||||
tmp = tmp->next;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* OK, it's a new one. Add it.
|
|
||||||
*/
|
|
||||||
xf86Msg(X_INFO, "Loading %s\n", module);
|
xf86Msg(X_INFO, "Loading %s\n", module);
|
||||||
if (wasLoaded)
|
|
||||||
*wasLoaded = 0;
|
|
||||||
|
|
||||||
/*
|
if (!(ret = dlopen(module, DLOPEN_LAZY | DLOPEN_GLOBAL))) {
|
||||||
* Find a free handle.
|
xf86Msg(X_ERROR, "Failed to load %s: %s\n", module, dlerror());
|
||||||
*/
|
|
||||||
new_handle = 1;
|
|
||||||
while (new_handle < MAX_HANDLE && refCount[new_handle])
|
|
||||||
new_handle++;
|
|
||||||
|
|
||||||
if (new_handle == MAX_HANDLE) {
|
|
||||||
xf86Msg(X_ERROR, "Out of loader space\n"); /* XXX */
|
|
||||||
if (errmaj)
|
|
||||||
*errmaj = LDR_NOSPACE;
|
|
||||||
if (errmin)
|
|
||||||
*errmin = LDR_NOSPACE;
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
refCount[new_handle] = 1;
|
|
||||||
|
|
||||||
tmp = _LoaderListPush();
|
|
||||||
tmp->name = malloc(strlen(module) + 1);
|
|
||||||
strcpy(tmp->name, module);
|
|
||||||
tmp->cname = malloc(strlen(cname) + 1);
|
|
||||||
strcpy(tmp->cname, cname);
|
|
||||||
tmp->handle = new_handle;
|
|
||||||
tmp->module = moduleseq++;
|
|
||||||
|
|
||||||
if ((tmp->private = DLLoadModule(tmp, flags)) == NULL) {
|
|
||||||
xf86Msg(X_ERROR, "Failed to load %s\n", module);
|
|
||||||
_LoaderListPop(new_handle);
|
|
||||||
refCount[new_handle] = 0;
|
|
||||||
if (errmaj)
|
if (errmaj)
|
||||||
*errmaj = LDR_NOLOAD;
|
*errmaj = LDR_NOLOAD;
|
||||||
if (errmin)
|
if (errmin)
|
||||||
*errmin = LDR_NOLOAD;
|
*errmin = LDR_NOLOAD;
|
||||||
return -1;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
return new_handle;
|
return ret;
|
||||||
}
|
|
||||||
|
|
||||||
int
|
|
||||||
LoaderHandleOpen(int handle)
|
|
||||||
{
|
|
||||||
if (handle < 0 || handle >= MAX_HANDLE)
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
if (!refCount[handle])
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
refCount[handle]++;
|
|
||||||
return handle;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void *
|
void *
|
||||||
LoaderSymbol(const char *sym)
|
LoaderSymbol(const char *name)
|
||||||
{
|
{
|
||||||
return (DLFindSymbol(sym));
|
static void *global_scope = NULL;
|
||||||
|
void *p;
|
||||||
|
|
||||||
|
p = dlsym(RTLD_DEFAULT, name);
|
||||||
|
if (p != NULL)
|
||||||
|
return p;
|
||||||
|
|
||||||
|
if (!global_scope)
|
||||||
|
global_scope = dlopen(NULL, DLOPEN_LAZY | DLOPEN_GLOBAL);
|
||||||
|
|
||||||
|
if (global_scope)
|
||||||
|
return dlsym(global_scope, name);
|
||||||
|
|
||||||
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
void
|
||||||
LoaderUnload(int handle)
|
LoaderUnload(const char *name, void *handle)
|
||||||
{
|
{
|
||||||
loaderRec fakeHead;
|
xf86Msg(X_INFO, "Unloading %s\n", name);
|
||||||
loaderPtr tmp = &fakeHead;
|
if (handle)
|
||||||
|
dlclose(handle);
|
||||||
if (handle < 0 || handle >= MAX_HANDLE)
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* check the reference count, only free it if it goes to zero
|
|
||||||
*/
|
|
||||||
if (--refCount[handle])
|
|
||||||
return 0;
|
|
||||||
/*
|
|
||||||
* find the loaderRecs associated with this handle.
|
|
||||||
*/
|
|
||||||
|
|
||||||
while ((tmp = _LoaderListPop(handle)) != NULL) {
|
|
||||||
xf86Msg(X_INFO, "Unloading %s\n", tmp->name);
|
|
||||||
DLUnloadModule(tmp->private);
|
|
||||||
free(tmp->name);
|
|
||||||
free(tmp->cname);
|
|
||||||
free(tmp);
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned long LoaderOptions = 0;
|
unsigned long LoaderOptions = 0;
|
||||||
|
|
|
@ -57,23 +57,6 @@
|
||||||
#include <X11/Xfuncproto.h>
|
#include <X11/Xfuncproto.h>
|
||||||
#include <X11/Xmd.h>
|
#include <X11/Xmd.h>
|
||||||
|
|
||||||
/* LoadModule proc flags; LD_FLAG_GLOBAL adds symbols to global
|
|
||||||
* namespace, default is to keep symbols local to module. */
|
|
||||||
#define LD_FLAG_GLOBAL 1
|
|
||||||
|
|
||||||
typedef struct _loader *loaderPtr;
|
|
||||||
|
|
||||||
/* Each module loaded has a loaderRec */
|
|
||||||
typedef struct _loader {
|
|
||||||
int handle; /* Unique id used to remove symbols from
|
|
||||||
* this module when it is unloaded */
|
|
||||||
int module; /* Unique id to identify compilation units */
|
|
||||||
char *name;
|
|
||||||
char *cname;
|
|
||||||
void *private; /* format specific data */
|
|
||||||
loaderPtr next;
|
|
||||||
} loaderRec;
|
|
||||||
|
|
||||||
/* Compiled-in version information */
|
/* Compiled-in version information */
|
||||||
typedef struct {
|
typedef struct {
|
||||||
int xf86Version;
|
int xf86Version;
|
||||||
|
@ -88,16 +71,6 @@ extern const ModuleVersions LoaderVersionInfo;
|
||||||
extern unsigned long LoaderOptions;
|
extern unsigned long LoaderOptions;
|
||||||
|
|
||||||
/* Internal Functions */
|
/* Internal Functions */
|
||||||
void LoaderDuplicateSymbol(const char *, const int);
|
void * LoaderOpen(const char *, int *, int *);
|
||||||
char *_LoaderModuleToName(int);
|
|
||||||
int LoaderOpen(const char *, const char *, int, int *, int *, int *, int);
|
|
||||||
int LoaderHandleOpen(int);
|
|
||||||
|
|
||||||
/* object to name lookup routines */
|
|
||||||
char *_LoaderHandleToName(int handle);
|
|
||||||
char *_LoaderHandleToCanonicalName(int handle);
|
|
||||||
|
|
||||||
/* Loader backends. */
|
|
||||||
#include "dlloader.h"
|
|
||||||
|
|
||||||
#endif /* _LOADER_H */
|
#endif /* _LOADER_H */
|
||||||
|
|
|
@ -60,7 +60,8 @@ typedef struct module_desc {
|
||||||
struct module_desc *sib;
|
struct module_desc *sib;
|
||||||
struct module_desc *parent;
|
struct module_desc *parent;
|
||||||
char *name;
|
char *name;
|
||||||
int handle;
|
char *path;
|
||||||
|
void *handle;
|
||||||
ModuleSetupProc SetupProc;
|
ModuleSetupProc SetupProc;
|
||||||
ModuleTearDownProc TearDownProc;
|
ModuleTearDownProc TearDownProc;
|
||||||
void *TearDownData; /* returned from SetupProc */
|
void *TearDownData; /* returned from SetupProc */
|
||||||
|
@ -81,7 +82,7 @@ void UnloadDriver(ModuleDescPtr);
|
||||||
void LoaderSetPath(const char *path);
|
void LoaderSetPath(const char *path);
|
||||||
void LoaderSortExtensions(void);
|
void LoaderSortExtensions(void);
|
||||||
|
|
||||||
int LoaderUnload(int);
|
void LoaderUnload(const char *, void *);
|
||||||
unsigned long LoaderGetModuleVersion(ModuleDescPtr mod);
|
unsigned long LoaderGetModuleVersion(ModuleDescPtr mod);
|
||||||
|
|
||||||
void LoaderResetOptions(void);
|
void LoaderResetOptions(void);
|
||||||
|
|
|
@ -83,8 +83,7 @@ static char *LoaderGetCanonicalName(const char *, PatternPtr);
|
||||||
static void RemoveChild(ModuleDescPtr);
|
static void RemoveChild(ModuleDescPtr);
|
||||||
static ModuleDescPtr doLoadModule(const char *, const char *, const char **,
|
static ModuleDescPtr doLoadModule(const char *, const char *, const char **,
|
||||||
const char **, pointer,
|
const char **, pointer,
|
||||||
const XF86ModReqInfo *, int *, int *,
|
const XF86ModReqInfo *, int *, int *);
|
||||||
int flags);
|
|
||||||
|
|
||||||
const ModuleVersions LoaderVersionInfo = {
|
const ModuleVersions LoaderVersionInfo = {
|
||||||
XORG_VERSION_CURRENT,
|
XORG_VERSION_CURRENT,
|
||||||
|
@ -765,7 +764,7 @@ LoadSubModule(pointer _parent, const char *module,
|
||||||
}
|
}
|
||||||
|
|
||||||
submod = doLoadModule(module, NULL, subdirlist, patternlist, options,
|
submod = doLoadModule(module, NULL, subdirlist, patternlist, options,
|
||||||
modreq, errmaj, errmin, LD_FLAG_GLOBAL);
|
modreq, errmaj, errmin);
|
||||||
if (submod && submod != (ModuleDescPtr) 1) {
|
if (submod && submod != (ModuleDescPtr) 1) {
|
||||||
parent->child = AddSibling(parent->child, submod);
|
parent->child = AddSibling(parent->child, submod);
|
||||||
submod->parent = parent;
|
submod->parent = parent;
|
||||||
|
@ -776,18 +775,10 @@ LoadSubModule(pointer _parent, const char *module,
|
||||||
static ModuleDescPtr
|
static ModuleDescPtr
|
||||||
NewModuleDesc(const char *name)
|
NewModuleDesc(const char *name)
|
||||||
{
|
{
|
||||||
ModuleDescPtr mdp = malloc(sizeof(ModuleDesc));
|
ModuleDescPtr mdp = calloc(1, sizeof(ModuleDesc));
|
||||||
|
|
||||||
if (mdp) {
|
if (mdp)
|
||||||
mdp->child = NULL;
|
|
||||||
mdp->sib = NULL;
|
|
||||||
mdp->parent = NULL;
|
|
||||||
mdp->name = xstrdup(name);
|
mdp->name = xstrdup(name);
|
||||||
mdp->handle = -1;
|
|
||||||
mdp->SetupProc = NULL;
|
|
||||||
mdp->TearDownProc = NULL;
|
|
||||||
mdp->TearDownData = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
return mdp;
|
return mdp;
|
||||||
}
|
}
|
||||||
|
@ -796,6 +787,7 @@ ModuleDescPtr
|
||||||
DuplicateModule(ModuleDescPtr mod, ModuleDescPtr parent)
|
DuplicateModule(ModuleDescPtr mod, ModuleDescPtr parent)
|
||||||
{
|
{
|
||||||
ModuleDescPtr ret;
|
ModuleDescPtr ret;
|
||||||
|
int errmaj, errmin;
|
||||||
|
|
||||||
if (!mod)
|
if (!mod)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -804,10 +796,11 @@ DuplicateModule(ModuleDescPtr mod, ModuleDescPtr parent)
|
||||||
if (ret == NULL)
|
if (ret == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if (LoaderHandleOpen(mod->handle) == -1)
|
if (!(ret->handle = LoaderOpen(mod->path, &errmaj, &errmin))) {
|
||||||
return NULL;
|
free(ret);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
ret->handle = mod->handle;
|
|
||||||
ret->SetupProc = mod->SetupProc;
|
ret->SetupProc = mod->SetupProc;
|
||||||
ret->TearDownProc = mod->TearDownProc;
|
ret->TearDownProc = mod->TearDownProc;
|
||||||
ret->TearDownData = NULL;
|
ret->TearDownData = NULL;
|
||||||
|
@ -815,6 +808,7 @@ DuplicateModule(ModuleDescPtr mod, ModuleDescPtr parent)
|
||||||
ret->sib = DuplicateModule(mod->sib, parent);
|
ret->sib = DuplicateModule(mod->sib, parent);
|
||||||
ret->parent = parent;
|
ret->parent = parent;
|
||||||
ret->VersionInfo = mod->VersionInfo;
|
ret->VersionInfo = mod->VersionInfo;
|
||||||
|
ret->path = strdup(mod->path);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -830,7 +824,7 @@ static ModuleDescPtr
|
||||||
doLoadModule(const char *module, const char *path, const char **subdirlist,
|
doLoadModule(const char *module, const char *path, const char **subdirlist,
|
||||||
const char **patternlist, pointer options,
|
const char **patternlist, pointer options,
|
||||||
const XF86ModReqInfo * modreq,
|
const XF86ModReqInfo * modreq,
|
||||||
int *errmaj, int *errmin, int flags)
|
int *errmaj, int *errmin)
|
||||||
{
|
{
|
||||||
XF86ModuleData *initdata = NULL;
|
XF86ModuleData *initdata = NULL;
|
||||||
char **pathlist = NULL;
|
char **pathlist = NULL;
|
||||||
|
@ -839,7 +833,6 @@ doLoadModule(const char *module, const char *path, const char **subdirlist,
|
||||||
char **path_elem = NULL;
|
char **path_elem = NULL;
|
||||||
char *p = NULL;
|
char *p = NULL;
|
||||||
ModuleDescPtr ret = NULL;
|
ModuleDescPtr ret = NULL;
|
||||||
int wasLoaded = 0;
|
|
||||||
PatternPtr patterns = NULL;
|
PatternPtr patterns = NULL;
|
||||||
int noncanonical = 0;
|
int noncanonical = 0;
|
||||||
char *m = NULL;
|
char *m = NULL;
|
||||||
|
@ -926,10 +919,10 @@ doLoadModule(const char *module, const char *path, const char **subdirlist,
|
||||||
*errmin = 0;
|
*errmin = 0;
|
||||||
goto LoadModule_fail;
|
goto LoadModule_fail;
|
||||||
}
|
}
|
||||||
ret->handle = LoaderOpen(found, name, 0,
|
ret->handle = LoaderOpen(found, errmaj, errmin);
|
||||||
errmaj, errmin, &wasLoaded, flags);
|
|
||||||
if (ret->handle < 0)
|
if (ret->handle < 0)
|
||||||
goto LoadModule_fail;
|
goto LoadModule_fail;
|
||||||
|
ret->path = strdup(found);
|
||||||
|
|
||||||
/* drop any explicit suffix from the module name */
|
/* drop any explicit suffix from the module name */
|
||||||
p = strchr(name, '.');
|
p = strchr(name, '.');
|
||||||
|
@ -960,26 +953,24 @@ doLoadModule(const char *module, const char *path, const char **subdirlist,
|
||||||
setup = initdata->setup;
|
setup = initdata->setup;
|
||||||
teardown = initdata->teardown;
|
teardown = initdata->teardown;
|
||||||
|
|
||||||
if (!wasLoaded) {
|
if (vers) {
|
||||||
if (vers) {
|
if (!CheckVersion(module, vers, modreq)) {
|
||||||
if (!CheckVersion(module, vers, modreq)) {
|
if (errmaj)
|
||||||
if (errmaj)
|
*errmaj = LDR_MISMATCH;
|
||||||
*errmaj = LDR_MISMATCH;
|
if (errmin)
|
||||||
if (errmin)
|
*errmin = 0;
|
||||||
*errmin = 0;
|
goto LoadModule_fail;
|
||||||
goto LoadModule_fail;
|
}
|
||||||
}
|
} else {
|
||||||
} else {
|
xf86Msg(X_ERROR,
|
||||||
xf86Msg(X_ERROR,
|
"LoadModule: Module %s does not supply"
|
||||||
"LoadModule: Module %s does not supply"
|
" version information\n", module);
|
||||||
" version information\n", module);
|
if (errmaj)
|
||||||
if (errmaj)
|
*errmaj = LDR_INVALID;
|
||||||
*errmaj = LDR_INVALID;
|
if (errmin)
|
||||||
if (errmin)
|
*errmin = 0;
|
||||||
*errmin = 0;
|
goto LoadModule_fail;
|
||||||
goto LoadModule_fail;
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
if (setup)
|
if (setup)
|
||||||
ret->SetupProc = setup;
|
ret->SetupProc = setup;
|
||||||
if (teardown)
|
if (teardown)
|
||||||
|
@ -1067,7 +1058,7 @@ LoadModule(const char *module, const char *path, const char **subdirlist,
|
||||||
const XF86ModReqInfo * modreq, int *errmaj, int *errmin)
|
const XF86ModReqInfo * modreq, int *errmaj, int *errmin)
|
||||||
{
|
{
|
||||||
return doLoadModule(module, path, subdirlist, patternlist, options,
|
return doLoadModule(module, path, subdirlist, patternlist, options,
|
||||||
modreq, errmaj, errmin, LD_FLAG_GLOBAL);
|
modreq, errmaj, errmin);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -1089,12 +1080,13 @@ UnloadModuleOrDriver(ModuleDescPtr mod)
|
||||||
|
|
||||||
if ((mod->TearDownProc) && (mod->TearDownData))
|
if ((mod->TearDownProc) && (mod->TearDownData))
|
||||||
mod->TearDownProc(mod->TearDownData);
|
mod->TearDownProc(mod->TearDownData);
|
||||||
LoaderUnload(mod->handle);
|
LoaderUnload(mod->name, mod->handle);
|
||||||
|
|
||||||
if (mod->child)
|
if (mod->child)
|
||||||
UnloadModuleOrDriver(mod->child);
|
UnloadModuleOrDriver(mod->child);
|
||||||
if (mod->sib)
|
if (mod->sib)
|
||||||
UnloadModuleOrDriver(mod->sib);
|
UnloadModuleOrDriver(mod->sib);
|
||||||
|
free(mod->path);
|
||||||
free(mod->name);
|
free(mod->name);
|
||||||
free(mod);
|
free(mod);
|
||||||
}
|
}
|
||||||
|
@ -1111,13 +1103,14 @@ UnloadSubModule(pointer _mod)
|
||||||
|
|
||||||
if ((mod->TearDownProc) && (mod->TearDownData))
|
if ((mod->TearDownProc) && (mod->TearDownData))
|
||||||
mod->TearDownProc(mod->TearDownData);
|
mod->TearDownProc(mod->TearDownData);
|
||||||
LoaderUnload(mod->handle);
|
LoaderUnload(mod->name, mod->handle);
|
||||||
|
|
||||||
RemoveChild(mod);
|
RemoveChild(mod);
|
||||||
|
|
||||||
if (mod->child)
|
if (mod->child)
|
||||||
UnloadModuleOrDriver(mod->child);
|
UnloadModuleOrDriver(mod->child);
|
||||||
|
|
||||||
|
free(mod->path);
|
||||||
free(mod->name);
|
free(mod->name);
|
||||||
free(mod);
|
free(mod);
|
||||||
}
|
}
|
||||||
|
|
|
@ -178,7 +178,6 @@ cat > sdksyms.c << EOF
|
||||||
#include "xaa.h"
|
#include "xaa.h"
|
||||||
#include "xaalocal.h"
|
#include "xaalocal.h"
|
||||||
#include "xaarop.h"
|
#include "xaarop.h"
|
||||||
#include "xaaWrapper.h"
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
@ -345,11 +344,14 @@ BEGIN {
|
||||||
if (sdk && $3 ~ /\.h"$/) {
|
if (sdk && $3 ~ /\.h"$/) {
|
||||||
# remove quotes
|
# remove quotes
|
||||||
gsub(/"/, "", $3);
|
gsub(/"/, "", $3);
|
||||||
|
line = $2;
|
||||||
|
header = $3;
|
||||||
if (! headers[$3]) {
|
if (! headers[$3]) {
|
||||||
printf(" \\\n %s", $3) >> "sdksyms.dep";
|
printf(" \\\n %s", $3) >> "sdksyms.dep";
|
||||||
headers[$3] = 1;
|
headers[$3] = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
next;
|
||||||
}
|
}
|
||||||
|
|
||||||
/^extern[ ]/ {
|
/^extern[ ]/ {
|
||||||
|
@ -398,10 +400,14 @@ BEGIN {
|
||||||
sub(/[^a-zA-Z0-9_].*/, "", symbol);
|
sub(/[^a-zA-Z0-9_].*/, "", symbol);
|
||||||
|
|
||||||
#print;
|
#print;
|
||||||
printf(" (void *) &%s,\n", symbol);
|
printf(" (void *) &%-50s /* %s:%s */\n", symbol ",", header, line);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
line++;
|
||||||
|
}
|
||||||
|
|
||||||
END {
|
END {
|
||||||
print("};");
|
print("};");
|
||||||
|
|
||||||
|
|
|
@ -227,11 +227,7 @@ xf86_set_cursor_colors (ScrnInfoPtr scrn, int bg, int fg)
|
||||||
CursorPtr cursor = xf86_config->cursor;
|
CursorPtr cursor = xf86_config->cursor;
|
||||||
int c;
|
int c;
|
||||||
CARD8 *bits = cursor ?
|
CARD8 *bits = cursor ?
|
||||||
#if XORG_VERSION_CURRENT < XORG_VERSION_NUMERIC(7,0,0,0,0)
|
|
||||||
dixLookupPrivate(&cursor->devPrivates, CursorScreenKey(screen))
|
dixLookupPrivate(&cursor->devPrivates, CursorScreenKey(screen))
|
||||||
#else
|
|
||||||
cursor->devPriv[screen->myNum]
|
|
||||||
#endif
|
|
||||||
: NULL;
|
: NULL;
|
||||||
|
|
||||||
/* Save ARGB versions of these colors */
|
/* Save ARGB versions of these colors */
|
||||||
|
@ -630,11 +626,7 @@ xf86_reload_cursors (ScreenPtr screen)
|
||||||
|
|
||||||
if (cursor)
|
if (cursor)
|
||||||
{
|
{
|
||||||
#if XORG_VERSION_CURRENT < XORG_VERSION_NUMERIC(7,0,0,0,0)
|
|
||||||
void *src = dixLookupPrivate(&cursor->devPrivates, CursorScreenKey(screen));
|
void *src = dixLookupPrivate(&cursor->devPrivates, CursorScreenKey(screen));
|
||||||
#else
|
|
||||||
void *src = cursor->devPriv[screen->myNum];
|
|
||||||
#endif
|
|
||||||
#ifdef ARGB_CURSOR
|
#ifdef ARGB_CURSOR
|
||||||
if (cursor->bits->argb && cursor_info->LoadCursorARGB)
|
if (cursor->bits->argb && cursor_info->LoadCursorARGB)
|
||||||
(*cursor_info->LoadCursorARGB) (scrn, cursor);
|
(*cursor_info->LoadCursorARGB) (scrn, cursor);
|
||||||
|
|
|
@ -484,8 +484,8 @@ DDCModesFromStandardTiming(struct std_timings *timing, ddc_quirk_t quirks,
|
||||||
(hsize == 1368 && vsize == 769))) {
|
(hsize == 1368 && vsize == 769))) {
|
||||||
Mode = xf86CVTMode(1366, 768, 60, FALSE, FALSE);
|
Mode = xf86CVTMode(1366, 768, 60, FALSE, FALSE);
|
||||||
Mode->HDisplay = 1366;
|
Mode->HDisplay = 1366;
|
||||||
Mode->VSyncStart--;
|
Mode->HSyncStart--;
|
||||||
Mode->VSyncEnd--;
|
Mode->HSyncEnd--;
|
||||||
} else if (hsize && vsize && refresh) {
|
} else if (hsize && vsize && refresh) {
|
||||||
Mode = FindDMTMode(hsize, vsize, refresh, rb);
|
Mode = FindDMTMode(hsize, vsize, refresh, rb);
|
||||||
|
|
||||||
|
@ -636,7 +636,6 @@ DDCModeFromDetailedTiming(int scrnIndex, struct detailed_timings *timing,
|
||||||
return Mode;
|
return Mode;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if XORG_VERSION_CURRENT < XORG_VERSION_NUMERIC(7,0,0,0,0)
|
|
||||||
static DisplayModePtr
|
static DisplayModePtr
|
||||||
DDCModesFromCVT(int scrnIndex, struct cvt_timings *t)
|
DDCModesFromCVT(int scrnIndex, struct cvt_timings *t)
|
||||||
{
|
{
|
||||||
|
@ -665,7 +664,6 @@ DDCModesFromCVT(int scrnIndex, struct cvt_timings *t)
|
||||||
|
|
||||||
return modes;
|
return modes;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
static const struct {
|
static const struct {
|
||||||
short w;
|
short w;
|
||||||
|
@ -1021,12 +1019,10 @@ static void handle_detailed_modes(struct detailed_monitor_section *det_mon,
|
||||||
p->quirks, p->timing_level,p->rb);
|
p->quirks, p->timing_level,p->rb);
|
||||||
p->Modes = xf86ModesAdd(p->Modes, Mode);
|
p->Modes = xf86ModesAdd(p->Modes, Mode);
|
||||||
break;
|
break;
|
||||||
#if XORG_VERSION_CURRENT < XORG_VERSION_NUMERIC(7,0,0,0,0)
|
|
||||||
case DS_CVT:
|
case DS_CVT:
|
||||||
Mode = DDCModesFromCVT(p->DDC->scrnIndex, det_mon->section.cvt);
|
Mode = DDCModesFromCVT(p->DDC->scrnIndex, det_mon->section.cvt);
|
||||||
p->Modes = xf86ModesAdd(p->Modes, Mode);
|
p->Modes = xf86ModesAdd(p->Modes, Mode);
|
||||||
break;
|
break;
|
||||||
#endif
|
|
||||||
case DS_EST_III:
|
case DS_EST_III:
|
||||||
Mode = DDCModesFromEstIII(det_mon->section.est_iii);
|
Mode = DDCModesFromEstIII(det_mon->section.est_iii);
|
||||||
p->Modes = xf86ModesAdd(p->Modes, Mode);
|
p->Modes = xf86ModesAdd(p->Modes, Mode);
|
||||||
|
|
|
@ -38,14 +38,6 @@
|
||||||
|
|
||||||
extern XF86ConfigPtr xf86configptr;
|
extern XF86ConfigPtr xf86configptr;
|
||||||
|
|
||||||
/*
|
|
||||||
* This is the version number where we epoched. These files get copied
|
|
||||||
* into drivers that want to use this setup infrastructure on pre-1.3
|
|
||||||
* servers, so when that happens they need to define these symbols
|
|
||||||
* themselves. However, _in_ the server, we basically always define them now.
|
|
||||||
*/
|
|
||||||
#if XORG_VERSION_CURRENT <= XORG_VERSION_NUMERIC(7,2,99,2,0)
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Calculates the horizontal sync rate of a mode.
|
* Calculates the horizontal sync rate of a mode.
|
||||||
*/
|
*/
|
||||||
|
@ -326,7 +318,6 @@ xf86PrintModeline(int scrnIndex,DisplayModePtr mode)
|
||||||
mode->VTotal, flags, xf86ModeHSync(mode));
|
mode->VTotal, flags, xf86ModeHSync(mode));
|
||||||
free(flags);
|
free(flags);
|
||||||
}
|
}
|
||||||
#endif /* XORG_VERSION_CURRENT <= 7.2.99.2 */
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Marks as bad any modes with unsupported flags.
|
* Marks as bad any modes with unsupported flags.
|
||||||
|
@ -503,12 +494,7 @@ xf86ValidateModesBandwidth(ScrnInfoPtr pScrn, DisplayModePtr modeList,
|
||||||
|
|
||||||
for (mode = modeList; mode != NULL; mode = mode->next) {
|
for (mode = modeList; mode != NULL; mode = mode->next) {
|
||||||
if (xf86ModeBandwidth(mode, depth) > bandwidth)
|
if (xf86ModeBandwidth(mode, depth) > bandwidth)
|
||||||
#if XORG_VERSION_CURRENT < XORG_VERSION_NUMERIC(7,0,0,0,0)
|
|
||||||
mode->status = MODE_BANDWIDTH;
|
mode->status = MODE_BANDWIDTH;
|
||||||
#else
|
|
||||||
/* MODE_BANDWIDTH didn't exist in xserver 1.2 */
|
|
||||||
mode->status = MODE_BAD;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -69,21 +69,12 @@ static Bool xf86RandR12CreateScreenResources12 (ScreenPtr pScreen);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static int xf86RandR12Generation;
|
static int xf86RandR12Generation;
|
||||||
#if XORG_VERSION_CURRENT < XORG_VERSION_NUMERIC(7,0,0,0,0)
|
|
||||||
|
|
||||||
static DevPrivateKeyRec xf86RandR12KeyRec;
|
static DevPrivateKeyRec xf86RandR12KeyRec;
|
||||||
static DevPrivateKey xf86RandR12Key;
|
static DevPrivateKey xf86RandR12Key;
|
||||||
#define XF86RANDRINFO(p) ((XF86RandRInfoPtr) \
|
#define XF86RANDRINFO(p) ((XF86RandRInfoPtr) \
|
||||||
dixLookupPrivate(&(p)->devPrivates, xf86RandR12Key))
|
dixLookupPrivate(&(p)->devPrivates, xf86RandR12Key))
|
||||||
|
|
||||||
#else /* XORG_VERSION_CURRENT < 7.0 */
|
|
||||||
|
|
||||||
static int xf86RandR12Index;
|
|
||||||
#define XF86RANDRINFO(p) \
|
|
||||||
((XF86RandRInfoPtr)(p)->devPrivates[xf86RandR12Index].ptr)
|
|
||||||
|
|
||||||
#endif /* XORG_VERSION_CURRENT < 7.0 */
|
|
||||||
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
xf86RandR12ModeRefresh (DisplayModePtr mode)
|
xf86RandR12ModeRefresh (DisplayModePtr mode)
|
||||||
|
@ -520,7 +511,6 @@ xf86RandR12SetMode (ScreenPtr pScreen,
|
||||||
WindowPtr pRoot = pScreen->root;
|
WindowPtr pRoot = pScreen->root;
|
||||||
DisplayModePtr currentMode = NULL;
|
DisplayModePtr currentMode = NULL;
|
||||||
Bool ret = TRUE;
|
Bool ret = TRUE;
|
||||||
PixmapPtr pspix = NULL;
|
|
||||||
|
|
||||||
if (pRoot)
|
if (pRoot)
|
||||||
(*scrp->EnableDisableFBAccess) (pScreen->myNum, FALSE);
|
(*scrp->EnableDisableFBAccess) (pScreen->myNum, FALSE);
|
||||||
|
@ -569,14 +559,6 @@ xf86RandR12SetMode (ScreenPtr pScreen,
|
||||||
pScreen->mmHeight = oldmmHeight;
|
pScreen->mmHeight = oldmmHeight;
|
||||||
scrp->currentMode = currentMode;
|
scrp->currentMode = currentMode;
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
* Get the new Screen pixmap ptr as SwitchMode might have called
|
|
||||||
* ModifyPixmapHeader and xf86EnableDisableFBAccess will put it back...
|
|
||||||
* Unfortunately.
|
|
||||||
*/
|
|
||||||
pspix = (*pScreen->GetScreenPixmap) (pScreen);
|
|
||||||
if (pspix->devPrivate.ptr)
|
|
||||||
scrp->pixmapPrivate = pspix->devPrivate;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Make sure the layout is correct
|
* Make sure the layout is correct
|
||||||
|
@ -686,21 +668,17 @@ xf86RandR12ScreenSetSize (ScreenPtr pScreen,
|
||||||
ScrnInfoPtr pScrn = XF86SCRNINFO(pScreen);
|
ScrnInfoPtr pScrn = XF86SCRNINFO(pScreen);
|
||||||
xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn);
|
xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn);
|
||||||
WindowPtr pRoot = pScreen->root;
|
WindowPtr pRoot = pScreen->root;
|
||||||
PixmapPtr pScrnPix = (*pScreen->GetScreenPixmap)(pScreen);
|
PixmapPtr pScrnPix;
|
||||||
Bool ret = FALSE;
|
Bool ret = FALSE;
|
||||||
int c;
|
int c;
|
||||||
|
|
||||||
#if XORG_VERSION_CURRENT < XORG_VERSION_NUMERIC(7,0,0,0,0)
|
|
||||||
if (xf86RandR12Key) {
|
if (xf86RandR12Key) {
|
||||||
#endif
|
|
||||||
if (randrp->virtualX == -1 || randrp->virtualY == -1)
|
if (randrp->virtualX == -1 || randrp->virtualY == -1)
|
||||||
{
|
{
|
||||||
randrp->virtualX = pScrn->virtualX;
|
randrp->virtualX = pScrn->virtualX;
|
||||||
randrp->virtualY = pScrn->virtualY;
|
randrp->virtualY = pScrn->virtualY;
|
||||||
}
|
}
|
||||||
#if XORG_VERSION_CURRENT < XORG_VERSION_NUMERIC(7,0,0,0,0)
|
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
if (pRoot && pScrn->vtSema)
|
if (pRoot && pScrn->vtSema)
|
||||||
(*pScrn->EnableDisableFBAccess) (pScreen->myNum, FALSE);
|
(*pScrn->EnableDisableFBAccess) (pScreen->myNum, FALSE);
|
||||||
|
|
||||||
|
@ -727,6 +705,7 @@ xf86RandR12ScreenSetSize (ScreenPtr pScreen,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pScrnPix = (*pScreen->GetScreenPixmap)(pScreen);
|
||||||
pScreen->width = pScrnPix->drawable.width = width;
|
pScreen->width = pScrnPix->drawable.width = width;
|
||||||
pScreen->height = pScrnPix->drawable.height = height;
|
pScreen->height = pScrnPix->drawable.height = height;
|
||||||
randrp->mmWidth = pScreen->mmWidth = mmWidth;
|
randrp->mmWidth = pScreen->mmWidth = mmWidth;
|
||||||
|
@ -843,10 +822,8 @@ xf86RandR12CreateScreenResources (ScreenPtr pScreen)
|
||||||
mmHeight);
|
mmHeight);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if XORG_VERSION_CURRENT < XORG_VERSION_NUMERIC(7,0,0,0,0)
|
|
||||||
if (xf86RandR12Key == NULL)
|
if (xf86RandR12Key == NULL)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
#endif
|
|
||||||
|
|
||||||
if (randrp->virtualX == -1 || randrp->virtualY == -1)
|
if (randrp->virtualX == -1 || randrp->virtualY == -1)
|
||||||
{
|
{
|
||||||
|
@ -882,13 +859,9 @@ xf86RandR12Init (ScreenPtr pScreen)
|
||||||
if (xf86RandR12Generation != serverGeneration)
|
if (xf86RandR12Generation != serverGeneration)
|
||||||
xf86RandR12Generation = serverGeneration;
|
xf86RandR12Generation = serverGeneration;
|
||||||
|
|
||||||
#if XORG_VERSION_CURRENT < XORG_VERSION_NUMERIC(7,0,0,0,0)
|
|
||||||
xf86RandR12Key = &xf86RandR12KeyRec;
|
xf86RandR12Key = &xf86RandR12KeyRec;
|
||||||
if (!dixRegisterPrivateKey(&xf86RandR12KeyRec, PRIVATE_SCREEN, 0))
|
if (!dixRegisterPrivateKey(&xf86RandR12KeyRec, PRIVATE_SCREEN, 0))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
#else
|
|
||||||
xf86RandR12Index = AllocateScreenPrivateIndex();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
randrp = malloc(sizeof (XF86RandRInfoRec));
|
randrp = malloc(sizeof (XF86RandRInfoRec));
|
||||||
if (!randrp)
|
if (!randrp)
|
||||||
|
@ -914,11 +887,7 @@ xf86RandR12Init (ScreenPtr pScreen)
|
||||||
|
|
||||||
randrp->maxX = randrp->maxY = 0;
|
randrp->maxX = randrp->maxY = 0;
|
||||||
|
|
||||||
#if XORG_VERSION_CURRENT < XORG_VERSION_NUMERIC(7,0,0,0,0)
|
|
||||||
dixSetPrivate(&pScreen->devPrivates, xf86RandR12Key, randrp);
|
dixSetPrivate(&pScreen->devPrivates, xf86RandR12Key, randrp);
|
||||||
#else
|
|
||||||
pScreen->devPrivates[xf86RandR12Index].ptr = randrp;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if RANDR_12_INTERFACE
|
#if RANDR_12_INTERFACE
|
||||||
if (!xf86RandR12Init12 (pScreen))
|
if (!xf86RandR12Init12 (pScreen))
|
||||||
|
@ -932,10 +901,8 @@ xf86RandR12CloseScreen (ScreenPtr pScreen)
|
||||||
{
|
{
|
||||||
XF86RandRInfoPtr randrp;
|
XF86RandRInfoPtr randrp;
|
||||||
|
|
||||||
#if XORG_VERSION_CURRENT < XORG_VERSION_NUMERIC(7,0,0,0,0)
|
|
||||||
if (xf86RandR12Key == NULL)
|
if (xf86RandR12Key == NULL)
|
||||||
return;
|
return;
|
||||||
#endif
|
|
||||||
|
|
||||||
randrp = XF86RANDRINFO(pScreen);
|
randrp = XF86RANDRINFO(pScreen);
|
||||||
#if RANDR_12_INTERFACE
|
#if RANDR_12_INTERFACE
|
||||||
|
@ -955,10 +922,8 @@ xf86RandR12SetRotations (ScreenPtr pScreen, Rotation rotations)
|
||||||
xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn);
|
xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if XORG_VERSION_CURRENT < XORG_VERSION_NUMERIC(7,0,0,0,0)
|
|
||||||
if (xf86RandR12Key == NULL)
|
if (xf86RandR12Key == NULL)
|
||||||
return;
|
return;
|
||||||
#endif
|
|
||||||
|
|
||||||
randrp = XF86RANDRINFO(pScreen);
|
randrp = XF86RANDRINFO(pScreen);
|
||||||
#if RANDR_12_INTERFACE
|
#if RANDR_12_INTERFACE
|
||||||
|
@ -981,10 +946,8 @@ xf86RandR12SetTransformSupport (ScreenPtr pScreen, Bool transforms)
|
||||||
xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn);
|
xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if XORG_VERSION_CURRENT < XORG_VERSION_NUMERIC(7,0,0,0,0)
|
|
||||||
if (xf86RandR12Key == NULL)
|
if (xf86RandR12Key == NULL)
|
||||||
return;
|
return;
|
||||||
#endif
|
|
||||||
|
|
||||||
randrp = XF86RANDRINFO(pScreen);
|
randrp = XF86RANDRINFO(pScreen);
|
||||||
#if RANDR_13_INTERFACE
|
#if RANDR_13_INTERFACE
|
||||||
|
@ -1599,10 +1562,8 @@ xf86RandR12CreateScreenResources12 (ScreenPtr pScreen)
|
||||||
ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
|
ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
|
||||||
xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn);
|
xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn);
|
||||||
|
|
||||||
#if XORG_VERSION_CURRENT < XORG_VERSION_NUMERIC(7,0,0,0,0)
|
|
||||||
if (xf86RandR12Key == NULL)
|
if (xf86RandR12Key == NULL)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
#endif
|
|
||||||
|
|
||||||
for (c = 0; c < config->num_crtc; c++)
|
for (c = 0; c < config->num_crtc; c++)
|
||||||
xf86RandR12CrtcNotify (config->crtc[c]->randr_crtc);
|
xf86RandR12CrtcNotify (config->crtc[c]->randr_crtc);
|
||||||
|
@ -1624,13 +1585,8 @@ xf86RandR12TellChanged (ScreenPtr pScreen)
|
||||||
xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn);
|
xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn);
|
||||||
int c;
|
int c;
|
||||||
|
|
||||||
#if XORG_VERSION_CURRENT < XORG_VERSION_NUMERIC(7,0,0,0,0)
|
|
||||||
if (xf86RandR12Key == NULL)
|
if (xf86RandR12Key == NULL)
|
||||||
return;
|
return;
|
||||||
#else
|
|
||||||
if (!XF86RANDRINFO(pScreen))
|
|
||||||
return;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
xf86RandR12SetInfo12 (pScreen);
|
xf86RandR12SetInfo12 (pScreen);
|
||||||
for (c = 0; c < config->num_crtc; c++)
|
for (c = 0; c < config->num_crtc; c++)
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue