2006-09-21 07:43:05 +02: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.
|
|
|
|
*/
|
|
|
|
/*
|
|
|
|
* This Xinerama implementation comes from the SiS driver which has
|
|
|
|
* the following notice:
|
|
|
|
*/
|
2014-10-31 00:45:12 +01:00
|
|
|
/*
|
2006-09-21 07:43:05 +02:00
|
|
|
* SiS driver main code
|
|
|
|
*
|
|
|
|
* Copyright (C) 2001-2005 by Thomas Winischhofer, Vienna, Austria.
|
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions
|
|
|
|
* are met:
|
|
|
|
* 1) Redistributions of source code must retain the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer.
|
|
|
|
* 2) Redistributions in binary form must reproduce the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer in the
|
|
|
|
* documentation and/or other materials provided with the distribution.
|
|
|
|
* 3) The name of the author may not be used to endorse or promote products
|
|
|
|
* derived from this software without specific prior written permission.
|
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
|
|
|
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
|
|
|
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
|
|
|
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|
|
|
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
|
|
|
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
|
|
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
|
|
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
|
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
|
|
|
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
*
|
|
|
|
* Author: Thomas Winischhofer <thomas@winischhofer.net>
|
|
|
|
* - driver entirely rewritten since 2001, only basic structure taken from
|
|
|
|
* old code (except sis_dri.c, sis_shadow.c, sis_accel.c and parts of
|
|
|
|
* sis_dga.c; these were mostly taken over; sis_dri.c was changed for
|
|
|
|
* new versions of the DRI layer)
|
|
|
|
*
|
|
|
|
* This notice covers the entire driver code unless indicated otherwise.
|
|
|
|
*
|
|
|
|
* Formerly based on code which was
|
|
|
|
* Copyright (C) 1998, 1999 by Alan Hourihane, Wigan, England.
|
|
|
|
* Written by:
|
|
|
|
* Alan Hourihane <alanh@fairlite.demon.co.uk>,
|
|
|
|
* Mike Chapman <mike@paranoia.com>,
|
|
|
|
* Juanjo Santamarta <santamarta@ctv.es>,
|
|
|
|
* Mitani Hiroshi <hmitani@drl.mei.co.jp>,
|
|
|
|
* David Thomas <davtom@dream.org.uk>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "randrstr.h"
|
|
|
|
#include "swaprep.h"
|
|
|
|
#include <X11/extensions/panoramiXproto.h>
|
2009-09-18 08:27:54 +02:00
|
|
|
#include "protocol-versions.h"
|
2006-09-21 07:43:05 +02:00
|
|
|
|
|
|
|
/* Xinerama is not multi-screen capable; just report about screen 0 */
|
|
|
|
#define RR_XINERAMA_SCREEN 0
|
|
|
|
|
|
|
|
static int ProcRRXineramaQueryVersion(ClientPtr client);
|
|
|
|
static int ProcRRXineramaGetState(ClientPtr client);
|
|
|
|
static int ProcRRXineramaGetScreenCount(ClientPtr client);
|
|
|
|
static int ProcRRXineramaGetScreenSize(ClientPtr client);
|
|
|
|
static int ProcRRXineramaIsActive(ClientPtr client);
|
|
|
|
static int ProcRRXineramaQueryScreens(ClientPtr client);
|
2017-02-16 20:56:45 +01:00
|
|
|
static int _X_COLD SProcRRXineramaDispatch(ClientPtr client);
|
2006-09-21 07:43:05 +02:00
|
|
|
|
2012-07-12 03:00:43 +02:00
|
|
|
Bool noRRXineramaExtension = FALSE;
|
|
|
|
|
2006-09-21 07:43:05 +02:00
|
|
|
/* Proc */
|
|
|
|
|
|
|
|
int
|
|
|
|
ProcRRXineramaQueryVersion(ClientPtr client)
|
|
|
|
{
|
2012-07-10 04:12:43 +02:00
|
|
|
xPanoramiXQueryVersionReply rep = {
|
|
|
|
.type = X_Reply,
|
|
|
|
.sequenceNumber = client->sequence,
|
|
|
|
.length = 0,
|
|
|
|
.majorVersion = SERVER_RRXINERAMA_MAJOR_VERSION,
|
|
|
|
.minorVersion = SERVER_RRXINERAMA_MINOR_VERSION
|
|
|
|
};
|
2006-09-21 07:43:05 +02:00
|
|
|
|
|
|
|
REQUEST_SIZE_MATCH(xPanoramiXQueryVersionReq);
|
2012-03-21 20:55:09 +01:00
|
|
|
if (client->swapped) {
|
2011-08-04 21:35:41 +02:00
|
|
|
swaps(&rep.sequenceNumber);
|
|
|
|
swapl(&rep.length);
|
|
|
|
swaps(&rep.majorVersion);
|
|
|
|
swaps(&rep.minorVersion);
|
2006-09-21 07:43:05 +02:00
|
|
|
}
|
2012-05-13 09:03:35 +02:00
|
|
|
WriteToClient(client, sizeof(xPanoramiXQueryVersionReply), &rep);
|
2010-05-11 05:22:05 +02:00
|
|
|
return Success;
|
2006-09-21 07:43:05 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
int
|
|
|
|
ProcRRXineramaGetState(ClientPtr client)
|
|
|
|
{
|
|
|
|
REQUEST(xPanoramiXGetStateReq);
|
2012-03-21 20:55:09 +01:00
|
|
|
WindowPtr pWin;
|
|
|
|
xPanoramiXGetStateReply rep;
|
|
|
|
register int rc;
|
|
|
|
ScreenPtr pScreen;
|
|
|
|
rrScrPrivPtr pScrPriv;
|
|
|
|
Bool active = FALSE;
|
2006-09-21 07:43:05 +02:00
|
|
|
|
|
|
|
REQUEST_SIZE_MATCH(xPanoramiXGetStateReq);
|
2008-02-28 22:43:43 +01:00
|
|
|
rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
|
2012-03-21 20:55:09 +01:00
|
|
|
if (rc != Success)
|
|
|
|
return rc;
|
2006-09-21 07:43:05 +02:00
|
|
|
|
|
|
|
pScreen = pWin->drawable.pScreen;
|
|
|
|
pScrPriv = rrGetScrPriv(pScreen);
|
2012-03-21 20:55:09 +01:00
|
|
|
if (pScrPriv) {
|
|
|
|
/* XXX do we need more than this? */
|
|
|
|
active = TRUE;
|
2006-09-21 07:43:05 +02:00
|
|
|
}
|
|
|
|
|
2012-07-10 04:12:43 +02:00
|
|
|
rep = (xPanoramiXGetStateReply) {
|
|
|
|
.type = X_Reply,
|
|
|
|
.state = active,
|
|
|
|
.sequenceNumber = client->sequence,
|
|
|
|
.length = 0,
|
|
|
|
.window = stuff->window
|
|
|
|
};
|
2012-03-21 20:55:09 +01:00
|
|
|
if (client->swapped) {
|
|
|
|
swaps(&rep.sequenceNumber);
|
|
|
|
swapl(&rep.length);
|
|
|
|
swapl(&rep.window);
|
2006-09-21 07:43:05 +02:00
|
|
|
}
|
2012-05-13 09:03:35 +02:00
|
|
|
WriteToClient(client, sizeof(xPanoramiXGetStateReply), &rep);
|
2010-05-11 05:22:05 +02:00
|
|
|
return Success;
|
2006-09-21 07:43:05 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
2012-03-21 20:55:09 +01:00
|
|
|
RRXineramaScreenCount(ScreenPtr pScreen)
|
2006-09-21 07:43:05 +02:00
|
|
|
{
|
2014-12-16 18:56:50 +01:00
|
|
|
return RRMonitorCountList(pScreen);
|
2006-09-21 07:43:05 +02:00
|
|
|
}
|
|
|
|
|
2007-09-01 07:11:13 +02:00
|
|
|
static Bool
|
2012-03-21 20:55:09 +01:00
|
|
|
RRXineramaScreenActive(ScreenPtr pScreen)
|
2007-09-01 07:11:13 +02:00
|
|
|
{
|
2012-03-21 20:55:09 +01:00
|
|
|
return RRXineramaScreenCount(pScreen) > 0;
|
2007-09-01 07:11:13 +02:00
|
|
|
}
|
|
|
|
|
2006-09-21 07:43:05 +02:00
|
|
|
int
|
|
|
|
ProcRRXineramaGetScreenCount(ClientPtr client)
|
|
|
|
{
|
|
|
|
REQUEST(xPanoramiXGetScreenCountReq);
|
2012-03-21 20:55:09 +01:00
|
|
|
WindowPtr pWin;
|
|
|
|
xPanoramiXGetScreenCountReply rep;
|
|
|
|
register int rc;
|
2006-09-21 07:43:05 +02:00
|
|
|
|
|
|
|
REQUEST_SIZE_MATCH(xPanoramiXGetScreenCountReq);
|
2008-02-28 22:43:43 +01:00
|
|
|
rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
|
2006-12-15 20:11:40 +01:00
|
|
|
if (rc != Success)
|
2012-03-21 20:55:09 +01:00
|
|
|
return rc;
|
|
|
|
|
2012-07-10 04:12:43 +02:00
|
|
|
rep = (xPanoramiXGetScreenCountReply) {
|
|
|
|
.type = X_Reply,
|
|
|
|
.ScreenCount = RRXineramaScreenCount(pWin->drawable.pScreen),
|
|
|
|
.sequenceNumber = client->sequence,
|
|
|
|
.length = 0,
|
|
|
|
.window = stuff->window
|
|
|
|
};
|
2012-03-21 20:55:09 +01:00
|
|
|
if (client->swapped) {
|
|
|
|
swaps(&rep.sequenceNumber);
|
|
|
|
swapl(&rep.length);
|
|
|
|
swapl(&rep.window);
|
2006-09-21 07:43:05 +02:00
|
|
|
}
|
2012-05-13 09:03:35 +02:00
|
|
|
WriteToClient(client, sizeof(xPanoramiXGetScreenCountReply), &rep);
|
2010-05-11 05:22:05 +02:00
|
|
|
return Success;
|
2006-09-21 07:43:05 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
int
|
|
|
|
ProcRRXineramaGetScreenSize(ClientPtr client)
|
|
|
|
{
|
|
|
|
REQUEST(xPanoramiXGetScreenSizeReq);
|
2012-03-21 20:55:09 +01:00
|
|
|
WindowPtr pWin, pRoot;
|
|
|
|
ScreenPtr pScreen;
|
|
|
|
xPanoramiXGetScreenSizeReply rep;
|
|
|
|
register int rc;
|
2006-09-21 07:43:05 +02:00
|
|
|
|
|
|
|
REQUEST_SIZE_MATCH(xPanoramiXGetScreenSizeReq);
|
2008-02-28 22:43:43 +01:00
|
|
|
rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
|
2006-12-15 20:11:40 +01:00
|
|
|
if (rc != Success)
|
2012-03-21 20:55:09 +01:00
|
|
|
return rc;
|
2006-09-21 07:43:05 +02:00
|
|
|
|
|
|
|
pScreen = pWin->drawable.pScreen;
|
2010-05-22 09:26:28 +02:00
|
|
|
pRoot = pScreen->root;
|
2012-03-21 20:55:09 +01:00
|
|
|
|
2012-07-10 04:12:43 +02:00
|
|
|
rep = (xPanoramiXGetScreenSizeReply) {
|
|
|
|
.type = X_Reply,
|
|
|
|
.sequenceNumber = client->sequence,
|
|
|
|
.length = 0,
|
|
|
|
.width = pRoot->drawable.width,
|
|
|
|
.height = pRoot->drawable.height,
|
|
|
|
.window = stuff->window,
|
|
|
|
.screen = stuff->screen
|
|
|
|
};
|
2012-03-21 20:55:09 +01:00
|
|
|
if (client->swapped) {
|
|
|
|
swaps(&rep.sequenceNumber);
|
|
|
|
swapl(&rep.length);
|
|
|
|
swapl(&rep.width);
|
|
|
|
swapl(&rep.height);
|
|
|
|
swapl(&rep.window);
|
|
|
|
swapl(&rep.screen);
|
2006-09-21 07:43:05 +02:00
|
|
|
}
|
2012-05-13 09:03:35 +02:00
|
|
|
WriteToClient(client, sizeof(xPanoramiXGetScreenSizeReply), &rep);
|
2010-05-11 05:22:05 +02:00
|
|
|
return Success;
|
2006-09-21 07:43:05 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
int
|
|
|
|
ProcRRXineramaIsActive(ClientPtr client)
|
|
|
|
{
|
2012-03-21 20:55:09 +01:00
|
|
|
xXineramaIsActiveReply rep;
|
2006-09-21 07:43:05 +02:00
|
|
|
|
|
|
|
REQUEST_SIZE_MATCH(xXineramaIsActiveReq);
|
2009-02-13 10:23:28 +01:00
|
|
|
|
2012-07-10 04:12:43 +02:00
|
|
|
rep = (xXineramaIsActiveReply) {
|
|
|
|
.type = X_Reply,
|
|
|
|
.length = 0,
|
|
|
|
.sequenceNumber = client->sequence,
|
|
|
|
.state = RRXineramaScreenActive(screenInfo.screens[RR_XINERAMA_SCREEN])
|
|
|
|
};
|
2012-03-21 20:55:09 +01:00
|
|
|
if (client->swapped) {
|
|
|
|
swaps(&rep.sequenceNumber);
|
|
|
|
swapl(&rep.length);
|
|
|
|
swapl(&rep.state);
|
2006-09-21 07:43:05 +02:00
|
|
|
}
|
2012-05-13 09:03:35 +02:00
|
|
|
WriteToClient(client, sizeof(xXineramaIsActiveReply), &rep);
|
2010-05-11 05:22:05 +02:00
|
|
|
return Success;
|
2006-09-21 07:43:05 +02:00
|
|
|
}
|
|
|
|
|
2008-12-08 23:28:55 +01:00
|
|
|
static void
|
2014-12-16 18:56:50 +01:00
|
|
|
RRXineramaWriteMonitor(ClientPtr client, RRMonitorPtr monitor)
|
2008-12-08 23:28:55 +01:00
|
|
|
{
|
|
|
|
xXineramaScreenInfo scratch;
|
|
|
|
|
2014-12-16 18:56:50 +01:00
|
|
|
scratch.x_org = monitor->geometry.box.x1;
|
|
|
|
scratch.y_org = monitor->geometry.box.y1;
|
|
|
|
scratch.width = monitor->geometry.box.x2 - monitor->geometry.box.x1;
|
|
|
|
scratch.height = monitor->geometry.box.y2 - monitor->geometry.box.y1;
|
|
|
|
|
2016-12-12 16:45:22 +01:00
|
|
|
if (client->swapped) {
|
|
|
|
swaps(&scratch.x_org);
|
|
|
|
swaps(&scratch.y_org);
|
|
|
|
swaps(&scratch.width);
|
|
|
|
swaps(&scratch.height);
|
|
|
|
}
|
|
|
|
|
2014-12-16 18:56:50 +01:00
|
|
|
WriteToClient(client, sz_XineramaScreenInfo, &scratch);
|
2008-12-08 23:28:55 +01:00
|
|
|
}
|
|
|
|
|
2006-09-21 07:43:05 +02:00
|
|
|
int
|
|
|
|
ProcRRXineramaQueryScreens(ClientPtr client)
|
|
|
|
{
|
2012-03-21 20:55:09 +01:00
|
|
|
xXineramaQueryScreensReply rep;
|
|
|
|
ScreenPtr pScreen = screenInfo.screens[RR_XINERAMA_SCREEN];
|
2014-12-16 18:56:50 +01:00
|
|
|
int m;
|
|
|
|
RRMonitorPtr monitors = NULL;
|
|
|
|
int nmonitors = 0;
|
2006-09-21 07:43:05 +02:00
|
|
|
|
|
|
|
REQUEST_SIZE_MATCH(xXineramaQueryScreensReq);
|
|
|
|
|
2012-07-10 04:12:42 +02:00
|
|
|
if (RRXineramaScreenActive(pScreen)) {
|
2012-03-21 20:55:09 +01:00
|
|
|
RRGetInfo(pScreen, FALSE);
|
2014-12-16 18:56:50 +01:00
|
|
|
if (!RRMonitorMakeList(pScreen, TRUE, &monitors, &nmonitors))
|
|
|
|
return BadAlloc;
|
2012-07-10 04:12:42 +02:00
|
|
|
}
|
2009-01-31 04:06:17 +01:00
|
|
|
|
2012-07-10 04:12:43 +02:00
|
|
|
rep = (xXineramaQueryScreensReply) {
|
|
|
|
.type = X_Reply,
|
|
|
|
.sequenceNumber = client->sequence,
|
2014-12-16 18:56:50 +01:00
|
|
|
.length = bytes_to_int32(nmonitors * sz_XineramaScreenInfo),
|
|
|
|
.number = nmonitors
|
2012-07-10 04:12:43 +02:00
|
|
|
};
|
2012-03-21 20:55:09 +01:00
|
|
|
if (client->swapped) {
|
|
|
|
swaps(&rep.sequenceNumber);
|
|
|
|
swapl(&rep.length);
|
|
|
|
swapl(&rep.number);
|
2006-09-21 07:43:05 +02:00
|
|
|
}
|
2012-05-13 09:03:35 +02:00
|
|
|
WriteToClient(client, sizeof(xXineramaQueryScreensReply), &rep);
|
2012-03-21 20:55:09 +01:00
|
|
|
|
2014-12-16 18:56:50 +01:00
|
|
|
for (m = 0; m < nmonitors; m++)
|
|
|
|
RRXineramaWriteMonitor(client, &monitors[m]);
|
|
|
|
|
|
|
|
if (monitors)
|
|
|
|
RRMonitorFreeList(monitors, nmonitors);
|
2006-09-21 07:43:05 +02:00
|
|
|
|
2010-05-11 05:22:05 +02:00
|
|
|
return Success;
|
2006-09-21 07:43:05 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
ProcRRXineramaDispatch(ClientPtr client)
|
|
|
|
{
|
|
|
|
REQUEST(xReq);
|
|
|
|
switch (stuff->data) {
|
2012-03-21 20:55:09 +01:00
|
|
|
case X_PanoramiXQueryVersion:
|
|
|
|
return ProcRRXineramaQueryVersion(client);
|
|
|
|
case X_PanoramiXGetState:
|
|
|
|
return ProcRRXineramaGetState(client);
|
|
|
|
case X_PanoramiXGetScreenCount:
|
|
|
|
return ProcRRXineramaGetScreenCount(client);
|
|
|
|
case X_PanoramiXGetScreenSize:
|
|
|
|
return ProcRRXineramaGetScreenSize(client);
|
|
|
|
case X_XineramaIsActive:
|
|
|
|
return ProcRRXineramaIsActive(client);
|
|
|
|
case X_XineramaQueryScreens:
|
|
|
|
return ProcRRXineramaQueryScreens(client);
|
2006-09-21 07:43:05 +02:00
|
|
|
}
|
|
|
|
return BadRequest;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* SProc */
|
|
|
|
|
2017-02-16 20:56:45 +01:00
|
|
|
static int _X_COLD
|
2012-03-21 20:55:09 +01:00
|
|
|
SProcRRXineramaQueryVersion(ClientPtr client)
|
2006-09-21 07:43:05 +02:00
|
|
|
{
|
|
|
|
REQUEST(xPanoramiXQueryVersionReq);
|
2011-08-04 21:35:41 +02:00
|
|
|
swaps(&stuff->length);
|
2012-03-21 20:55:09 +01:00
|
|
|
REQUEST_SIZE_MATCH(xPanoramiXQueryVersionReq);
|
2006-09-21 07:43:05 +02:00
|
|
|
return ProcRRXineramaQueryVersion(client);
|
|
|
|
}
|
|
|
|
|
2017-02-16 20:56:45 +01:00
|
|
|
static int _X_COLD
|
2006-09-21 07:43:05 +02:00
|
|
|
SProcRRXineramaGetState(ClientPtr client)
|
|
|
|
{
|
|
|
|
REQUEST(xPanoramiXGetStateReq);
|
2011-08-04 21:35:41 +02:00
|
|
|
swaps(&stuff->length);
|
2006-09-21 07:43:05 +02:00
|
|
|
REQUEST_SIZE_MATCH(xPanoramiXGetStateReq);
|
2011-08-04 21:35:41 +02:00
|
|
|
swapl(&stuff->window);
|
2006-09-21 07:43:05 +02:00
|
|
|
return ProcRRXineramaGetState(client);
|
|
|
|
}
|
|
|
|
|
2017-02-16 20:56:45 +01:00
|
|
|
static int _X_COLD
|
2006-09-21 07:43:05 +02:00
|
|
|
SProcRRXineramaGetScreenCount(ClientPtr client)
|
|
|
|
{
|
|
|
|
REQUEST(xPanoramiXGetScreenCountReq);
|
2011-08-04 21:35:41 +02:00
|
|
|
swaps(&stuff->length);
|
2006-09-21 07:43:05 +02:00
|
|
|
REQUEST_SIZE_MATCH(xPanoramiXGetScreenCountReq);
|
2011-08-04 21:35:41 +02:00
|
|
|
swapl(&stuff->window);
|
2006-09-21 07:43:05 +02:00
|
|
|
return ProcRRXineramaGetScreenCount(client);
|
|
|
|
}
|
|
|
|
|
2017-02-16 20:56:45 +01:00
|
|
|
static int _X_COLD
|
2006-09-21 07:43:05 +02:00
|
|
|
SProcRRXineramaGetScreenSize(ClientPtr client)
|
|
|
|
{
|
|
|
|
REQUEST(xPanoramiXGetScreenSizeReq);
|
2011-08-04 21:35:41 +02:00
|
|
|
swaps(&stuff->length);
|
2006-09-21 07:43:05 +02:00
|
|
|
REQUEST_SIZE_MATCH(xPanoramiXGetScreenSizeReq);
|
2011-08-04 21:35:41 +02:00
|
|
|
swapl(&stuff->window);
|
|
|
|
swapl(&stuff->screen);
|
2006-09-21 07:43:05 +02:00
|
|
|
return ProcRRXineramaGetScreenSize(client);
|
|
|
|
}
|
|
|
|
|
2017-02-16 20:56:45 +01:00
|
|
|
static int _X_COLD
|
2006-09-21 07:43:05 +02:00
|
|
|
SProcRRXineramaIsActive(ClientPtr client)
|
|
|
|
{
|
|
|
|
REQUEST(xXineramaIsActiveReq);
|
2011-08-04 21:35:41 +02:00
|
|
|
swaps(&stuff->length);
|
2006-09-21 07:43:05 +02:00
|
|
|
REQUEST_SIZE_MATCH(xXineramaIsActiveReq);
|
|
|
|
return ProcRRXineramaIsActive(client);
|
|
|
|
}
|
|
|
|
|
2017-02-16 20:56:45 +01:00
|
|
|
static int _X_COLD
|
2006-09-21 07:43:05 +02:00
|
|
|
SProcRRXineramaQueryScreens(ClientPtr client)
|
|
|
|
{
|
|
|
|
REQUEST(xXineramaQueryScreensReq);
|
2011-08-04 21:35:41 +02:00
|
|
|
swaps(&stuff->length);
|
2006-09-21 07:43:05 +02:00
|
|
|
REQUEST_SIZE_MATCH(xXineramaQueryScreensReq);
|
|
|
|
return ProcRRXineramaQueryScreens(client);
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
|
|
|
SProcRRXineramaDispatch(ClientPtr client)
|
|
|
|
{
|
|
|
|
REQUEST(xReq);
|
|
|
|
switch (stuff->data) {
|
2012-03-21 20:55:09 +01:00
|
|
|
case X_PanoramiXQueryVersion:
|
|
|
|
return SProcRRXineramaQueryVersion(client);
|
|
|
|
case X_PanoramiXGetState:
|
|
|
|
return SProcRRXineramaGetState(client);
|
|
|
|
case X_PanoramiXGetScreenCount:
|
|
|
|
return SProcRRXineramaGetScreenCount(client);
|
|
|
|
case X_PanoramiXGetScreenSize:
|
|
|
|
return SProcRRXineramaGetScreenSize(client);
|
|
|
|
case X_XineramaIsActive:
|
|
|
|
return SProcRRXineramaIsActive(client);
|
|
|
|
case X_XineramaQueryScreens:
|
|
|
|
return SProcRRXineramaQueryScreens(client);
|
2006-09-21 07:43:05 +02:00
|
|
|
}
|
|
|
|
return BadRequest;
|
|
|
|
}
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
void
|
2006-09-21 07:43:05 +02:00
|
|
|
RRXineramaExtensionInit(void)
|
|
|
|
{
|
|
|
|
#ifdef PANORAMIX
|
2012-03-21 20:55:09 +01:00
|
|
|
if (!noPanoramiXExtension)
|
|
|
|
return;
|
2006-09-21 07:43:05 +02:00
|
|
|
#endif
|
|
|
|
|
2012-07-12 03:00:43 +02:00
|
|
|
if (noRRXineramaExtension)
|
|
|
|
return;
|
|
|
|
|
2007-04-25 22:35:04 +02:00
|
|
|
/*
|
|
|
|
* Xinerama isn't capable enough to have multiple protocol screens each
|
|
|
|
* with their own output geometry. So if there's more than one protocol
|
|
|
|
* screen, just don't even try.
|
|
|
|
*/
|
|
|
|
if (screenInfo.numScreens > 1)
|
2012-03-21 20:55:09 +01:00
|
|
|
return;
|
2007-04-25 22:35:04 +02:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
(void) AddExtension(PANORAMIX_PROTOCOL_NAME, 0, 0,
|
|
|
|
ProcRRXineramaDispatch,
|
|
|
|
SProcRRXineramaDispatch, NULL, StandardMinorOpcode);
|
2006-09-21 07:43:05 +02:00
|
|
|
}
|