diff options
author | marha <marha@users.sourceforge.net> | 2009-07-25 20:12:58 +0000 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2009-07-25 20:12:58 +0000 |
commit | 2553bdd7c359cd87525d367761c86932cec5adff (patch) | |
tree | ae71245933c98474a699d3e392de5820879b2018 /xorg-server/hw/xfree86/dixmods/extmod/xf86vmode.c | |
parent | e2c51f2ee7b0a3ea1a052fc49324057b4a4bbc78 (diff) | |
parent | 4a3dbb926ae3f5410198d7cc4f4ebe4f62eebf05 (diff) | |
download | vcxsrv-2553bdd7c359cd87525d367761c86932cec5adff.tar.gz vcxsrv-2553bdd7c359cd87525d367761c86932cec5adff.tar.bz2 vcxsrv-2553bdd7c359cd87525d367761c86932cec5adff.zip |
svn merge file:///D:/svnrepos/vcxsrv/branches/released .
Diffstat (limited to 'xorg-server/hw/xfree86/dixmods/extmod/xf86vmode.c')
-rw-r--r-- | xorg-server/hw/xfree86/dixmods/extmod/xf86vmode.c | 40 |
1 files changed, 13 insertions, 27 deletions
diff --git a/xorg-server/hw/xfree86/dixmods/extmod/xf86vmode.c b/xorg-server/hw/xfree86/dixmods/extmod/xf86vmode.c index 718d40fbd..aecaf94ff 100644 --- a/xorg-server/hw/xfree86/dixmods/extmod/xf86vmode.c +++ b/xorg-server/hw/xfree86/dixmods/extmod/xf86vmode.c @@ -48,11 +48,13 @@ from Kaleb S. KEITHLEY #include "swaprep.h" #include "xf86.h" #include "vidmodeproc.h" +#include "globals.h" #define DEFAULT_XF86VIDMODE_VERBOSITY 3 static int VidModeErrorBase; -static DevPrivateKey VidModeClientPrivateKey = &VidModeClientPrivateKey; +static int VidModeClientPrivateKeyIndex; +static DevPrivateKey VidModeClientPrivateKey = &VidModeClientPrivateKeyIndex; /* This holds the client's version information */ typedef struct { @@ -65,10 +67,6 @@ typedef struct { #define VM_SETPRIV(c,p) \ dixSetPrivate(&(c)->devPrivates, VidModeClientPrivateKey, p) -static void XF86VidModeResetProc( - ExtensionEntry* /* extEntry */ -); - static DISPATCH_PROC(ProcXF86VidModeDispatch); static DISPATCH_PROC(ProcXF86VidModeGetAllModeLines); static DISPATCH_PROC(ProcXF86VidModeGetModeLine); @@ -126,8 +124,6 @@ static void SXF86VidModeNotifyEvent(); xXF86VidModeNotifyEvent * /* to */ ); -extern WindowPtr *WindowTable; - static RESTYPE EventType; /* resource type for event masks */ typedef struct _XF86VidModeEvent *XF86VidModeEventPtr; @@ -146,8 +142,9 @@ typedef struct _XF86VidModeScreenPrivate { XF86VidModeEventPtr events; Bool hasWindow; } XF86VidModeScreenPrivateRec, *XF86VidModeScreenPrivatePtr; - -static DevPrivateKey ScreenPrivateKey = &ScreenPrivateKey; + +static int ScreenPrivateKeyIndex; +static DevPrivateKey ScreenPrivateKey = &ScreenPrivateKeyIndex; #define GetScreenPrivate(s) ((ScreenSaverScreenPrivatePtr) \ dixLookupPrivate(&(s)->devPrivates, ScreenPrivateKey)) @@ -199,7 +196,7 @@ XFree86VidModeExtensionInit(void) XF86VidModeNumberErrors, ProcXF86VidModeDispatch, SProcXF86VidModeDispatch, - XF86VidModeResetProc, + NULL, StandardMinorOpcode))) { #if 0 XF86VidModeReqCode = (unsigned char)extEntry->base; @@ -212,13 +209,6 @@ XFree86VidModeExtensionInit(void) } } -/*ARGSUSED*/ -static void -XF86VidModeResetProc (extEntry) - ExtensionEntry* extEntry; -{ -} - static int ClientMajorVersion(ClientPtr client) { @@ -1553,6 +1543,7 @@ ProcXF86VidModeGetGammaRamp(ClientPtr client) { CARD16 *ramp = NULL; int n, length, i; + size_t ramplen; xXF86VidModeGetGammaRampReply rep; REQUEST(xXF86VidModeGetGammaRampReq); @@ -1567,7 +1558,8 @@ ProcXF86VidModeGetGammaRamp(ClientPtr client) length = (stuff->size + 1) & ~1; if(stuff->size) { - if(!(ramp = xalloc(length * 3 * sizeof(CARD16)))) + ramplen = length * 3 * sizeof(CARD16); + if (!(ramp = xalloc(ramplen))) return BadAlloc; if (!VidModeGetGammaRamp(stuff->screen, stuff->size, @@ -1585,13 +1577,12 @@ ProcXF86VidModeGetGammaRamp(ClientPtr client) swaps(&rep.sequenceNumber, n); swapl(&rep.length, n); swaps(&rep.size, n); - for(i = 0; i < length * 3; i++) - swaps(&ramp[i],n); + SwapShorts(ramp, length * 3); } WriteToClient(client, sizeof(xXF86VidModeGetGammaRampReply), (char *)&rep); if(stuff->size) { - WriteToClient(client, rep.length << 2, (char*)ramp); + WriteToClient(client, ramplen, (char*)ramp); xfree(ramp); } @@ -2072,7 +2063,6 @@ SProcXF86VidModeGetGamma(ClientPtr client) static int SProcXF86VidModeSetGammaRamp(ClientPtr client) { - CARD16 *ramp; int length, n; REQUEST(xXF86VidModeSetGammaRampReq); swaps(&stuff->length, n); @@ -2081,11 +2071,7 @@ SProcXF86VidModeSetGammaRamp(ClientPtr client) swaps(&stuff->screen, n); length = ((stuff->size + 1) & ~1) * 6; REQUEST_FIXED_SIZE(xXF86VidModeSetGammaRampReq, length); - ramp = (CARD16*)&stuff[1]; - while(length--) { - swaps(ramp, n); - ramp++; - } + SwapRestS(stuff); return ProcXF86VidModeSetGammaRamp(client); } |