2003-11-14 16:54:54 +01:00
|
|
|
/*****************************************************************
|
|
|
|
Copyright (c) 1991, 1997 Digital Equipment Corporation, Maynard, Massachusetts.
|
|
|
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
|
|
of this software and associated documentation files (the "Software"), to deal
|
|
|
|
in the Software without restriction, including without limitation the rights
|
|
|
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
|
|
copies of the Software.
|
|
|
|
|
|
|
|
The above copyright notice and this permission notice shall be included in
|
|
|
|
all copies or substantial portions of the Software.
|
|
|
|
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
|
|
|
DIGITAL EQUIPMENT CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES, INCLUDING,
|
|
|
|
BUT NOT LIMITED TO CONSEQUENTIAL OR INCIDENTAL DAMAGES, OR OTHER LIABILITY,
|
|
|
|
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
|
|
|
|
IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
|
|
|
|
|
|
Except as contained in this notice, the name of Digital Equipment Corporation
|
|
|
|
shall not be used in advertising or otherwise to promote the sale, use or other
|
|
|
|
dealings in this Software without prior written authorization from Digital
|
|
|
|
Equipment Corporation.
|
|
|
|
******************************************************************/
|
|
|
|
|
2005-07-03 09:02:09 +02:00
|
|
|
#ifdef HAVE_DIX_CONFIG_H
|
|
|
|
#include <dix-config.h>
|
|
|
|
#endif
|
|
|
|
|
2005-07-27 10:16:35 +02:00
|
|
|
#ifdef HAVE_DMX_CONFIG_H
|
|
|
|
#include <dmx-config.h>
|
|
|
|
#endif
|
|
|
|
|
2003-11-14 16:54:54 +01:00
|
|
|
#include <stdio.h>
|
2005-04-20 14:25:48 +02:00
|
|
|
#include <X11/X.h>
|
|
|
|
#include <X11/Xproto.h>
|
|
|
|
#include <X11/Xarch.h>
|
2005-07-03 10:53:54 +02:00
|
|
|
#include "misc.h"
|
2003-11-14 16:54:54 +01:00
|
|
|
#include "cursor.h"
|
|
|
|
#include "cursorstr.h"
|
|
|
|
#include "extnsionst.h"
|
|
|
|
#include "dixstruct.h"
|
|
|
|
#include "gc.h"
|
|
|
|
#include "gcstruct.h"
|
|
|
|
#include "scrnintstr.h"
|
|
|
|
#include "window.h"
|
|
|
|
#include "windowstr.h"
|
|
|
|
#include "pixmapstr.h"
|
|
|
|
#include "panoramiX.h"
|
2005-04-20 14:25:48 +02:00
|
|
|
#include <X11/extensions/panoramiXproto.h>
|
2003-11-14 17:49:22 +01:00
|
|
|
#include "panoramiXsrv.h"
|
|
|
|
#include "globals.h"
|
|
|
|
#include "servermd.h"
|
|
|
|
#include "resource.h"
|
|
|
|
#include "picturestr.h"
|
2010-01-05 21:35:10 +01:00
|
|
|
#include "xfixesint.h"
|
damageext: Xineramify (v7)
v7: Don't bother making resources for the backing listeners. [keithp]
This is now slightly unlike how other resources are xineramified. We
create N+1 internal damage listeners, one that's a real resource and
reflects the protocol view, and then one per backend screen where the
report function piles onto the protocol view. The internal listeners
are not stored in the resource database directly, they just hang off the
xinerama resource. We don't wrap Subtract at the dispatch level, but we
do extend it for the Xinerama case to clip to the root window geometry.
As a result of the N+1 design here, the damage reports we generate are
not quite minimal. However they are indistinguishable from sequential
rendering events happening before the client hears damage, and we don't
need to add a post-dispatch callback just for this one extension.
Add is probably (still) somewhat broken since it will only hit screen 0,
but Add really only exists for DRI1's sake, and DRI1 disables itself
with Xinerama enabled anyway. In the absence of a use case, I'm leaving
it unwrapped under Xinerama; if someone wants to define how it ought to
work, be my guest.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-09-16 21:17:26 +02:00
|
|
|
#include "damageextint.h"
|
2010-01-06 20:55:48 +01:00
|
|
|
#ifdef COMPOSITE
|
|
|
|
#include "compint.h"
|
|
|
|
#endif
|
2012-07-10 03:02:56 +02:00
|
|
|
#include "extinit.h"
|
2009-09-18 08:27:54 +02:00
|
|
|
#include "protocol-versions.h"
|
2003-11-14 16:54:54 +01:00
|
|
|
|
2004-06-30 22:06:56 +02:00
|
|
|
#ifdef GLXPROXY
|
|
|
|
extern VisualPtr glxMatchVisual(ScreenPtr pScreen,
|
2012-03-21 20:55:09 +01:00
|
|
|
VisualPtr pVisual, ScreenPtr pMatchScreen);
|
2004-06-30 22:06:56 +02:00
|
|
|
#endif
|
|
|
|
|
2003-11-14 16:54:54 +01:00
|
|
|
/*
|
|
|
|
* PanoramiX data declarations
|
|
|
|
*/
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
int PanoramiXPixWidth = 0;
|
|
|
|
int PanoramiXPixHeight = 0;
|
|
|
|
int PanoramiXNumScreens = 0;
|
2003-11-14 17:49:22 +01:00
|
|
|
|
2013-10-29 15:44:07 +01:00
|
|
|
_X_EXPORT RegionRec PanoramiXScreenRegion = { {0, 0, 0, 0}, NULL };
|
2003-11-14 16:54:54 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
static int PanoramiXNumDepths;
|
|
|
|
static DepthPtr PanoramiXDepths;
|
|
|
|
static int PanoramiXNumVisuals;
|
|
|
|
static VisualPtr PanoramiXVisuals;
|
2003-11-14 16:54:54 +01:00
|
|
|
|
2011-02-28 22:28:26 +01:00
|
|
|
RESTYPE XRC_DRAWABLE;
|
|
|
|
RESTYPE XRT_WINDOW;
|
|
|
|
RESTYPE XRT_PIXMAP;
|
|
|
|
RESTYPE XRT_GC;
|
|
|
|
RESTYPE XRT_COLORMAP;
|
2003-11-14 17:49:22 +01:00
|
|
|
|
2008-05-04 22:45:27 +02:00
|
|
|
static Bool VisualsEqual(VisualPtr, ScreenPtr, VisualPtr);
|
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
|
|
|
XineramaVisualsEqualProcPtr XineramaVisualsEqualPtr = &VisualsEqual;
|
2008-05-04 22:45:27 +02:00
|
|
|
|
2003-11-14 16:54:54 +01:00
|
|
|
/*
|
|
|
|
* Function prototypes
|
|
|
|
*/
|
|
|
|
|
2003-11-25 20:29:01 +01:00
|
|
|
static int panoramiXGeneration;
|
2012-03-21 20:55:09 +01:00
|
|
|
static int ProcPanoramiXDispatch(ClientPtr client);
|
2003-11-25 20:29:01 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
static void PanoramiXResetProc(ExtensionEntry *);
|
2003-11-14 16:54:54 +01:00
|
|
|
|
|
|
|
/*
|
2003-11-25 20:29:01 +01:00
|
|
|
* External references for functions and data variables
|
2003-11-14 16:54:54 +01:00
|
|
|
*/
|
|
|
|
|
2003-11-25 20:29:01 +01:00
|
|
|
#include "panoramiXh.h"
|
2003-11-14 16:54:54 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
int (*SavedProcVector[256]) (ClientPtr client) = {
|
|
|
|
NULL,};
|
2003-11-14 17:49:22 +01:00
|
|
|
|
2010-04-27 02:22:21 +02:00
|
|
|
static DevPrivateKeyRec PanoramiXGCKeyRec;
|
2012-03-21 20:55:09 +01:00
|
|
|
|
2010-04-27 02:22:21 +02:00
|
|
|
#define PanoramiXGCKey (&PanoramiXGCKeyRec)
|
|
|
|
static DevPrivateKeyRec PanoramiXScreenKeyRec;
|
2012-03-21 20:55:09 +01:00
|
|
|
|
2010-04-27 02:22:21 +02:00
|
|
|
#define PanoramiXScreenKey (&PanoramiXScreenKeyRec)
|
2003-11-14 17:49:22 +01:00
|
|
|
|
|
|
|
typedef struct {
|
2012-03-21 20:55:09 +01:00
|
|
|
DDXPointRec clipOrg;
|
|
|
|
DDXPointRec patOrg;
|
|
|
|
GCFuncs *wrapFuncs;
|
2003-11-14 17:49:22 +01:00
|
|
|
} PanoramiXGCRec, *PanoramiXGCPtr;
|
|
|
|
|
|
|
|
typedef struct {
|
2012-03-21 20:55:09 +01:00
|
|
|
CreateGCProcPtr CreateGC;
|
|
|
|
CloseScreenProcPtr CloseScreen;
|
2003-11-14 17:49:22 +01:00
|
|
|
} PanoramiXScreenRec, *PanoramiXScreenPtr;
|
|
|
|
|
|
|
|
static void XineramaValidateGC(GCPtr, unsigned long, DrawablePtr);
|
|
|
|
static void XineramaChangeGC(GCPtr, unsigned long);
|
|
|
|
static void XineramaCopyGC(GCPtr, unsigned long, GCPtr);
|
|
|
|
static void XineramaDestroyGC(GCPtr);
|
|
|
|
static void XineramaChangeClip(GCPtr, int, pointer, int);
|
|
|
|
static void XineramaDestroyClip(GCPtr);
|
|
|
|
static void XineramaCopyClip(GCPtr, GCPtr);
|
|
|
|
|
2007-03-25 23:57:22 +02:00
|
|
|
static GCFuncs XineramaGCFuncs = {
|
2003-11-14 17:49:22 +01:00
|
|
|
XineramaValidateGC, XineramaChangeGC, XineramaCopyGC, XineramaDestroyGC,
|
|
|
|
XineramaChangeClip, XineramaDestroyClip, XineramaCopyClip
|
|
|
|
};
|
|
|
|
|
|
|
|
#define Xinerama_GC_FUNC_PROLOGUE(pGC)\
|
2007-08-28 15:28:25 +02:00
|
|
|
PanoramiXGCPtr pGCPriv = (PanoramiXGCPtr) \
|
|
|
|
dixLookupPrivate(&(pGC)->devPrivates, PanoramiXGCKey); \
|
2003-11-14 17:49:22 +01:00
|
|
|
(pGC)->funcs = pGCPriv->wrapFuncs;
|
|
|
|
|
|
|
|
#define Xinerama_GC_FUNC_EPILOGUE(pGC)\
|
|
|
|
pGCPriv->wrapFuncs = (pGC)->funcs;\
|
|
|
|
(pGC)->funcs = &XineramaGCFuncs;
|
|
|
|
|
|
|
|
static Bool
|
api: rework the X server driver API to avoid global arrays.
This is a squash merge containing all the API changes, as
well as the video ABI bump.
Its been squashed to make bisection easier.
Full patch log below:
commit b202738bbf0c5a1c1172767119c2c71f1e7f8070
Author: Aaron Plattner <aplattner@nvidia.com>
Date: Mon May 14 15:16:11 2012 -0700
xfree86: Bump video ABI to 13.0
The ABI was broken by changes to convert from screen index numbers to ScreenPtr
/ ScrnInfoPtr in various structures and function signatures.
Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 3d5f7d9f8d408bcad3f83277d255f25d3b0edbf3
Author: Dave Airlie <airlied@redhat.com>
Date: Thu May 24 10:56:57 2012 +0100
xf86: xf86ClearEntityListForScreen should take a pScrn
When adding GPU screens this make life easier.
(also fix comment, as pointed out by Alan)
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit afee8b5ab4501597ecc1ade34124d7ca227ab055
Author: Dave Airlie <airlied@redhat.com>
Date: Thu May 24 07:07:32 2012 +0100
xf86i2c: add pscrn for drivers to use
This just adds a pScrn pointer into the struct for the drivers to use
instead of scrnIndex. Mostly scrnIndex is used for logging, but some
drivers use it to lookup xf86Screens, so let them stash a pScrn instead.
Removing the scrnIndex is a bit more involved and I'm not sure its worth
the effort. Doing i2c in the X server is legacy code as far as I'm concerned.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit ea5092f1f679691d187f1eee9427e6057beec56e
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 19:25:20 2012 +0100
dix/gc: consolidate GC object creation in one place
The standard GC create and scratch GC create were 90% the same really,
and I have a need in the future for creating GC objects without the
other bits, so wanted to avoid a third copy.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 3d91482ea9b4883e64e496f2768168e0ffa21ba1
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 10:24:06 2012 +0100
xf86: add a define to denote the new non-index interfaces are being used
This can be used by drivers to provide compatible APIs.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 37c3ae3e6cd4f3dedc72f371096d6743f8f99df3
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 15:09:12 2012 +0100
dix: make Create/Free scratch pixmaps take a ScreenPtr
While technically an API/ABI change I doubt anyone uses it,
but it helps in splitting screens up.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 75f2062a3fe94f04764ecc7d2ff2fbbeccb9da60
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 14:57:55 2012 +0100
xf86/xv: remove scrnIndexfrom xf86FindXvOptions.
Move this interface to taking an ScrnInfoPtr.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit f80c2374f40ea7b2ee0556e2e76cc07406f3d843
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 14:53:59 2012 +0100
xf86: make xf86DeleteScreen take a ScrnInfoPtr (v2)
stop passing indices into this function.
v2: drop flags argument.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 58824e414f35682435f15bfe6c4b656bd90b9235
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 14:48:09 2012 +0100
xf86: fix xf86IsScreenPrimary interface to take a pScrn (API/ABI)
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 6b4fc1f9d391bcdf7ca288766e49bce60f4635cd
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:18:59 2012 +0100
xserver: convert block/wakeup handlers to passing ScreenPtr (ABI/API) (v2)
Instead of passing an index, pass the actual ScreenPtr. This allows
more moving towards not abusing xf86Screens + screenInfo.
v2: drop the blockData/wakeupData args as per ajax's suggestion.,
fix docs.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 790d003de20fb47674420a24dadd92412d78620d
Author: Dave Airlie <airlied@gmail.com>
Date: Wed Apr 11 09:53:14 2012 +0100
xf86/common: remove some more pScrn->pScreen uses
remove some more conversions that appeared after api cleanups.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit aac85e18d1dd093f2cad6bd29375e40bd7af0b8f
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 16:34:53 2012 +0100
ddc: change API to take ScrnInfoPtr (v2)
This removes all xf86Screens usage from ddc code,
it modifies the API for some functions to avoid taking indices.
v2: address Alan's comments about dropping DDC2Init parameter.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit fe3f57b6eaf6860a33876a54f9439f69578f03a5
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 16:31:26 2012 +0100
vbe: don't use index for VBEInterpretPanelID (API)
Remove use of xf86screens from vbe module.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit abf1965f4ed91529036d3fdb470d6a3ce6f29675
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 16:25:11 2012 +0100
int10/vbe: don't use xf86Screens. (ABI) (v3)
Pass the ScrnInfoPtr instead of the index in the int10 struct.
This saves us using it to dereference xf86Screens.
v2: address Alan's comment to fix struct alignment.
v3: squash in all the int10 fixes, test the vm86 code builds,
after comments by Keith.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 23cca612b4fb5efc33683c7624b803b457387e3d
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:30:18 2012 +0100
xserver: drop index argument to ScreenInit (ABI/API) (v2)
This drops the index argument, its the same as pScreen->myNum,
and its the last major index abuse I can find.
v2: address Alan's review - update docs, fix xwin/xnest/darwin
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 40d360e2d7e832407f3ed64e3a02c27ecc89a960
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:23:01 2012 +0100
xf86: migrate PointerMoved from index to ScrnInfoPtr (ABI/API)
This migrates PointerMoved from an index to ScrnInfoPtr.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit aa60a2f38679d0eeb979a9c2648c9bc771409bf9
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:20:46 2012 +0100
xf86: migrate PMEvent to a ScrnInfoPtr (ABI/API)
This migrates the PMEvent from index to ScrnInfoPtr.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit d3f28ef44371ed4a039ffc5dd7eb6408d1269ba2
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:18:30 2012 +0100
xf86: migrate SetDGAMode from index to ScrnInfoPtr (ABI/API)
This migrates the SetDGAMode callback from an index to ScrnInfoPtr.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit baf5e4818a74f2b68c3dfdcc56f54322351039a0
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:14:11 2012 +0100
xf86: migrate ChangeGamma from index to ScrnInfoPtr (ABI/API) (v2)
This migrates the ChangeGamma interface to avoid passing a index.
v2: fix xf86RandR12.c + xf86cmap.c call
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 51e5f90ada929d6b23176090badbb42fdb3fa550
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:11:09 2012 +0100
xf86/exa: migrate index to screen types for EnableDisableFBAccess (ABI/API)
The EXA interface migrates to ScreenPtr,
and the xf86 interface migrated to ScrnInfoPtr.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 94f1f21d17e86f96d4a54292a399160950087675
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:02:11 2012 +0100
xf86: migrate ValidMode callback to ScrnInfoPtr (ABI/API)
This migrates the ValidMode to passing a ScrnInfoPtr instead
of an index.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 3f8f18198fed4f39ec805b508a3482e91eea26b2
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:59:46 2012 +0100
xf86: migrate SwitchMode to taking ScrnInfoPtr (ABI/API) (v2)
This migrate the SwitchMode interface to take a ScrnInfoPtr
instead of an index.
v2: drop flags.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit d06a038a5c49328ab3a8d969d24f9fcd22c63202
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:50:37 2012 +0100
xf86: move AdjustFrame to passing ScrnInfoPtr (ABI/API) (v2)
This converts AdjustFrame code paths to passing a ScrnInfoPtr
instead of an integer index.
v2: drop flags args.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 53d2f8608ffd4090d08e7d5cf2e92fb954959b90
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:41:27 2012 +0100
xf86: modify FreeScreen callback to take pScrn instead of index. (ABI/API) (v2)
Another index->pScrn conversion.
v2: drop flags arg.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 60db37c0b247052e0f5c54b1921fe58a3609c2e3
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:35:41 2012 +0100
xf86: change EnterVT/LeaveVT to take a ScrnInfoPtr (ABI/API break) (v2)
This modifies the EnterVT/LeaveVT interfaces to take a ScrnInfoPtr
instead of an index into xf86Screens. This allows dropping more
public dereferences of the xf86Screens and screenInfo.
v2: drop flags args as suggested by Keith, fix docs.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 06729dbbc804a20242e6499f446acb5d94023c3c
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:04:59 2012 +0100
xserver: remove index from CloseScreen (API/ABI breakage)
This drops the index from the CloseScreen callback,
its always been useless really, since the pScreen contains it.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-06-05 14:22:18 +02:00
|
|
|
XineramaCloseScreen(ScreenPtr pScreen)
|
2003-11-14 17:49:22 +01:00
|
|
|
{
|
2007-08-28 15:28:25 +02:00
|
|
|
PanoramiXScreenPtr pScreenPriv = (PanoramiXScreenPtr)
|
2012-03-21 20:55:09 +01:00
|
|
|
dixLookupPrivate(&pScreen->devPrivates, PanoramiXScreenKey);
|
2003-11-14 17:49:22 +01:00
|
|
|
|
|
|
|
pScreen->CloseScreen = pScreenPriv->CloseScreen;
|
|
|
|
pScreen->CreateGC = pScreenPriv->CreateGC;
|
|
|
|
|
|
|
|
if (pScreen->myNum == 0)
|
2012-03-21 20:55:09 +01:00
|
|
|
RegionUninit(&PanoramiXScreenRegion);
|
2003-11-14 17:49:22 +01:00
|
|
|
|
2010-05-05 20:44:06 +02:00
|
|
|
free((pointer) pScreenPriv);
|
2003-11-14 17:49:22 +01:00
|
|
|
|
api: rework the X server driver API to avoid global arrays.
This is a squash merge containing all the API changes, as
well as the video ABI bump.
Its been squashed to make bisection easier.
Full patch log below:
commit b202738bbf0c5a1c1172767119c2c71f1e7f8070
Author: Aaron Plattner <aplattner@nvidia.com>
Date: Mon May 14 15:16:11 2012 -0700
xfree86: Bump video ABI to 13.0
The ABI was broken by changes to convert from screen index numbers to ScreenPtr
/ ScrnInfoPtr in various structures and function signatures.
Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 3d5f7d9f8d408bcad3f83277d255f25d3b0edbf3
Author: Dave Airlie <airlied@redhat.com>
Date: Thu May 24 10:56:57 2012 +0100
xf86: xf86ClearEntityListForScreen should take a pScrn
When adding GPU screens this make life easier.
(also fix comment, as pointed out by Alan)
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit afee8b5ab4501597ecc1ade34124d7ca227ab055
Author: Dave Airlie <airlied@redhat.com>
Date: Thu May 24 07:07:32 2012 +0100
xf86i2c: add pscrn for drivers to use
This just adds a pScrn pointer into the struct for the drivers to use
instead of scrnIndex. Mostly scrnIndex is used for logging, but some
drivers use it to lookup xf86Screens, so let them stash a pScrn instead.
Removing the scrnIndex is a bit more involved and I'm not sure its worth
the effort. Doing i2c in the X server is legacy code as far as I'm concerned.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit ea5092f1f679691d187f1eee9427e6057beec56e
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 19:25:20 2012 +0100
dix/gc: consolidate GC object creation in one place
The standard GC create and scratch GC create were 90% the same really,
and I have a need in the future for creating GC objects without the
other bits, so wanted to avoid a third copy.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 3d91482ea9b4883e64e496f2768168e0ffa21ba1
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 10:24:06 2012 +0100
xf86: add a define to denote the new non-index interfaces are being used
This can be used by drivers to provide compatible APIs.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 37c3ae3e6cd4f3dedc72f371096d6743f8f99df3
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 15:09:12 2012 +0100
dix: make Create/Free scratch pixmaps take a ScreenPtr
While technically an API/ABI change I doubt anyone uses it,
but it helps in splitting screens up.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 75f2062a3fe94f04764ecc7d2ff2fbbeccb9da60
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 14:57:55 2012 +0100
xf86/xv: remove scrnIndexfrom xf86FindXvOptions.
Move this interface to taking an ScrnInfoPtr.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit f80c2374f40ea7b2ee0556e2e76cc07406f3d843
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 14:53:59 2012 +0100
xf86: make xf86DeleteScreen take a ScrnInfoPtr (v2)
stop passing indices into this function.
v2: drop flags argument.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 58824e414f35682435f15bfe6c4b656bd90b9235
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 14:48:09 2012 +0100
xf86: fix xf86IsScreenPrimary interface to take a pScrn (API/ABI)
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 6b4fc1f9d391bcdf7ca288766e49bce60f4635cd
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:18:59 2012 +0100
xserver: convert block/wakeup handlers to passing ScreenPtr (ABI/API) (v2)
Instead of passing an index, pass the actual ScreenPtr. This allows
more moving towards not abusing xf86Screens + screenInfo.
v2: drop the blockData/wakeupData args as per ajax's suggestion.,
fix docs.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 790d003de20fb47674420a24dadd92412d78620d
Author: Dave Airlie <airlied@gmail.com>
Date: Wed Apr 11 09:53:14 2012 +0100
xf86/common: remove some more pScrn->pScreen uses
remove some more conversions that appeared after api cleanups.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit aac85e18d1dd093f2cad6bd29375e40bd7af0b8f
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 16:34:53 2012 +0100
ddc: change API to take ScrnInfoPtr (v2)
This removes all xf86Screens usage from ddc code,
it modifies the API for some functions to avoid taking indices.
v2: address Alan's comments about dropping DDC2Init parameter.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit fe3f57b6eaf6860a33876a54f9439f69578f03a5
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 16:31:26 2012 +0100
vbe: don't use index for VBEInterpretPanelID (API)
Remove use of xf86screens from vbe module.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit abf1965f4ed91529036d3fdb470d6a3ce6f29675
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 16:25:11 2012 +0100
int10/vbe: don't use xf86Screens. (ABI) (v3)
Pass the ScrnInfoPtr instead of the index in the int10 struct.
This saves us using it to dereference xf86Screens.
v2: address Alan's comment to fix struct alignment.
v3: squash in all the int10 fixes, test the vm86 code builds,
after comments by Keith.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 23cca612b4fb5efc33683c7624b803b457387e3d
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:30:18 2012 +0100
xserver: drop index argument to ScreenInit (ABI/API) (v2)
This drops the index argument, its the same as pScreen->myNum,
and its the last major index abuse I can find.
v2: address Alan's review - update docs, fix xwin/xnest/darwin
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 40d360e2d7e832407f3ed64e3a02c27ecc89a960
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:23:01 2012 +0100
xf86: migrate PointerMoved from index to ScrnInfoPtr (ABI/API)
This migrates PointerMoved from an index to ScrnInfoPtr.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit aa60a2f38679d0eeb979a9c2648c9bc771409bf9
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:20:46 2012 +0100
xf86: migrate PMEvent to a ScrnInfoPtr (ABI/API)
This migrates the PMEvent from index to ScrnInfoPtr.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit d3f28ef44371ed4a039ffc5dd7eb6408d1269ba2
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:18:30 2012 +0100
xf86: migrate SetDGAMode from index to ScrnInfoPtr (ABI/API)
This migrates the SetDGAMode callback from an index to ScrnInfoPtr.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit baf5e4818a74f2b68c3dfdcc56f54322351039a0
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:14:11 2012 +0100
xf86: migrate ChangeGamma from index to ScrnInfoPtr (ABI/API) (v2)
This migrates the ChangeGamma interface to avoid passing a index.
v2: fix xf86RandR12.c + xf86cmap.c call
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 51e5f90ada929d6b23176090badbb42fdb3fa550
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:11:09 2012 +0100
xf86/exa: migrate index to screen types for EnableDisableFBAccess (ABI/API)
The EXA interface migrates to ScreenPtr,
and the xf86 interface migrated to ScrnInfoPtr.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 94f1f21d17e86f96d4a54292a399160950087675
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:02:11 2012 +0100
xf86: migrate ValidMode callback to ScrnInfoPtr (ABI/API)
This migrates the ValidMode to passing a ScrnInfoPtr instead
of an index.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 3f8f18198fed4f39ec805b508a3482e91eea26b2
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:59:46 2012 +0100
xf86: migrate SwitchMode to taking ScrnInfoPtr (ABI/API) (v2)
This migrate the SwitchMode interface to take a ScrnInfoPtr
instead of an index.
v2: drop flags.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit d06a038a5c49328ab3a8d969d24f9fcd22c63202
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:50:37 2012 +0100
xf86: move AdjustFrame to passing ScrnInfoPtr (ABI/API) (v2)
This converts AdjustFrame code paths to passing a ScrnInfoPtr
instead of an integer index.
v2: drop flags args.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 53d2f8608ffd4090d08e7d5cf2e92fb954959b90
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:41:27 2012 +0100
xf86: modify FreeScreen callback to take pScrn instead of index. (ABI/API) (v2)
Another index->pScrn conversion.
v2: drop flags arg.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 60db37c0b247052e0f5c54b1921fe58a3609c2e3
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:35:41 2012 +0100
xf86: change EnterVT/LeaveVT to take a ScrnInfoPtr (ABI/API break) (v2)
This modifies the EnterVT/LeaveVT interfaces to take a ScrnInfoPtr
instead of an index into xf86Screens. This allows dropping more
public dereferences of the xf86Screens and screenInfo.
v2: drop flags args as suggested by Keith, fix docs.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 06729dbbc804a20242e6499f446acb5d94023c3c
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:04:59 2012 +0100
xserver: remove index from CloseScreen (API/ABI breakage)
This drops the index from the CloseScreen callback,
its always been useless really, since the pScreen contains it.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-06-05 14:22:18 +02:00
|
|
|
return (*pScreen->CloseScreen) (pScreen);
|
2003-11-14 17:49:22 +01:00
|
|
|
}
|
|
|
|
|
2007-03-25 23:57:22 +02:00
|
|
|
static Bool
|
2003-11-14 17:49:22 +01:00
|
|
|
XineramaCreateGC(GCPtr pGC)
|
|
|
|
{
|
|
|
|
ScreenPtr pScreen = pGC->pScreen;
|
2007-08-28 15:28:25 +02:00
|
|
|
PanoramiXScreenPtr pScreenPriv = (PanoramiXScreenPtr)
|
2012-03-21 20:55:09 +01:00
|
|
|
dixLookupPrivate(&pScreen->devPrivates, PanoramiXScreenKey);
|
2003-11-14 17:49:22 +01:00
|
|
|
Bool ret;
|
|
|
|
|
|
|
|
pScreen->CreateGC = pScreenPriv->CreateGC;
|
2012-03-21 20:55:09 +01:00
|
|
|
if ((ret = (*pScreen->CreateGC) (pGC))) {
|
|
|
|
PanoramiXGCPtr pGCPriv = (PanoramiXGCPtr)
|
|
|
|
dixLookupPrivate(&pGC->devPrivates, PanoramiXGCKey);
|
2003-11-14 17:49:22 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
pGCPriv->wrapFuncs = pGC->funcs;
|
2003-11-14 17:49:22 +01:00
|
|
|
pGC->funcs = &XineramaGCFuncs;
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
pGCPriv->clipOrg.x = pGC->clipOrg.x;
|
|
|
|
pGCPriv->clipOrg.y = pGC->clipOrg.y;
|
|
|
|
pGCPriv->patOrg.x = pGC->patOrg.x;
|
|
|
|
pGCPriv->patOrg.y = pGC->patOrg.y;
|
2003-11-14 17:49:22 +01:00
|
|
|
}
|
|
|
|
pScreen->CreateGC = XineramaCreateGC;
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-03-21 20:55:09 +01:00
|
|
|
XineramaValidateGC(GCPtr pGC, unsigned long changes, DrawablePtr pDraw)
|
|
|
|
{
|
|
|
|
Xinerama_GC_FUNC_PROLOGUE(pGC);
|
|
|
|
|
|
|
|
if ((pDraw->type == DRAWABLE_WINDOW) && !(((WindowPtr) pDraw)->parent)) {
|
|
|
|
/* the root window */
|
|
|
|
int x_off = pGC->pScreen->x;
|
|
|
|
int y_off = pGC->pScreen->y;
|
|
|
|
int new_val;
|
|
|
|
|
|
|
|
new_val = pGCPriv->clipOrg.x - x_off;
|
|
|
|
if (pGC->clipOrg.x != new_val) {
|
|
|
|
pGC->clipOrg.x = new_val;
|
|
|
|
changes |= GCClipXOrigin;
|
|
|
|
}
|
|
|
|
new_val = pGCPriv->clipOrg.y - y_off;
|
|
|
|
if (pGC->clipOrg.y != new_val) {
|
|
|
|
pGC->clipOrg.y = new_val;
|
|
|
|
changes |= GCClipYOrigin;
|
|
|
|
}
|
|
|
|
new_val = pGCPriv->patOrg.x - x_off;
|
|
|
|
if (pGC->patOrg.x != new_val) {
|
|
|
|
pGC->patOrg.x = new_val;
|
|
|
|
changes |= GCTileStipXOrigin;
|
|
|
|
}
|
|
|
|
new_val = pGCPriv->patOrg.y - y_off;
|
|
|
|
if (pGC->patOrg.y != new_val) {
|
|
|
|
pGC->patOrg.y = new_val;
|
|
|
|
changes |= GCTileStipYOrigin;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
if (pGC->clipOrg.x != pGCPriv->clipOrg.x) {
|
|
|
|
pGC->clipOrg.x = pGCPriv->clipOrg.x;
|
|
|
|
changes |= GCClipXOrigin;
|
|
|
|
}
|
|
|
|
if (pGC->clipOrg.y != pGCPriv->clipOrg.y) {
|
|
|
|
pGC->clipOrg.y = pGCPriv->clipOrg.y;
|
|
|
|
changes |= GCClipYOrigin;
|
|
|
|
}
|
|
|
|
if (pGC->patOrg.x != pGCPriv->patOrg.x) {
|
|
|
|
pGC->patOrg.x = pGCPriv->patOrg.x;
|
|
|
|
changes |= GCTileStipXOrigin;
|
|
|
|
}
|
|
|
|
if (pGC->patOrg.y != pGCPriv->patOrg.y) {
|
|
|
|
pGC->patOrg.y = pGCPriv->patOrg.y;
|
|
|
|
changes |= GCTileStipYOrigin;
|
|
|
|
}
|
2003-11-14 17:49:22 +01:00
|
|
|
}
|
2012-03-21 20:55:09 +01:00
|
|
|
|
|
|
|
(*pGC->funcs->ValidateGC) (pGC, changes, pDraw);
|
|
|
|
Xinerama_GC_FUNC_EPILOGUE(pGC);
|
2003-11-14 17:49:22 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
XineramaDestroyGC(GCPtr pGC)
|
|
|
|
{
|
2012-03-21 20:55:09 +01:00
|
|
|
Xinerama_GC_FUNC_PROLOGUE(pGC);
|
|
|
|
(*pGC->funcs->DestroyGC) (pGC);
|
|
|
|
Xinerama_GC_FUNC_EPILOGUE(pGC);
|
2003-11-14 17:49:22 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-03-21 20:55:09 +01:00
|
|
|
XineramaChangeGC(GCPtr pGC, unsigned long mask)
|
|
|
|
{
|
|
|
|
Xinerama_GC_FUNC_PROLOGUE(pGC);
|
|
|
|
|
|
|
|
if (mask & GCTileStipXOrigin)
|
|
|
|
pGCPriv->patOrg.x = pGC->patOrg.x;
|
|
|
|
if (mask & GCTileStipYOrigin)
|
|
|
|
pGCPriv->patOrg.y = pGC->patOrg.y;
|
|
|
|
if (mask & GCClipXOrigin)
|
|
|
|
pGCPriv->clipOrg.x = pGC->clipOrg.x;
|
|
|
|
if (mask & GCClipYOrigin)
|
|
|
|
pGCPriv->clipOrg.y = pGC->clipOrg.y;
|
2003-11-14 17:49:22 +01:00
|
|
|
|
|
|
|
(*pGC->funcs->ChangeGC) (pGC, mask);
|
2012-03-21 20:55:09 +01:00
|
|
|
Xinerama_GC_FUNC_EPILOGUE(pGC);
|
2003-11-14 17:49:22 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-03-21 20:55:09 +01:00
|
|
|
XineramaCopyGC(GCPtr pGCSrc, unsigned long mask, GCPtr pGCDst)
|
|
|
|
{
|
2007-08-28 15:28:25 +02:00
|
|
|
PanoramiXGCPtr pSrcPriv = (PanoramiXGCPtr)
|
2012-03-21 20:55:09 +01:00
|
|
|
dixLookupPrivate(&pGCSrc->devPrivates, PanoramiXGCKey);
|
2003-11-14 17:49:22 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
Xinerama_GC_FUNC_PROLOGUE(pGCDst);
|
|
|
|
|
|
|
|
if (mask & GCTileStipXOrigin)
|
2003-11-14 17:49:22 +01:00
|
|
|
pGCPriv->patOrg.x = pSrcPriv->patOrg.x;
|
2012-03-21 20:55:09 +01:00
|
|
|
if (mask & GCTileStipYOrigin)
|
2003-11-14 17:49:22 +01:00
|
|
|
pGCPriv->patOrg.y = pSrcPriv->patOrg.y;
|
2012-03-21 20:55:09 +01:00
|
|
|
if (mask & GCClipXOrigin)
|
2003-11-14 17:49:22 +01:00
|
|
|
pGCPriv->clipOrg.x = pSrcPriv->clipOrg.x;
|
2012-03-21 20:55:09 +01:00
|
|
|
if (mask & GCClipYOrigin)
|
2003-11-14 17:49:22 +01:00
|
|
|
pGCPriv->clipOrg.y = pSrcPriv->clipOrg.y;
|
|
|
|
|
|
|
|
(*pGCDst->funcs->CopyGC) (pGCSrc, mask, pGCDst);
|
2012-03-21 20:55:09 +01:00
|
|
|
Xinerama_GC_FUNC_EPILOGUE(pGCDst);
|
2003-11-14 17:49:22 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-03-21 20:55:09 +01:00
|
|
|
XineramaChangeClip(GCPtr pGC, int type, pointer pvalue, int nrects)
|
|
|
|
{
|
|
|
|
Xinerama_GC_FUNC_PROLOGUE(pGC);
|
2003-11-14 17:49:22 +01:00
|
|
|
(*pGC->funcs->ChangeClip) (pGC, type, pvalue, nrects);
|
2012-03-21 20:55:09 +01:00
|
|
|
Xinerama_GC_FUNC_EPILOGUE(pGC);
|
2003-11-14 17:49:22 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
XineramaCopyClip(GCPtr pgcDst, GCPtr pgcSrc)
|
|
|
|
{
|
2012-03-21 20:55:09 +01:00
|
|
|
Xinerama_GC_FUNC_PROLOGUE(pgcDst);
|
|
|
|
(*pgcDst->funcs->CopyClip) (pgcDst, pgcSrc);
|
|
|
|
Xinerama_GC_FUNC_EPILOGUE(pgcDst);
|
2003-11-14 17:49:22 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
XineramaDestroyClip(GCPtr pGC)
|
|
|
|
{
|
2012-03-21 20:55:09 +01:00
|
|
|
Xinerama_GC_FUNC_PROLOGUE(pGC);
|
|
|
|
(*pGC->funcs->DestroyClip) (pGC);
|
|
|
|
Xinerama_GC_FUNC_EPILOGUE(pGC);
|
2003-11-14 17:49:22 +01:00
|
|
|
}
|
|
|
|
|
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
|
|
|
int
|
2003-11-14 17:49:22 +01:00
|
|
|
XineramaDeleteResource(pointer data, XID id)
|
|
|
|
{
|
2010-05-05 20:44:06 +02:00
|
|
|
free(data);
|
2003-11-14 17:49:22 +01:00
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
typedef struct {
|
2012-03-21 20:55:09 +01:00
|
|
|
int screen;
|
|
|
|
int id;
|
|
|
|
} PanoramiXSearchData;
|
2003-11-14 17:49:22 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
static Bool
|
2003-11-14 17:49:22 +01:00
|
|
|
XineramaFindIDByScrnum(pointer resource, XID id, pointer privdata)
|
|
|
|
{
|
2012-03-21 20:55:09 +01:00
|
|
|
PanoramiXRes *res = (PanoramiXRes *) resource;
|
|
|
|
PanoramiXSearchData *data = (PanoramiXSearchData *) privdata;
|
|
|
|
|
2010-06-06 16:18:40 +02:00
|
|
|
return res->info[data->screen].id == data->id;
|
2003-11-14 17:49:22 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
PanoramiXRes *
|
|
|
|
PanoramiXFindIDByScrnum(RESTYPE type, XID id, int screen)
|
|
|
|
{
|
|
|
|
PanoramiXSearchData data;
|
2009-04-29 07:04:37 +02:00
|
|
|
pointer val;
|
2003-11-14 17:49:22 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
if (!screen) {
|
|
|
|
dixLookupResourceByType(&val, id, type, serverClient, DixReadAccess);
|
|
|
|
return val;
|
2009-04-29 07:04:37 +02:00
|
|
|
}
|
2003-11-14 17:49:22 +01:00
|
|
|
|
|
|
|
data.screen = screen;
|
|
|
|
data.id = id;
|
|
|
|
|
|
|
|
return LookupClientResourceComplex(clients[CLIENT_ID(id)], type,
|
2012-03-21 20:55:09 +01:00
|
|
|
XineramaFindIDByScrnum, &data);
|
2003-11-14 17:49:22 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
typedef struct _connect_callback_list {
|
2012-03-21 20:55:09 +01:00
|
|
|
void (*func) (void);
|
2003-11-14 17:49:22 +01:00
|
|
|
struct _connect_callback_list *next;
|
|
|
|
} XineramaConnectionCallbackList;
|
|
|
|
|
|
|
|
static XineramaConnectionCallbackList *ConnectionCallbackList = NULL;
|
|
|
|
|
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
|
|
|
Bool
|
2012-03-21 20:55:09 +01:00
|
|
|
XineramaRegisterConnectionBlockCallback(void (*func) (void))
|
2003-11-14 17:49:22 +01:00
|
|
|
{
|
|
|
|
XineramaConnectionCallbackList *newlist;
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
if (!(newlist = malloc(sizeof(XineramaConnectionCallbackList))))
|
|
|
|
return FALSE;
|
2003-11-14 17:49:22 +01:00
|
|
|
|
|
|
|
newlist->next = ConnectionCallbackList;
|
|
|
|
newlist->func = func;
|
|
|
|
ConnectionCallbackList = newlist;
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
2003-11-14 16:54:54 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
static void
|
|
|
|
XineramaInitData(void)
|
2004-06-30 22:06:56 +02:00
|
|
|
{
|
|
|
|
int i, w, h;
|
|
|
|
|
2010-05-21 21:18:22 +02:00
|
|
|
RegionNull(&PanoramiXScreenRegion);
|
2011-03-09 06:01:20 +01:00
|
|
|
FOR_NSCREENS(i) {
|
2012-03-21 20:55:09 +01:00
|
|
|
BoxRec TheBox;
|
|
|
|
RegionRec ScreenRegion;
|
2004-06-30 22:06:56 +02:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
ScreenPtr pScreen = screenInfo.screens[i];
|
2004-06-30 22:06:56 +02:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
TheBox.x1 = pScreen->x;
|
|
|
|
TheBox.x2 = TheBox.x1 + pScreen->width;
|
|
|
|
TheBox.y1 = pScreen->y;
|
|
|
|
TheBox.y2 = TheBox.y1 + pScreen->height;
|
2004-06-30 22:06:56 +02:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
RegionInit(&ScreenRegion, &TheBox, 1);
|
|
|
|
RegionUnion(&PanoramiXScreenRegion, &PanoramiXScreenRegion,
|
|
|
|
&ScreenRegion);
|
|
|
|
RegionUninit(&ScreenRegion);
|
2004-06-30 22:06:56 +02:00
|
|
|
}
|
|
|
|
|
2010-05-23 19:11:47 +02:00
|
|
|
PanoramiXPixWidth = screenInfo.screens[0]->x + screenInfo.screens[0]->width;
|
2012-03-21 20:55:09 +01:00
|
|
|
PanoramiXPixHeight =
|
|
|
|
screenInfo.screens[0]->y + screenInfo.screens[0]->height;
|
2004-06-30 22:06:56 +02:00
|
|
|
|
2011-03-09 06:05:26 +01:00
|
|
|
FOR_NSCREENS_FORWARD_SKIP(i) {
|
2012-03-21 20:55:09 +01:00
|
|
|
ScreenPtr pScreen = screenInfo.screens[i];
|
|
|
|
|
|
|
|
w = pScreen->x + pScreen->width;
|
|
|
|
h = pScreen->y + pScreen->height;
|
|
|
|
|
|
|
|
if (PanoramiXPixWidth < w)
|
|
|
|
PanoramiXPixWidth = w;
|
|
|
|
if (PanoramiXPixHeight < h)
|
|
|
|
PanoramiXPixHeight = h;
|
2004-06-30 22:06:56 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
void
|
|
|
|
XineramaReinitData(void)
|
2004-06-30 22:06:56 +02:00
|
|
|
{
|
2010-05-22 00:05:48 +02:00
|
|
|
RegionUninit(&PanoramiXScreenRegion);
|
2010-09-18 01:23:12 +02:00
|
|
|
XineramaInitData();
|
2004-06-30 22:06:56 +02:00
|
|
|
}
|
|
|
|
|
2003-11-14 16:54:54 +01:00
|
|
|
/*
|
|
|
|
* PanoramiXExtensionInit():
|
|
|
|
* Called from InitExtensions in main().
|
|
|
|
* Register PanoramiXeen Extension
|
|
|
|
* Initialize global variables.
|
2012-03-21 20:55:09 +01:00
|
|
|
*/
|
2003-11-14 16:54:54 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
void
|
2012-07-10 03:02:52 +02:00
|
|
|
PanoramiXExtensionInit(void)
|
2003-11-14 16:54:54 +01:00
|
|
|
{
|
2012-03-21 20:55:09 +01:00
|
|
|
int i;
|
|
|
|
Bool success = FALSE;
|
|
|
|
ExtensionEntry *extEntry;
|
|
|
|
ScreenPtr pScreen = screenInfo.screens[0];
|
|
|
|
PanoramiXScreenPtr pScreenPriv;
|
2004-06-30 22:06:56 +02:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
if (noPanoramiXExtension)
|
|
|
|
return;
|
2003-11-14 17:49:22 +01:00
|
|
|
|
2010-04-27 02:22:21 +02:00
|
|
|
if (!dixRegisterPrivateKey(&PanoramiXScreenKeyRec, PRIVATE_SCREEN, 0)) {
|
2012-03-21 20:55:09 +01:00
|
|
|
noPanoramiXExtension = TRUE;
|
|
|
|
return;
|
2010-04-27 02:22:21 +02:00
|
|
|
}
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
if (!dixRegisterPrivateKey
|
|
|
|
(&PanoramiXGCKeyRec, PRIVATE_GC, sizeof(PanoramiXGCRec))) {
|
|
|
|
noPanoramiXExtension = TRUE;
|
|
|
|
return;
|
2010-04-27 02:22:21 +02:00
|
|
|
}
|
|
|
|
|
2003-11-14 16:54:54 +01:00
|
|
|
PanoramiXNumScreens = screenInfo.numScreens;
|
2012-03-21 20:55:09 +01:00
|
|
|
if (PanoramiXNumScreens == 1) { /* Only 1 screen */
|
|
|
|
noPanoramiXExtension = TRUE;
|
|
|
|
return;
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
while (panoramiXGeneration != serverGeneration) {
|
2012-03-21 20:55:09 +01:00
|
|
|
extEntry = AddExtension(PANORAMIX_PROTOCOL_NAME, 0, 0,
|
|
|
|
ProcPanoramiXDispatch,
|
|
|
|
SProcPanoramiXDispatch, PanoramiXResetProc,
|
|
|
|
StandardMinorOpcode);
|
|
|
|
if (!extEntry)
|
|
|
|
break;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* First make sure all the basic allocations succeed. If not,
|
|
|
|
* run in non-PanoramiXeen mode.
|
|
|
|
*/
|
|
|
|
|
|
|
|
FOR_NSCREENS(i) {
|
|
|
|
pScreen = screenInfo.screens[i];
|
|
|
|
pScreenPriv = malloc(sizeof(PanoramiXScreenRec));
|
|
|
|
dixSetPrivate(&pScreen->devPrivates, PanoramiXScreenKey,
|
|
|
|
pScreenPriv);
|
|
|
|
if (!pScreenPriv) {
|
|
|
|
noPanoramiXExtension = TRUE;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
pScreenPriv->CreateGC = pScreen->CreateGC;
|
|
|
|
pScreenPriv->CloseScreen = pScreen->CloseScreen;
|
|
|
|
|
|
|
|
pScreen->CreateGC = XineramaCreateGC;
|
|
|
|
pScreen->CloseScreen = XineramaCloseScreen;
|
|
|
|
}
|
|
|
|
|
|
|
|
XRC_DRAWABLE = CreateNewResourceClass();
|
|
|
|
XRT_WINDOW = CreateNewResourceType(XineramaDeleteResource,
|
|
|
|
"XineramaWindow");
|
|
|
|
if (XRT_WINDOW)
|
|
|
|
XRT_WINDOW |= XRC_DRAWABLE;
|
|
|
|
XRT_PIXMAP = CreateNewResourceType(XineramaDeleteResource,
|
|
|
|
"XineramaPixmap");
|
|
|
|
if (XRT_PIXMAP)
|
|
|
|
XRT_PIXMAP |= XRC_DRAWABLE;
|
|
|
|
XRT_GC = CreateNewResourceType(XineramaDeleteResource, "XineramaGC");
|
|
|
|
XRT_COLORMAP = CreateNewResourceType(XineramaDeleteResource,
|
|
|
|
"XineramaColormap");
|
|
|
|
|
|
|
|
if (XRT_WINDOW && XRT_PIXMAP && XRT_GC && XRT_COLORMAP) {
|
|
|
|
panoramiXGeneration = serverGeneration;
|
|
|
|
success = TRUE;
|
|
|
|
}
|
|
|
|
SetResourceTypeErrorValue(XRT_WINDOW, BadWindow);
|
|
|
|
SetResourceTypeErrorValue(XRT_PIXMAP, BadPixmap);
|
|
|
|
SetResourceTypeErrorValue(XRT_GC, BadGC);
|
|
|
|
SetResourceTypeErrorValue(XRT_COLORMAP, BadColor);
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
if (!success) {
|
2012-03-21 20:55:09 +01:00
|
|
|
noPanoramiXExtension = TRUE;
|
|
|
|
ErrorF(PANORAMIX_PROTOCOL_NAME " extension failed to initialize\n");
|
|
|
|
return;
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
2012-03-21 20:55:09 +01:00
|
|
|
|
2010-09-18 01:23:12 +02:00
|
|
|
XineramaInitData();
|
2003-11-14 16:54:54 +01:00
|
|
|
|
|
|
|
/*
|
2012-03-21 20:55:09 +01:00
|
|
|
* Put our processes into the ProcVector
|
2003-11-14 16:54:54 +01:00
|
|
|
*/
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
for (i = 256; i--;)
|
|
|
|
SavedProcVector[i] = ProcVector[i];
|
2003-11-14 16:54:54 +01:00
|
|
|
|
|
|
|
ProcVector[X_CreateWindow] = PanoramiXCreateWindow;
|
|
|
|
ProcVector[X_ChangeWindowAttributes] = PanoramiXChangeWindowAttributes;
|
|
|
|
ProcVector[X_DestroyWindow] = PanoramiXDestroyWindow;
|
|
|
|
ProcVector[X_DestroySubwindows] = PanoramiXDestroySubwindows;
|
|
|
|
ProcVector[X_ChangeSaveSet] = PanoramiXChangeSaveSet;
|
|
|
|
ProcVector[X_ReparentWindow] = PanoramiXReparentWindow;
|
|
|
|
ProcVector[X_MapWindow] = PanoramiXMapWindow;
|
|
|
|
ProcVector[X_MapSubwindows] = PanoramiXMapSubwindows;
|
|
|
|
ProcVector[X_UnmapWindow] = PanoramiXUnmapWindow;
|
|
|
|
ProcVector[X_UnmapSubwindows] = PanoramiXUnmapSubwindows;
|
|
|
|
ProcVector[X_ConfigureWindow] = PanoramiXConfigureWindow;
|
|
|
|
ProcVector[X_CirculateWindow] = PanoramiXCirculateWindow;
|
|
|
|
ProcVector[X_GetGeometry] = PanoramiXGetGeometry;
|
2003-11-14 17:49:22 +01:00
|
|
|
ProcVector[X_TranslateCoords] = PanoramiXTranslateCoords;
|
2003-11-14 16:54:54 +01:00
|
|
|
ProcVector[X_CreatePixmap] = PanoramiXCreatePixmap;
|
|
|
|
ProcVector[X_FreePixmap] = PanoramiXFreePixmap;
|
|
|
|
ProcVector[X_CreateGC] = PanoramiXCreateGC;
|
|
|
|
ProcVector[X_ChangeGC] = PanoramiXChangeGC;
|
|
|
|
ProcVector[X_CopyGC] = PanoramiXCopyGC;
|
|
|
|
ProcVector[X_SetDashes] = PanoramiXSetDashes;
|
|
|
|
ProcVector[X_SetClipRectangles] = PanoramiXSetClipRectangles;
|
|
|
|
ProcVector[X_FreeGC] = PanoramiXFreeGC;
|
|
|
|
ProcVector[X_ClearArea] = PanoramiXClearToBackground;
|
2008-11-08 18:18:13 +01:00
|
|
|
ProcVector[X_CopyArea] = PanoramiXCopyArea;
|
|
|
|
ProcVector[X_CopyPlane] = PanoramiXCopyPlane;
|
2003-11-14 16:54:54 +01:00
|
|
|
ProcVector[X_PolyPoint] = PanoramiXPolyPoint;
|
|
|
|
ProcVector[X_PolyLine] = PanoramiXPolyLine;
|
|
|
|
ProcVector[X_PolySegment] = PanoramiXPolySegment;
|
|
|
|
ProcVector[X_PolyRectangle] = PanoramiXPolyRectangle;
|
|
|
|
ProcVector[X_PolyArc] = PanoramiXPolyArc;
|
|
|
|
ProcVector[X_FillPoly] = PanoramiXFillPoly;
|
|
|
|
ProcVector[X_PolyFillRectangle] = PanoramiXPolyFillRectangle;
|
|
|
|
ProcVector[X_PolyFillArc] = PanoramiXPolyFillArc;
|
|
|
|
ProcVector[X_PutImage] = PanoramiXPutImage;
|
|
|
|
ProcVector[X_GetImage] = PanoramiXGetImage;
|
|
|
|
ProcVector[X_PolyText8] = PanoramiXPolyText8;
|
|
|
|
ProcVector[X_PolyText16] = PanoramiXPolyText16;
|
|
|
|
ProcVector[X_ImageText8] = PanoramiXImageText8;
|
|
|
|
ProcVector[X_ImageText16] = PanoramiXImageText16;
|
|
|
|
ProcVector[X_CreateColormap] = PanoramiXCreateColormap;
|
|
|
|
ProcVector[X_FreeColormap] = PanoramiXFreeColormap;
|
2003-11-14 17:49:22 +01:00
|
|
|
ProcVector[X_CopyColormapAndFree] = PanoramiXCopyColormapAndFree;
|
2003-11-14 16:54:54 +01:00
|
|
|
ProcVector[X_InstallColormap] = PanoramiXInstallColormap;
|
|
|
|
ProcVector[X_UninstallColormap] = PanoramiXUninstallColormap;
|
|
|
|
ProcVector[X_AllocColor] = PanoramiXAllocColor;
|
|
|
|
ProcVector[X_AllocNamedColor] = PanoramiXAllocNamedColor;
|
|
|
|
ProcVector[X_AllocColorCells] = PanoramiXAllocColorCells;
|
2008-11-08 18:18:13 +01:00
|
|
|
ProcVector[X_AllocColorPlanes] = PanoramiXAllocColorPlanes;
|
2003-11-14 16:54:54 +01:00
|
|
|
ProcVector[X_FreeColors] = PanoramiXFreeColors;
|
2008-11-08 18:18:13 +01:00
|
|
|
ProcVector[X_StoreColors] = PanoramiXStoreColors;
|
|
|
|
ProcVector[X_StoreNamedColor] = PanoramiXStoreNamedColor;
|
2003-11-14 16:54:54 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
PanoramiXRenderInit();
|
|
|
|
PanoramiXFixesInit();
|
damageext: Xineramify (v7)
v7: Don't bother making resources for the backing listeners. [keithp]
This is now slightly unlike how other resources are xineramified. We
create N+1 internal damage listeners, one that's a real resource and
reflects the protocol view, and then one per backend screen where the
report function piles onto the protocol view. The internal listeners
are not stored in the resource database directly, they just hang off the
xinerama resource. We don't wrap Subtract at the dispatch level, but we
do extend it for the Xinerama case to clip to the root window geometry.
As a result of the N+1 design here, the damage reports we generate are
not quite minimal. However they are indistinguishable from sequential
rendering events happening before the client hears damage, and we don't
need to add a post-dispatch callback just for this one extension.
Add is probably (still) somewhat broken since it will only hit screen 0,
but Add really only exists for DRI1's sake, and DRI1 disables itself
with Xinerama enabled anyway. In the absence of a use case, I'm leaving
it unwrapped under Xinerama; if someone wants to define how it ought to
work, be my guest.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-09-16 21:17:26 +02:00
|
|
|
PanoramiXDamageInit();
|
2010-01-06 20:55:48 +01:00
|
|
|
#ifdef COMPOSITE
|
2012-03-21 20:55:09 +01:00
|
|
|
PanoramiXCompositeInit();
|
2010-01-06 20:55:48 +01:00
|
|
|
#endif
|
|
|
|
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
2003-11-14 17:49:22 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
Bool
|
|
|
|
PanoramiXCreateConnectionBlock(void)
|
2003-11-14 16:54:54 +01:00
|
|
|
{
|
2003-11-14 17:49:22 +01:00
|
|
|
int i, j, length;
|
2013-02-14 01:13:53 +01:00
|
|
|
Bool disable_backing_store = FALSE;
|
2003-11-14 16:54:54 +01:00
|
|
|
int old_width, old_height;
|
2003-11-14 17:49:22 +01:00
|
|
|
float width_mult, height_mult;
|
2003-11-14 16:54:54 +01:00
|
|
|
xWindowRoot *root;
|
2003-11-14 17:49:22 +01:00
|
|
|
xVisualType *visual;
|
|
|
|
xDepth *depth;
|
|
|
|
VisualPtr pVisual;
|
|
|
|
ScreenPtr pScreen;
|
2003-11-14 16:54:54 +01:00
|
|
|
|
|
|
|
/*
|
2012-03-21 20:55:09 +01:00
|
|
|
* Do normal CreateConnectionBlock but faking it for only one screen
|
2003-11-14 16:54:54 +01:00
|
|
|
*/
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
if (!PanoramiXNumDepths) {
|
|
|
|
ErrorF("Xinerama error: No common visuals\n");
|
|
|
|
return FALSE;
|
2003-11-14 17:49:22 +01:00
|
|
|
}
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
for (i = 1; i < screenInfo.numScreens; i++) {
|
|
|
|
pScreen = screenInfo.screens[i];
|
|
|
|
if (pScreen->rootDepth != screenInfo.screens[0]->rootDepth) {
|
|
|
|
ErrorF("Xinerama error: Root window depths differ\n");
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
if (pScreen->backingStoreSupport !=
|
|
|
|
screenInfo.screens[0]->backingStoreSupport)
|
2013-02-14 01:13:53 +01:00
|
|
|
disable_backing_store = TRUE;
|
2003-11-14 17:49:22 +01:00
|
|
|
}
|
|
|
|
|
2013-02-14 01:13:53 +01:00
|
|
|
if (disable_backing_store) {
|
2012-03-21 20:55:09 +01:00
|
|
|
for (i = 0; i < screenInfo.numScreens; i++) {
|
|
|
|
pScreen = screenInfo.screens[i];
|
|
|
|
pScreen->backingStoreSupport = NotUseful;
|
|
|
|
}
|
2003-11-14 17:49:22 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
i = screenInfo.numScreens;
|
|
|
|
screenInfo.numScreens = 1;
|
2003-11-14 16:54:54 +01:00
|
|
|
if (!CreateConnectionBlock()) {
|
2012-03-21 20:55:09 +01:00
|
|
|
screenInfo.numScreens = i;
|
|
|
|
return FALSE;
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
|
|
|
|
2003-11-14 17:49:22 +01:00
|
|
|
screenInfo.numScreens = i;
|
2012-03-21 20:55:09 +01:00
|
|
|
|
2003-11-14 17:49:22 +01:00
|
|
|
root = (xWindowRoot *) (ConnectionInfo + connBlockScreenStart);
|
|
|
|
length = connBlockScreenStart + sizeof(xWindowRoot);
|
|
|
|
|
|
|
|
/* overwrite the connection block */
|
|
|
|
root->nDepths = PanoramiXNumDepths;
|
|
|
|
|
|
|
|
for (i = 0; i < PanoramiXNumDepths; i++) {
|
2012-03-21 20:55:09 +01:00
|
|
|
depth = (xDepth *) (ConnectionInfo + length);
|
|
|
|
depth->depth = PanoramiXDepths[i].depth;
|
|
|
|
depth->nVisuals = PanoramiXDepths[i].numVids;
|
|
|
|
length += sizeof(xDepth);
|
|
|
|
visual = (xVisualType *) (ConnectionInfo + length);
|
|
|
|
|
|
|
|
for (j = 0; j < depth->nVisuals; j++, visual++) {
|
|
|
|
visual->visualID = PanoramiXDepths[i].vids[j];
|
|
|
|
|
|
|
|
for (pVisual = PanoramiXVisuals;
|
|
|
|
pVisual->vid != visual->visualID; pVisual++);
|
|
|
|
|
|
|
|
visual->class = pVisual->class;
|
|
|
|
visual->bitsPerRGB = pVisual->bitsPerRGBValue;
|
|
|
|
visual->colormapEntries = pVisual->ColormapEntries;
|
|
|
|
visual->redMask = pVisual->redMask;
|
|
|
|
visual->greenMask = pVisual->greenMask;
|
|
|
|
visual->blueMask = pVisual->blueMask;
|
|
|
|
}
|
|
|
|
|
|
|
|
length += (depth->nVisuals * sizeof(xVisualType));
|
2003-11-14 17:49:22 +01:00
|
|
|
}
|
|
|
|
|
2009-07-06 04:20:21 +02:00
|
|
|
connSetupPrefix.length = bytes_to_int32(length);
|
2003-11-14 17:49:22 +01:00
|
|
|
|
|
|
|
for (i = 0; i < PanoramiXNumDepths; i++)
|
2012-03-21 20:55:09 +01:00
|
|
|
free(PanoramiXDepths[i].vids);
|
2010-05-05 20:44:06 +02:00
|
|
|
free(PanoramiXDepths);
|
2008-05-04 22:45:27 +02:00
|
|
|
PanoramiXDepths = NULL;
|
2003-11-14 17:49:22 +01:00
|
|
|
|
2003-11-14 16:54:54 +01:00
|
|
|
/*
|
|
|
|
* OK, change some dimensions so it looks as if it were one big screen
|
|
|
|
*/
|
2012-03-21 20:55:09 +01:00
|
|
|
|
2003-11-14 16:54:54 +01:00
|
|
|
old_width = root->pixWidth;
|
|
|
|
old_height = root->pixHeight;
|
2003-11-14 17:49:22 +01:00
|
|
|
|
|
|
|
root->pixWidth = PanoramiXPixWidth;
|
|
|
|
root->pixHeight = PanoramiXPixHeight;
|
|
|
|
width_mult = (1.0 * root->pixWidth) / old_width;
|
|
|
|
height_mult = (1.0 * root->pixHeight) / old_height;
|
2003-11-14 16:54:54 +01:00
|
|
|
root->mmWidth *= width_mult;
|
|
|
|
root->mmHeight *= height_mult;
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
while (ConnectionCallbackList) {
|
|
|
|
pointer tmp;
|
2003-11-14 16:54:54 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
tmp = (pointer) ConnectionCallbackList;
|
|
|
|
(*ConnectionCallbackList->func) ();
|
|
|
|
ConnectionCallbackList = ConnectionCallbackList->next;
|
|
|
|
free(tmp);
|
2003-11-14 17:49:22 +01:00
|
|
|
}
|
2003-11-14 16:54:54 +01:00
|
|
|
|
2003-11-14 17:49:22 +01:00
|
|
|
return TRUE;
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
|
|
|
|
2007-12-24 19:13:19 +01:00
|
|
|
/*
|
|
|
|
* This isn't just memcmp(), bitsPerRGBValue is skipped. markv made that
|
|
|
|
* change way back before xf86 4.0, but the comment for _why_ is a bit
|
|
|
|
* opaque, so I'm not going to question it for now.
|
|
|
|
*
|
|
|
|
* This is probably better done as a screen hook so DBE/EVI/GLX can add
|
|
|
|
* their own tests, and adding privates to VisualRec so they don't have to
|
|
|
|
* do their own back-mapping.
|
|
|
|
*/
|
|
|
|
static Bool
|
2008-05-04 22:45:27 +02:00
|
|
|
VisualsEqual(VisualPtr a, ScreenPtr pScreenB, VisualPtr b)
|
2003-11-14 16:54:54 +01:00
|
|
|
{
|
2007-12-24 19:13:19 +01:00
|
|
|
return ((a->class == b->class) &&
|
2012-03-21 20:55:09 +01:00
|
|
|
(a->ColormapEntries == b->ColormapEntries) &&
|
|
|
|
(a->nplanes == b->nplanes) &&
|
|
|
|
(a->redMask == b->redMask) &&
|
|
|
|
(a->greenMask == b->greenMask) &&
|
|
|
|
(a->blueMask == b->blueMask) &&
|
|
|
|
(a->offsetRed == b->offsetRed) &&
|
|
|
|
(a->offsetGreen == b->offsetGreen) &&
|
|
|
|
(a->offsetBlue == b->offsetBlue));
|
2007-12-24 19:13:19 +01:00
|
|
|
}
|
2003-11-14 17:49:22 +01:00
|
|
|
|
2007-12-24 19:13:19 +01:00
|
|
|
static void
|
|
|
|
PanoramiXMaybeAddDepth(DepthPtr pDepth)
|
|
|
|
{
|
|
|
|
ScreenPtr pScreen;
|
|
|
|
int j, k;
|
|
|
|
Bool found = FALSE;
|
|
|
|
|
2011-03-09 06:05:26 +01:00
|
|
|
FOR_NSCREENS_FORWARD_SKIP(j) {
|
2012-03-21 20:55:09 +01:00
|
|
|
pScreen = screenInfo.screens[j];
|
|
|
|
for (k = 0; k < pScreen->numDepths; k++) {
|
|
|
|
if (pScreen->allowedDepths[k].depth == pDepth->depth) {
|
|
|
|
found = TRUE;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2003-11-25 20:29:01 +01:00
|
|
|
}
|
|
|
|
|
2007-12-24 19:13:19 +01:00
|
|
|
if (!found)
|
2012-03-21 20:55:09 +01:00
|
|
|
return;
|
2003-11-14 17:49:22 +01:00
|
|
|
|
2007-12-24 19:13:19 +01:00
|
|
|
j = PanoramiXNumDepths;
|
|
|
|
PanoramiXNumDepths++;
|
2010-05-05 20:44:06 +02:00
|
|
|
PanoramiXDepths = realloc(PanoramiXDepths,
|
2012-03-21 20:55:09 +01:00
|
|
|
PanoramiXNumDepths * sizeof(DepthRec));
|
2007-12-24 19:13:19 +01:00
|
|
|
PanoramiXDepths[j].depth = pDepth->depth;
|
|
|
|
PanoramiXDepths[j].numVids = 0;
|
|
|
|
/* XXX suboptimal, should grow these dynamically */
|
2012-03-21 20:55:09 +01:00
|
|
|
if (pDepth->numVids)
|
|
|
|
PanoramiXDepths[j].vids = malloc(sizeof(VisualID) * pDepth->numVids);
|
2007-12-24 19:13:19 +01:00
|
|
|
else
|
2012-03-21 20:55:09 +01:00
|
|
|
PanoramiXDepths[j].vids = NULL;
|
2007-12-24 19:13:19 +01:00
|
|
|
}
|
2004-06-30 22:06:56 +02:00
|
|
|
|
2007-12-24 19:13:19 +01:00
|
|
|
static void
|
|
|
|
PanoramiXMaybeAddVisual(VisualPtr pVisual)
|
|
|
|
{
|
|
|
|
ScreenPtr pScreen;
|
|
|
|
int j, k;
|
|
|
|
Bool found = FALSE;
|
|
|
|
|
2011-03-09 06:05:26 +01:00
|
|
|
FOR_NSCREENS_FORWARD_SKIP(j) {
|
2012-03-21 20:55:09 +01:00
|
|
|
pScreen = screenInfo.screens[j];
|
|
|
|
found = FALSE;
|
2007-12-24 19:13:19 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
for (k = 0; k < pScreen->numVisuals; k++) {
|
|
|
|
VisualPtr candidate = &pScreen->visuals[k];
|
2008-05-04 22:45:27 +02:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
if ((*XineramaVisualsEqualPtr) (pVisual, pScreen, candidate)
|
2004-06-30 22:06:56 +02:00
|
|
|
#ifdef GLXPROXY
|
2012-03-21 20:55:09 +01:00
|
|
|
&& glxMatchVisual(screenInfo.screens[0], pVisual, pScreen)
|
2004-06-30 22:06:56 +02:00
|
|
|
#endif
|
2012-03-21 20:55:09 +01:00
|
|
|
) {
|
|
|
|
found = TRUE;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!found)
|
|
|
|
return;
|
2007-12-24 19:13:19 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/* found a matching visual on all screens, add it to the subset list */
|
|
|
|
j = PanoramiXNumVisuals;
|
|
|
|
PanoramiXNumVisuals++;
|
2010-05-05 20:44:06 +02:00
|
|
|
PanoramiXVisuals = realloc(PanoramiXVisuals,
|
2012-03-21 20:55:09 +01:00
|
|
|
PanoramiXNumVisuals * sizeof(VisualRec));
|
2007-12-24 19:13:19 +01:00
|
|
|
|
|
|
|
memcpy(&PanoramiXVisuals[j], pVisual, sizeof(VisualRec));
|
|
|
|
|
|
|
|
for (k = 0; k < PanoramiXNumDepths; k++) {
|
2012-03-21 20:55:09 +01:00
|
|
|
if (PanoramiXDepths[k].depth == pVisual->nplanes) {
|
|
|
|
PanoramiXDepths[k].vids[PanoramiXDepths[k].numVids] = pVisual->vid;
|
|
|
|
PanoramiXDepths[k].numVids++;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2007-12-24 19:13:19 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
extern void
|
|
|
|
PanoramiXConsolidate(void)
|
|
|
|
{
|
2012-03-21 20:55:09 +01:00
|
|
|
int i;
|
2007-12-24 19:13:19 +01:00
|
|
|
PanoramiXRes *root, *defmap, *saver;
|
2012-03-21 20:55:09 +01:00
|
|
|
ScreenPtr pScreen = screenInfo.screens[0];
|
|
|
|
DepthPtr pDepth = pScreen->allowedDepths;
|
|
|
|
VisualPtr pVisual = pScreen->visuals;
|
2007-12-24 19:13:19 +01:00
|
|
|
|
|
|
|
PanoramiXNumDepths = 0;
|
|
|
|
PanoramiXNumVisuals = 0;
|
2003-11-14 17:49:22 +01:00
|
|
|
|
2007-12-24 19:13:19 +01:00
|
|
|
for (i = 0; i < pScreen->numDepths; i++)
|
2012-03-21 20:55:09 +01:00
|
|
|
PanoramiXMaybeAddDepth(pDepth++);
|
2003-11-14 17:49:22 +01:00
|
|
|
|
2007-12-24 19:13:19 +01:00
|
|
|
for (i = 0; i < pScreen->numVisuals; i++)
|
2012-03-21 20:55:09 +01:00
|
|
|
PanoramiXMaybeAddVisual(pVisual++);
|
2007-12-24 19:13:19 +01:00
|
|
|
|
2010-05-05 20:44:06 +02:00
|
|
|
root = malloc(sizeof(PanoramiXRes));
|
2003-11-14 17:49:22 +01:00
|
|
|
root->type = XRT_WINDOW;
|
2010-05-05 20:44:06 +02:00
|
|
|
defmap = malloc(sizeof(PanoramiXRes));
|
2003-11-14 17:49:22 +01:00
|
|
|
defmap->type = XRT_COLORMAP;
|
2010-05-05 20:44:06 +02:00
|
|
|
saver = malloc(sizeof(PanoramiXRes));
|
2003-11-25 20:29:01 +01:00
|
|
|
saver->type = XRT_WINDOW;
|
|
|
|
|
2011-03-09 06:01:20 +01:00
|
|
|
FOR_NSCREENS(i) {
|
2013-02-14 01:13:53 +01:00
|
|
|
ScreenPtr scr = screenInfo.screens[i];
|
2012-03-21 20:55:09 +01:00
|
|
|
|
2013-02-14 01:13:53 +01:00
|
|
|
root->info[i].id = scr->root->drawable.id;
|
2012-03-21 20:55:09 +01:00
|
|
|
root->u.win.class = InputOutput;
|
2003-11-25 20:29:01 +01:00
|
|
|
root->u.win.root = TRUE;
|
2013-02-14 01:13:53 +01:00
|
|
|
saver->info[i].id = scr->screensaver.wid;
|
2003-11-25 20:29:01 +01:00
|
|
|
saver->u.win.class = InputOutput;
|
|
|
|
saver->u.win.root = TRUE;
|
2013-02-14 01:13:53 +01:00
|
|
|
defmap->info[i].id = scr->defColormap;
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
|
|
|
|
2003-11-14 17:49:22 +01:00
|
|
|
AddResource(root->info[0].id, XRT_WINDOW, root);
|
2003-11-25 20:29:01 +01:00
|
|
|
AddResource(saver->info[0].id, XRT_WINDOW, saver);
|
2003-11-14 17:49:22 +01:00
|
|
|
AddResource(defmap->info[0].id, XRT_COLORMAP, defmap);
|
|
|
|
}
|
2003-11-14 16:54:54 +01:00
|
|
|
|
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
|
|
|
VisualID
|
2007-12-24 19:13:19 +01:00
|
|
|
PanoramiXTranslateVisualID(int screen, VisualID orig)
|
|
|
|
{
|
2008-05-04 22:45:27 +02:00
|
|
|
ScreenPtr pOtherScreen = screenInfo.screens[screen];
|
2007-12-24 19:13:19 +01:00
|
|
|
VisualPtr pVisual = NULL;
|
2008-05-04 22:45:27 +02:00
|
|
|
int i;
|
|
|
|
|
2007-12-24 19:13:19 +01:00
|
|
|
for (i = 0; i < PanoramiXNumVisuals; i++) {
|
2012-03-21 20:55:09 +01:00
|
|
|
if (orig == PanoramiXVisuals[i].vid) {
|
|
|
|
pVisual = &PanoramiXVisuals[i];
|
|
|
|
break;
|
|
|
|
}
|
2007-12-24 19:13:19 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
if (!pVisual)
|
2012-03-21 20:55:09 +01:00
|
|
|
return 0;
|
2007-12-24 19:13:19 +01:00
|
|
|
|
2008-05-20 21:39:28 +02:00
|
|
|
/* if screen is 0, orig is already the correct visual ID */
|
|
|
|
if (screen == 0)
|
2012-03-21 20:55:09 +01:00
|
|
|
return orig;
|
2008-05-20 21:39:28 +02:00
|
|
|
|
2007-12-24 19:13:19 +01:00
|
|
|
/* found the original, now translate it relative to the backend screen */
|
2008-05-04 22:45:27 +02:00
|
|
|
for (i = 0; i < pOtherScreen->numVisuals; i++) {
|
2012-03-21 20:55:09 +01:00
|
|
|
VisualPtr pOtherVisual = &pOtherScreen->visuals[i];
|
2008-05-04 22:45:27 +02:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
if ((*XineramaVisualsEqualPtr) (pVisual, pOtherScreen, pOtherVisual))
|
|
|
|
return pOtherVisual->vid;
|
2008-05-04 22:45:27 +02:00
|
|
|
}
|
|
|
|
|
2007-12-24 19:13:19 +01:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2003-11-14 16:54:54 +01:00
|
|
|
/*
|
|
|
|
* PanoramiXResetProc()
|
|
|
|
* Exit, deallocating as needed.
|
|
|
|
*/
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
static void
|
|
|
|
PanoramiXResetProc(ExtensionEntry * extEntry)
|
2003-11-14 16:54:54 +01:00
|
|
|
{
|
2012-03-21 20:55:09 +01:00
|
|
|
int i;
|
2003-11-14 16:54:54 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
PanoramiXRenderReset();
|
|
|
|
PanoramiXFixesReset();
|
damageext: Xineramify (v7)
v7: Don't bother making resources for the backing listeners. [keithp]
This is now slightly unlike how other resources are xineramified. We
create N+1 internal damage listeners, one that's a real resource and
reflects the protocol view, and then one per backend screen where the
report function piles onto the protocol view. The internal listeners
are not stored in the resource database directly, they just hang off the
xinerama resource. We don't wrap Subtract at the dispatch level, but we
do extend it for the Xinerama case to clip to the root window geometry.
As a result of the N+1 design here, the damage reports we generate are
not quite minimal. However they are indistinguishable from sequential
rendering events happening before the client hears damage, and we don't
need to add a post-dispatch callback just for this one extension.
Add is probably (still) somewhat broken since it will only hit screen 0,
but Add really only exists for DRI1's sake, and DRI1 disables itself
with Xinerama enabled anyway. In the absence of a use case, I'm leaving
it unwrapped under Xinerama; if someone wants to define how it ought to
work, be my guest.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-09-16 21:17:26 +02:00
|
|
|
PanoramiXDamageReset();
|
2012-07-10 03:03:36 +02:00
|
|
|
#ifdef COMPOSITE
|
|
|
|
PanoramiXCompositeReset ();
|
2010-01-05 21:35:10 +01:00
|
|
|
#endif
|
2003-11-14 16:54:54 +01:00
|
|
|
screenInfo.numScreens = PanoramiXNumScreens;
|
2012-03-21 20:55:09 +01:00
|
|
|
for (i = 256; i--;)
|
|
|
|
ProcVector[i] = SavedProcVector[i];
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2012-03-21 20:55:09 +01:00
|
|
|
ProcPanoramiXQueryVersion(ClientPtr client)
|
2003-11-14 16:54:54 +01:00
|
|
|
{
|
2003-11-14 17:49:22 +01:00
|
|
|
/* REQUEST(xPanoramiXQueryVersionReq); */
|
2012-07-10 04:12:43 +02:00
|
|
|
xPanoramiXQueryVersionReply rep = {
|
|
|
|
.type = X_Reply,
|
|
|
|
.sequenceNumber = client->sequence,
|
|
|
|
.length = 0,
|
|
|
|
.majorVersion = SERVER_PANORAMIX_MAJOR_VERSION,
|
|
|
|
.minorVersion = SERVER_PANORAMIX_MINOR_VERSION
|
|
|
|
};
|
2003-11-14 16:54:54 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
REQUEST_SIZE_MATCH(xPanoramiXQueryVersionReq);
|
|
|
|
if (client->swapped) {
|
2011-08-04 21:35:41 +02:00
|
|
|
swaps(&rep.sequenceNumber);
|
|
|
|
swapl(&rep.length);
|
|
|
|
swaps(&rep.majorVersion);
|
|
|
|
swaps(&rep.minorVersion);
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
2012-05-13 09:03:35 +02:00
|
|
|
WriteToClient(client, sizeof(xPanoramiXQueryVersionReply), &rep);
|
2010-05-11 05:22:05 +02:00
|
|
|
return Success;
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
int
|
|
|
|
ProcPanoramiXGetState(ClientPtr client)
|
|
|
|
{
|
2012-03-21 20:55:09 +01:00
|
|
|
REQUEST(xPanoramiXGetStateReq);
|
|
|
|
WindowPtr pWin;
|
|
|
|
xPanoramiXGetStateReply rep;
|
|
|
|
int rc;
|
|
|
|
|
|
|
|
REQUEST_SIZE_MATCH(xPanoramiXGetStateReq);
|
|
|
|
rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
|
|
|
|
if (rc != Success)
|
|
|
|
return rc;
|
|
|
|
|
2012-07-10 04:12:43 +02:00
|
|
|
rep = (xPanoramiXGetStateReply) {
|
|
|
|
.type = X_Reply,
|
|
|
|
.state = !noPanoramiXExtension,
|
|
|
|
.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);
|
|
|
|
}
|
2012-05-13 09:03:35 +02:00
|
|
|
WriteToClient(client, sizeof(xPanoramiXGetStateReply), &rep);
|
2012-03-21 20:55:09 +01:00
|
|
|
return Success;
|
2003-11-14 16:54:54 +01:00
|
|
|
|
|
|
|
}
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
int
|
2003-11-14 16:54:54 +01:00
|
|
|
ProcPanoramiXGetScreenCount(ClientPtr client)
|
|
|
|
{
|
2012-03-21 20:55:09 +01:00
|
|
|
REQUEST(xPanoramiXGetScreenCountReq);
|
|
|
|
WindowPtr pWin;
|
|
|
|
xPanoramiXGetScreenCountReply rep;
|
|
|
|
int rc;
|
|
|
|
|
|
|
|
REQUEST_SIZE_MATCH(xPanoramiXGetScreenCountReq);
|
|
|
|
rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
|
|
|
|
if (rc != Success)
|
|
|
|
return rc;
|
|
|
|
|
2012-07-10 04:12:43 +02:00
|
|
|
rep = (xPanoramiXGetScreenCountReply) {
|
|
|
|
.type = X_Reply,
|
|
|
|
.ScreenCount = PanoramiXNumScreens,
|
|
|
|
.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);
|
|
|
|
}
|
2012-05-13 09:03:35 +02:00
|
|
|
WriteToClient(client, sizeof(xPanoramiXGetScreenCountReply), &rep);
|
2012-03-21 20:55:09 +01:00
|
|
|
return Success;
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
int
|
2003-11-14 16:54:54 +01:00
|
|
|
ProcPanoramiXGetScreenSize(ClientPtr client)
|
|
|
|
{
|
2012-03-21 20:55:09 +01:00
|
|
|
REQUEST(xPanoramiXGetScreenSizeReq);
|
|
|
|
WindowPtr pWin;
|
|
|
|
xPanoramiXGetScreenSizeReply rep;
|
|
|
|
int rc;
|
2003-11-14 16:54:54 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
if (stuff->screen >= PanoramiXNumScreens)
|
|
|
|
return BadMatch;
|
|
|
|
|
|
|
|
REQUEST_SIZE_MATCH(xPanoramiXGetScreenSizeReq);
|
|
|
|
rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
|
|
|
|
if (rc != Success)
|
|
|
|
return rc;
|
|
|
|
|
2012-07-10 04:12:43 +02:00
|
|
|
rep = (xPanoramiXGetScreenSizeReply) {
|
|
|
|
.type = X_Reply,
|
|
|
|
.sequenceNumber = client->sequence,
|
|
|
|
.length = 0,
|
2012-03-21 20:55:09 +01:00
|
|
|
/* screen dimensions */
|
2012-07-10 04:12:43 +02:00
|
|
|
.width = screenInfo.screens[stuff->screen]->width,
|
|
|
|
.height = screenInfo.screens[stuff->screen]->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);
|
|
|
|
}
|
2012-05-13 09:03:35 +02:00
|
|
|
WriteToClient(client, sizeof(xPanoramiXGetScreenSizeReply), &rep);
|
2012-03-21 20:55:09 +01:00
|
|
|
return Success;
|
|
|
|
}
|
2003-11-14 16:54:54 +01:00
|
|
|
|
2003-11-14 17:49:22 +01:00
|
|
|
int
|
|
|
|
ProcXineramaIsActive(ClientPtr client)
|
|
|
|
{
|
|
|
|
/* REQUEST(xXineramaIsActiveReq); */
|
2012-03-21 20:55:09 +01:00
|
|
|
xXineramaIsActiveReply rep;
|
2003-11-14 17:49:22 +01:00
|
|
|
|
|
|
|
REQUEST_SIZE_MATCH(xXineramaIsActiveReq);
|
|
|
|
|
2012-07-10 04:12:43 +02:00
|
|
|
rep = (xXineramaIsActiveReply) {
|
|
|
|
.type = X_Reply,
|
|
|
|
.sequenceNumber = client->sequence,
|
|
|
|
.length = 0,
|
2005-06-09 04:29:42 +02:00
|
|
|
#if 1
|
2012-03-21 20:55:09 +01:00
|
|
|
/* The following hack fools clients into thinking that Xinerama
|
|
|
|
* is disabled even though it is not. */
|
2012-07-10 04:12:43 +02:00
|
|
|
.state = !noPanoramiXExtension && !PanoramiXExtensionDisabledHack
|
2005-06-09 04:29:42 +02:00
|
|
|
#else
|
2012-07-10 04:12:43 +02:00
|
|
|
.state = !noPanoramiXExtension;
|
2005-06-09 04:29:42 +02:00
|
|
|
#endif
|
2012-07-10 04:12:43 +02:00
|
|
|
};
|
2003-11-14 17:49:22 +01:00
|
|
|
if (client->swapped) {
|
2012-03-21 20:55:09 +01:00
|
|
|
swaps(&rep.sequenceNumber);
|
|
|
|
swapl(&rep.length);
|
|
|
|
swapl(&rep.state);
|
|
|
|
}
|
2012-05-13 09:03:35 +02:00
|
|
|
WriteToClient(client, sizeof(xXineramaIsActiveReply), &rep);
|
2010-05-11 05:22:05 +02:00
|
|
|
return Success;
|
2003-11-14 17:49:22 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
int
|
|
|
|
ProcXineramaQueryScreens(ClientPtr client)
|
2003-11-14 16:54:54 +01:00
|
|
|
{
|
2003-11-14 17:49:22 +01:00
|
|
|
/* REQUEST(xXineramaQueryScreensReq); */
|
2012-07-14 19:02:52 +02:00
|
|
|
CARD32 number = (noPanoramiXExtension) ? 0 : PanoramiXNumScreens;
|
2012-07-10 04:12:43 +02:00
|
|
|
xXineramaQueryScreensReply rep = {
|
|
|
|
.type = X_Reply,
|
|
|
|
.sequenceNumber = client->sequence,
|
2012-07-14 19:02:52 +02:00
|
|
|
.length = bytes_to_int32(number * sz_XineramaScreenInfo),
|
|
|
|
.number = number
|
2012-07-10 04:12:43 +02:00
|
|
|
};
|
2003-11-14 17:49:22 +01:00
|
|
|
|
|
|
|
REQUEST_SIZE_MATCH(xXineramaQueryScreensReq);
|
|
|
|
|
|
|
|
if (client->swapped) {
|
2012-03-21 20:55:09 +01:00
|
|
|
swaps(&rep.sequenceNumber);
|
|
|
|
swapl(&rep.length);
|
|
|
|
swapl(&rep.number);
|
|
|
|
}
|
2012-05-13 09:03:35 +02:00
|
|
|
WriteToClient(client, sizeof(xXineramaQueryScreensReply), &rep);
|
2012-03-21 20:55:09 +01:00
|
|
|
|
|
|
|
if (!noPanoramiXExtension) {
|
|
|
|
xXineramaScreenInfo scratch;
|
|
|
|
int i;
|
|
|
|
|
|
|
|
FOR_NSCREENS(i) {
|
|
|
|
scratch.x_org = screenInfo.screens[i]->x;
|
|
|
|
scratch.y_org = screenInfo.screens[i]->y;
|
|
|
|
scratch.width = screenInfo.screens[i]->width;
|
|
|
|
scratch.height = screenInfo.screens[i]->height;
|
|
|
|
|
|
|
|
if (client->swapped) {
|
|
|
|
swaps(&scratch.x_org);
|
|
|
|
swaps(&scratch.y_org);
|
|
|
|
swaps(&scratch.width);
|
|
|
|
swaps(&scratch.height);
|
|
|
|
}
|
2012-05-13 09:03:35 +02:00
|
|
|
WriteToClient(client, sz_XineramaScreenInfo, &scratch);
|
2012-03-21 20:55:09 +01:00
|
|
|
}
|
2003-11-14 17:49:22 +01:00
|
|
|
}
|
|
|
|
|
2010-05-11 05:22:05 +02:00
|
|
|
return Success;
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
2003-11-14 17:49:22 +01:00
|
|
|
|
2003-11-14 16:54:54 +01:00
|
|
|
static int
|
2012-03-21 20:55:09 +01:00
|
|
|
ProcPanoramiXDispatch(ClientPtr client)
|
|
|
|
{
|
|
|
|
REQUEST(xReq);
|
|
|
|
switch (stuff->data) {
|
|
|
|
case X_PanoramiXQueryVersion:
|
|
|
|
return ProcPanoramiXQueryVersion(client);
|
|
|
|
case X_PanoramiXGetState:
|
|
|
|
return ProcPanoramiXGetState(client);
|
|
|
|
case X_PanoramiXGetScreenCount:
|
|
|
|
return ProcPanoramiXGetScreenCount(client);
|
|
|
|
case X_PanoramiXGetScreenSize:
|
|
|
|
return ProcPanoramiXGetScreenSize(client);
|
|
|
|
case X_XineramaIsActive:
|
|
|
|
return ProcXineramaIsActive(client);
|
|
|
|
case X_XineramaQueryScreens:
|
|
|
|
return ProcXineramaQueryScreens(client);
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
|
|
|
return BadRequest;
|
|
|
|
}
|
2003-11-14 17:49:22 +01:00
|
|
|
|
|
|
|
#if X_BYTE_ORDER == X_LITTLE_ENDIAN
|
|
|
|
#define SHIFT_L(v,s) (v) << (s)
|
|
|
|
#define SHIFT_R(v,s) (v) >> (s)
|
|
|
|
#else
|
|
|
|
#define SHIFT_L(v,s) (v) >> (s)
|
|
|
|
#define SHIFT_R(v,s) (v) << (s)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
static void
|
|
|
|
CopyBits(char *dst, int shiftL, char *src, int bytes)
|
|
|
|
{
|
2012-03-21 20:55:09 +01:00
|
|
|
/* Just get it to work. Worry about speed later */
|
2003-11-14 17:49:22 +01:00
|
|
|
int shiftR = 8 - shiftL;
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
while (bytes--) {
|
|
|
|
*dst |= SHIFT_L(*src, shiftL);
|
|
|
|
*(dst + 1) |= SHIFT_R(*src, shiftR);
|
|
|
|
dst++;
|
|
|
|
src++;
|
|
|
|
}
|
2003-11-14 17:49:22 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Caution. This doesn't support 2 and 4 bpp formats. We expect
|
|
|
|
1 bpp and planar data to be already cleared when presented
|
|
|
|
to this function */
|
|
|
|
|
|
|
|
void
|
2012-03-21 20:55:09 +01:00
|
|
|
XineramaGetImageData(DrawablePtr *pDrawables,
|
|
|
|
int left,
|
|
|
|
int top,
|
|
|
|
int width,
|
|
|
|
int height,
|
|
|
|
unsigned int format,
|
|
|
|
unsigned long planemask,
|
|
|
|
char *data, int pitch, Bool isRoot)
|
|
|
|
{
|
2010-05-23 06:13:48 +02:00
|
|
|
RegionRec SrcRegion, ScreenRegion, GrabRegion;
|
2003-11-14 17:49:22 +01:00
|
|
|
BoxRec SrcBox, *pbox;
|
|
|
|
int x, y, w, h, i, j, nbox, size, sizeNeeded, ScratchPitch, inOut, depth;
|
|
|
|
DrawablePtr pDraw = pDrawables[0];
|
|
|
|
char *ScratchMem = NULL;
|
|
|
|
|
|
|
|
size = 0;
|
|
|
|
|
|
|
|
/* find box in logical screen space */
|
|
|
|
SrcBox.x1 = left;
|
|
|
|
SrcBox.y1 = top;
|
2012-03-21 20:55:09 +01:00
|
|
|
if (!isRoot) {
|
|
|
|
SrcBox.x1 += pDraw->x + screenInfo.screens[0]->x;
|
|
|
|
SrcBox.y1 += pDraw->y + screenInfo.screens[0]->y;
|
2003-11-14 17:49:22 +01:00
|
|
|
}
|
|
|
|
SrcBox.x2 = SrcBox.x1 + width;
|
|
|
|
SrcBox.y2 = SrcBox.y1 + height;
|
2012-03-21 20:55:09 +01:00
|
|
|
|
2010-05-22 00:05:48 +02:00
|
|
|
RegionInit(&SrcRegion, &SrcBox, 1);
|
|
|
|
RegionNull(&GrabRegion);
|
2003-11-14 17:49:22 +01:00
|
|
|
|
|
|
|
depth = (format == XYPixmap) ? 1 : pDraw->depth;
|
|
|
|
|
2011-03-09 06:01:20 +01:00
|
|
|
FOR_NSCREENS(i) {
|
2012-03-21 20:55:09 +01:00
|
|
|
BoxRec TheBox;
|
|
|
|
ScreenPtr pScreen;
|
|
|
|
|
|
|
|
pDraw = pDrawables[i];
|
|
|
|
pScreen = pDraw->pScreen;
|
|
|
|
|
|
|
|
TheBox.x1 = pScreen->x;
|
|
|
|
TheBox.x2 = TheBox.x1 + pScreen->width;
|
|
|
|
TheBox.y1 = pScreen->y;
|
|
|
|
TheBox.y2 = TheBox.y1 + pScreen->height;
|
|
|
|
|
|
|
|
RegionInit(&ScreenRegion, &TheBox, 1);
|
|
|
|
inOut = RegionContainsRect(&ScreenRegion, &SrcBox);
|
|
|
|
if (inOut == rgnPART)
|
|
|
|
RegionIntersect(&GrabRegion, &SrcRegion, &ScreenRegion);
|
|
|
|
RegionUninit(&ScreenRegion);
|
|
|
|
|
|
|
|
if (inOut == rgnIN) {
|
|
|
|
(*pScreen->GetImage) (pDraw,
|
|
|
|
SrcBox.x1 - pDraw->x -
|
|
|
|
screenInfo.screens[i]->x,
|
|
|
|
SrcBox.y1 - pDraw->y -
|
|
|
|
screenInfo.screens[i]->y, width, height,
|
|
|
|
format, planemask, data);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
else if (inOut == rgnOUT)
|
|
|
|
continue;
|
|
|
|
|
|
|
|
nbox = RegionNumRects(&GrabRegion);
|
|
|
|
|
|
|
|
if (nbox) {
|
|
|
|
pbox = RegionRects(&GrabRegion);
|
|
|
|
|
|
|
|
while (nbox--) {
|
|
|
|
w = pbox->x2 - pbox->x1;
|
|
|
|
h = pbox->y2 - pbox->y1;
|
|
|
|
ScratchPitch = PixmapBytePad(w, depth);
|
|
|
|
sizeNeeded = ScratchPitch * h;
|
|
|
|
|
|
|
|
if (sizeNeeded > size) {
|
|
|
|
char *tmpdata = ScratchMem;
|
|
|
|
|
|
|
|
ScratchMem = realloc(ScratchMem, sizeNeeded);
|
|
|
|
if (ScratchMem)
|
|
|
|
size = sizeNeeded;
|
|
|
|
else {
|
|
|
|
ScratchMem = tmpdata;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
x = pbox->x1 - pDraw->x - screenInfo.screens[i]->x;
|
|
|
|
y = pbox->y1 - pDraw->y - screenInfo.screens[i]->y;
|
|
|
|
|
|
|
|
(*pScreen->GetImage) (pDraw, x, y, w, h,
|
|
|
|
format, planemask, ScratchMem);
|
|
|
|
|
|
|
|
/* copy the memory over */
|
|
|
|
|
|
|
|
if (depth == 1) {
|
|
|
|
int k, shift, leftover, index, index2;
|
|
|
|
|
|
|
|
x = pbox->x1 - SrcBox.x1;
|
|
|
|
y = pbox->y1 - SrcBox.y1;
|
|
|
|
shift = x & 7;
|
|
|
|
x >>= 3;
|
|
|
|
leftover = w & 7;
|
|
|
|
w >>= 3;
|
|
|
|
|
|
|
|
/* clean up the edge */
|
|
|
|
if (leftover) {
|
|
|
|
int mask = (1 << leftover) - 1;
|
|
|
|
|
|
|
|
for (j = h, k = w; j--; k += ScratchPitch)
|
|
|
|
ScratchMem[k] &= mask;
|
|
|
|
}
|
|
|
|
|
|
|
|
for (j = 0, index = (pitch * y) + x, index2 = 0; j < h;
|
|
|
|
j++, index += pitch, index2 += ScratchPitch) {
|
|
|
|
if (w) {
|
|
|
|
if (!shift)
|
|
|
|
memcpy(data + index, ScratchMem + index2, w);
|
|
|
|
else
|
|
|
|
CopyBits(data + index, shift,
|
|
|
|
ScratchMem + index2, w);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (leftover) {
|
|
|
|
data[index + w] |=
|
|
|
|
SHIFT_L(ScratchMem[index2 + w], shift);
|
|
|
|
if ((shift + leftover) > 8)
|
|
|
|
data[index + w + 1] |=
|
|
|
|
SHIFT_R(ScratchMem[index2 + w],
|
|
|
|
(8 - shift));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
j = BitsPerPixel(depth) >> 3;
|
|
|
|
x = (pbox->x1 - SrcBox.x1) * j;
|
|
|
|
y = pbox->y1 - SrcBox.y1;
|
|
|
|
w *= j;
|
|
|
|
|
|
|
|
for (j = 0; j < h; j++) {
|
|
|
|
memcpy(data + (pitch * (y + j)) + x,
|
|
|
|
ScratchMem + (ScratchPitch * j), w);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
pbox++;
|
|
|
|
}
|
|
|
|
|
|
|
|
RegionSubtract(&SrcRegion, &SrcRegion, &GrabRegion);
|
|
|
|
if (!RegionNotEmpty(&SrcRegion))
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2003-11-14 17:49:22 +01:00
|
|
|
}
|
|
|
|
|
2010-06-06 10:28:30 +02:00
|
|
|
free(ScratchMem);
|
2003-11-14 17:49:22 +01:00
|
|
|
|
2010-05-22 00:05:48 +02:00
|
|
|
RegionUninit(&SrcRegion);
|
|
|
|
RegionUninit(&GrabRegion);
|
2003-11-14 17:49:22 +01:00
|
|
|
}
|