2006-09-17 23:03:23 -07:00
|
|
|
/*
|
|
|
|
|
* 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.
|
|
|
|
|
*/
|
|
|
|
|
|
2024-02-09 20:03:12 +01:00
|
|
|
#include "randrstr_priv.h"
|
2006-09-17 23:03:23 -07:00
|
|
|
|
2017-02-16 14:56:45 -05:00
|
|
|
static int _X_COLD
|
2006-09-17 23:03:23 -07:00
|
|
|
SProcRRQueryVersion(ClientPtr client)
|
|
|
|
|
{
|
|
|
|
|
REQUEST(xRRQueryVersionReq);
|
|
|
|
|
|
2014-01-26 19:38:09 -08:00
|
|
|
REQUEST_SIZE_MATCH(xRRQueryVersionReq);
|
2011-08-04 15:35:41 -04:00
|
|
|
swapl(&stuff->majorVersion);
|
|
|
|
|
swapl(&stuff->minorVersion);
|
2024-07-29 15:01:08 +02:00
|
|
|
return ProcRRQueryVersion(client);
|
2006-09-17 23:03:23 -07:00
|
|
|
}
|
|
|
|
|
|
2017-02-16 14:56:45 -05:00
|
|
|
static int _X_COLD
|
2006-09-17 23:03:23 -07:00
|
|
|
SProcRRGetScreenInfo(ClientPtr client)
|
|
|
|
|
{
|
|
|
|
|
REQUEST(xRRGetScreenInfoReq);
|
|
|
|
|
|
2014-01-26 19:38:09 -08:00
|
|
|
REQUEST_SIZE_MATCH(xRRGetScreenInfoReq);
|
2011-08-04 15:35:41 -04:00
|
|
|
swapl(&stuff->window);
|
2024-07-29 15:01:08 +02:00
|
|
|
return ProcRRGetScreenInfo(client);
|
2006-09-17 23:03:23 -07:00
|
|
|
}
|
|
|
|
|
|
2017-02-16 14:56:45 -05:00
|
|
|
static int _X_COLD
|
2006-09-17 23:03:23 -07:00
|
|
|
SProcRRSetScreenConfig(ClientPtr client)
|
|
|
|
|
{
|
|
|
|
|
REQUEST(xRRSetScreenConfigReq);
|
|
|
|
|
|
|
|
|
|
if (RRClientKnowsRates(client)) {
|
|
|
|
|
REQUEST_SIZE_MATCH(xRRSetScreenConfigReq);
|
2011-08-04 15:35:41 -04:00
|
|
|
swaps(&stuff->rate);
|
2006-09-17 23:03:23 -07:00
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
REQUEST_SIZE_MATCH(xRR1_0SetScreenConfigReq);
|
|
|
|
|
}
|
2012-03-21 12:55:09 -07:00
|
|
|
|
2011-08-04 15:35:41 -04:00
|
|
|
swapl(&stuff->drawable);
|
|
|
|
|
swapl(&stuff->timestamp);
|
|
|
|
|
swaps(&stuff->sizeID);
|
|
|
|
|
swaps(&stuff->rotation);
|
2024-07-29 15:01:08 +02:00
|
|
|
return ProcRRSetScreenConfig(client);
|
2006-09-17 23:03:23 -07:00
|
|
|
}
|
|
|
|
|
|
2017-02-16 14:56:45 -05:00
|
|
|
static int _X_COLD
|
2006-09-17 23:03:23 -07:00
|
|
|
SProcRRSelectInput(ClientPtr client)
|
|
|
|
|
{
|
|
|
|
|
REQUEST(xRRSelectInputReq);
|
|
|
|
|
|
2014-01-26 19:38:09 -08:00
|
|
|
REQUEST_SIZE_MATCH(xRRSelectInputReq);
|
2011-08-04 15:35:41 -04:00
|
|
|
swapl(&stuff->window);
|
|
|
|
|
swaps(&stuff->enable);
|
2024-07-29 15:01:08 +02:00
|
|
|
return ProcRRSelectInput(client);
|
2006-09-17 23:03:23 -07:00
|
|
|
}
|
|
|
|
|
|
2017-02-16 14:56:45 -05:00
|
|
|
static int _X_COLD
|
2006-09-17 23:03:23 -07:00
|
|
|
SProcRRGetScreenSizeRange(ClientPtr client)
|
|
|
|
|
{
|
|
|
|
|
REQUEST(xRRGetScreenSizeRangeReq);
|
2008-08-21 01:32:03 +02:00
|
|
|
|
2006-09-17 23:03:23 -07:00
|
|
|
REQUEST_SIZE_MATCH(xRRGetScreenSizeRangeReq);
|
2011-08-04 15:35:41 -04:00
|
|
|
swapl(&stuff->window);
|
2024-07-29 15:01:08 +02:00
|
|
|
return ProcRRGetScreenSizeRange(client);
|
2006-09-17 23:03:23 -07:00
|
|
|
}
|
|
|
|
|
|
2017-02-16 14:56:45 -05:00
|
|
|
static int _X_COLD
|
2006-09-17 23:03:23 -07:00
|
|
|
SProcRRSetScreenSize(ClientPtr client)
|
|
|
|
|
{
|
|
|
|
|
REQUEST(xRRSetScreenSizeReq);
|
2008-08-21 01:32:03 +02:00
|
|
|
|
2006-09-17 23:03:23 -07:00
|
|
|
REQUEST_SIZE_MATCH(xRRSetScreenSizeReq);
|
2011-08-04 15:35:41 -04:00
|
|
|
swapl(&stuff->window);
|
|
|
|
|
swaps(&stuff->width);
|
|
|
|
|
swaps(&stuff->height);
|
|
|
|
|
swapl(&stuff->widthInMillimeters);
|
|
|
|
|
swapl(&stuff->heightInMillimeters);
|
2024-07-29 15:01:08 +02:00
|
|
|
return ProcRRSetScreenSize(client);
|
2006-09-17 23:03:23 -07:00
|
|
|
}
|
|
|
|
|
|
2017-02-16 14:56:45 -05:00
|
|
|
static int _X_COLD
|
2006-09-17 23:03:23 -07:00
|
|
|
SProcRRGetScreenResources(ClientPtr client)
|
|
|
|
|
{
|
|
|
|
|
REQUEST(xRRGetScreenResourcesReq);
|
2008-08-21 01:32:03 +02:00
|
|
|
|
2006-09-17 23:03:23 -07:00
|
|
|
REQUEST_SIZE_MATCH(xRRGetScreenResourcesReq);
|
2011-08-04 15:35:41 -04:00
|
|
|
swapl(&stuff->window);
|
2024-07-29 15:01:08 +02:00
|
|
|
return ProcRRGetScreenResources(client);
|
2006-09-17 23:03:23 -07:00
|
|
|
}
|
|
|
|
|
|
2024-07-29 15:01:08 +02:00
|
|
|
static int _X_COLD
|
|
|
|
|
SProcRRGetScreenResourcesCurrent(ClientPtr client)
|
|
|
|
|
{
|
|
|
|
|
REQUEST(xRRGetScreenResourcesCurrentReq);
|
|
|
|
|
|
|
|
|
|
REQUEST_SIZE_MATCH(xRRGetScreenResourcesCurrentReq);
|
|
|
|
|
swaps(&stuff->length);
|
|
|
|
|
swapl(&stuff->window);
|
2024-07-29 15:01:08 +02:00
|
|
|
return ProcRRGetScreenResourcesCurrent(client);
|
2024-07-29 15:01:08 +02:00
|
|
|
}
|
|
|
|
|
|
2017-02-16 14:56:45 -05:00
|
|
|
static int _X_COLD
|
2006-09-17 23:03:23 -07:00
|
|
|
SProcRRGetOutputInfo(ClientPtr client)
|
|
|
|
|
{
|
2008-11-08 12:18:13 -05:00
|
|
|
REQUEST(xRRGetOutputInfoReq);
|
2008-08-21 01:32:03 +02:00
|
|
|
|
2006-09-17 23:03:23 -07:00
|
|
|
REQUEST_SIZE_MATCH(xRRGetOutputInfoReq);
|
2011-08-04 15:35:41 -04:00
|
|
|
swapl(&stuff->output);
|
|
|
|
|
swapl(&stuff->configTimestamp);
|
2024-07-29 15:01:08 +02:00
|
|
|
return ProcRRGetScreenResources(client);
|
2006-09-17 23:03:23 -07:00
|
|
|
}
|
|
|
|
|
|
2017-02-16 14:56:45 -05:00
|
|
|
static int _X_COLD
|
2006-09-17 23:03:23 -07:00
|
|
|
SProcRRListOutputProperties(ClientPtr client)
|
|
|
|
|
{
|
|
|
|
|
REQUEST(xRRListOutputPropertiesReq);
|
2008-08-21 01:32:03 +02:00
|
|
|
|
2006-09-17 23:03:23 -07:00
|
|
|
REQUEST_SIZE_MATCH(xRRListOutputPropertiesReq);
|
2011-08-04 15:35:41 -04:00
|
|
|
swapl(&stuff->output);
|
2024-07-29 15:01:08 +02:00
|
|
|
return ProcRRListOutputProperties(client);
|
2006-09-17 23:03:23 -07:00
|
|
|
}
|
|
|
|
|
|
2017-02-16 14:56:45 -05:00
|
|
|
static int _X_COLD
|
2006-11-21 01:15:26 -08:00
|
|
|
SProcRRQueryOutputProperty(ClientPtr client)
|
|
|
|
|
{
|
|
|
|
|
REQUEST(xRRQueryOutputPropertyReq);
|
2008-08-21 01:32:03 +02:00
|
|
|
|
2006-11-21 01:15:26 -08:00
|
|
|
REQUEST_SIZE_MATCH(xRRQueryOutputPropertyReq);
|
2011-08-04 15:35:41 -04:00
|
|
|
swapl(&stuff->output);
|
|
|
|
|
swapl(&stuff->property);
|
2024-07-29 15:01:08 +02:00
|
|
|
return ProcRRQueryOutputProperty(client);
|
2006-11-21 01:15:26 -08:00
|
|
|
}
|
|
|
|
|
|
2017-02-16 14:56:45 -05:00
|
|
|
static int _X_COLD
|
2006-11-21 01:15:26 -08:00
|
|
|
SProcRRConfigureOutputProperty(ClientPtr client)
|
|
|
|
|
{
|
|
|
|
|
REQUEST(xRRConfigureOutputPropertyReq);
|
2008-08-21 01:32:03 +02:00
|
|
|
|
2014-01-26 19:38:09 -08:00
|
|
|
REQUEST_AT_LEAST_SIZE(xRRConfigureOutputPropertyReq);
|
2011-08-04 15:35:41 -04:00
|
|
|
swapl(&stuff->output);
|
|
|
|
|
swapl(&stuff->property);
|
2008-08-21 01:32:03 +02:00
|
|
|
SwapRestL(stuff);
|
2024-07-29 15:01:08 +02:00
|
|
|
return ProcRRConfigureOutputProperty(client);
|
2006-11-21 01:15:26 -08:00
|
|
|
}
|
|
|
|
|
|
2017-02-16 14:56:45 -05:00
|
|
|
static int _X_COLD
|
2006-09-17 23:03:23 -07:00
|
|
|
SProcRRChangeOutputProperty(ClientPtr client)
|
|
|
|
|
{
|
|
|
|
|
REQUEST(xRRChangeOutputPropertyReq);
|
2008-08-21 01:32:03 +02:00
|
|
|
|
|
|
|
|
REQUEST_AT_LEAST_SIZE(xRRChangeOutputPropertyReq);
|
2011-08-04 15:35:41 -04:00
|
|
|
swapl(&stuff->output);
|
|
|
|
|
swapl(&stuff->property);
|
|
|
|
|
swapl(&stuff->type);
|
|
|
|
|
swapl(&stuff->nUnits);
|
2008-08-21 01:32:03 +02:00
|
|
|
switch (stuff->format) {
|
|
|
|
|
case 8:
|
|
|
|
|
break;
|
|
|
|
|
case 16:
|
|
|
|
|
SwapRestS(stuff);
|
|
|
|
|
break;
|
|
|
|
|
case 32:
|
|
|
|
|
SwapRestL(stuff);
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
client->errorValue = stuff->format;
|
|
|
|
|
return BadValue;
|
|
|
|
|
}
|
2024-07-29 15:01:08 +02:00
|
|
|
return ProcRRChangeOutputProperty(client);
|
2006-09-17 23:03:23 -07:00
|
|
|
}
|
|
|
|
|
|
2017-02-16 14:56:45 -05:00
|
|
|
static int _X_COLD
|
2006-09-17 23:03:23 -07:00
|
|
|
SProcRRDeleteOutputProperty(ClientPtr client)
|
|
|
|
|
{
|
|
|
|
|
REQUEST(xRRDeleteOutputPropertyReq);
|
2012-03-21 12:55:09 -07:00
|
|
|
|
2006-09-17 23:03:23 -07:00
|
|
|
REQUEST_SIZE_MATCH(xRRDeleteOutputPropertyReq);
|
2011-08-04 15:35:41 -04:00
|
|
|
swapl(&stuff->output);
|
|
|
|
|
swapl(&stuff->property);
|
2024-07-29 15:01:08 +02:00
|
|
|
return ProcRRDeleteOutputProperty(client);
|
2006-09-17 23:03:23 -07:00
|
|
|
}
|
|
|
|
|
|
2017-02-16 14:56:45 -05:00
|
|
|
static int _X_COLD
|
2006-09-17 23:03:23 -07:00
|
|
|
SProcRRGetOutputProperty(ClientPtr client)
|
|
|
|
|
{
|
|
|
|
|
REQUEST(xRRGetOutputPropertyReq);
|
2008-08-21 01:32:03 +02:00
|
|
|
|
2006-09-17 23:03:23 -07:00
|
|
|
REQUEST_SIZE_MATCH(xRRGetOutputPropertyReq);
|
2011-08-04 15:35:41 -04:00
|
|
|
swapl(&stuff->output);
|
|
|
|
|
swapl(&stuff->property);
|
|
|
|
|
swapl(&stuff->type);
|
|
|
|
|
swapl(&stuff->longOffset);
|
|
|
|
|
swapl(&stuff->longLength);
|
2024-07-29 15:01:08 +02:00
|
|
|
return ProcRRGetOutputProperty(client);
|
2006-09-17 23:03:23 -07:00
|
|
|
}
|
|
|
|
|
|
2017-02-16 14:56:45 -05:00
|
|
|
static int _X_COLD
|
2006-09-17 23:03:23 -07:00
|
|
|
SProcRRCreateMode(ClientPtr client)
|
|
|
|
|
{
|
2008-08-21 01:32:03 +02:00
|
|
|
xRRModeInfo *modeinfo;
|
2012-03-21 12:55:09 -07:00
|
|
|
|
2006-09-17 23:03:23 -07:00
|
|
|
REQUEST(xRRCreateModeReq);
|
2008-08-21 01:32:03 +02:00
|
|
|
|
|
|
|
|
REQUEST_AT_LEAST_SIZE(xRRCreateModeReq);
|
2011-08-04 15:35:41 -04:00
|
|
|
swapl(&stuff->window);
|
2008-08-21 01:32:03 +02:00
|
|
|
|
|
|
|
|
modeinfo = &stuff->modeInfo;
|
2011-08-04 15:35:41 -04:00
|
|
|
swapl(&modeinfo->id);
|
|
|
|
|
swaps(&modeinfo->width);
|
|
|
|
|
swaps(&modeinfo->height);
|
|
|
|
|
swapl(&modeinfo->dotClock);
|
|
|
|
|
swaps(&modeinfo->hSyncStart);
|
|
|
|
|
swaps(&modeinfo->hSyncEnd);
|
|
|
|
|
swaps(&modeinfo->hTotal);
|
|
|
|
|
swaps(&modeinfo->vSyncStart);
|
|
|
|
|
swaps(&modeinfo->vSyncEnd);
|
|
|
|
|
swaps(&modeinfo->vTotal);
|
|
|
|
|
swaps(&modeinfo->nameLength);
|
|
|
|
|
swapl(&modeinfo->modeFlags);
|
2024-07-29 15:01:08 +02:00
|
|
|
return ProcRRCreateMode(client);
|
2006-09-17 23:03:23 -07:00
|
|
|
}
|
|
|
|
|
|
2017-02-16 14:56:45 -05:00
|
|
|
static int _X_COLD
|
2006-09-17 23:03:23 -07:00
|
|
|
SProcRRDestroyMode(ClientPtr client)
|
|
|
|
|
{
|
|
|
|
|
REQUEST(xRRDestroyModeReq);
|
2008-08-21 01:32:03 +02:00
|
|
|
|
2006-09-17 23:03:23 -07:00
|
|
|
REQUEST_SIZE_MATCH(xRRDestroyModeReq);
|
2011-08-04 15:35:41 -04:00
|
|
|
swapl(&stuff->mode);
|
2024-07-29 15:01:08 +02:00
|
|
|
return ProcRRDestroyMode(client);
|
2006-09-17 23:03:23 -07:00
|
|
|
}
|
|
|
|
|
|
2017-02-16 14:56:45 -05:00
|
|
|
static int _X_COLD
|
2006-09-17 23:03:23 -07:00
|
|
|
SProcRRAddOutputMode(ClientPtr client)
|
|
|
|
|
{
|
|
|
|
|
REQUEST(xRRAddOutputModeReq);
|
2008-08-21 01:32:03 +02:00
|
|
|
|
2006-09-17 23:03:23 -07:00
|
|
|
REQUEST_SIZE_MATCH(xRRAddOutputModeReq);
|
2011-08-04 15:35:41 -04:00
|
|
|
swapl(&stuff->output);
|
|
|
|
|
swapl(&stuff->mode);
|
2024-07-29 15:01:08 +02:00
|
|
|
return ProcRRAddOutputMode(client);
|
2006-09-17 23:03:23 -07:00
|
|
|
}
|
|
|
|
|
|
2017-02-16 14:56:45 -05:00
|
|
|
static int _X_COLD
|
2006-09-17 23:03:23 -07:00
|
|
|
SProcRRDeleteOutputMode(ClientPtr client)
|
|
|
|
|
{
|
|
|
|
|
REQUEST(xRRDeleteOutputModeReq);
|
2008-08-21 01:32:03 +02:00
|
|
|
|
2006-09-17 23:03:23 -07:00
|
|
|
REQUEST_SIZE_MATCH(xRRDeleteOutputModeReq);
|
2011-08-04 15:35:41 -04:00
|
|
|
swapl(&stuff->output);
|
|
|
|
|
swapl(&stuff->mode);
|
2024-07-29 15:01:08 +02:00
|
|
|
return ProcRRDeleteOutputMode(client);
|
2006-09-17 23:03:23 -07:00
|
|
|
}
|
|
|
|
|
|
2017-02-16 14:56:45 -05:00
|
|
|
static int _X_COLD
|
2006-09-17 23:03:23 -07:00
|
|
|
SProcRRGetCrtcInfo(ClientPtr client)
|
|
|
|
|
{
|
|
|
|
|
REQUEST(xRRGetCrtcInfoReq);
|
2008-08-21 01:32:03 +02:00
|
|
|
|
2006-09-17 23:03:23 -07:00
|
|
|
REQUEST_SIZE_MATCH(xRRGetCrtcInfoReq);
|
2011-08-04 15:35:41 -04:00
|
|
|
swapl(&stuff->crtc);
|
|
|
|
|
swapl(&stuff->configTimestamp);
|
2024-07-29 15:01:08 +02:00
|
|
|
return ProcRRGetCrtcInfo(client);
|
2006-09-17 23:03:23 -07:00
|
|
|
}
|
|
|
|
|
|
2017-02-16 14:56:45 -05:00
|
|
|
static int _X_COLD
|
2006-09-17 23:03:23 -07:00
|
|
|
SProcRRSetCrtcConfig(ClientPtr client)
|
|
|
|
|
{
|
|
|
|
|
REQUEST(xRRSetCrtcConfigReq);
|
2008-08-21 01:32:03 +02:00
|
|
|
|
|
|
|
|
REQUEST_AT_LEAST_SIZE(xRRSetCrtcConfigReq);
|
2011-08-04 15:35:41 -04:00
|
|
|
swapl(&stuff->crtc);
|
|
|
|
|
swapl(&stuff->timestamp);
|
|
|
|
|
swapl(&stuff->configTimestamp);
|
|
|
|
|
swaps(&stuff->x);
|
|
|
|
|
swaps(&stuff->y);
|
|
|
|
|
swapl(&stuff->mode);
|
|
|
|
|
swaps(&stuff->rotation);
|
2008-08-21 01:32:03 +02:00
|
|
|
SwapRestL(stuff);
|
2024-07-29 15:01:08 +02:00
|
|
|
return ProcRRSetCrtcConfig(client);
|
2006-09-17 23:03:23 -07:00
|
|
|
}
|
|
|
|
|
|
2017-02-16 14:56:45 -05:00
|
|
|
static int _X_COLD
|
2006-09-17 23:03:23 -07:00
|
|
|
SProcRRGetCrtcGammaSize(ClientPtr client)
|
|
|
|
|
{
|
|
|
|
|
REQUEST(xRRGetCrtcGammaSizeReq);
|
2008-08-21 01:32:03 +02:00
|
|
|
|
2006-09-17 23:03:23 -07:00
|
|
|
REQUEST_SIZE_MATCH(xRRGetCrtcGammaSizeReq);
|
2011-08-04 15:35:41 -04:00
|
|
|
swapl(&stuff->crtc);
|
2024-07-29 15:01:08 +02:00
|
|
|
return ProcRRGetCrtcGammaSize(client);
|
2006-09-17 23:03:23 -07:00
|
|
|
}
|
|
|
|
|
|
2017-02-16 14:56:45 -05:00
|
|
|
static int _X_COLD
|
2006-09-17 23:03:23 -07:00
|
|
|
SProcRRGetCrtcGamma(ClientPtr client)
|
|
|
|
|
{
|
|
|
|
|
REQUEST(xRRGetCrtcGammaReq);
|
2008-08-21 01:32:03 +02:00
|
|
|
|
2006-09-17 23:03:23 -07:00
|
|
|
REQUEST_SIZE_MATCH(xRRGetCrtcGammaReq);
|
2011-08-04 15:35:41 -04:00
|
|
|
swapl(&stuff->crtc);
|
2024-07-29 15:01:08 +02:00
|
|
|
return ProcRRGetCrtcGamma(client);
|
2006-09-17 23:03:23 -07:00
|
|
|
}
|
|
|
|
|
|
2017-02-16 14:56:45 -05:00
|
|
|
static int _X_COLD
|
2006-09-17 23:03:23 -07:00
|
|
|
SProcRRSetCrtcGamma(ClientPtr client)
|
|
|
|
|
{
|
|
|
|
|
REQUEST(xRRSetCrtcGammaReq);
|
2008-08-21 01:32:03 +02:00
|
|
|
|
|
|
|
|
REQUEST_AT_LEAST_SIZE(xRRSetCrtcGammaReq);
|
2011-08-04 15:35:41 -04:00
|
|
|
swapl(&stuff->crtc);
|
|
|
|
|
swaps(&stuff->size);
|
2008-08-21 01:32:03 +02:00
|
|
|
SwapRestS(stuff);
|
2024-07-29 15:01:08 +02:00
|
|
|
return ProcRRSetCrtcGamma(client);
|
2006-09-17 23:03:23 -07:00
|
|
|
}
|
|
|
|
|
|
2017-02-16 14:56:45 -05:00
|
|
|
static int _X_COLD
|
2008-03-13 21:31:12 -07:00
|
|
|
SProcRRSetCrtcTransform(ClientPtr client)
|
|
|
|
|
{
|
2011-08-04 15:35:41 -04:00
|
|
|
int nparams;
|
2008-11-26 21:19:55 +01:00
|
|
|
char *filter;
|
|
|
|
|
CARD32 *params;
|
2012-03-21 12:55:09 -07:00
|
|
|
|
2008-03-13 21:31:12 -07:00
|
|
|
REQUEST(xRRSetCrtcTransformReq);
|
2008-11-26 21:19:55 +01:00
|
|
|
|
|
|
|
|
REQUEST_AT_LEAST_SIZE(xRRSetCrtcTransformReq);
|
2011-08-04 15:35:41 -04:00
|
|
|
swapl(&stuff->crtc);
|
2009-07-06 12:24:27 +10:00
|
|
|
SwapLongs((CARD32 *) &stuff->transform,
|
|
|
|
|
bytes_to_int32(sizeof(xRenderTransform)));
|
2011-08-04 15:35:41 -04:00
|
|
|
swaps(&stuff->nbytesFilter);
|
2008-11-26 21:19:55 +01:00
|
|
|
filter = (char *) (stuff + 1);
|
2009-07-06 12:24:27 +10:00
|
|
|
params = (CARD32 *) (filter + pad_to_int32(stuff->nbytesFilter));
|
2008-11-26 21:19:55 +01:00
|
|
|
nparams = ((CARD32 *) stuff + client->req_len) - params;
|
|
|
|
|
if (nparams < 0)
|
|
|
|
|
return BadLength;
|
|
|
|
|
|
|
|
|
|
SwapLongs(params, nparams);
|
2024-07-29 15:01:08 +02:00
|
|
|
return ProcRRSetCrtcTransform(client);
|
2008-03-13 21:31:12 -07:00
|
|
|
}
|
|
|
|
|
|
2017-02-16 14:56:45 -05:00
|
|
|
static int _X_COLD
|
2008-03-13 21:31:12 -07:00
|
|
|
SProcRRGetCrtcTransform(ClientPtr client)
|
|
|
|
|
{
|
|
|
|
|
REQUEST(xRRGetCrtcTransformReq);
|
2008-11-26 21:19:55 +01:00
|
|
|
|
2008-03-13 21:31:12 -07:00
|
|
|
REQUEST_SIZE_MATCH(xRRGetCrtcTransformReq);
|
2011-08-04 15:35:41 -04:00
|
|
|
swapl(&stuff->crtc);
|
2024-07-29 15:01:08 +02:00
|
|
|
return ProcRRGetCrtcTransform(client);
|
2008-03-13 21:31:12 -07:00
|
|
|
}
|
|
|
|
|
|
2017-02-16 14:56:45 -05:00
|
|
|
static int _X_COLD
|
2008-12-05 15:37:15 +01:00
|
|
|
SProcRRGetPanning(ClientPtr client)
|
|
|
|
|
{
|
|
|
|
|
REQUEST(xRRGetPanningReq);
|
2012-03-21 12:55:09 -07:00
|
|
|
|
2008-12-05 15:37:15 +01:00
|
|
|
REQUEST_SIZE_MATCH(xRRGetPanningReq);
|
2011-08-04 15:35:41 -04:00
|
|
|
swapl(&stuff->crtc);
|
2024-07-29 15:01:08 +02:00
|
|
|
return ProcRRGetPanning(client);
|
2008-12-05 15:37:15 +01:00
|
|
|
}
|
|
|
|
|
|
2017-02-16 14:56:45 -05:00
|
|
|
static int _X_COLD
|
2008-12-05 15:37:15 +01:00
|
|
|
SProcRRSetPanning(ClientPtr client)
|
|
|
|
|
{
|
|
|
|
|
REQUEST(xRRSetPanningReq);
|
2012-03-21 12:55:09 -07:00
|
|
|
|
2008-12-05 15:37:15 +01:00
|
|
|
REQUEST_SIZE_MATCH(xRRSetPanningReq);
|
2011-08-04 15:35:41 -04:00
|
|
|
swapl(&stuff->crtc);
|
|
|
|
|
swapl(&stuff->timestamp);
|
|
|
|
|
swaps(&stuff->left);
|
|
|
|
|
swaps(&stuff->top);
|
|
|
|
|
swaps(&stuff->width);
|
|
|
|
|
swaps(&stuff->height);
|
|
|
|
|
swaps(&stuff->track_left);
|
|
|
|
|
swaps(&stuff->track_top);
|
|
|
|
|
swaps(&stuff->track_width);
|
|
|
|
|
swaps(&stuff->track_height);
|
|
|
|
|
swaps(&stuff->border_left);
|
|
|
|
|
swaps(&stuff->border_top);
|
|
|
|
|
swaps(&stuff->border_right);
|
|
|
|
|
swaps(&stuff->border_bottom);
|
2024-07-29 15:01:08 +02:00
|
|
|
return ProcRRSetPanning(client);
|
2008-12-05 15:37:15 +01:00
|
|
|
}
|
|
|
|
|
|
2017-02-16 14:56:45 -05:00
|
|
|
static int _X_COLD
|
2008-12-09 10:51:37 -05:00
|
|
|
SProcRRSetOutputPrimary(ClientPtr client)
|
|
|
|
|
{
|
|
|
|
|
REQUEST(xRRSetOutputPrimaryReq);
|
|
|
|
|
|
|
|
|
|
REQUEST_SIZE_MATCH(xRRSetOutputPrimaryReq);
|
2011-08-04 15:35:41 -04:00
|
|
|
swapl(&stuff->window);
|
|
|
|
|
swapl(&stuff->output);
|
2024-07-29 15:01:08 +02:00
|
|
|
return ProcRRSetOutputPrimary(client);
|
2008-12-09 10:51:37 -05:00
|
|
|
}
|
|
|
|
|
|
2017-02-16 14:56:45 -05:00
|
|
|
static int _X_COLD
|
2008-12-09 10:51:37 -05:00
|
|
|
SProcRRGetOutputPrimary(ClientPtr client)
|
|
|
|
|
{
|
2009-06-15 10:10:26 -04:00
|
|
|
REQUEST(xRRGetOutputPrimaryReq);
|
2008-12-09 10:51:37 -05:00
|
|
|
|
|
|
|
|
REQUEST_SIZE_MATCH(xRRGetOutputPrimaryReq);
|
2011-08-04 15:35:41 -04:00
|
|
|
swapl(&stuff->window);
|
2024-07-29 15:01:08 +02:00
|
|
|
return ProcRRGetOutputPrimary(client);
|
2008-12-09 10:51:37 -05:00
|
|
|
}
|
|
|
|
|
|
2017-02-16 14:56:45 -05:00
|
|
|
static int _X_COLD
|
|
|
|
|
SProcRRGetProviders(ClientPtr client)
|
2014-04-18 18:29:44 -07:00
|
|
|
{
|
|
|
|
|
REQUEST(xRRGetProvidersReq);
|
|
|
|
|
|
|
|
|
|
REQUEST_SIZE_MATCH(xRRGetProvidersReq);
|
|
|
|
|
swapl(&stuff->window);
|
2024-07-29 15:01:08 +02:00
|
|
|
return ProcRRGetProviders(client);
|
2014-04-18 18:29:44 -07:00
|
|
|
}
|
|
|
|
|
|
2017-02-16 14:56:45 -05:00
|
|
|
static int _X_COLD
|
|
|
|
|
SProcRRGetProviderInfo(ClientPtr client)
|
2014-04-18 18:29:44 -07:00
|
|
|
{
|
|
|
|
|
REQUEST(xRRGetProviderInfoReq);
|
|
|
|
|
|
|
|
|
|
REQUEST_SIZE_MATCH(xRRGetProviderInfoReq);
|
|
|
|
|
swapl(&stuff->provider);
|
|
|
|
|
swapl(&stuff->configTimestamp);
|
2024-07-29 15:01:08 +02:00
|
|
|
return ProcRRGetProviderInfo(client);
|
2014-04-18 18:29:44 -07:00
|
|
|
}
|
|
|
|
|
|
2017-02-16 14:56:45 -05:00
|
|
|
static int _X_COLD
|
|
|
|
|
SProcRRSetProviderOffloadSink(ClientPtr client)
|
2014-04-18 18:29:44 -07:00
|
|
|
{
|
|
|
|
|
REQUEST(xRRSetProviderOffloadSinkReq);
|
|
|
|
|
|
|
|
|
|
REQUEST_SIZE_MATCH(xRRSetProviderOffloadSinkReq);
|
|
|
|
|
swapl(&stuff->provider);
|
|
|
|
|
swapl(&stuff->sink_provider);
|
|
|
|
|
swapl(&stuff->configTimestamp);
|
2024-07-29 15:01:08 +02:00
|
|
|
return ProcRRSetProviderOffloadSink(client);
|
2014-04-18 18:29:44 -07:00
|
|
|
}
|
|
|
|
|
|
2017-02-16 14:56:45 -05:00
|
|
|
static int _X_COLD
|
|
|
|
|
SProcRRSetProviderOutputSource(ClientPtr client)
|
2014-04-18 18:29:44 -07:00
|
|
|
{
|
|
|
|
|
REQUEST(xRRSetProviderOutputSourceReq);
|
|
|
|
|
|
|
|
|
|
REQUEST_SIZE_MATCH(xRRSetProviderOutputSourceReq);
|
|
|
|
|
swapl(&stuff->provider);
|
|
|
|
|
swapl(&stuff->source_provider);
|
|
|
|
|
swapl(&stuff->configTimestamp);
|
2024-07-29 15:01:08 +02:00
|
|
|
return ProcRRSetProviderOutputSource(client);
|
2014-04-18 18:29:44 -07:00
|
|
|
}
|
|
|
|
|
|
2017-02-16 14:56:45 -05:00
|
|
|
static int _X_COLD
|
|
|
|
|
SProcRRListProviderProperties(ClientPtr client)
|
2014-04-18 18:29:44 -07:00
|
|
|
{
|
|
|
|
|
REQUEST(xRRListProviderPropertiesReq);
|
|
|
|
|
|
|
|
|
|
REQUEST_SIZE_MATCH(xRRListProviderPropertiesReq);
|
|
|
|
|
swapl(&stuff->provider);
|
2024-07-29 15:01:08 +02:00
|
|
|
return ProcRRListProviderProperties(client);
|
2014-04-18 18:29:44 -07:00
|
|
|
}
|
|
|
|
|
|
2017-02-16 14:56:45 -05:00
|
|
|
static int _X_COLD
|
|
|
|
|
SProcRRQueryProviderProperty(ClientPtr client)
|
2014-04-18 18:29:44 -07:00
|
|
|
{
|
|
|
|
|
REQUEST(xRRQueryProviderPropertyReq);
|
|
|
|
|
|
|
|
|
|
REQUEST_SIZE_MATCH(xRRQueryProviderPropertyReq);
|
|
|
|
|
swapl(&stuff->provider);
|
|
|
|
|
swapl(&stuff->property);
|
2024-07-29 15:01:08 +02:00
|
|
|
return ProcRRQueryProviderProperty(client);
|
2014-04-18 18:29:44 -07:00
|
|
|
}
|
|
|
|
|
|
2017-02-16 14:56:45 -05:00
|
|
|
static int _X_COLD
|
|
|
|
|
SProcRRConfigureProviderProperty(ClientPtr client)
|
2014-04-18 18:29:44 -07:00
|
|
|
{
|
|
|
|
|
REQUEST(xRRConfigureProviderPropertyReq);
|
|
|
|
|
|
|
|
|
|
REQUEST_AT_LEAST_SIZE(xRRConfigureProviderPropertyReq);
|
|
|
|
|
swapl(&stuff->provider);
|
|
|
|
|
swapl(&stuff->property);
|
|
|
|
|
/* TODO: no way to specify format? */
|
|
|
|
|
SwapRestL(stuff);
|
2024-07-29 15:01:08 +02:00
|
|
|
return ProcRRConfigureProviderProperty(client);
|
2014-04-18 18:29:44 -07:00
|
|
|
}
|
|
|
|
|
|
2017-02-16 14:56:45 -05:00
|
|
|
static int _X_COLD
|
|
|
|
|
SProcRRChangeProviderProperty(ClientPtr client)
|
2014-04-18 18:29:44 -07:00
|
|
|
{
|
|
|
|
|
REQUEST(xRRChangeProviderPropertyReq);
|
|
|
|
|
|
|
|
|
|
REQUEST_AT_LEAST_SIZE(xRRChangeProviderPropertyReq);
|
|
|
|
|
swapl(&stuff->provider);
|
|
|
|
|
swapl(&stuff->property);
|
|
|
|
|
swapl(&stuff->type);
|
|
|
|
|
swapl(&stuff->nUnits);
|
|
|
|
|
switch (stuff->format) {
|
|
|
|
|
case 8:
|
|
|
|
|
break;
|
|
|
|
|
case 16:
|
|
|
|
|
SwapRestS(stuff);
|
|
|
|
|
break;
|
|
|
|
|
case 32:
|
|
|
|
|
SwapRestL(stuff);
|
|
|
|
|
break;
|
|
|
|
|
}
|
2024-07-29 15:01:08 +02:00
|
|
|
return ProcRRChangeProviderProperty(client);
|
2014-04-18 18:29:44 -07:00
|
|
|
}
|
|
|
|
|
|
2017-02-16 14:56:45 -05:00
|
|
|
static int _X_COLD
|
|
|
|
|
SProcRRDeleteProviderProperty(ClientPtr client)
|
2014-04-18 18:29:44 -07:00
|
|
|
{
|
|
|
|
|
REQUEST(xRRDeleteProviderPropertyReq);
|
|
|
|
|
|
|
|
|
|
REQUEST_SIZE_MATCH(xRRDeleteProviderPropertyReq);
|
|
|
|
|
swapl(&stuff->provider);
|
|
|
|
|
swapl(&stuff->property);
|
2024-07-29 15:01:08 +02:00
|
|
|
return ProcRRDeleteProviderProperty(client);
|
2014-04-18 18:29:44 -07:00
|
|
|
}
|
|
|
|
|
|
2017-02-16 14:56:45 -05:00
|
|
|
static int _X_COLD
|
|
|
|
|
SProcRRGetProviderProperty(ClientPtr client)
|
2014-04-18 18:29:44 -07:00
|
|
|
{
|
|
|
|
|
REQUEST(xRRGetProviderPropertyReq);
|
|
|
|
|
|
|
|
|
|
REQUEST_SIZE_MATCH(xRRGetProviderPropertyReq);
|
|
|
|
|
swapl(&stuff->provider);
|
|
|
|
|
swapl(&stuff->property);
|
|
|
|
|
swapl(&stuff->type);
|
|
|
|
|
swapl(&stuff->longOffset);
|
|
|
|
|
swapl(&stuff->longLength);
|
2024-07-29 15:01:08 +02:00
|
|
|
return ProcRRGetProviderProperty(client);
|
2014-04-18 18:29:44 -07:00
|
|
|
}
|
|
|
|
|
|
2017-02-16 14:56:45 -05:00
|
|
|
static int _X_COLD
|
|
|
|
|
SProcRRGetMonitors(ClientPtr client) {
|
2014-12-16 01:59:03 -08:00
|
|
|
REQUEST(xRRGetMonitorsReq);
|
|
|
|
|
|
|
|
|
|
REQUEST_SIZE_MATCH(xRRGetMonitorsReq);
|
|
|
|
|
swapl(&stuff->window);
|
2024-07-29 15:01:08 +02:00
|
|
|
return ProcRRGetMonitors(client);
|
2014-12-16 01:59:03 -08:00
|
|
|
}
|
|
|
|
|
|
2017-02-16 14:56:45 -05:00
|
|
|
static int _X_COLD
|
|
|
|
|
SProcRRSetMonitor(ClientPtr client) {
|
2014-12-16 01:59:03 -08:00
|
|
|
REQUEST(xRRSetMonitorReq);
|
|
|
|
|
|
|
|
|
|
REQUEST_AT_LEAST_SIZE(xRRGetMonitorsReq);
|
|
|
|
|
swapl(&stuff->window);
|
|
|
|
|
swapl(&stuff->monitor.name);
|
|
|
|
|
swaps(&stuff->monitor.noutput);
|
|
|
|
|
swaps(&stuff->monitor.x);
|
|
|
|
|
swaps(&stuff->monitor.y);
|
|
|
|
|
swaps(&stuff->monitor.width);
|
|
|
|
|
swaps(&stuff->monitor.height);
|
|
|
|
|
SwapRestL(stuff);
|
2024-07-29 15:01:08 +02:00
|
|
|
return ProcRRSetMonitor(client);
|
2014-12-16 01:59:03 -08:00
|
|
|
}
|
|
|
|
|
|
2017-02-16 14:56:45 -05:00
|
|
|
static int _X_COLD
|
|
|
|
|
SProcRRDeleteMonitor(ClientPtr client) {
|
2014-12-16 01:59:03 -08:00
|
|
|
REQUEST(xRRDeleteMonitorReq);
|
|
|
|
|
|
|
|
|
|
REQUEST_SIZE_MATCH(xRRDeleteMonitorReq);
|
|
|
|
|
swapl(&stuff->window);
|
|
|
|
|
swapl(&stuff->name);
|
2024-07-29 15:01:08 +02:00
|
|
|
return ProcRRDeleteMonitor(client);
|
2014-12-16 01:59:03 -08:00
|
|
|
}
|
|
|
|
|
|
Add RandR leases with modesetting driver support [v6]
This adds support for RandR CRTC/Output leases through the modesetting
driver, creating a lease using new kernel infrastructure and returning
that to a client through an fd which will have access to only those
resources.
v2: Restore CRTC mode when leases terminate
When a lease terminates for a crtc we have saved data for, go
ahead and restore the saved mode.
v3: Report RR_Rotate_0 rotations for leased crtcs.
Ignore leased CRTCs when selecting screen size.
Stop leasing encoders, the kernel doesn't do that anymore.
Turn off crtc->enabled while leased so that modesetting
ignores them.
Check lease status before calling any driver mode functions
When starting a lease, mark leased CRTCs as disabled and hide
their cursors. Also, check to see if there are other
non-leased CRTCs which are driving leased Outputs and mark
them as disabled as well. Sometimes an application will lease
an idle crtc instead of the one already associated with the
leased output.
When terminating a lease, reset any CRTCs which are driving
outputs that are no longer leased so that they start working
again.
This required splitting the DIX level lease termination code
into two pieces, one to remove the lease from the system
(RRLeaseTerminated) and a new function that frees the lease
data structure (RRLeaseFree).
v4: Report RR_Rotate_0 rotation for leased crtcs.
v5: Terminate all leases on server reset.
Leases hang around after the associated client exits so that
the client doesn't need to occupy an X server client slot and
consume a file descriptor once it has gotten the output
resources necessary.
Any leases still hanging around when the X server resets or
shuts down need to be cleaned up by calling the kernel to
terminate the lease and freeing any DIX structures.
Note that we cannot simply use the existing
drmmode_terminate_lease function on each lease as that wants
to also reset the video mode, and during server shut down that
modesetting: Validate leases on VT enter
The kernel doesn't allow any master ioctls to run when another
VT is active, including simple things like listing the active
leases. To deal with that, we check the list of leases
whenever the X server VT is activated.
xfree86: hide disabled cursors when resetting after lease termination
The lessee may well have played with cursors and left one
active on our screen. Just tell the kernel to turn it off.
v6: Add meson build infrastructure
[Also bumped libdrm requirement - ajax]
Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2018-02-12 13:51:56 -08:00
|
|
|
static int _X_COLD
|
|
|
|
|
SProcRRCreateLease(ClientPtr client) {
|
|
|
|
|
REQUEST(xRRCreateLeaseReq);
|
|
|
|
|
|
|
|
|
|
REQUEST_AT_LEAST_SIZE(xRRCreateLeaseReq);
|
|
|
|
|
swapl(&stuff->window);
|
|
|
|
|
swaps(&stuff->nCrtcs);
|
|
|
|
|
swaps(&stuff->nOutputs);
|
|
|
|
|
SwapRestL(stuff);
|
2024-07-29 15:01:08 +02:00
|
|
|
return ProcRRCreateLease(client);
|
Add RandR leases with modesetting driver support [v6]
This adds support for RandR CRTC/Output leases through the modesetting
driver, creating a lease using new kernel infrastructure and returning
that to a client through an fd which will have access to only those
resources.
v2: Restore CRTC mode when leases terminate
When a lease terminates for a crtc we have saved data for, go
ahead and restore the saved mode.
v3: Report RR_Rotate_0 rotations for leased crtcs.
Ignore leased CRTCs when selecting screen size.
Stop leasing encoders, the kernel doesn't do that anymore.
Turn off crtc->enabled while leased so that modesetting
ignores them.
Check lease status before calling any driver mode functions
When starting a lease, mark leased CRTCs as disabled and hide
their cursors. Also, check to see if there are other
non-leased CRTCs which are driving leased Outputs and mark
them as disabled as well. Sometimes an application will lease
an idle crtc instead of the one already associated with the
leased output.
When terminating a lease, reset any CRTCs which are driving
outputs that are no longer leased so that they start working
again.
This required splitting the DIX level lease termination code
into two pieces, one to remove the lease from the system
(RRLeaseTerminated) and a new function that frees the lease
data structure (RRLeaseFree).
v4: Report RR_Rotate_0 rotation for leased crtcs.
v5: Terminate all leases on server reset.
Leases hang around after the associated client exits so that
the client doesn't need to occupy an X server client slot and
consume a file descriptor once it has gotten the output
resources necessary.
Any leases still hanging around when the X server resets or
shuts down need to be cleaned up by calling the kernel to
terminate the lease and freeing any DIX structures.
Note that we cannot simply use the existing
drmmode_terminate_lease function on each lease as that wants
to also reset the video mode, and during server shut down that
modesetting: Validate leases on VT enter
The kernel doesn't allow any master ioctls to run when another
VT is active, including simple things like listing the active
leases. To deal with that, we check the list of leases
whenever the X server VT is activated.
xfree86: hide disabled cursors when resetting after lease termination
The lessee may well have played with cursors and left one
active on our screen. Just tell the kernel to turn it off.
v6: Add meson build infrastructure
[Also bumped libdrm requirement - ajax]
Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2018-02-12 13:51:56 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static int _X_COLD
|
|
|
|
|
SProcRRFreeLease(ClientPtr client) {
|
|
|
|
|
REQUEST(xRRFreeLeaseReq);
|
|
|
|
|
|
|
|
|
|
REQUEST_SIZE_MATCH(xRRFreeLeaseReq);
|
|
|
|
|
swapl(&stuff->lid);
|
2024-07-29 15:01:08 +02:00
|
|
|
return ProcRRFreeLease(client);
|
Add RandR leases with modesetting driver support [v6]
This adds support for RandR CRTC/Output leases through the modesetting
driver, creating a lease using new kernel infrastructure and returning
that to a client through an fd which will have access to only those
resources.
v2: Restore CRTC mode when leases terminate
When a lease terminates for a crtc we have saved data for, go
ahead and restore the saved mode.
v3: Report RR_Rotate_0 rotations for leased crtcs.
Ignore leased CRTCs when selecting screen size.
Stop leasing encoders, the kernel doesn't do that anymore.
Turn off crtc->enabled while leased so that modesetting
ignores them.
Check lease status before calling any driver mode functions
When starting a lease, mark leased CRTCs as disabled and hide
their cursors. Also, check to see if there are other
non-leased CRTCs which are driving leased Outputs and mark
them as disabled as well. Sometimes an application will lease
an idle crtc instead of the one already associated with the
leased output.
When terminating a lease, reset any CRTCs which are driving
outputs that are no longer leased so that they start working
again.
This required splitting the DIX level lease termination code
into two pieces, one to remove the lease from the system
(RRLeaseTerminated) and a new function that frees the lease
data structure (RRLeaseFree).
v4: Report RR_Rotate_0 rotation for leased crtcs.
v5: Terminate all leases on server reset.
Leases hang around after the associated client exits so that
the client doesn't need to occupy an X server client slot and
consume a file descriptor once it has gotten the output
resources necessary.
Any leases still hanging around when the X server resets or
shuts down need to be cleaned up by calling the kernel to
terminate the lease and freeing any DIX structures.
Note that we cannot simply use the existing
drmmode_terminate_lease function on each lease as that wants
to also reset the video mode, and during server shut down that
modesetting: Validate leases on VT enter
The kernel doesn't allow any master ioctls to run when another
VT is active, including simple things like listing the active
leases. To deal with that, we check the list of leases
whenever the X server VT is activated.
xfree86: hide disabled cursors when resetting after lease termination
The lessee may well have played with cursors and left one
active on our screen. Just tell the kernel to turn it off.
v6: Add meson build infrastructure
[Also bumped libdrm requirement - ajax]
Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2018-02-12 13:51:56 -08:00
|
|
|
}
|
|
|
|
|
|
2024-07-29 15:03:35 +02:00
|
|
|
int
|
|
|
|
|
SProcRRDispatch(ClientPtr client)
|
|
|
|
|
{
|
|
|
|
|
REQUEST(xReq);
|
|
|
|
|
UpdateCurrentTimeIf();
|
|
|
|
|
|
|
|
|
|
switch (stuff->data) {
|
|
|
|
|
case X_RRQueryVersion: return SProcRRQueryVersion(client);
|
|
|
|
|
case X_RRSetScreenConfig: return SProcRRSetScreenConfig(client);
|
|
|
|
|
case X_RRSelectInput: return SProcRRSelectInput(client);
|
|
|
|
|
case X_RRGetScreenInfo: return SProcRRGetScreenInfo(client);
|
|
|
|
|
|
|
|
|
|
/* V1.2 additions */
|
|
|
|
|
case X_RRGetScreenSizeRange: return SProcRRGetScreenSizeRange(client);
|
|
|
|
|
case X_RRSetScreenSize: return SProcRRSetScreenSize(client);
|
|
|
|
|
case X_RRGetScreenResources: return SProcRRGetScreenResources(client);
|
|
|
|
|
case X_RRGetOutputInfo: return SProcRRGetOutputInfo(client);
|
|
|
|
|
case X_RRListOutputProperties: return SProcRRListOutputProperties(client);
|
|
|
|
|
case X_RRQueryOutputProperty: return SProcRRQueryOutputProperty(client);
|
|
|
|
|
case X_RRConfigureOutputProperty: return SProcRRConfigureOutputProperty(client);
|
|
|
|
|
case X_RRChangeOutputProperty: return SProcRRChangeOutputProperty(client);
|
|
|
|
|
case X_RRDeleteOutputProperty: return SProcRRDeleteOutputProperty(client);
|
|
|
|
|
case X_RRGetOutputProperty: return SProcRRGetOutputProperty(client);
|
|
|
|
|
case X_RRCreateMode: return SProcRRCreateMode(client);
|
|
|
|
|
case X_RRDestroyMode: return SProcRRDestroyMode(client);
|
|
|
|
|
case X_RRAddOutputMode: return SProcRRAddOutputMode(client);
|
|
|
|
|
case X_RRDeleteOutputMode: return SProcRRDeleteOutputMode(client);
|
|
|
|
|
case X_RRGetCrtcInfo: return SProcRRGetCrtcInfo(client);
|
|
|
|
|
case X_RRSetCrtcConfig: return SProcRRSetCrtcConfig(client);
|
|
|
|
|
case X_RRGetCrtcGammaSize: return SProcRRGetCrtcGammaSize(client);
|
|
|
|
|
case X_RRGetCrtcGamma: return SProcRRGetCrtcGamma(client);
|
|
|
|
|
case X_RRSetCrtcGamma: return SProcRRSetCrtcGamma(client);
|
|
|
|
|
|
|
|
|
|
/* V1.3 additions */
|
|
|
|
|
case X_RRGetScreenResourcesCurrent: return SProcRRGetScreenResourcesCurrent(client);
|
|
|
|
|
case X_RRSetCrtcTransform: return SProcRRSetCrtcTransform(client);
|
|
|
|
|
case X_RRGetCrtcTransform: return SProcRRGetCrtcTransform(client);
|
|
|
|
|
case X_RRGetPanning: return SProcRRGetPanning(client);
|
|
|
|
|
case X_RRSetPanning: return SProcRRSetPanning(client);
|
|
|
|
|
case X_RRSetOutputPrimary: return SProcRRSetOutputPrimary(client);
|
|
|
|
|
case X_RRGetOutputPrimary: return SProcRRGetOutputPrimary(client);
|
|
|
|
|
|
|
|
|
|
/* V1.4 additions */
|
|
|
|
|
case X_RRGetProviders: return SProcRRGetProviders(client);
|
|
|
|
|
case X_RRGetProviderInfo: return SProcRRGetProviderInfo(client);
|
|
|
|
|
case X_RRSetProviderOffloadSink: return SProcRRSetProviderOffloadSink(client);
|
|
|
|
|
case X_RRSetProviderOutputSource: return SProcRRSetProviderOutputSource(client);
|
|
|
|
|
case X_RRListProviderProperties: return SProcRRListProviderProperties(client);
|
|
|
|
|
case X_RRQueryProviderProperty: return SProcRRQueryProviderProperty(client);
|
|
|
|
|
case X_RRConfigureProviderProperty: return SProcRRConfigureProviderProperty(client);
|
|
|
|
|
case X_RRChangeProviderProperty: return SProcRRChangeProviderProperty(client);
|
|
|
|
|
case X_RRDeleteProviderProperty: return SProcRRDeleteProviderProperty(client);
|
|
|
|
|
case X_RRGetProviderProperty: return SProcRRGetProviderProperty(client);
|
|
|
|
|
|
|
|
|
|
/* V1.5 additions */
|
|
|
|
|
case X_RRGetMonitors: return SProcRRGetMonitors(client);
|
|
|
|
|
case X_RRSetMonitor: return SProcRRSetMonitor(client);
|
|
|
|
|
case X_RRDeleteMonitor: return SProcRRDeleteMonitor(client);
|
|
|
|
|
|
|
|
|
|
/* V1.6 additions */
|
|
|
|
|
case X_RRCreateLease: return SProcRRCreateLease(client);
|
|
|
|
|
case X_RRFreeLease: return SProcRRFreeLease(client);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return BadRequest;
|
|
|
|
|
}
|