hw/xfree86: Re-indent xf86vmode.c
This is the result of re-running the 'x-indent.sh' script over xf86vmode.c to clean up the disaster caused by broken syntax in the file. Signed-off-by: Keith Packard <keithp@keithp.com>
This commit is contained in:
parent
592bd0ae2b
commit
9779b904c7
|
@ -75,8 +75,7 @@ static unsigned char XF86VidModeReqCode = 0;
|
|||
#ifdef XF86VIDMODE_EVENTS
|
||||
static int XF86VidModeEventBase = 0;
|
||||
|
||||
static void SXF86VidModeNotifyEvent(
|
||||
xXF86VidModeNotifyEvent * /* from */ , xXF86VidModeNotifyEvent * /* to */
|
||||
static void SXF86VidModeNotifyEvent(xXF86VidModeNotifyEvent * /* from */ , xXF86VidModeNotifyEvent * /* to */
|
||||
);
|
||||
|
||||
static RESTYPE EventType; /* resource type for event masks */
|
||||
|
@ -117,7 +116,8 @@ static DevPrivateKeyRec ScreenPrivateKeyRec;
|
|||
#define DEBUG_P(x) /**/
|
||||
#endif
|
||||
static int
|
||||
ClientMajorVersion(ClientPtr client) {
|
||||
ClientMajorVersion(ClientPtr client)
|
||||
{
|
||||
VidModePrivPtr pPriv;
|
||||
|
||||
pPriv = VM_GETPRIV(client);
|
||||
|
@ -126,9 +126,10 @@ static DevPrivateKeyRec ScreenPrivateKeyRec;
|
|||
else
|
||||
return pPriv->major;
|
||||
}
|
||||
|
||||
#ifdef XF86VIDMODE_EVENTS
|
||||
static void
|
||||
CheckScreenPrivate(pScreen)
|
||||
CheckScreenPrivate(pScreen)
|
||||
ScreenPtr
|
||||
pScreen;
|
||||
{
|
||||
|
@ -142,7 +143,8 @@ ScreenPtr
|
|||
}
|
||||
}
|
||||
|
||||
static XF86VidModeScreenPrivatePtr MakeScreenPrivate(pScreen)
|
||||
static XF86VidModeScreenPrivatePtr
|
||||
MakeScreenPrivate(pScreen)
|
||||
ScreenPtr
|
||||
pScreen;
|
||||
{
|
||||
|
@ -160,7 +162,8 @@ ScreenPtr
|
|||
}
|
||||
|
||||
static unsigned long
|
||||
getEventMask(ScreenPtr pScreen, ClientPtr client) {
|
||||
getEventMask(ScreenPtr pScreen, ClientPtr client)
|
||||
{
|
||||
SetupScreen(pScreen);
|
||||
XF86VidModeEventPtr pEv;
|
||||
|
||||
|
@ -170,8 +173,11 @@ static unsigned long
|
|||
if (pEv->client == client)
|
||||
return pEv->mask;
|
||||
return 0;
|
||||
} static Bool
|
||||
setEventMask(ScreenPtr pScreen, ClientPtr client, unsigned long mask) {
|
||||
}
|
||||
|
||||
static Bool
|
||||
setEventMask(ScreenPtr pScreen, ClientPtr client, unsigned long mask)
|
||||
{
|
||||
SetupScreen(pScreen);
|
||||
XF86VidModeEventPtr pEv, *pPrev;
|
||||
|
||||
|
@ -181,7 +187,8 @@ static unsigned long
|
|||
pPriv = MakeScreenPrivate(pScreen);
|
||||
if (!pPriv)
|
||||
return FALSE;
|
||||
} for (pPrev = &pPriv->events; pEv = *pPrev; pPrev = &pEv->next)
|
||||
}
|
||||
for (pPrev = &pPriv->events; pEv = *pPrev; pPrev = &pEv->next)
|
||||
if (pEv->client == client)
|
||||
break;
|
||||
if (mask == 0) {
|
||||
|
@ -208,9 +215,11 @@ static unsigned long
|
|||
}
|
||||
|
||||
static int
|
||||
XF86VidModeFreeEvents(pointer value, XID id) {
|
||||
XF86VidModeFreeEvents(pointer value, XID id)
|
||||
{
|
||||
XF86VidModeEventPtr pOld = (XF86VidModeEventPtr) value;
|
||||
ScreenPtr pScreen = pOld->screen;
|
||||
|
||||
SetupScreen(pScreen);
|
||||
XF86VidModeEventPtr pEv, *pPrev;
|
||||
|
||||
|
@ -225,8 +234,11 @@ static int
|
|||
free(pEv);
|
||||
CheckScreenPrivate(pScreen);
|
||||
return TRUE;
|
||||
} static void
|
||||
SendXF86VidModeNotify(ScreenPtr pScreen, int state, Bool forced) {
|
||||
}
|
||||
|
||||
static void
|
||||
SendXF86VidModeNotify(ScreenPtr pScreen, int state, Bool forced)
|
||||
{
|
||||
XF86VidModeScreenPrivatePtr pPriv;
|
||||
XF86VidModeEventPtr pEv;
|
||||
unsigned long mask;
|
||||
|
@ -251,8 +263,10 @@ static int
|
|||
ev.forced = forced;
|
||||
WriteEventsToClient(pEv->client, 1, (xEvent *) &ev);
|
||||
}} static void
|
||||
SXF86VidModeNotifyEvent(xXF86VidModeNotifyEvent * from,
|
||||
xXF86VidModeNotifyEvent * to) {
|
||||
|
||||
SXF86VidModeNotifyEvent(xXF86VidModeNotifyEvent * from,
|
||||
xXF86VidModeNotifyEvent * to)
|
||||
{
|
||||
to->type = from->type;
|
||||
to->state = from->state;
|
||||
cpswaps(from->sequenceNumber, to->sequenceNumber);
|
||||
|
@ -264,7 +278,8 @@ static int
|
|||
#endif
|
||||
|
||||
static int
|
||||
ProcXF86VidModeQueryVersion(ClientPtr client) {
|
||||
ProcXF86VidModeQueryVersion(ClientPtr client)
|
||||
{
|
||||
xXF86VidModeQueryVersionReply rep;
|
||||
|
||||
DEBUG_P("XF86VidModeQueryVersion");
|
||||
|
@ -280,13 +295,14 @@ static int
|
|||
swapl(&rep.length);
|
||||
swaps(&rep.majorVersion);
|
||||
swaps(&rep.minorVersion);
|
||||
} WriteToClient(client, sizeof(xXF86VidModeQueryVersionReply),
|
||||
(char *) &rep);
|
||||
}
|
||||
WriteToClient(client, sizeof(xXF86VidModeQueryVersionReply), (char *) &rep);
|
||||
return Success;
|
||||
}
|
||||
|
||||
static int
|
||||
ProcXF86VidModeGetModeLine(ClientPtr client) {
|
||||
ProcXF86VidModeGetModeLine(ClientPtr client)
|
||||
{
|
||||
REQUEST(xXF86VidModeGetModeLineReq);
|
||||
xXF86VidModeGetModeLineReply rep;
|
||||
xXF86OldVidModeGetModeLineReply oldrep;
|
||||
|
@ -386,7 +402,8 @@ static int
|
|||
}
|
||||
|
||||
static int
|
||||
ProcXF86VidModeGetAllModeLines(ClientPtr client) {
|
||||
ProcXF86VidModeGetAllModeLines(ClientPtr client)
|
||||
{
|
||||
REQUEST(xXF86VidModeGetAllModeLinesReq);
|
||||
xXF86VidModeGetAllModeLinesReply rep;
|
||||
xXF86VidModeModeInfo mdinf;
|
||||
|
@ -425,7 +442,8 @@ static int
|
|||
swaps(&rep.sequenceNumber);
|
||||
swapl(&rep.length);
|
||||
swapl(&rep.modecount);
|
||||
} WriteToClient(client, sizeof(xXF86VidModeGetAllModeLinesReply),
|
||||
}
|
||||
WriteToClient(client, sizeof(xXF86VidModeGetAllModeLinesReply),
|
||||
(char *) &rep);
|
||||
|
||||
do {
|
||||
|
@ -492,7 +510,8 @@ static int
|
|||
&& VidModeGetModeValue(mode, VIDMODE_FLAGS) == stuff->flags )
|
||||
|
||||
static int
|
||||
ProcXF86VidModeAddModeLine(ClientPtr client) {
|
||||
ProcXF86VidModeAddModeLine(ClientPtr client)
|
||||
{
|
||||
REQUEST(xXF86VidModeAddModeLineReq);
|
||||
xXF86OldVidModeAddModeLineReq *oldstuff =
|
||||
(xXF86OldVidModeAddModeLineReq *) client->requestBuffer;
|
||||
|
@ -533,7 +552,8 @@ static int
|
|||
stuff->after_vsyncend = oldstuff->after_vsyncend;
|
||||
stuff->after_vtotal = oldstuff->after_vtotal;
|
||||
stuff->after_flags = oldstuff->after_flags;
|
||||
} if (xf86GetVerbosity() > DEFAULT_XF86VIDMODE_VERBOSITY) {
|
||||
}
|
||||
if (xf86GetVerbosity() > DEFAULT_XF86VIDMODE_VERBOSITY) {
|
||||
ErrorF("AddModeLine - scrn: %d clock: %ld\n",
|
||||
(int) stuff->screen, (unsigned long) stuff->dotclock);
|
||||
ErrorF("AddModeLine - hdsp: %d hbeg: %d hend: %d httl: %d\n",
|
||||
|
@ -654,7 +674,8 @@ static int
|
|||
}
|
||||
|
||||
static int
|
||||
ProcXF86VidModeDeleteModeLine(ClientPtr client) {
|
||||
ProcXF86VidModeDeleteModeLine(ClientPtr client)
|
||||
{
|
||||
REQUEST(xXF86VidModeDeleteModeLineReq);
|
||||
xXF86OldVidModeDeleteModeLineReq *oldstuff =
|
||||
(xXF86OldVidModeDeleteModeLineReq *) client->requestBuffer;
|
||||
|
@ -683,7 +704,8 @@ static int
|
|||
stuff->vtotal = oldstuff->vtotal;
|
||||
stuff->flags = oldstuff->flags;
|
||||
stuff->privsize = oldstuff->privsize;
|
||||
} if (xf86GetVerbosity() > DEFAULT_XF86VIDMODE_VERBOSITY) {
|
||||
}
|
||||
if (xf86GetVerbosity() > DEFAULT_XF86VIDMODE_VERBOSITY) {
|
||||
ErrorF("DeleteModeLine - scrn: %d clock: %ld\n",
|
||||
(int) stuff->screen, (unsigned long) stuff->dotclock);
|
||||
ErrorF(" hdsp: %d hbeg: %d hend: %d httl: %d\n",
|
||||
|
@ -777,7 +799,8 @@ static int
|
|||
}
|
||||
|
||||
static int
|
||||
ProcXF86VidModeModModeLine(ClientPtr client) {
|
||||
ProcXF86VidModeModModeLine(ClientPtr client)
|
||||
{
|
||||
REQUEST(xXF86VidModeModModeLineReq);
|
||||
xXF86OldVidModeModModeLineReq *oldstuff =
|
||||
(xXF86OldVidModeModModeLineReq *) client->requestBuffer;
|
||||
|
@ -805,7 +828,8 @@ static int
|
|||
stuff->vtotal = oldstuff->vtotal;
|
||||
stuff->flags = oldstuff->flags;
|
||||
stuff->privsize = oldstuff->privsize;
|
||||
} if (xf86GetVerbosity() > DEFAULT_XF86VIDMODE_VERBOSITY) {
|
||||
}
|
||||
if (xf86GetVerbosity() > DEFAULT_XF86VIDMODE_VERBOSITY) {
|
||||
ErrorF("ModModeLine - scrn: %d hdsp: %d hbeg: %d hend: %d httl: %d\n",
|
||||
(int) stuff->screen, stuff->hdisplay, stuff->hsyncstart,
|
||||
stuff->hsyncend, stuff->htotal);
|
||||
|
@ -903,7 +927,8 @@ static int
|
|||
}
|
||||
|
||||
static int
|
||||
ProcXF86VidModeValidateModeLine(ClientPtr client) {
|
||||
ProcXF86VidModeValidateModeLine(ClientPtr client)
|
||||
{
|
||||
REQUEST(xXF86VidModeValidateModeLineReq);
|
||||
xXF86OldVidModeValidateModeLineReq *oldstuff =
|
||||
(xXF86OldVidModeValidateModeLineReq *) client->requestBuffer;
|
||||
|
@ -933,7 +958,8 @@ static int
|
|||
stuff->vtotal = oldstuff->vtotal;
|
||||
stuff->flags = oldstuff->flags;
|
||||
stuff->privsize = oldstuff->privsize;
|
||||
} if (xf86GetVerbosity() > DEFAULT_XF86VIDMODE_VERBOSITY) {
|
||||
}
|
||||
if (xf86GetVerbosity() > DEFAULT_XF86VIDMODE_VERBOSITY) {
|
||||
ErrorF("ValidateModeLine - scrn: %d clock: %ld\n",
|
||||
(int) stuff->screen, (unsigned long) stuff->dotclock);
|
||||
ErrorF(" hdsp: %d hbeg: %d hend: %d httl: %d\n",
|
||||
|
@ -1022,7 +1048,8 @@ static int
|
|||
}
|
||||
|
||||
static int
|
||||
ProcXF86VidModeSwitchMode(ClientPtr client) {
|
||||
ProcXF86VidModeSwitchMode(ClientPtr client)
|
||||
{
|
||||
REQUEST(xXF86VidModeSwitchModeReq);
|
||||
|
||||
DEBUG_P("XF86VidModeSwitchMode");
|
||||
|
@ -1035,8 +1062,11 @@ static int
|
|||
VidModeZoomViewport(stuff->screen, (short) stuff->zoom);
|
||||
|
||||
return Success;
|
||||
} static int
|
||||
ProcXF86VidModeSwitchToMode(ClientPtr client) {
|
||||
}
|
||||
|
||||
static int
|
||||
ProcXF86VidModeSwitchToMode(ClientPtr client)
|
||||
{
|
||||
REQUEST(xXF86VidModeSwitchToModeReq);
|
||||
xXF86OldVidModeSwitchToModeReq *oldstuff =
|
||||
(xXF86OldVidModeSwitchToModeReq *) client->requestBuffer;
|
||||
|
@ -1065,7 +1095,8 @@ static int
|
|||
stuff->vtotal = oldstuff->vtotal;
|
||||
stuff->flags = oldstuff->flags;
|
||||
stuff->privsize = oldstuff->privsize;
|
||||
} if (xf86GetVerbosity() > DEFAULT_XF86VIDMODE_VERBOSITY) {
|
||||
}
|
||||
if (xf86GetVerbosity() > DEFAULT_XF86VIDMODE_VERBOSITY) {
|
||||
ErrorF("SwitchToMode - scrn: %d clock: %ld\n",
|
||||
(int) stuff->screen, (unsigned long) stuff->dotclock);
|
||||
ErrorF(" hdsp: %d hbeg: %d hend: %d httl: %d\n",
|
||||
|
@ -1138,7 +1169,8 @@ static int
|
|||
}
|
||||
|
||||
static int
|
||||
ProcXF86VidModeLockModeSwitch(ClientPtr client) {
|
||||
ProcXF86VidModeLockModeSwitch(ClientPtr client)
|
||||
{
|
||||
REQUEST(xXF86VidModeLockModeSwitchReq);
|
||||
|
||||
REQUEST_SIZE_MATCH(xXF86VidModeLockModeSwitchReq);
|
||||
|
@ -1152,8 +1184,11 @@ static int
|
|||
return VidModeErrorBase + XF86VidModeZoomLocked;
|
||||
|
||||
return Success;
|
||||
} static int
|
||||
ProcXF86VidModeGetMonitor(ClientPtr client) {
|
||||
}
|
||||
|
||||
static int
|
||||
ProcXF86VidModeGetMonitor(ClientPtr client)
|
||||
{
|
||||
REQUEST(xXF86VidModeGetMonitorReq);
|
||||
xXF86VidModeGetMonitorReply rep;
|
||||
CARD32 *hsyncdata, *vsyncdata;
|
||||
|
@ -1198,7 +1233,8 @@ static int
|
|||
hsyncdata = malloc(nHsync * sizeof(CARD32));
|
||||
if (!hsyncdata) {
|
||||
return BadAlloc;
|
||||
} vsyncdata = malloc(nVrefresh * sizeof(CARD32));
|
||||
}
|
||||
vsyncdata = malloc(nVrefresh * sizeof(CARD32));
|
||||
|
||||
if (!vsyncdata) {
|
||||
free(hsyncdata);
|
||||
|
@ -1208,18 +1244,17 @@ static int
|
|||
for (i = 0; i < nHsync; i++) {
|
||||
hsyncdata[i] = (unsigned short) (VidModeGetMonitorValue(monitor,
|
||||
VIDMODE_MON_HSYNC_LO,
|
||||
i)).
|
||||
f | (unsigned
|
||||
i)).f |
|
||||
(unsigned
|
||||
short) (VidModeGetMonitorValue(monitor, VIDMODE_MON_HSYNC_HI,
|
||||
i)).f << 16;
|
||||
}
|
||||
for (i = 0; i < nVrefresh; i++) {
|
||||
vsyncdata[i] = (unsigned short) (VidModeGetMonitorValue(monitor,
|
||||
VIDMODE_MON_VREFRESH_LO,
|
||||
i)).
|
||||
f | (unsigned
|
||||
short) (VidModeGetMonitorValue(monitor,
|
||||
VIDMODE_MON_VREFRESH_HI,
|
||||
i)).f |
|
||||
(unsigned
|
||||
short) (VidModeGetMonitorValue(monitor, VIDMODE_MON_VREFRESH_HI,
|
||||
i)).f << 16;
|
||||
}
|
||||
|
||||
|
@ -1249,7 +1284,8 @@ static int
|
|||
}
|
||||
|
||||
static int
|
||||
ProcXF86VidModeGetViewPort(ClientPtr client) {
|
||||
ProcXF86VidModeGetViewPort(ClientPtr client)
|
||||
{
|
||||
REQUEST(xXF86VidModeGetViewPortReq);
|
||||
xXF86VidModeGetViewPortReply rep;
|
||||
int x, y;
|
||||
|
@ -1274,13 +1310,14 @@ static int
|
|||
swapl(&rep.length);
|
||||
swapl(&rep.x);
|
||||
swapl(&rep.y);
|
||||
} WriteToClient(client, SIZEOF(xXF86VidModeGetViewPortReply),
|
||||
(char *) &rep);
|
||||
}
|
||||
WriteToClient(client, SIZEOF(xXF86VidModeGetViewPortReply), (char *) &rep);
|
||||
return Success;
|
||||
}
|
||||
|
||||
static int
|
||||
ProcXF86VidModeSetViewPort(ClientPtr client) {
|
||||
ProcXF86VidModeSetViewPort(ClientPtr client)
|
||||
{
|
||||
REQUEST(xXF86VidModeSetViewPortReq);
|
||||
|
||||
DEBUG_P("XF86VidModeSetViewPort");
|
||||
|
@ -1294,8 +1331,11 @@ static int
|
|||
return BadValue;
|
||||
|
||||
return Success;
|
||||
} static int
|
||||
ProcXF86VidModeGetDotClocks(ClientPtr client) {
|
||||
}
|
||||
|
||||
static int
|
||||
ProcXF86VidModeGetDotClocks(ClientPtr client)
|
||||
{
|
||||
REQUEST(xXF86VidModeGetDotClocksReq);
|
||||
xXF86VidModeGetDotClocksReply rep;
|
||||
int n;
|
||||
|
@ -1328,7 +1368,9 @@ static int
|
|||
if (!VidModeGetClocks(stuff->screen, Clocks)) {
|
||||
free(Clocks);
|
||||
return BadValue;
|
||||
}} if (ClockProg) {
|
||||
}
|
||||
}
|
||||
if (ClockProg) {
|
||||
rep.flags |= CLKFLAG_PROGRAMABLE;
|
||||
}
|
||||
if (client->swapped) {
|
||||
|
@ -1356,7 +1398,8 @@ static int
|
|||
}
|
||||
|
||||
static int
|
||||
ProcXF86VidModeSetGamma(ClientPtr client) {
|
||||
ProcXF86VidModeSetGamma(ClientPtr client)
|
||||
{
|
||||
REQUEST(xXF86VidModeSetGammaReq);
|
||||
|
||||
DEBUG_P("XF86VidModeSetGamma");
|
||||
|
@ -1372,8 +1415,11 @@ static int
|
|||
return BadValue;
|
||||
|
||||
return Success;
|
||||
} static int
|
||||
ProcXF86VidModeGetGamma(ClientPtr client) {
|
||||
}
|
||||
|
||||
static int
|
||||
ProcXF86VidModeGetGamma(ClientPtr client)
|
||||
{
|
||||
REQUEST(xXF86VidModeGetGammaReq);
|
||||
xXF86VidModeGetGammaReply rep;
|
||||
float red, green, blue;
|
||||
|
@ -1399,15 +1445,18 @@ static int
|
|||
swapl(&rep.red);
|
||||
swapl(&rep.green);
|
||||
swapl(&rep.blue);
|
||||
} WriteToClient(client, sizeof(xXF86VidModeGetGammaReply), (char *) &rep);
|
||||
}
|
||||
WriteToClient(client, sizeof(xXF86VidModeGetGammaReply), (char *) &rep);
|
||||
|
||||
return Success;
|
||||
}
|
||||
|
||||
static int
|
||||
ProcXF86VidModeSetGammaRamp(ClientPtr client) {
|
||||
ProcXF86VidModeSetGammaRamp(ClientPtr client)
|
||||
{
|
||||
CARD16 *r, *g, *b;
|
||||
int length;
|
||||
|
||||
REQUEST(xXF86VidModeSetGammaRampReq);
|
||||
|
||||
if (stuff->screen >= screenInfo.numScreens)
|
||||
|
@ -1428,12 +1477,16 @@ static int
|
|||
return BadValue;
|
||||
|
||||
return Success;
|
||||
} static int
|
||||
ProcXF86VidModeGetGammaRamp(ClientPtr client) {
|
||||
}
|
||||
|
||||
static int
|
||||
ProcXF86VidModeGetGammaRamp(ClientPtr client)
|
||||
{
|
||||
CARD16 *ramp = NULL;
|
||||
int length;
|
||||
size_t ramplen = 0;
|
||||
xXF86VidModeGetGammaRampReply rep;
|
||||
|
||||
REQUEST(xXF86VidModeGetGammaRampReq);
|
||||
|
||||
if (stuff->screen >= screenInfo.numScreens)
|
||||
|
@ -1455,7 +1508,9 @@ static int
|
|||
ramp, ramp + length, ramp + (length * 2))) {
|
||||
free(ramp);
|
||||
return BadValue;
|
||||
}} rep.type = X_Reply;
|
||||
}
|
||||
}
|
||||
rep.type = X_Reply;
|
||||
rep.length = (length >> 1) * 3;
|
||||
rep.sequenceNumber = client->sequence;
|
||||
rep.size = stuff->size;
|
||||
|
@ -1476,8 +1531,10 @@ static int
|
|||
}
|
||||
|
||||
static int
|
||||
ProcXF86VidModeGetGammaRampSize(ClientPtr client) {
|
||||
ProcXF86VidModeGetGammaRampSize(ClientPtr client)
|
||||
{
|
||||
xXF86VidModeGetGammaRampSizeReply rep;
|
||||
|
||||
REQUEST(xXF86VidModeGetGammaRampSizeReq);
|
||||
|
||||
if (stuff->screen >= screenInfo.numScreens)
|
||||
|
@ -1493,15 +1550,18 @@ static int
|
|||
swaps(&rep.sequenceNumber);
|
||||
swapl(&rep.length);
|
||||
swaps(&rep.size);
|
||||
} WriteToClient(client, sizeof(xXF86VidModeGetGammaRampSizeReply),
|
||||
}
|
||||
WriteToClient(client, sizeof(xXF86VidModeGetGammaRampSizeReply),
|
||||
(char *) &rep);
|
||||
|
||||
return Success;
|
||||
}
|
||||
|
||||
static int
|
||||
ProcXF86VidModeGetPermissions(ClientPtr client) {
|
||||
ProcXF86VidModeGetPermissions(ClientPtr client)
|
||||
{
|
||||
xXF86VidModeGetPermissionsReply rep;
|
||||
|
||||
REQUEST(xXF86VidModeGetPermissionsReq);
|
||||
|
||||
if (stuff->screen >= screenInfo.numScreens)
|
||||
|
@ -1516,7 +1576,8 @@ static int
|
|||
if (xf86GetVidModeEnabled() &&
|
||||
(xf86GetVidModeAllowNonLocal() || LocalClient(client))) {
|
||||
rep.permissions |= XF86VM_WRITE_PERMISSION;
|
||||
} if (client->swapped) {
|
||||
}
|
||||
if (client->swapped) {
|
||||
swaps(&rep.sequenceNumber);
|
||||
swapl(&rep.length);
|
||||
swapl(&rep.permissions);
|
||||
|
@ -1528,7 +1589,8 @@ static int
|
|||
}
|
||||
|
||||
static int
|
||||
ProcXF86VidModeSetClientVersion(ClientPtr client) {
|
||||
ProcXF86VidModeSetClientVersion(ClientPtr client)
|
||||
{
|
||||
REQUEST(xXF86VidModeSetClientVersionReq);
|
||||
|
||||
VidModePrivPtr pPriv;
|
||||
|
@ -1542,7 +1604,8 @@ static int
|
|||
if (!pPriv)
|
||||
return BadAlloc;
|
||||
VM_SETPRIV(client, pPriv);
|
||||
} pPriv->major = stuff->major;
|
||||
}
|
||||
pPriv->major = stuff->major;
|
||||
|
||||
pPriv->minor = stuff->minor;
|
||||
|
||||
|
@ -1550,79 +1613,97 @@ static int
|
|||
}
|
||||
|
||||
static int
|
||||
ProcXF86VidModeDispatch(ClientPtr client) {
|
||||
ProcXF86VidModeDispatch(ClientPtr client)
|
||||
{
|
||||
REQUEST(xReq);
|
||||
switch (stuff->data) {
|
||||
case X_XF86VidModeQueryVersion:
|
||||
return ProcXF86VidModeQueryVersion(client);
|
||||
case X_XF86VidModeGetModeLine:return ProcXF86VidModeGetModeLine(client);
|
||||
case X_XF86VidModeGetMonitor:return ProcXF86VidModeGetMonitor(client);
|
||||
case X_XF86VidModeGetAllModeLines:return
|
||||
ProcXF86VidModeGetAllModeLines(client);
|
||||
case X_XF86VidModeValidateModeLine:return
|
||||
ProcXF86VidModeValidateModeLine(client);
|
||||
case X_XF86VidModeGetViewPort:return ProcXF86VidModeGetViewPort(client);
|
||||
case X_XF86VidModeGetDotClocks:return
|
||||
ProcXF86VidModeGetDotClocks(client);
|
||||
case X_XF86VidModeSetClientVersion:return
|
||||
ProcXF86VidModeSetClientVersion(client);
|
||||
case X_XF86VidModeGetGamma:return ProcXF86VidModeGetGamma(client);
|
||||
case X_XF86VidModeGetGammaRamp:return
|
||||
ProcXF86VidModeGetGammaRamp(client);
|
||||
case X_XF86VidModeGetGammaRampSize:return
|
||||
ProcXF86VidModeGetGammaRampSize(client);
|
||||
case X_XF86VidModeGetPermissions:return
|
||||
ProcXF86VidModeGetPermissions(client);
|
||||
default:if (!xf86GetVidModeEnabled())
|
||||
case X_XF86VidModeGetModeLine:
|
||||
return ProcXF86VidModeGetModeLine(client);
|
||||
case X_XF86VidModeGetMonitor:
|
||||
return ProcXF86VidModeGetMonitor(client);
|
||||
case X_XF86VidModeGetAllModeLines:
|
||||
return ProcXF86VidModeGetAllModeLines(client);
|
||||
case X_XF86VidModeValidateModeLine:
|
||||
return ProcXF86VidModeValidateModeLine(client);
|
||||
case X_XF86VidModeGetViewPort:
|
||||
return ProcXF86VidModeGetViewPort(client);
|
||||
case X_XF86VidModeGetDotClocks:
|
||||
return ProcXF86VidModeGetDotClocks(client);
|
||||
case X_XF86VidModeSetClientVersion:
|
||||
return ProcXF86VidModeSetClientVersion(client);
|
||||
case X_XF86VidModeGetGamma:
|
||||
return ProcXF86VidModeGetGamma(client);
|
||||
case X_XF86VidModeGetGammaRamp:
|
||||
return ProcXF86VidModeGetGammaRamp(client);
|
||||
case X_XF86VidModeGetGammaRampSize:
|
||||
return ProcXF86VidModeGetGammaRampSize(client);
|
||||
case X_XF86VidModeGetPermissions:
|
||||
return ProcXF86VidModeGetPermissions(client);
|
||||
default:
|
||||
if (!xf86GetVidModeEnabled())
|
||||
return VidModeErrorBase + XF86VidModeExtensionDisabled;
|
||||
if (xf86GetVidModeAllowNonLocal() || LocalClient(client)) {
|
||||
switch (stuff->data) {
|
||||
case X_XF86VidModeAddModeLine:
|
||||
return ProcXF86VidModeAddModeLine(client);
|
||||
case X_XF86VidModeDeleteModeLine:return
|
||||
ProcXF86VidModeDeleteModeLine(client);
|
||||
case X_XF86VidModeModModeLine:return
|
||||
ProcXF86VidModeModModeLine(client);
|
||||
case X_XF86VidModeSwitchMode:return
|
||||
ProcXF86VidModeSwitchMode(client);
|
||||
case X_XF86VidModeSwitchToMode:return
|
||||
ProcXF86VidModeSwitchToMode(client);
|
||||
case X_XF86VidModeLockModeSwitch:return
|
||||
ProcXF86VidModeLockModeSwitch(client);
|
||||
case X_XF86VidModeSetViewPort:return
|
||||
ProcXF86VidModeSetViewPort(client);
|
||||
case X_XF86VidModeSetGamma:return
|
||||
ProcXF86VidModeSetGamma(client);
|
||||
case X_XF86VidModeSetGammaRamp:return
|
||||
ProcXF86VidModeSetGammaRamp(client);
|
||||
default:return BadRequest;
|
||||
}}
|
||||
case X_XF86VidModeDeleteModeLine:
|
||||
return ProcXF86VidModeDeleteModeLine(client);
|
||||
case X_XF86VidModeModModeLine:
|
||||
return ProcXF86VidModeModModeLine(client);
|
||||
case X_XF86VidModeSwitchMode:
|
||||
return ProcXF86VidModeSwitchMode(client);
|
||||
case X_XF86VidModeSwitchToMode:
|
||||
return ProcXF86VidModeSwitchToMode(client);
|
||||
case X_XF86VidModeLockModeSwitch:
|
||||
return ProcXF86VidModeLockModeSwitch(client);
|
||||
case X_XF86VidModeSetViewPort:
|
||||
return ProcXF86VidModeSetViewPort(client);
|
||||
case X_XF86VidModeSetGamma:
|
||||
return ProcXF86VidModeSetGamma(client);
|
||||
case X_XF86VidModeSetGammaRamp:
|
||||
return ProcXF86VidModeSetGammaRamp(client);
|
||||
default:
|
||||
return BadRequest;
|
||||
}
|
||||
}
|
||||
else
|
||||
return VidModeErrorBase + XF86VidModeClientNotLocal;
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
SProcXF86VidModeQueryVersion(ClientPtr client) {
|
||||
SProcXF86VidModeQueryVersion(ClientPtr client)
|
||||
{
|
||||
REQUEST(xXF86VidModeQueryVersionReq);
|
||||
swaps(&stuff->length);
|
||||
return ProcXF86VidModeQueryVersion(client);
|
||||
} static int
|
||||
SProcXF86VidModeGetModeLine(ClientPtr client) {
|
||||
}
|
||||
|
||||
static int
|
||||
SProcXF86VidModeGetModeLine(ClientPtr client)
|
||||
{
|
||||
REQUEST(xXF86VidModeGetModeLineReq);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xXF86VidModeGetModeLineReq);
|
||||
swaps(&stuff->screen);
|
||||
return ProcXF86VidModeGetModeLine(client);
|
||||
} static int
|
||||
SProcXF86VidModeGetAllModeLines(ClientPtr client) {
|
||||
}
|
||||
|
||||
static int
|
||||
SProcXF86VidModeGetAllModeLines(ClientPtr client)
|
||||
{
|
||||
REQUEST(xXF86VidModeGetAllModeLinesReq);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xXF86VidModeGetAllModeLinesReq);
|
||||
swaps(&stuff->screen);
|
||||
return ProcXF86VidModeGetAllModeLines(client);
|
||||
} static int
|
||||
SProcXF86VidModeAddModeLine(ClientPtr client) {
|
||||
}
|
||||
|
||||
static int
|
||||
SProcXF86VidModeAddModeLine(ClientPtr client)
|
||||
{
|
||||
xXF86OldVidModeAddModeLineReq *oldstuff =
|
||||
(xXF86OldVidModeAddModeLineReq *) client->requestBuffer;
|
||||
int ver;
|
||||
|
@ -1666,7 +1747,8 @@ static int
|
|||
}
|
||||
|
||||
static int
|
||||
SProcXF86VidModeDeleteModeLine(ClientPtr client) {
|
||||
SProcXF86VidModeDeleteModeLine(ClientPtr client)
|
||||
{
|
||||
xXF86OldVidModeDeleteModeLineReq *oldstuff =
|
||||
(xXF86OldVidModeDeleteModeLineReq *) client->requestBuffer;
|
||||
int ver;
|
||||
|
@ -1710,7 +1792,8 @@ static int
|
|||
}
|
||||
|
||||
static int
|
||||
SProcXF86VidModeModModeLine(ClientPtr client) {
|
||||
SProcXF86VidModeModModeLine(ClientPtr client)
|
||||
{
|
||||
xXF86OldVidModeModModeLineReq *oldstuff =
|
||||
(xXF86OldVidModeModModeLineReq *) client->requestBuffer;
|
||||
int ver;
|
||||
|
@ -1754,7 +1837,8 @@ static int
|
|||
}
|
||||
|
||||
static int
|
||||
SProcXF86VidModeValidateModeLine(ClientPtr client) {
|
||||
SProcXF86VidModeValidateModeLine(ClientPtr client)
|
||||
{
|
||||
xXF86OldVidModeValidateModeLineReq *oldstuff =
|
||||
(xXF86OldVidModeValidateModeLineReq *) client->requestBuffer;
|
||||
int ver;
|
||||
|
@ -1798,44 +1882,60 @@ static int
|
|||
}
|
||||
|
||||
static int
|
||||
SProcXF86VidModeSwitchMode(ClientPtr client) {
|
||||
SProcXF86VidModeSwitchMode(ClientPtr client)
|
||||
{
|
||||
REQUEST(xXF86VidModeSwitchModeReq);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xXF86VidModeSwitchModeReq);
|
||||
swaps(&stuff->screen);
|
||||
swaps(&stuff->zoom);
|
||||
return ProcXF86VidModeSwitchMode(client);
|
||||
} static int
|
||||
SProcXF86VidModeSwitchToMode(ClientPtr client) {
|
||||
}
|
||||
|
||||
static int
|
||||
SProcXF86VidModeSwitchToMode(ClientPtr client)
|
||||
{
|
||||
REQUEST(xXF86VidModeSwitchToModeReq);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xXF86VidModeSwitchToModeReq);
|
||||
swapl(&stuff->screen);
|
||||
return ProcXF86VidModeSwitchToMode(client);
|
||||
} static int
|
||||
SProcXF86VidModeLockModeSwitch(ClientPtr client) {
|
||||
}
|
||||
|
||||
static int
|
||||
SProcXF86VidModeLockModeSwitch(ClientPtr client)
|
||||
{
|
||||
REQUEST(xXF86VidModeLockModeSwitchReq);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xXF86VidModeLockModeSwitchReq);
|
||||
swaps(&stuff->screen);
|
||||
swaps(&stuff->lock);
|
||||
return ProcXF86VidModeLockModeSwitch(client);
|
||||
} static int
|
||||
SProcXF86VidModeGetMonitor(ClientPtr client) {
|
||||
}
|
||||
|
||||
static int
|
||||
SProcXF86VidModeGetMonitor(ClientPtr client)
|
||||
{
|
||||
REQUEST(xXF86VidModeGetMonitorReq);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xXF86VidModeGetMonitorReq);
|
||||
swaps(&stuff->screen);
|
||||
return ProcXF86VidModeGetMonitor(client);
|
||||
} static int
|
||||
SProcXF86VidModeGetViewPort(ClientPtr client) {
|
||||
}
|
||||
|
||||
static int
|
||||
SProcXF86VidModeGetViewPort(ClientPtr client)
|
||||
{
|
||||
REQUEST(xXF86VidModeGetViewPortReq);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xXF86VidModeGetViewPortReq);
|
||||
swaps(&stuff->screen);
|
||||
return ProcXF86VidModeGetViewPort(client);
|
||||
} static int
|
||||
SProcXF86VidModeSetViewPort(ClientPtr client) {
|
||||
}
|
||||
|
||||
static int
|
||||
SProcXF86VidModeSetViewPort(ClientPtr client)
|
||||
{
|
||||
REQUEST(xXF86VidModeSetViewPortReq);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xXF86VidModeSetViewPortReq);
|
||||
|
@ -1843,23 +1943,32 @@ static int
|
|||
swapl(&stuff->x);
|
||||
swapl(&stuff->y);
|
||||
return ProcXF86VidModeSetViewPort(client);
|
||||
} static int
|
||||
SProcXF86VidModeGetDotClocks(ClientPtr client) {
|
||||
}
|
||||
|
||||
static int
|
||||
SProcXF86VidModeGetDotClocks(ClientPtr client)
|
||||
{
|
||||
REQUEST(xXF86VidModeGetDotClocksReq);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xXF86VidModeGetDotClocksReq);
|
||||
swaps(&stuff->screen);
|
||||
return ProcXF86VidModeGetDotClocks(client);
|
||||
} static int
|
||||
SProcXF86VidModeSetClientVersion(ClientPtr client) {
|
||||
}
|
||||
|
||||
static int
|
||||
SProcXF86VidModeSetClientVersion(ClientPtr client)
|
||||
{
|
||||
REQUEST(xXF86VidModeSetClientVersionReq);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xXF86VidModeSetClientVersionReq);
|
||||
swaps(&stuff->major);
|
||||
swaps(&stuff->minor);
|
||||
return ProcXF86VidModeSetClientVersion(client);
|
||||
} static int
|
||||
SProcXF86VidModeSetGamma(ClientPtr client) {
|
||||
}
|
||||
|
||||
static int
|
||||
SProcXF86VidModeSetGamma(ClientPtr client)
|
||||
{
|
||||
REQUEST(xXF86VidModeSetGammaReq);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xXF86VidModeSetGammaReq);
|
||||
|
@ -1868,16 +1977,23 @@ static int
|
|||
swapl(&stuff->green);
|
||||
swapl(&stuff->blue);
|
||||
return ProcXF86VidModeSetGamma(client);
|
||||
} static int
|
||||
SProcXF86VidModeGetGamma(ClientPtr client) {
|
||||
}
|
||||
|
||||
static int
|
||||
SProcXF86VidModeGetGamma(ClientPtr client)
|
||||
{
|
||||
REQUEST(xXF86VidModeGetGammaReq);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xXF86VidModeGetGammaReq);
|
||||
swaps(&stuff->screen);
|
||||
return ProcXF86VidModeGetGamma(client);
|
||||
} static int
|
||||
SProcXF86VidModeSetGammaRamp(ClientPtr client) {
|
||||
}
|
||||
|
||||
static int
|
||||
SProcXF86VidModeSetGammaRamp(ClientPtr client)
|
||||
{
|
||||
int length;
|
||||
|
||||
REQUEST(xXF86VidModeSetGammaRampReq);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_AT_LEAST_SIZE(xXF86VidModeSetGammaRampReq);
|
||||
|
@ -1887,85 +2003,103 @@ static int
|
|||
REQUEST_FIXED_SIZE(xXF86VidModeSetGammaRampReq, length);
|
||||
SwapRestS(stuff);
|
||||
return ProcXF86VidModeSetGammaRamp(client);
|
||||
} static int
|
||||
SProcXF86VidModeGetGammaRamp(ClientPtr client) {
|
||||
}
|
||||
|
||||
static int
|
||||
SProcXF86VidModeGetGammaRamp(ClientPtr client)
|
||||
{
|
||||
REQUEST(xXF86VidModeGetGammaRampReq);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xXF86VidModeGetGammaRampReq);
|
||||
swaps(&stuff->size);
|
||||
swaps(&stuff->screen);
|
||||
return ProcXF86VidModeGetGammaRamp(client);
|
||||
} static int
|
||||
SProcXF86VidModeGetGammaRampSize(ClientPtr client) {
|
||||
}
|
||||
|
||||
static int
|
||||
SProcXF86VidModeGetGammaRampSize(ClientPtr client)
|
||||
{
|
||||
REQUEST(xXF86VidModeGetGammaRampSizeReq);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xXF86VidModeGetGammaRampSizeReq);
|
||||
swaps(&stuff->screen);
|
||||
return ProcXF86VidModeGetGammaRampSize(client);
|
||||
} static int
|
||||
SProcXF86VidModeGetPermissions(ClientPtr client) {
|
||||
}
|
||||
|
||||
static int
|
||||
SProcXF86VidModeGetPermissions(ClientPtr client)
|
||||
{
|
||||
REQUEST(xXF86VidModeGetPermissionsReq);
|
||||
swaps(&stuff->length);
|
||||
REQUEST_SIZE_MATCH(xXF86VidModeGetPermissionsReq);
|
||||
swaps(&stuff->screen);
|
||||
return ProcXF86VidModeGetPermissions(client);
|
||||
} static int
|
||||
SProcXF86VidModeDispatch(ClientPtr client) {
|
||||
}
|
||||
|
||||
static int
|
||||
SProcXF86VidModeDispatch(ClientPtr client)
|
||||
{
|
||||
REQUEST(xReq);
|
||||
switch (stuff->data) {
|
||||
case X_XF86VidModeQueryVersion:
|
||||
return SProcXF86VidModeQueryVersion(client);
|
||||
case X_XF86VidModeGetModeLine:return
|
||||
SProcXF86VidModeGetModeLine(client);
|
||||
case X_XF86VidModeGetMonitor:return SProcXF86VidModeGetMonitor(client);
|
||||
case X_XF86VidModeGetAllModeLines:return
|
||||
SProcXF86VidModeGetAllModeLines(client);
|
||||
case X_XF86VidModeGetViewPort:return
|
||||
SProcXF86VidModeGetViewPort(client);
|
||||
case X_XF86VidModeValidateModeLine:return
|
||||
SProcXF86VidModeValidateModeLine(client);
|
||||
case X_XF86VidModeGetDotClocks:return
|
||||
SProcXF86VidModeGetDotClocks(client);
|
||||
case X_XF86VidModeSetClientVersion:return
|
||||
SProcXF86VidModeSetClientVersion(client);
|
||||
case X_XF86VidModeGetGamma:return SProcXF86VidModeGetGamma(client);
|
||||
case X_XF86VidModeGetGammaRamp:return
|
||||
SProcXF86VidModeGetGammaRamp(client);
|
||||
case X_XF86VidModeGetGammaRampSize:return
|
||||
SProcXF86VidModeGetGammaRampSize(client);
|
||||
case X_XF86VidModeGetPermissions:return
|
||||
SProcXF86VidModeGetPermissions(client);
|
||||
default:if (!xf86GetVidModeEnabled())
|
||||
case X_XF86VidModeGetModeLine:
|
||||
return SProcXF86VidModeGetModeLine(client);
|
||||
case X_XF86VidModeGetMonitor:
|
||||
return SProcXF86VidModeGetMonitor(client);
|
||||
case X_XF86VidModeGetAllModeLines:
|
||||
return SProcXF86VidModeGetAllModeLines(client);
|
||||
case X_XF86VidModeGetViewPort:
|
||||
return SProcXF86VidModeGetViewPort(client);
|
||||
case X_XF86VidModeValidateModeLine:
|
||||
return SProcXF86VidModeValidateModeLine(client);
|
||||
case X_XF86VidModeGetDotClocks:
|
||||
return SProcXF86VidModeGetDotClocks(client);
|
||||
case X_XF86VidModeSetClientVersion:
|
||||
return SProcXF86VidModeSetClientVersion(client);
|
||||
case X_XF86VidModeGetGamma:
|
||||
return SProcXF86VidModeGetGamma(client);
|
||||
case X_XF86VidModeGetGammaRamp:
|
||||
return SProcXF86VidModeGetGammaRamp(client);
|
||||
case X_XF86VidModeGetGammaRampSize:
|
||||
return SProcXF86VidModeGetGammaRampSize(client);
|
||||
case X_XF86VidModeGetPermissions:
|
||||
return SProcXF86VidModeGetPermissions(client);
|
||||
default:
|
||||
if (!xf86GetVidModeEnabled())
|
||||
return VidModeErrorBase + XF86VidModeExtensionDisabled;
|
||||
if (xf86GetVidModeAllowNonLocal() || LocalClient(client)) {
|
||||
switch (stuff->data) {
|
||||
case X_XF86VidModeAddModeLine:
|
||||
return SProcXF86VidModeAddModeLine(client);
|
||||
case X_XF86VidModeDeleteModeLine:return
|
||||
SProcXF86VidModeDeleteModeLine(client);
|
||||
case X_XF86VidModeModModeLine:return
|
||||
SProcXF86VidModeModModeLine(client);
|
||||
case X_XF86VidModeSwitchMode:return
|
||||
SProcXF86VidModeSwitchMode(client);
|
||||
case X_XF86VidModeSwitchToMode:return
|
||||
SProcXF86VidModeSwitchToMode(client);
|
||||
case X_XF86VidModeLockModeSwitch:return
|
||||
SProcXF86VidModeLockModeSwitch(client);
|
||||
case X_XF86VidModeSetViewPort:return
|
||||
SProcXF86VidModeSetViewPort(client);
|
||||
case X_XF86VidModeSetGamma:return
|
||||
SProcXF86VidModeSetGamma(client);
|
||||
case X_XF86VidModeSetGammaRamp:return
|
||||
SProcXF86VidModeSetGammaRamp(client);
|
||||
default:return BadRequest;
|
||||
}}
|
||||
case X_XF86VidModeDeleteModeLine:
|
||||
return SProcXF86VidModeDeleteModeLine(client);
|
||||
case X_XF86VidModeModModeLine:
|
||||
return SProcXF86VidModeModModeLine(client);
|
||||
case X_XF86VidModeSwitchMode:
|
||||
return SProcXF86VidModeSwitchMode(client);
|
||||
case X_XF86VidModeSwitchToMode:
|
||||
return SProcXF86VidModeSwitchToMode(client);
|
||||
case X_XF86VidModeLockModeSwitch:
|
||||
return SProcXF86VidModeLockModeSwitch(client);
|
||||
case X_XF86VidModeSetViewPort:
|
||||
return SProcXF86VidModeSetViewPort(client);
|
||||
case X_XF86VidModeSetGamma:
|
||||
return SProcXF86VidModeSetGamma(client);
|
||||
case X_XF86VidModeSetGammaRamp:
|
||||
return SProcXF86VidModeSetGammaRamp(client);
|
||||
default:
|
||||
return BadRequest;
|
||||
}
|
||||
}
|
||||
else
|
||||
return VidModeErrorBase + XF86VidModeClientNotLocal;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
XFree86VidModeExtensionInit(void) {
|
||||
XFree86VidModeExtensionInit(void)
|
||||
{
|
||||
ExtensionEntry *extEntry;
|
||||
ScreenPtr pScreen;
|
||||
int i;
|
||||
|
|
Loading…
Reference in New Issue
Block a user