diff options
-rw-r--r-- | randr/mirandr.c | 6 | ||||
-rw-r--r-- | randr/randrstr.h | 24 | ||||
-rw-r--r-- | randr/rrcrtc.c | 46 | ||||
-rw-r--r-- | randr/rroutput.c | 29 | ||||
-rw-r--r-- | randr/rrscreen.c | 13 |
5 files changed, 29 insertions, 89 deletions
diff --git a/randr/mirandr.c b/randr/mirandr.c index 3f56fe42e..3a99bf9ed 100644 --- a/randr/mirandr.c +++ b/randr/mirandr.c @@ -52,7 +52,7 @@ miRRCrtcSet (ScreenPtr pScreen, int y, Rotation rotation, int numOutput, - RROutputConfigPtr outputs) + RROutputPtr *outputs) { return TRUE; } @@ -137,10 +137,6 @@ miRandRInit (ScreenPtr pScreen) return FALSE; if (!RROutputSetCrtcs (output, &crtc, 1)) return FALSE; - if (!RROutputSetPossibleOptions (output, 0)) - return FALSE; - if (!RROutputSetCurrentOptions (output, 0)) - return FALSE; if (!RROutputSetConnection (output, RR_Connected)) return FALSE; RRCrtcNotify (crtc, mode, 0, 0, RR_Rotate_0, 1, &output); diff --git a/randr/randrstr.h b/randr/randrstr.h index 2c3e0e71c..19af9b979 100644 --- a/randr/randrstr.h +++ b/randr/randrstr.h @@ -72,7 +72,6 @@ extern int (*SProcRandrVector[RRNumberRequests])(ClientPtr); typedef struct _rrMode RRModeRec, *RRModePtr; typedef struct _rrCrtc RRCrtcRec, *RRCrtcPtr; typedef struct _rrOutput RROutputRec, *RROutputPtr; -typedef struct _rrOutputConfig RROutputConfigRec, *RROutputConfigPtr; struct _rrMode { int refcnt; @@ -109,8 +108,6 @@ struct _rrOutput { int mmWidth; int mmHeight; RRCrtcPtr crtc; - CARD32 currentOptions; - CARD32 possibleOptions; int numCrtcs; RRCrtcPtr *crtcs; int numClones; @@ -123,11 +120,6 @@ struct _rrOutput { void *devPrivate; }; -struct _rrOutputConfig { - RROutputPtr output; - CARD32 options; -}; - #if RANDR_12_INTERFACE typedef Bool (*RRScreenSetSizeProcPtr) (ScreenPtr pScreen, CARD16 width, @@ -142,7 +134,7 @@ typedef Bool (*RRCrtcSetProcPtr) (ScreenPtr pScreen, int y, Rotation rotation, int numOutputs, - RROutputConfigPtr outputs); + RROutputPtr *outputs); typedef Bool (*RRCrtcSetGammaProcPtr) (ScreenPtr pScreen, RRCrtcPtr crtc); @@ -369,7 +361,7 @@ miRRCrtcSet (ScreenPtr pScreen, int y, Rotation rotation, int numOutput, - RROutputConfigPtr outputs); + RROutputPtr *outputs); /* randr.c */ /* @@ -490,7 +482,7 @@ RRCrtcSet (RRCrtcPtr crtc, int y, Rotation rotation, int numOutput, - RROutputConfigPtr outputs); + RROutputPtr *outputs); /* * Request that the Crtc gamma be changed @@ -641,10 +633,6 @@ RROutputSetCrtcs (RROutputPtr output, RRCrtcPtr *crtcs, int numCrtcs); -Bool -RROutputSetPossibleOptions (RROutputPtr output, - CARD32 possibleOptions); - void RROutputSetCrtc (RROutputPtr output, RRCrtcPtr crtc); @@ -657,10 +645,6 @@ RROutputSetSubpixelOrder (RROutputPtr output, int subpixelOrder); Bool -RROutputSetCurrentOptions (RROutputPtr output, - CARD32 currentOptions); - -Bool RROutputSetPhysicalSize (RROutputPtr output, int mmWidth, int mmHeight); @@ -739,8 +723,6 @@ Query state: RRScreenSetSizeRange RROutputSetCrtcs RROutputSetCrtc - RROutputSetPossibleOptions - RRSetCurrentOptions RRModeGet RROutputSetModes RROutputSetConnection diff --git a/randr/rrcrtc.c b/randr/rrcrtc.c index 9f7177a34..c945468bf 100644 --- a/randr/rrcrtc.c +++ b/randr/rrcrtc.c @@ -257,7 +257,7 @@ RRCrtcSet (RRCrtcPtr crtc, int y, Rotation rotation, int numOutputs, - RROutputConfigPtr outputs) + RROutputPtr *outputs) { ScreenPtr pScreen = crtc->pScreen; @@ -290,10 +290,10 @@ RRCrtcSet (RRCrtcPtr crtc, size.width = mode->mode.width; size.height = mode->mode.height; - if (outputs[0].output->mmWidth && outputs[0].output->mmHeight) + if (outputs[0]->mmWidth && outputs[0]->mmHeight) { - size.mmWidth = outputs[0].output->mmWidth; - size.mmHeight = outputs[0].output->mmHeight; + size.mmWidth = outputs[0]->mmWidth; + size.mmHeight = outputs[0]->mmHeight; } else { @@ -308,7 +308,7 @@ RRCrtcSet (RRCrtcPtr crtc, * Old 1.0 interface tied screen size to mode size */ if (ret) - RRCrtcNotify (crtc, mode, x, y, rotation, 1, &outputs[0].output); + RRCrtcNotify (crtc, mode, x, y, rotation, 1, outputs); return ret; } #endif @@ -554,15 +554,15 @@ ProcRRSetCrtcConfig (ClientPtr client) RRCrtcPtr crtc; RRModePtr mode; int numOutputs; - RROutputConfigPtr outputs = NULL; - xRROutputConfig *outputConfigs; + RROutputPtr *outputs = NULL; + RROutput *outputIds; TimeStamp configTime; TimeStamp time; Rotation rotation; int i, j; REQUEST_AT_LEAST_SIZE(xRRSetCrtcConfigReq); - numOutputs = (stuff->length - (SIZEOF (xRRSetCrtcConfigReq) >> 2)) >> 1; + numOutputs = (stuff->length - (SIZEOF (xRRSetCrtcConfigReq) >> 2)); crtc = LookupIDByType (stuff->crtc, RRCrtcType); if (!crtc) @@ -589,47 +589,39 @@ ProcRRSetCrtcConfig (ClientPtr client) } if (numOutputs) { - outputs = xalloc (numOutputs * sizeof (RROutputConfigRec)); + outputs = xalloc (numOutputs * sizeof (RROutputPtr)); if (!outputs) return BadAlloc; } else outputs = NULL; - outputConfigs = (xRROutputConfig *) (stuff + 1); + outputIds = (RROutput *) (stuff + 1); for (i = 0; i < numOutputs; i++) { - outputs[i].output = LookupIDByType (outputConfigs[i].output, RROutputType); - if (!outputs[i].output) + outputs[i] = (RROutputPtr) LookupIDByType (outputIds[i], RROutputType); + if (!outputs[i]) { - client->errorValue = outputConfigs[i].output; + client->errorValue = outputIds[i]; if (outputs) xfree (outputs); return RRErrorBase + BadRROutput; } - outputs[i].options = outputConfigs[i].options; - if (outputs[i].options & ~outputs[i].output->possibleOptions) - { - client->errorValue = outputConfigs[i].options; - if (outputs) - xfree (outputs); - return BadMatch; - } /* validate crtc for this output */ - for (j = 0; j < outputs[i].output->numCrtcs; j++) - if (outputs[i].output->crtcs[j] == crtc) + for (j = 0; j < outputs[i]->numCrtcs; j++) + if (outputs[i]->crtcs[j] == crtc) break; - if (j == outputs[i].output->numCrtcs) + if (j == outputs[i]->numCrtcs) { if (outputs) xfree (outputs); return BadMatch; } /* validate mode for this output */ - for (j = 0; j < outputs[i].output->numModes; j++) - if (outputs[i].output->modes[j] == mode) + for (j = 0; j < outputs[i]->numModes; j++) + if (outputs[i]->modes[j] == mode) break; - if (j == outputs[i].output->numModes) + if (j == outputs[i]->numModes) { if (outputs) xfree (outputs); diff --git a/randr/rroutput.c b/randr/rroutput.c index 102587b50..8b760ec9a 100644 --- a/randr/rroutput.c +++ b/randr/rroutput.c @@ -65,8 +65,6 @@ RROutputCreate (const char *name, output->mmWidth = 0; output->mmHeight = 0; output->crtc = NULL; - output->currentOptions = 0; - output->possibleOptions = 0; output->numCrtcs = 0; output->crtcs = NULL; output->numClones = 0; @@ -223,17 +221,6 @@ RROutputSetCrtcs (RROutputPtr output, return TRUE; } -Bool -RROutputSetPossibleOptions (RROutputPtr output, - CARD32 possibleOptions) -{ - if (output->possibleOptions == possibleOptions) - return TRUE; - output->possibleOptions = possibleOptions; - RROutputChanged (output); - return TRUE; -} - void RROutputSetCrtc (RROutputPtr output, RRCrtcPtr crtc) { @@ -267,17 +254,6 @@ RROutputSetSubpixelOrder (RROutputPtr output, } Bool -RROutputSetCurrentOptions (RROutputPtr output, - CARD32 currentOptions) -{ - if (output->currentOptions == currentOptions) - return TRUE; - output->currentOptions = currentOptions; - RROutputChanged (output); - return TRUE; -} - -Bool RROutputSetPhysicalSize (RROutputPtr output, int mmWidth, int mmHeight) @@ -413,7 +389,6 @@ ProcRRGetOutputInfo (ClientPtr client) rep.length = OutputInfoExtra >> 2; rep.timestamp = pScrPriv->lastSetTime.milliseconds; rep.crtc = output->crtc ? output->crtc->id : None; - rep.currentOptions = output->currentOptions; rep.mmWidth = output->mmWidth; rep.mmHeight = output->mmHeight; rep.connection = output->connection; @@ -423,7 +398,6 @@ ProcRRGetOutputInfo (ClientPtr client) rep.nPreferred = output->numPreferred; rep.nClones = output->numClones; rep.nameLength = output->nameLength; - rep.possibleOptions = output->possibleOptions; extraLen = ((output->numCrtcs + output->numModes + @@ -469,15 +443,12 @@ ProcRRGetOutputInfo (ClientPtr client) swapl(&rep.length, n); swapl(&rep.timestamp, n); swapl(&rep.crtc, n); - swapl(&rep.currentOptions, n); swapl(&rep.mmWidth, n); swapl(&rep.mmHeight, n); swaps(&rep.nCrtcs, n); swaps(&rep.nModes, n); swaps(&rep.nClones, n); - swapl(&rep.possibleOptions, n); swaps(&rep.nameLength, n); - swapl(&rep.possibleOptions, n); } WriteToClient(client, sizeof(xRRGetOutputInfoReply), (char *)&rep); if (extraLen) diff --git a/randr/rrscreen.c b/randr/rrscreen.c index d47e9d60a..76c16b010 100644 --- a/randr/rrscreen.c +++ b/randr/rrscreen.c @@ -712,7 +712,7 @@ ProcRRSetScreenConfig (ClientPtr client) Rotation rotation; int rate; Bool has_rate; - RROutputConfigRec output; + RROutputPtr output; RRModePtr mode; RR10DataPtr pData = NULL; RRScreenSizePtr pSize; @@ -749,14 +749,13 @@ ProcRRSetScreenConfig (ClientPtr client) if (!RRGetInfo (pScreen)) return BadAlloc; - output.output = RRFirstOutput (pScreen); - if (!output.output) + output = RRFirstOutput (pScreen); + if (!output) { time = currentTime; rep.status = RRSetConfigFailed; goto sendReply; } - output.options = output.output->currentOptions; /* * if the client's config timestamp is not the same as the last config @@ -769,7 +768,7 @@ ProcRRSetScreenConfig (ClientPtr client) goto sendReply; } - pData = RR10GetData (pScreen, output.output); + pData = RR10GetData (pScreen, output); if (!pData) return BadAlloc; @@ -805,7 +804,7 @@ ProcRRSetScreenConfig (ClientPtr client) return BadValue; } - if ((~output.output->crtc->rotations) & rotation) + if ((~output->crtc->rotations) & rotation) { /* * requested rotation or reflection not supported by screen @@ -878,7 +877,7 @@ ProcRRSetScreenConfig (ClientPtr client) } } - rep.status = RRCrtcSet (output.output->crtc, mode, 0, 0, stuff->rotation, + rep.status = RRCrtcSet (output->crtc, mode, 0, 0, stuff->rotation, 1, &output); /* |