Split out RandR dispatch code from randr.c to rr*dispatch.c.
More disassembly to ease ongoing development.
This commit is contained in:
parent
3e745745fe
commit
bf07893947
|
@ -11,6 +11,8 @@ librandr_la_SOURCES = \
|
||||||
randr.c \
|
randr.c \
|
||||||
randrstr.h \
|
randrstr.h \
|
||||||
rrcrtc.c \
|
rrcrtc.c \
|
||||||
|
rrdispatch.c \
|
||||||
rrmode.c \
|
rrmode.c \
|
||||||
rroutput.c \
|
rroutput.c \
|
||||||
rrscreen.c
|
rrscreen.c \
|
||||||
|
rrsdispatch.c
|
||||||
|
|
1100
randr/randr.c
1100
randr/randr.c
File diff suppressed because it is too large
Load Diff
|
@ -59,8 +59,11 @@ typedef XID RRMode;
|
||||||
typedef XID RROutput;
|
typedef XID RROutput;
|
||||||
typedef XID RRCrtc;
|
typedef XID RRCrtc;
|
||||||
|
|
||||||
extern int RREventBase;
|
extern int RREventBase, RRErrorBase;
|
||||||
|
|
||||||
|
extern int (*ProcRandrVector[RRNumberRequests])(ClientPtr);
|
||||||
|
extern int (*SProcRandrVector[RRNumberRequests])(ClientPtr);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Modeline for a monitor. Name follows directly after this struct
|
* Modeline for a monitor. Name follows directly after this struct
|
||||||
*/
|
*/
|
||||||
|
@ -101,7 +104,7 @@ struct _rrOutput {
|
||||||
int numCrtcs;
|
int numCrtcs;
|
||||||
RRCrtcPtr *crtcs;
|
RRCrtcPtr *crtcs;
|
||||||
int numClones;
|
int numClones;
|
||||||
RROutputPtr *outputs;
|
RROutputPtr *clones;
|
||||||
int numModes;
|
int numModes;
|
||||||
RRModePtr *modes;
|
RRModePtr *modes;
|
||||||
Bool changed;
|
Bool changed;
|
||||||
|
@ -210,6 +213,42 @@ extern int rrPrivIndex;
|
||||||
#define rrScrPriv(pScr) rrScrPrivPtr pScrPriv = rrGetScrPriv(pScr)
|
#define rrScrPriv(pScr) rrScrPrivPtr pScrPriv = rrGetScrPriv(pScr)
|
||||||
#define SetRRScreen(s,p) ((s)->devPrivates[rrPrivIndex].ptr = (pointer) (p))
|
#define SetRRScreen(s,p) ((s)->devPrivates[rrPrivIndex].ptr = (pointer) (p))
|
||||||
|
|
||||||
|
/*
|
||||||
|
* each window has a list of clients requesting
|
||||||
|
* RRNotify events. Each client has a resource
|
||||||
|
* for each window it selects RRNotify input for,
|
||||||
|
* this resource is used to delete the RRNotifyRec
|
||||||
|
* entry from the per-window queue.
|
||||||
|
*/
|
||||||
|
|
||||||
|
typedef struct _RREvent *RREventPtr;
|
||||||
|
|
||||||
|
typedef struct _RREvent {
|
||||||
|
RREventPtr next;
|
||||||
|
ClientPtr client;
|
||||||
|
WindowPtr window;
|
||||||
|
XID clientResource;
|
||||||
|
int mask;
|
||||||
|
} RREventRec;
|
||||||
|
|
||||||
|
typedef struct _RRTimes {
|
||||||
|
TimeStamp setTime;
|
||||||
|
TimeStamp configTime;
|
||||||
|
} RRTimesRec, *RRTimesPtr;
|
||||||
|
|
||||||
|
typedef struct _RRClient {
|
||||||
|
int major_version;
|
||||||
|
int minor_version;
|
||||||
|
/* RRTimesRec times[0]; */
|
||||||
|
} RRClientRec, *RRClientPtr;
|
||||||
|
|
||||||
|
extern RESTYPE RRClientType, RREventType; /* resource types for event masks */
|
||||||
|
extern int RRClientPrivateIndex;
|
||||||
|
extern RESTYPE RRCrtcType, RRModeType, RROutputType;
|
||||||
|
|
||||||
|
#define GetRRClient(pClient) ((RRClientPtr) (pClient)->devPrivates[RRClientPrivateIndex].ptr)
|
||||||
|
#define rrClientPriv(pClient) RRClientPtr pRRClient = GetRRClient(pClient)
|
||||||
|
|
||||||
/* Initialize the extension */
|
/* Initialize the extension */
|
||||||
void
|
void
|
||||||
RRExtensionInit (void);
|
RRExtensionInit (void);
|
||||||
|
@ -278,8 +317,17 @@ miRRCrtcSet (ScreenPtr pScreen,
|
||||||
void
|
void
|
||||||
RRTellChanged (ScreenPtr pScreen);
|
RRTellChanged (ScreenPtr pScreen);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Poll the driver for changed information
|
||||||
|
*/
|
||||||
|
Bool
|
||||||
|
RRGetInfo (ScreenPtr pScreen);
|
||||||
|
|
||||||
Bool RRScreenInit(ScreenPtr pScreen);
|
Bool RRScreenInit(ScreenPtr pScreen);
|
||||||
|
|
||||||
|
RROutputPtr
|
||||||
|
RRFirstOutput (ScreenPtr pScreen);
|
||||||
|
|
||||||
Rotation
|
Rotation
|
||||||
RRGetRotation (ScreenPtr pScreen);
|
RRGetRotation (ScreenPtr pScreen);
|
||||||
|
|
||||||
|
@ -338,13 +386,6 @@ RRCrtcPtr
|
||||||
RRCrtcCreate (ScreenPtr pScreen,
|
RRCrtcCreate (ScreenPtr pScreen,
|
||||||
void *devPrivate);
|
void *devPrivate);
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Use this value for any num parameter to indicate that
|
|
||||||
* the related data are unchanged
|
|
||||||
*/
|
|
||||||
#define RR_NUM_UNCHANGED -1
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Notify the extension that the Crtc has been reconfigured,
|
* Notify the extension that the Crtc has been reconfigured,
|
||||||
* the driver calls this whenever it has updated the mode
|
* the driver calls this whenever it has updated the mode
|
||||||
|
@ -358,6 +399,9 @@ RRCrtcNotify (RRCrtcPtr crtc,
|
||||||
int numOutput,
|
int numOutput,
|
||||||
RROutputPtr *outputs);
|
RROutputPtr *outputs);
|
||||||
|
|
||||||
|
void
|
||||||
|
RRDeliverCrtcEvent (ClientPtr client, WindowPtr pWin, RRCrtcPtr crtc);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Request that the Crtc be reconfigured
|
* Request that the Crtc be reconfigured
|
||||||
*/
|
*/
|
||||||
|
@ -382,6 +426,10 @@ RRCrtcDestroy (RRCrtcPtr crtc);
|
||||||
Bool
|
Bool
|
||||||
RRCrtcInit (void);
|
RRCrtcInit (void);
|
||||||
|
|
||||||
|
/* rrdispatch.c */
|
||||||
|
Bool
|
||||||
|
RRClientKnowsRates (ClientPtr pClient);
|
||||||
|
|
||||||
/* rrmode.c */
|
/* rrmode.c */
|
||||||
/*
|
/*
|
||||||
* Find, and if necessary, create a mode
|
* Find, and if necessary, create a mode
|
||||||
|
@ -438,6 +486,9 @@ Bool
|
||||||
RROutputSetConnection (RROutputPtr output,
|
RROutputSetConnection (RROutputPtr output,
|
||||||
CARD8 connection);
|
CARD8 connection);
|
||||||
|
|
||||||
|
void
|
||||||
|
RRDeliverOutputEvent(ClientPtr client, WindowPtr pWin, RROutputPtr output);
|
||||||
|
|
||||||
void
|
void
|
||||||
RROutputDestroy (RROutputPtr output);
|
RROutputDestroy (RROutputPtr output);
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
|
|
||||||
#include "randrstr.h"
|
#include "randrstr.h"
|
||||||
|
|
||||||
static RESTYPE CrtcType;
|
RESTYPE RRCrtcType;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Create a CRTC
|
* Create a CRTC
|
||||||
|
@ -144,6 +144,12 @@ RRCrtcNotify (RRCrtcPtr crtc,
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
RRDeliverCrtcEvent (ClientPtr client, WindowPtr pWin, RRCrtcPtr crtc)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Request that the Crtc be reconfigured
|
* Request that the Crtc be reconfigured
|
||||||
*/
|
*/
|
||||||
|
@ -216,6 +222,7 @@ RRCrtcDestroyResource (pointer value, XID pid)
|
||||||
memmove (pScrPriv->crtcs, pScrPriv->crtcs + 1,
|
memmove (pScrPriv->crtcs, pScrPriv->crtcs + 1,
|
||||||
(pScrPriv->numCrtcs - (i - 1)) * sizeof (RRCrtcPtr));
|
(pScrPriv->numCrtcs - (i - 1)) * sizeof (RRCrtcPtr));
|
||||||
--pScrPriv->numCrtcs;
|
--pScrPriv->numCrtcs;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
free (value);
|
free (value);
|
||||||
|
@ -228,11 +235,11 @@ RRCrtcDestroyResource (pointer value, XID pid)
|
||||||
Bool
|
Bool
|
||||||
RRCrtcInit (void)
|
RRCrtcInit (void)
|
||||||
{
|
{
|
||||||
CrtcType = CreateNewResourceType (RRCrtcDestroyResource);
|
RRCrtcType = CreateNewResourceType (RRCrtcDestroyResource);
|
||||||
if (!CrtcType)
|
if (!RRCrtcType)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
#ifdef XResExtension
|
#ifdef XResExtension
|
||||||
RegisterResourceName (CrtcType, "CRTC");
|
RegisterResourceName (RRCrtcType, "CRTC");
|
||||||
#endif
|
#endif
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
1034
randr/rrdispatch.c
Normal file
1034
randr/rrdispatch.c
Normal file
File diff suppressed because it is too large
Load Diff
|
@ -22,7 +22,7 @@
|
||||||
|
|
||||||
#include "randrstr.h"
|
#include "randrstr.h"
|
||||||
|
|
||||||
static RESTYPE ModeType;
|
RESTYPE RRModeType;
|
||||||
|
|
||||||
RRModePtr
|
RRModePtr
|
||||||
RRModeGet (ScreenPtr pScreen,
|
RRModeGet (ScreenPtr pScreen,
|
||||||
|
@ -50,7 +50,7 @@ RRModeGet (ScreenPtr pScreen,
|
||||||
memcpy (mode->name, name, modeInfo->nameLength);
|
memcpy (mode->name, name, modeInfo->nameLength);
|
||||||
mode->name[modeInfo->nameLength] = '\0';
|
mode->name[modeInfo->nameLength] = '\0';
|
||||||
mode->id = FakeClientID(0);
|
mode->id = FakeClientID(0);
|
||||||
if (!AddResource (mode->id, ModeType, (pointer) mode))
|
if (!AddResource (mode->id, RRModeType, (pointer) mode))
|
||||||
return NULL;
|
return NULL;
|
||||||
++mode->refcnt;
|
++mode->refcnt;
|
||||||
pScrPriv->changed = TRUE;
|
pScrPriv->changed = TRUE;
|
||||||
|
@ -75,11 +75,11 @@ RRModeDestroyResource (pointer value, XID pid)
|
||||||
Bool
|
Bool
|
||||||
RRModeInit (void)
|
RRModeInit (void)
|
||||||
{
|
{
|
||||||
ModeType = CreateNewResourceType (RRModeDestroyResource);
|
RRModeType = CreateNewResourceType (RRModeDestroyResource);
|
||||||
if (!ModeType)
|
if (!RRModeType)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
#ifdef XResExtension
|
#ifdef XResExtension
|
||||||
RegisterResourceName (ModeType, "MODE");
|
RegisterResourceName (RRModeType, "MODE");
|
||||||
#endif
|
#endif
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
148
randr/rroutput.c
148
randr/rroutput.c
|
@ -22,7 +22,124 @@
|
||||||
|
|
||||||
#include "randrstr.h"
|
#include "randrstr.h"
|
||||||
|
|
||||||
static RESTYPE OutputType;
|
RESTYPE RROutputType;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Create an output
|
||||||
|
*/
|
||||||
|
|
||||||
|
RROutputPtr
|
||||||
|
RROutputCreate (ScreenPtr pScreen,
|
||||||
|
char *name,
|
||||||
|
int nameLength,
|
||||||
|
void *devPrivate)
|
||||||
|
{
|
||||||
|
rrScrPriv (pScreen);
|
||||||
|
RROutputPtr output;
|
||||||
|
RROutputPtr *outputs;
|
||||||
|
|
||||||
|
output = xalloc (sizeof (RROutputRec) + nameLength + 1);
|
||||||
|
if (!output)
|
||||||
|
return NULL;
|
||||||
|
if (pScrPriv->numOutputs)
|
||||||
|
outputs = xrealloc (pScrPriv->outputs,
|
||||||
|
(pScrPriv->numOutputs + 1) * sizeof (RROutputPtr));
|
||||||
|
else
|
||||||
|
outputs = xalloc (sizeof (RROutputPtr));
|
||||||
|
if (!outputs)
|
||||||
|
{
|
||||||
|
xfree (output);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
output->id = FakeClientID (0);
|
||||||
|
output->pScreen = pScreen;
|
||||||
|
output->name = (char *) (output + 1);
|
||||||
|
output->nameLength = nameLength;
|
||||||
|
memcpy (output->name, name, nameLength);
|
||||||
|
output->connection = RR_UnknownConnection;
|
||||||
|
output->subpixelOrder = SubPixelUnknown;
|
||||||
|
output->crtc = NULL;
|
||||||
|
output->numCrtcs = 0;
|
||||||
|
output->crtcs = NULL;
|
||||||
|
output->numClones = 0;
|
||||||
|
output->clones = NULL;
|
||||||
|
output->numModes = 0;
|
||||||
|
output->modes = NULL;
|
||||||
|
output->changed = TRUE;
|
||||||
|
output->devPrivate = devPrivate;
|
||||||
|
pScrPriv->outputs[pScrPriv->numOutputs++] = output;
|
||||||
|
return output;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Notify extension that output parameters have been changed
|
||||||
|
*/
|
||||||
|
Bool
|
||||||
|
RROutputSetClones (RROutputPtr output,
|
||||||
|
RROutputPtr *clones,
|
||||||
|
int numClones)
|
||||||
|
{
|
||||||
|
RROutputPtr *newClones;
|
||||||
|
|
||||||
|
newClones = xalloc (numClones * sizeof (RROutputPtr));
|
||||||
|
if (!newClones)
|
||||||
|
return FALSE;
|
||||||
|
if (output->clones)
|
||||||
|
xfree (output->clones);
|
||||||
|
memcpy (newClones, clones, numClones * sizeof (RROutputPtr));
|
||||||
|
output->clones = newClones;
|
||||||
|
output->numClones = numClones;
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
Bool
|
||||||
|
RROutputSetModes (RROutputPtr output,
|
||||||
|
RRModePtr *modes,
|
||||||
|
int numModes)
|
||||||
|
{
|
||||||
|
RRModePtr *newModes;
|
||||||
|
|
||||||
|
newModes = xalloc (numModes * sizeof (RRModePtr));
|
||||||
|
if (!newModes)
|
||||||
|
return FALSE;
|
||||||
|
if (output->modes)
|
||||||
|
xfree (output->modes);
|
||||||
|
memcpy (newModes, modes, numModes * sizeof (RRModePtr));
|
||||||
|
output->modes = newModes;
|
||||||
|
output->numModes = numModes;
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
Bool
|
||||||
|
RROutputSetCrtcs (RROutputPtr output,
|
||||||
|
RRCrtcPtr *crtcs,
|
||||||
|
int numCrtcs)
|
||||||
|
{
|
||||||
|
RRCrtcPtr *newCrtcs;
|
||||||
|
|
||||||
|
newCrtcs = xalloc (numCrtcs * sizeof (RRCrtcPtr));
|
||||||
|
if (!newCrtcs)
|
||||||
|
return FALSE;
|
||||||
|
if (output->crtcs)
|
||||||
|
xfree (output->crtcs);
|
||||||
|
memcpy (newCrtcs, crtcs, numCrtcs * sizeof (RRCrtcPtr));
|
||||||
|
output->crtcs = newCrtcs;
|
||||||
|
output->numCrtcs = numCrtcs;
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
Bool
|
||||||
|
RROutputSetConnection (RROutputPtr output,
|
||||||
|
CARD8 connection)
|
||||||
|
{
|
||||||
|
output->connection = connection;
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
RRDeliverOutputEvent(ClientPtr client, WindowPtr pWin, RROutputPtr output)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Destroy a Output at shutdown
|
* Destroy a Output at shutdown
|
||||||
|
@ -36,7 +153,28 @@ RROutputDestroy (RROutputPtr crtc)
|
||||||
static int
|
static int
|
||||||
RROutputDestroyResource (pointer value, XID pid)
|
RROutputDestroyResource (pointer value, XID pid)
|
||||||
{
|
{
|
||||||
free (value);
|
RROutputPtr output = (RROutputPtr) value;
|
||||||
|
ScreenPtr pScreen = output->pScreen;
|
||||||
|
rrScrPriv(pScreen);
|
||||||
|
int i;
|
||||||
|
|
||||||
|
for (i = 0; i < pScrPriv->numOutputs; i++)
|
||||||
|
{
|
||||||
|
if (pScrPriv->outputs[i] == output)
|
||||||
|
{
|
||||||
|
memmove (pScrPriv->outputs, pScrPriv->outputs + 1,
|
||||||
|
(pScrPriv->numOutputs - (i - 1)) * sizeof (RROutputPtr));
|
||||||
|
--pScrPriv->numOutputs;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (output->modes)
|
||||||
|
xfree (output->modes);
|
||||||
|
if (output->crtcs)
|
||||||
|
xfree (output->crtcs);
|
||||||
|
if (output->clones)
|
||||||
|
xfree (output->clones);
|
||||||
|
xfree (output);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -46,11 +184,11 @@ RROutputDestroyResource (pointer value, XID pid)
|
||||||
Bool
|
Bool
|
||||||
RROutputInit (void)
|
RROutputInit (void)
|
||||||
{
|
{
|
||||||
OutputType = CreateNewResourceType (RROutputDestroyResource);
|
RROutputType = CreateNewResourceType (RROutputDestroyResource);
|
||||||
if (!OutputType)
|
if (!RROutputType)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
#ifdef XResExtension
|
#ifdef XResExtension
|
||||||
RegisterResourceName (OutputType, "OUTPUT");
|
RegisterResourceName (RROutputType, "OUTPUT");
|
||||||
#endif
|
#endif
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
282
randr/rrsdispatch.c
Normal file
282
randr/rrsdispatch.c
Normal file
|
@ -0,0 +1,282 @@
|
||||||
|
/*
|
||||||
|
* Copyright © 2006 Keith Packard
|
||||||
|
*
|
||||||
|
* 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 copyright holders not be used in advertising or
|
||||||
|
* publicity pertaining to distribution of the software without specific,
|
||||||
|
* written prior permission. The copyright holders make no representations
|
||||||
|
* about the suitability of this software for any purpose. It is provided "as
|
||||||
|
* is" without express or implied warranty.
|
||||||
|
*
|
||||||
|
* THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||||
|
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
|
||||||
|
* EVENT SHALL THE COPYRIGHT HOLDERS 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "randrstr.h"
|
||||||
|
|
||||||
|
static int
|
||||||
|
SProcRRQueryVersion (ClientPtr client)
|
||||||
|
{
|
||||||
|
register int n;
|
||||||
|
REQUEST(xRRQueryVersionReq);
|
||||||
|
|
||||||
|
swaps(&stuff->length, n);
|
||||||
|
swapl(&stuff->majorVersion, n);
|
||||||
|
swapl(&stuff->minorVersion, n);
|
||||||
|
return (*ProcRandrVector[stuff->randrReqType]) (client);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
SProcRRGetScreenInfo (ClientPtr client)
|
||||||
|
{
|
||||||
|
register int n;
|
||||||
|
REQUEST(xRRGetScreenInfoReq);
|
||||||
|
|
||||||
|
swaps(&stuff->length, n);
|
||||||
|
swapl(&stuff->window, n);
|
||||||
|
return (*ProcRandrVector[stuff->randrReqType]) (client);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
SProcRRSetScreenConfig (ClientPtr client)
|
||||||
|
{
|
||||||
|
register int n;
|
||||||
|
REQUEST(xRRSetScreenConfigReq);
|
||||||
|
|
||||||
|
if (RRClientKnowsRates (client))
|
||||||
|
{
|
||||||
|
REQUEST_SIZE_MATCH (xRRSetScreenConfigReq);
|
||||||
|
swaps (&stuff->rate, n);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
REQUEST_SIZE_MATCH (xRR1_0SetScreenConfigReq);
|
||||||
|
}
|
||||||
|
|
||||||
|
swaps(&stuff->length, n);
|
||||||
|
swapl(&stuff->drawable, n);
|
||||||
|
swapl(&stuff->timestamp, n);
|
||||||
|
swaps(&stuff->sizeID, n);
|
||||||
|
swaps(&stuff->rotation, n);
|
||||||
|
return (*ProcRandrVector[stuff->randrReqType]) (client);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
SProcRRSelectInput (ClientPtr client)
|
||||||
|
{
|
||||||
|
register int n;
|
||||||
|
REQUEST(xRRSelectInputReq);
|
||||||
|
|
||||||
|
swaps(&stuff->length, n);
|
||||||
|
swapl(&stuff->window, n);
|
||||||
|
return (*ProcRandrVector[stuff->randrReqType]) (client);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
SProcRRGetScreenSizeRange (ClientPtr client)
|
||||||
|
{
|
||||||
|
REQUEST(xRRGetScreenSizeRangeReq);
|
||||||
|
|
||||||
|
REQUEST_SIZE_MATCH(xRRGetScreenSizeRangeReq);
|
||||||
|
(void) stuff;
|
||||||
|
return BadImplementation;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
SProcRRSetScreenSize (ClientPtr client)
|
||||||
|
{
|
||||||
|
REQUEST(xRRSetScreenSizeReq);
|
||||||
|
|
||||||
|
REQUEST_SIZE_MATCH(xRRSetScreenSizeReq);
|
||||||
|
(void) stuff;
|
||||||
|
return BadImplementation;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
SProcRRGetScreenResources (ClientPtr client)
|
||||||
|
{
|
||||||
|
REQUEST(xRRGetScreenResourcesReq);
|
||||||
|
|
||||||
|
REQUEST_SIZE_MATCH(xRRGetScreenResourcesReq);
|
||||||
|
(void) stuff;
|
||||||
|
return BadImplementation;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
SProcRRGetOutputInfo (ClientPtr client)
|
||||||
|
{
|
||||||
|
REQUEST(xRRGetOutputInfoReq);;
|
||||||
|
|
||||||
|
REQUEST_SIZE_MATCH(xRRGetOutputInfoReq);
|
||||||
|
(void) stuff;
|
||||||
|
return BadImplementation;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
SProcRRListOutputProperties (ClientPtr client)
|
||||||
|
{
|
||||||
|
REQUEST(xRRListOutputPropertiesReq);
|
||||||
|
|
||||||
|
REQUEST_SIZE_MATCH(xRRListOutputPropertiesReq);
|
||||||
|
(void) stuff;
|
||||||
|
return BadImplementation;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
SProcRRChangeOutputProperty (ClientPtr client)
|
||||||
|
{
|
||||||
|
REQUEST(xRRChangeOutputPropertyReq);
|
||||||
|
|
||||||
|
REQUEST_SIZE_MATCH(xRRChangeOutputPropertyReq);
|
||||||
|
(void) stuff;
|
||||||
|
return BadImplementation;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
SProcRRDeleteOutputProperty (ClientPtr client)
|
||||||
|
{
|
||||||
|
REQUEST(xRRDeleteOutputPropertyReq);
|
||||||
|
|
||||||
|
REQUEST_SIZE_MATCH(xRRDeleteOutputPropertyReq);
|
||||||
|
(void) stuff;
|
||||||
|
return BadImplementation;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
SProcRRGetOutputProperty (ClientPtr client)
|
||||||
|
{
|
||||||
|
REQUEST(xRRGetOutputPropertyReq);
|
||||||
|
|
||||||
|
REQUEST_SIZE_MATCH(xRRGetOutputPropertyReq);
|
||||||
|
(void) stuff;
|
||||||
|
return BadImplementation;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
SProcRRCreateMode (ClientPtr client)
|
||||||
|
{
|
||||||
|
REQUEST(xRRCreateModeReq);
|
||||||
|
|
||||||
|
REQUEST_SIZE_MATCH(xRRCreateModeReq);
|
||||||
|
(void) stuff;
|
||||||
|
return BadImplementation;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
SProcRRDestroyMode (ClientPtr client)
|
||||||
|
{
|
||||||
|
REQUEST(xRRDestroyModeReq);
|
||||||
|
|
||||||
|
REQUEST_SIZE_MATCH(xRRDestroyModeReq);
|
||||||
|
(void) stuff;
|
||||||
|
return BadImplementation;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
SProcRRAddOutputMode (ClientPtr client)
|
||||||
|
{
|
||||||
|
REQUEST(xRRAddOutputModeReq);
|
||||||
|
|
||||||
|
REQUEST_SIZE_MATCH(xRRAddOutputModeReq);
|
||||||
|
(void) stuff;
|
||||||
|
return BadImplementation;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
SProcRRDeleteOutputMode (ClientPtr client)
|
||||||
|
{
|
||||||
|
REQUEST(xRRDeleteOutputModeReq);
|
||||||
|
|
||||||
|
REQUEST_SIZE_MATCH(xRRDeleteOutputModeReq);
|
||||||
|
(void) stuff;
|
||||||
|
return BadImplementation;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
SProcRRGetCrtcInfo (ClientPtr client)
|
||||||
|
{
|
||||||
|
REQUEST(xRRGetCrtcInfoReq);
|
||||||
|
|
||||||
|
REQUEST_SIZE_MATCH(xRRGetCrtcInfoReq);
|
||||||
|
(void) stuff;
|
||||||
|
return BadImplementation;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
SProcRRSetCrtcConfig (ClientPtr client)
|
||||||
|
{
|
||||||
|
REQUEST(xRRSetCrtcConfigReq);
|
||||||
|
|
||||||
|
REQUEST_SIZE_MATCH(xRRSetCrtcConfigReq);
|
||||||
|
(void) stuff;
|
||||||
|
return BadImplementation;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
SProcRRGetCrtcGammaSize (ClientPtr client)
|
||||||
|
{
|
||||||
|
REQUEST(xRRGetCrtcGammaSizeReq);
|
||||||
|
|
||||||
|
REQUEST_SIZE_MATCH(xRRGetCrtcGammaSizeReq);
|
||||||
|
(void) stuff;
|
||||||
|
return BadImplementation;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
SProcRRGetCrtcGamma (ClientPtr client)
|
||||||
|
{
|
||||||
|
REQUEST(xRRGetCrtcGammaReq);
|
||||||
|
|
||||||
|
REQUEST_SIZE_MATCH(xRRGetCrtcGammaReq);
|
||||||
|
(void) stuff;
|
||||||
|
return BadImplementation;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
SProcRRSetCrtcGamma (ClientPtr client)
|
||||||
|
{
|
||||||
|
REQUEST(xRRSetCrtcGammaReq);
|
||||||
|
|
||||||
|
REQUEST_SIZE_MATCH(xRRSetCrtcGammaReq);
|
||||||
|
(void) stuff;
|
||||||
|
return BadImplementation;
|
||||||
|
}
|
||||||
|
|
||||||
|
int (*SProcRandrVector[RRNumberRequests])(ClientPtr) = {
|
||||||
|
SProcRRQueryVersion, /* 0 */
|
||||||
|
/* we skip 1 to make old clients fail pretty immediately */
|
||||||
|
NULL, /* 1 SProcRandrOldGetScreenInfo */
|
||||||
|
/* V1.0 apps share the same set screen config request id */
|
||||||
|
SProcRRSetScreenConfig, /* 2 */
|
||||||
|
NULL, /* 3 SProcRandrOldScreenChangeSelectInput */
|
||||||
|
/* 3 used to be ScreenChangeSelectInput; deprecated */
|
||||||
|
SProcRRSelectInput, /* 4 */
|
||||||
|
SProcRRGetScreenInfo, /* 5 */
|
||||||
|
/* V1.2 additions */
|
||||||
|
SProcRRGetScreenSizeRange, /* 6 */
|
||||||
|
SProcRRSetScreenSize, /* 7 */
|
||||||
|
SProcRRGetScreenResources, /* 8 */
|
||||||
|
SProcRRGetOutputInfo, /* 9 */
|
||||||
|
SProcRRListOutputProperties,/* 10 */
|
||||||
|
SProcRRChangeOutputProperty,/* 11 */
|
||||||
|
SProcRRDeleteOutputProperty,/* 12 */
|
||||||
|
SProcRRGetOutputProperty, /* 13 */
|
||||||
|
SProcRRCreateMode, /* 14 */
|
||||||
|
SProcRRDestroyMode, /* 15 */
|
||||||
|
SProcRRAddOutputMode, /* 16 */
|
||||||
|
SProcRRDeleteOutputMode, /* 17 */
|
||||||
|
SProcRRGetCrtcInfo, /* 18 */
|
||||||
|
SProcRRSetCrtcConfig, /* 19 */
|
||||||
|
SProcRRGetCrtcGammaSize, /* 20 */
|
||||||
|
SProcRRGetCrtcGamma, /* 21 */
|
||||||
|
SProcRRSetCrtcGamma, /* 22 */
|
||||||
|
};
|
||||||
|
|
Loading…
Reference in New Issue
Block a user