2003-11-14 16:54:54 +01:00
|
|
|
/*
|
|
|
|
* misprite.c
|
|
|
|
*
|
|
|
|
* machine independent software sprite routines
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
Copyright 1989, 1998 The Open Group
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
|
|
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 THE
|
|
|
|
OPEN GROUP BE LIABLE FOR ANY CLAIM, 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 The Open Group shall not be
|
|
|
|
used in advertising or otherwise to promote the sale, use or other dealings
|
|
|
|
in this Software without prior written authorization from The Open Group.
|
|
|
|
*/
|
|
|
|
|
2005-08-21 21:29:55 +02:00
|
|
|
#ifdef HAVE_DIX_CONFIG_H
|
|
|
|
#include <dix-config.h>
|
|
|
|
#endif
|
|
|
|
|
2009-03-27 17:44:20 +01:00
|
|
|
#include <X11/X.h>
|
|
|
|
#include <X11/Xproto.h>
|
|
|
|
#include "misc.h"
|
|
|
|
#include "pixmapstr.h"
|
|
|
|
#include "input.h"
|
|
|
|
#include "mi.h"
|
|
|
|
#include "cursorstr.h"
|
|
|
|
#include <X11/fonts/font.h>
|
|
|
|
#include "scrnintstr.h"
|
|
|
|
#include "colormapst.h"
|
|
|
|
#include "windowstr.h"
|
|
|
|
#include "gcstruct.h"
|
|
|
|
#include "mipointer.h"
|
|
|
|
#include "misprite.h"
|
|
|
|
#include "dixfontstr.h"
|
|
|
|
#include <X11/fonts/fontstruct.h>
|
|
|
|
#include "inputstr.h"
|
|
|
|
#include "damage.h"
|
|
|
|
|
|
|
|
typedef struct {
|
2012-03-21 20:55:09 +01:00
|
|
|
CursorPtr pCursor;
|
|
|
|
int x; /* cursor hotspot */
|
|
|
|
int y;
|
|
|
|
BoxRec saved; /* saved area from the screen */
|
|
|
|
Bool isUp; /* cursor in frame buffer */
|
|
|
|
Bool shouldBeUp; /* cursor should be displayed */
|
|
|
|
WindowPtr pCacheWin; /* window the cursor last seen in */
|
|
|
|
Bool isInCacheWin;
|
|
|
|
Bool checkPixels; /* check colormap collision */
|
|
|
|
ScreenPtr pScreen;
|
2009-03-27 17:44:20 +01:00
|
|
|
} miCursorInfoRec, *miCursorInfoPtr;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* per screen information
|
|
|
|
*/
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
/* screen procedures */
|
2012-03-21 20:55:09 +01:00
|
|
|
CloseScreenProcPtr CloseScreen;
|
|
|
|
GetImageProcPtr GetImage;
|
|
|
|
GetSpansProcPtr GetSpans;
|
|
|
|
SourceValidateProcPtr SourceValidate;
|
|
|
|
|
2009-03-27 17:44:20 +01:00
|
|
|
/* window procedures */
|
2012-03-21 20:55:09 +01:00
|
|
|
CopyWindowProcPtr CopyWindow;
|
|
|
|
|
2009-03-27 17:44:20 +01:00
|
|
|
/* colormap procedures */
|
2012-03-21 20:55:09 +01:00
|
|
|
InstallColormapProcPtr InstallColormap;
|
|
|
|
StoreColorsProcPtr StoreColors;
|
|
|
|
|
2009-03-27 17:44:20 +01:00
|
|
|
/* os layer procedures */
|
2012-03-21 20:55:09 +01:00
|
|
|
ScreenBlockHandlerProcPtr BlockHandler;
|
|
|
|
|
|
|
|
xColorItem colors[2];
|
|
|
|
ColormapPtr pInstalledMap;
|
|
|
|
ColormapPtr pColormap;
|
|
|
|
VisualPtr pVisual;
|
|
|
|
DamagePtr pDamage; /* damage tracking structure */
|
|
|
|
Bool damageRegistered;
|
|
|
|
int numberOfCursors;
|
2009-03-27 17:44:20 +01:00
|
|
|
} miSpriteScreenRec, *miSpriteScreenPtr;
|
|
|
|
|
|
|
|
#define SOURCE_COLOR 0
|
|
|
|
#define MASK_COLOR 1
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Overlap BoxPtr and Box elements
|
|
|
|
*/
|
|
|
|
#define BOX_OVERLAP(pCbox,X1,Y1,X2,Y2) \
|
|
|
|
(((pCbox)->x1 <= (X2)) && ((X1) <= (pCbox)->x2) && \
|
|
|
|
((pCbox)->y1 <= (Y2)) && ((Y1) <= (pCbox)->y2))
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Overlap BoxPtr, origins, and rectangle
|
|
|
|
*/
|
|
|
|
#define ORG_OVERLAP(pCbox,xorg,yorg,x,y,w,h) \
|
|
|
|
BOX_OVERLAP((pCbox),(x)+(xorg),(y)+(yorg),(x)+(xorg)+(w),(y)+(yorg)+(h))
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Overlap BoxPtr, origins and RectPtr
|
|
|
|
*/
|
|
|
|
#define ORGRECT_OVERLAP(pCbox,xorg,yorg,pRect) \
|
|
|
|
ORG_OVERLAP((pCbox),(xorg),(yorg),(pRect)->x,(pRect)->y, \
|
|
|
|
(int)((pRect)->width), (int)((pRect)->height))
|
|
|
|
/*
|
|
|
|
* Overlap BoxPtr and horizontal span
|
|
|
|
*/
|
|
|
|
#define SPN_OVERLAP(pCbox,y,x,w) BOX_OVERLAP((pCbox),(x),(y),(x)+(w),(y))
|
|
|
|
|
|
|
|
#define LINE_SORT(x1,y1,x2,y2) \
|
|
|
|
{ int _t; \
|
|
|
|
if (x1 > x2) { _t = x1; x1 = x2; x2 = _t; } \
|
|
|
|
if (y1 > y2) { _t = y1; y1 = y2; y2 = _t; } }
|
|
|
|
|
|
|
|
#define LINE_OVERLAP(pCbox,x1,y1,x2,y2,lw2) \
|
|
|
|
BOX_OVERLAP((pCbox), (x1)-(lw2), (y1)-(lw2), (x2)+(lw2), (y2)+(lw2))
|
|
|
|
|
2006-11-22 08:28:57 +01:00
|
|
|
#define SPRITE_DEBUG_ENABLE 0
|
2004-08-07 03:23:07 +02:00
|
|
|
#if SPRITE_DEBUG_ENABLE
|
|
|
|
#define SPRITE_DEBUG(x) ErrorF x
|
|
|
|
#else
|
|
|
|
#define SPRITE_DEBUG(x)
|
|
|
|
#endif
|
2003-11-14 16:54:54 +01:00
|
|
|
|
2007-04-09 12:01:59 +02:00
|
|
|
#define MISPRITE(dev) \
|
2011-02-11 03:47:37 +01:00
|
|
|
(IsFloating(dev) ? \
|
2008-01-03 07:34:54 +01:00
|
|
|
(miCursorInfoPtr)dixLookupPrivate(&dev->devPrivates, miSpriteDevPrivatesKey) : \
|
2009-05-21 04:07:03 +02:00
|
|
|
(miCursorInfoPtr)dixLookupPrivate(&(GetMaster(dev, MASTER_POINTER))->devPrivates, miSpriteDevPrivatesKey))
|
2007-04-09 12:01:59 +02:00
|
|
|
|
2008-08-19 20:47:10 +02:00
|
|
|
static void
|
|
|
|
miSpriteDisableDamage(ScreenPtr pScreen, miSpriteScreenPtr pScreenPriv)
|
|
|
|
{
|
2009-03-27 17:36:42 +01:00
|
|
|
if (pScreenPriv->damageRegistered) {
|
2013-08-26 20:03:51 +02:00
|
|
|
DamageUnregister(pScreenPriv->pDamage);
|
2012-03-21 20:55:09 +01:00
|
|
|
pScreenPriv->damageRegistered = 0;
|
2008-08-19 20:47:10 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
miSpriteEnableDamage(ScreenPtr pScreen, miSpriteScreenPtr pScreenPriv)
|
|
|
|
{
|
2009-03-27 17:36:42 +01:00
|
|
|
if (!pScreenPriv->damageRegistered) {
|
2012-03-21 20:55:09 +01:00
|
|
|
pScreenPriv->damageRegistered = 1;
|
|
|
|
DamageRegister(&(pScreen->GetScreenPixmap(pScreen)->drawable),
|
|
|
|
pScreenPriv->pDamage);
|
2008-08-19 20:47:10 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
miSpriteIsUp(miCursorInfoPtr pDevCursor)
|
|
|
|
{
|
|
|
|
pDevCursor->isUp = TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
miSpriteIsDown(miCursorInfoPtr pDevCursor)
|
|
|
|
{
|
|
|
|
pDevCursor->isUp = FALSE;
|
|
|
|
}
|
2007-04-26 14:48:35 +02:00
|
|
|
|
2003-11-14 16:54:54 +01:00
|
|
|
/*
|
|
|
|
* screen wrappers
|
|
|
|
*/
|
|
|
|
|
2010-04-27 02:22:21 +02:00
|
|
|
static DevPrivateKeyRec miSpriteScreenKeyRec;
|
2012-03-21 20:55:09 +01:00
|
|
|
|
2010-04-27 02:22:21 +02:00
|
|
|
#define miSpriteScreenKey (&miSpriteScreenKeyRec)
|
2010-12-30 18:19:36 +01:00
|
|
|
#define GetSpriteScreen(pScreen) \
|
|
|
|
(dixLookupPrivate(&(pScreen)->devPrivates, miSpriteScreenKey))
|
2010-04-27 02:22:21 +02:00
|
|
|
static DevPrivateKeyRec miSpriteDevPrivatesKeyRec;
|
2012-03-21 20:55:09 +01:00
|
|
|
|
2010-04-27 02:22:21 +02:00
|
|
|
#define miSpriteDevPrivatesKey (&miSpriteDevPrivatesKeyRec)
|
2003-11-14 16:54:54 +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
|
|
|
static Bool miSpriteCloseScreen(ScreenPtr pScreen);
|
2012-03-21 20:55:09 +01:00
|
|
|
static void miSpriteGetImage(DrawablePtr pDrawable, int sx, int sy,
|
|
|
|
int w, int h, unsigned int format,
|
|
|
|
unsigned long planemask, char *pdstLine);
|
|
|
|
static void miSpriteGetSpans(DrawablePtr pDrawable, int wMax,
|
|
|
|
DDXPointPtr ppt, int *pwidth, int nspans,
|
|
|
|
char *pdstStart);
|
|
|
|
static void miSpriteSourceValidate(DrawablePtr pDrawable, int x, int y,
|
|
|
|
int width, int height,
|
|
|
|
unsigned int subWindowMode);
|
|
|
|
static void miSpriteCopyWindow(WindowPtr pWindow,
|
|
|
|
DDXPointRec ptOldOrg, RegionPtr prgnSrc);
|
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
|
|
|
static void miSpriteBlockHandler(ScreenPtr pScreen,
|
2013-12-15 10:05:51 +01:00
|
|
|
void *pTimeout, void *pReadMask);
|
2012-03-21 20:55:09 +01:00
|
|
|
static void miSpriteInstallColormap(ColormapPtr pMap);
|
|
|
|
static void miSpriteStoreColors(ColormapPtr pMap, int ndef, xColorItem * pdef);
|
|
|
|
|
|
|
|
static void miSpriteComputeSaved(DeviceIntPtr pDev, ScreenPtr pScreen);
|
|
|
|
|
|
|
|
static Bool miSpriteDeviceCursorInitialize(DeviceIntPtr pDev,
|
|
|
|
ScreenPtr pScreen);
|
|
|
|
static void miSpriteDeviceCursorCleanup(DeviceIntPtr pDev, ScreenPtr pScreen);
|
2007-04-09 12:01:59 +02:00
|
|
|
|
2010-12-30 18:19:37 +01:00
|
|
|
#define SCREEN_PROLOGUE(pPriv, pScreen, field) ((pScreen)->field = \
|
|
|
|
(pPriv)->field)
|
|
|
|
#define SCREEN_EPILOGUE(pPriv, pScreen, field)\
|
|
|
|
((pPriv)->field = (pScreen)->field, (pScreen)->field = miSprite##field)
|
2003-11-14 16:54:54 +01:00
|
|
|
|
|
|
|
/*
|
|
|
|
* pointer-sprite method table
|
|
|
|
*/
|
|
|
|
|
2006-11-17 05:40:37 +01:00
|
|
|
static Bool miSpriteRealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen,
|
2008-06-17 03:13:36 +02:00
|
|
|
CursorPtr pCursor);
|
|
|
|
static Bool miSpriteUnrealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen,
|
2006-11-17 05:40:37 +01:00
|
|
|
CursorPtr pCursor);
|
2008-06-17 03:13:36 +02:00
|
|
|
static void miSpriteSetCursor(DeviceIntPtr pDev, ScreenPtr pScreen,
|
2006-11-17 05:40:37 +01:00
|
|
|
CursorPtr pCursor, int x, int y);
|
2008-06-17 03:13:36 +02:00
|
|
|
static void miSpriteMoveCursor(DeviceIntPtr pDev, ScreenPtr pScreen,
|
2006-11-17 05:40:37 +01:00
|
|
|
int x, int y);
|
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
|
|
|
miPointerSpriteFuncRec miSpritePointerFuncs = {
|
2003-11-14 16:54:54 +01:00
|
|
|
miSpriteRealizeCursor,
|
|
|
|
miSpriteUnrealizeCursor,
|
|
|
|
miSpriteSetCursor,
|
|
|
|
miSpriteMoveCursor,
|
2007-04-09 12:01:59 +02:00
|
|
|
miSpriteDeviceCursorInitialize,
|
|
|
|
miSpriteDeviceCursorCleanup,
|
2003-11-14 16:54:54 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
* other misc functions
|
|
|
|
*/
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
static void miSpriteRemoveCursor(DeviceIntPtr pDev, ScreenPtr pScreen);
|
|
|
|
static void miSpriteSaveUnderCursor(DeviceIntPtr pDev, ScreenPtr pScreen);
|
|
|
|
static void miSpriteRestoreCursor(DeviceIntPtr pDev, ScreenPtr pScreen);
|
2003-11-14 16:54:54 +01:00
|
|
|
|
2010-12-30 18:19:40 +01:00
|
|
|
static void
|
|
|
|
miSpriteRegisterBlockHandler(ScreenPtr pScreen, miSpriteScreenPtr pScreenPriv)
|
|
|
|
{
|
|
|
|
if (!pScreenPriv->BlockHandler) {
|
|
|
|
pScreenPriv->BlockHandler = pScreen->BlockHandler;
|
|
|
|
pScreen->BlockHandler = miSpriteBlockHandler;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2004-08-07 03:23:07 +02:00
|
|
|
static void
|
2012-03-21 20:55:09 +01:00
|
|
|
miSpriteReportDamage(DamagePtr pDamage, RegionPtr pRegion, void *closure)
|
2004-08-07 03:23:07 +02:00
|
|
|
{
|
2012-03-21 20:55:09 +01:00
|
|
|
ScreenPtr pScreen = closure;
|
|
|
|
miCursorInfoPtr pCursorInfo;
|
|
|
|
DeviceIntPtr pDev;
|
|
|
|
|
|
|
|
for (pDev = inputInfo.devices; pDev; pDev = pDev->next) {
|
|
|
|
if (DevHasCursor(pDev)) {
|
2007-04-09 12:01:59 +02:00
|
|
|
pCursorInfo = MISPRITE(pDev);
|
2006-12-14 01:20:18 +01:00
|
|
|
|
2006-11-27 05:17:23 +01:00
|
|
|
if (pCursorInfo->isUp &&
|
2008-06-17 03:13:36 +02:00
|
|
|
pCursorInfo->pScreen == pScreen &&
|
2012-03-21 20:55:09 +01:00
|
|
|
RegionContainsRect(pRegion, &pCursorInfo->saved) != rgnOUT) {
|
2006-11-27 05:17:23 +01:00
|
|
|
SPRITE_DEBUG(("Damage remove\n"));
|
2012-03-21 20:55:09 +01:00
|
|
|
miSpriteRemoveCursor(pDev, pScreen);
|
2006-11-21 01:56:21 +01:00
|
|
|
}
|
|
|
|
}
|
2006-11-21 11:01:30 +01:00
|
|
|
}
|
2004-08-07 03:23:07 +02:00
|
|
|
}
|
|
|
|
|
2003-11-14 16:54:54 +01:00
|
|
|
/*
|
|
|
|
* miSpriteInitialize -- called from device-dependent screen
|
|
|
|
* initialization proc after all of the function pointers have
|
|
|
|
* been stored in the screen structure.
|
|
|
|
*/
|
|
|
|
|
|
|
|
Bool
|
2012-03-21 20:55:09 +01:00
|
|
|
miSpriteInitialize(ScreenPtr pScreen, miPointerScreenFuncPtr screenFuncs)
|
2003-11-14 16:54:54 +01:00
|
|
|
{
|
2012-03-21 20:55:09 +01:00
|
|
|
miSpriteScreenPtr pScreenPriv;
|
|
|
|
VisualPtr pVisual;
|
2008-06-17 03:13:36 +02:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
if (!DamageSetup(pScreen))
|
|
|
|
return FALSE;
|
2004-08-07 03:23:07 +02:00
|
|
|
|
2010-04-27 02:22:21 +02:00
|
|
|
if (!dixRegisterPrivateKey(&miSpriteScreenKeyRec, PRIVATE_SCREEN, 0))
|
2012-03-21 20:55:09 +01:00
|
|
|
return FALSE;
|
2010-04-27 02:22:21 +02:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
if (!dixRegisterPrivateKey
|
|
|
|
(&miSpriteDevPrivatesKeyRec, PRIVATE_DEVICE, sizeof(miCursorInfoRec)))
|
|
|
|
return FALSE;
|
2010-04-27 02:22:21 +02:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
pScreenPriv = malloc(sizeof(miSpriteScreenRec));
|
2004-08-07 03:23:07 +02:00
|
|
|
if (!pScreenPriv)
|
2012-03-21 20:55:09 +01:00
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
pScreenPriv->pDamage = DamageCreate(miSpriteReportDamage,
|
|
|
|
NULL,
|
|
|
|
DamageReportRawRegion,
|
|
|
|
TRUE, pScreen, pScreen);
|
|
|
|
|
|
|
|
if (!miPointerInitialize(pScreen, &miSpritePointerFuncs, screenFuncs, TRUE)) {
|
|
|
|
free(pScreenPriv);
|
|
|
|
return FALSE;
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
|
|
|
for (pVisual = pScreen->visuals;
|
2012-03-21 20:55:09 +01:00
|
|
|
pVisual->vid != pScreen->rootVisual; pVisual++);
|
2004-08-07 03:23:07 +02:00
|
|
|
pScreenPriv->pVisual = pVisual;
|
|
|
|
pScreenPriv->CloseScreen = pScreen->CloseScreen;
|
|
|
|
pScreenPriv->GetImage = pScreen->GetImage;
|
|
|
|
pScreenPriv->GetSpans = pScreen->GetSpans;
|
|
|
|
pScreenPriv->SourceValidate = pScreen->SourceValidate;
|
|
|
|
|
|
|
|
pScreenPriv->CopyWindow = pScreen->CopyWindow;
|
2008-06-17 03:13:36 +02:00
|
|
|
|
2004-08-07 03:23:07 +02:00
|
|
|
pScreenPriv->InstallColormap = pScreen->InstallColormap;
|
|
|
|
pScreenPriv->StoreColors = pScreen->StoreColors;
|
2008-06-17 03:13:36 +02:00
|
|
|
|
2010-12-30 18:19:40 +01:00
|
|
|
pScreenPriv->BlockHandler = NULL;
|
2006-12-14 01:20:18 +01:00
|
|
|
|
2007-04-09 12:01:59 +02:00
|
|
|
pScreenPriv->pInstalledMap = NULL;
|
|
|
|
pScreenPriv->pColormap = NULL;
|
|
|
|
pScreenPriv->colors[SOURCE_COLOR].red = 0;
|
|
|
|
pScreenPriv->colors[SOURCE_COLOR].green = 0;
|
|
|
|
pScreenPriv->colors[SOURCE_COLOR].blue = 0;
|
|
|
|
pScreenPriv->colors[MASK_COLOR].red = 0;
|
|
|
|
pScreenPriv->colors[MASK_COLOR].green = 0;
|
|
|
|
pScreenPriv->colors[MASK_COLOR].blue = 0;
|
2009-03-27 17:36:42 +01:00
|
|
|
pScreenPriv->damageRegistered = 0;
|
2010-12-30 18:19:39 +01:00
|
|
|
pScreenPriv->numberOfCursors = 0;
|
2009-03-27 17:36:42 +01:00
|
|
|
|
2007-08-28 15:28:25 +02:00
|
|
|
dixSetPrivate(&pScreen->devPrivates, miSpriteScreenKey, pScreenPriv);
|
2008-06-17 03:13:36 +02:00
|
|
|
|
2003-11-14 16:54:54 +01:00
|
|
|
pScreen->CloseScreen = miSpriteCloseScreen;
|
|
|
|
pScreen->GetImage = miSpriteGetImage;
|
|
|
|
pScreen->GetSpans = miSpriteGetSpans;
|
|
|
|
pScreen->SourceValidate = miSpriteSourceValidate;
|
2006-11-27 08:37:16 +01:00
|
|
|
|
2003-11-14 16:54:54 +01:00
|
|
|
pScreen->CopyWindow = miSpriteCopyWindow;
|
2004-08-07 03:23:07 +02:00
|
|
|
pScreen->InstallColormap = miSpriteInstallColormap;
|
|
|
|
pScreen->StoreColors = miSpriteStoreColors;
|
2003-11-14 16:54:54 +01:00
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Screen wrappers
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
* CloseScreen wrapper -- unwrap everything, free the private data
|
|
|
|
* and call the wrapped function
|
|
|
|
*/
|
|
|
|
|
|
|
|
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
|
|
|
miSpriteCloseScreen(ScreenPtr pScreen)
|
2003-11-14 16:54:54 +01:00
|
|
|
{
|
2012-03-21 20:55:09 +01:00
|
|
|
miSpriteScreenPtr pScreenPriv = GetSpriteScreen(pScreen);
|
2003-11-14 16:54:54 +01:00
|
|
|
|
|
|
|
pScreen->CloseScreen = pScreenPriv->CloseScreen;
|
|
|
|
pScreen->GetImage = pScreenPriv->GetImage;
|
|
|
|
pScreen->GetSpans = pScreenPriv->GetSpans;
|
|
|
|
pScreen->SourceValidate = pScreenPriv->SourceValidate;
|
|
|
|
pScreen->InstallColormap = pScreenPriv->InstallColormap;
|
|
|
|
pScreen->StoreColors = pScreenPriv->StoreColors;
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
DamageDestroy(pScreenPriv->pDamage);
|
2006-11-20 08:28:30 +01:00
|
|
|
|
2010-05-05 20:44:06 +02:00
|
|
|
free(pScreenPriv);
|
2003-11-14 16:54:54 +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 16:54:54 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-03-21 20:55:09 +01:00
|
|
|
miSpriteGetImage(DrawablePtr pDrawable, int sx, int sy, int w, int h,
|
|
|
|
unsigned int format, unsigned long planemask, char *pdstLine)
|
2003-11-14 16:54:54 +01:00
|
|
|
{
|
2012-03-21 20:55:09 +01:00
|
|
|
ScreenPtr pScreen = pDrawable->pScreen;
|
|
|
|
DeviceIntPtr pDev;
|
|
|
|
miCursorInfoPtr pCursorInfo;
|
|
|
|
miSpriteScreenPtr pPriv = GetSpriteScreen(pScreen);
|
|
|
|
|
|
|
|
SCREEN_PROLOGUE(pPriv, pScreen, GetImage);
|
|
|
|
|
|
|
|
if (pDrawable->type == DRAWABLE_WINDOW) {
|
|
|
|
for (pDev = inputInfo.devices; pDev; pDev = pDev->next) {
|
|
|
|
if (DevHasCursor(pDev)) {
|
|
|
|
pCursorInfo = MISPRITE(pDev);
|
|
|
|
if (pCursorInfo->isUp && pCursorInfo->pScreen == pScreen &&
|
|
|
|
ORG_OVERLAP(&pCursorInfo->saved, pDrawable->x, pDrawable->y,
|
|
|
|
sx, sy, w, h)) {
|
|
|
|
SPRITE_DEBUG(("GetImage remove\n"));
|
|
|
|
miSpriteRemoveCursor(pDev, pScreen);
|
|
|
|
}
|
2009-03-27 16:54:52 +01:00
|
|
|
}
|
2006-11-20 08:28:30 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
(*pScreen->GetImage) (pDrawable, sx, sy, w, h, format, planemask, pdstLine);
|
2003-11-14 16:54:54 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
SCREEN_EPILOGUE(pPriv, pScreen, GetImage);
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-03-21 20:55:09 +01:00
|
|
|
miSpriteGetSpans(DrawablePtr pDrawable, int wMax, DDXPointPtr ppt,
|
|
|
|
int *pwidth, int nspans, char *pdstStart)
|
2003-11-14 16:54:54 +01:00
|
|
|
{
|
2012-03-21 20:55:09 +01:00
|
|
|
ScreenPtr pScreen = pDrawable->pScreen;
|
|
|
|
DeviceIntPtr pDev;
|
|
|
|
miCursorInfoPtr pCursorInfo;
|
|
|
|
miSpriteScreenPtr pPriv = GetSpriteScreen(pScreen);
|
|
|
|
|
|
|
|
SCREEN_PROLOGUE(pPriv, pScreen, GetSpans);
|
|
|
|
|
|
|
|
if (pDrawable->type == DRAWABLE_WINDOW) {
|
|
|
|
for (pDev = inputInfo.devices; pDev; pDev = pDev->next) {
|
|
|
|
if (DevHasCursor(pDev)) {
|
2009-03-27 16:54:52 +01:00
|
|
|
pCursorInfo = MISPRITE(pDev);
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
if (pCursorInfo->isUp && pCursorInfo->pScreen == pScreen) {
|
|
|
|
DDXPointPtr pts;
|
|
|
|
int *widths;
|
|
|
|
int nPts;
|
|
|
|
int xorg, yorg;
|
2009-03-27 16:54:52 +01:00
|
|
|
|
|
|
|
xorg = pDrawable->x;
|
|
|
|
yorg = pDrawable->y;
|
|
|
|
|
|
|
|
for (pts = ppt, widths = pwidth, nPts = nspans;
|
2012-03-21 20:55:09 +01:00
|
|
|
nPts--; pts++, widths++) {
|
|
|
|
if (SPN_OVERLAP(&pCursorInfo->saved, pts->y + yorg,
|
|
|
|
pts->x + xorg, *widths)) {
|
|
|
|
SPRITE_DEBUG(("GetSpans remove\n"));
|
|
|
|
miSpriteRemoveCursor(pDev, pScreen);
|
2009-03-27 16:54:52 +01:00
|
|
|
break;
|
|
|
|
}
|
2006-11-27 05:17:23 +01:00
|
|
|
}
|
2006-11-20 08:28:30 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2003-11-14 16:54:54 +01:00
|
|
|
(*pScreen->GetSpans) (pDrawable, wMax, ppt, pwidth, nspans, pdstStart);
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
SCREEN_EPILOGUE(pPriv, pScreen, GetSpans);
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-03-21 20:55:09 +01:00
|
|
|
miSpriteSourceValidate(DrawablePtr pDrawable, int x, int y, int width,
|
|
|
|
int height, unsigned int subWindowMode)
|
2003-11-14 16:54:54 +01:00
|
|
|
{
|
2012-03-21 20:55:09 +01:00
|
|
|
ScreenPtr pScreen = pDrawable->pScreen;
|
|
|
|
DeviceIntPtr pDev;
|
|
|
|
miCursorInfoPtr pCursorInfo;
|
|
|
|
miSpriteScreenPtr pPriv = GetSpriteScreen(pScreen);
|
|
|
|
|
|
|
|
SCREEN_PROLOGUE(pPriv, pScreen, SourceValidate);
|
|
|
|
|
|
|
|
if (pDrawable->type == DRAWABLE_WINDOW) {
|
|
|
|
for (pDev = inputInfo.devices; pDev; pDev = pDev->next) {
|
|
|
|
if (DevHasCursor(pDev)) {
|
|
|
|
pCursorInfo = MISPRITE(pDev);
|
|
|
|
if (pCursorInfo->isUp && pCursorInfo->pScreen == pScreen &&
|
|
|
|
ORG_OVERLAP(&pCursorInfo->saved, pDrawable->x, pDrawable->y,
|
|
|
|
x, y, width, height)) {
|
|
|
|
SPRITE_DEBUG(("SourceValidate remove\n"));
|
|
|
|
miSpriteRemoveCursor(pDev, pScreen);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
2006-11-27 05:17:23 +01:00
|
|
|
|
2003-11-14 16:54:54 +01:00
|
|
|
if (pScreen->SourceValidate)
|
2012-03-21 20:55:09 +01:00
|
|
|
(*pScreen->SourceValidate) (pDrawable, x, y, width, height,
|
|
|
|
subWindowMode);
|
2003-11-14 16:54:54 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
SCREEN_EPILOGUE(pPriv, pScreen, SourceValidate);
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
|
|
|
|
2004-08-07 03:23:07 +02:00
|
|
|
static void
|
2012-03-21 20:55:09 +01:00
|
|
|
miSpriteCopyWindow(WindowPtr pWindow, DDXPointRec ptOldOrg, RegionPtr prgnSrc)
|
2003-11-14 16:54:54 +01:00
|
|
|
{
|
2012-03-21 20:55:09 +01:00
|
|
|
ScreenPtr pScreen = pWindow->drawable.pScreen;
|
|
|
|
DeviceIntPtr pDev;
|
|
|
|
miCursorInfoPtr pCursorInfo;
|
|
|
|
miSpriteScreenPtr pPriv = GetSpriteScreen(pScreen);
|
2008-06-17 03:13:36 +02:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
SCREEN_PROLOGUE(pPriv, pScreen, CopyWindow);
|
2003-11-14 16:54:54 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
for (pDev = inputInfo.devices; pDev; pDev = pDev->next) {
|
|
|
|
if (DevHasCursor(pDev)) {
|
2007-04-09 12:01:59 +02:00
|
|
|
pCursorInfo = MISPRITE(pDev);
|
2006-11-27 05:17:23 +01:00
|
|
|
/*
|
|
|
|
* Damage will take care of destination check
|
|
|
|
*/
|
2007-04-26 14:48:35 +02:00
|
|
|
if (pCursorInfo->isUp && pCursorInfo->pScreen == pScreen &&
|
2012-03-21 20:55:09 +01:00
|
|
|
RegionContainsRect(prgnSrc, &pCursorInfo->saved) != rgnOUT) {
|
|
|
|
SPRITE_DEBUG(("CopyWindow remove\n"));
|
|
|
|
miSpriteRemoveCursor(pDev, pScreen);
|
2006-11-20 08:28:30 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2003-11-14 16:54:54 +01:00
|
|
|
|
2004-08-07 03:23:07 +02:00
|
|
|
(*pScreen->CopyWindow) (pWindow, ptOldOrg, prgnSrc);
|
2012-03-21 20:55:09 +01:00
|
|
|
SCREEN_EPILOGUE(pPriv, pScreen, CopyWindow);
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2013-12-15 10:05:51 +01:00
|
|
|
miSpriteBlockHandler(ScreenPtr pScreen, void *pTimeout,
|
|
|
|
void *pReadmask)
|
2003-11-14 16:54:54 +01:00
|
|
|
{
|
2012-03-21 20:55:09 +01:00
|
|
|
miSpriteScreenPtr pPriv = GetSpriteScreen(pScreen);
|
|
|
|
DeviceIntPtr pDev;
|
|
|
|
miCursorInfoPtr pCursorInfo;
|
|
|
|
Bool WorkToDo = FALSE;
|
|
|
|
|
|
|
|
for (pDev = inputInfo.devices; pDev; pDev = pDev->next) {
|
|
|
|
if (DevHasCursor(pDev)) {
|
2007-04-09 12:01:59 +02:00
|
|
|
pCursorInfo = MISPRITE(pDev);
|
2008-06-05 07:59:35 +02:00
|
|
|
if (pCursorInfo && !pCursorInfo->isUp
|
2012-03-21 20:55:09 +01:00
|
|
|
&& pCursorInfo->pScreen == pScreen && pCursorInfo->shouldBeUp) {
|
|
|
|
SPRITE_DEBUG(("BlockHandler save"));
|
|
|
|
miSpriteSaveUnderCursor(pDev, pScreen);
|
2007-01-29 06:40:03 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2012-03-21 20:55:09 +01:00
|
|
|
for (pDev = inputInfo.devices; pDev; pDev = pDev->next) {
|
|
|
|
if (DevHasCursor(pDev)) {
|
2007-04-09 12:01:59 +02:00
|
|
|
pCursorInfo = MISPRITE(pDev);
|
2008-06-05 07:59:35 +02:00
|
|
|
if (pCursorInfo && !pCursorInfo->isUp &&
|
2012-03-21 20:55:09 +01:00
|
|
|
pCursorInfo->pScreen == pScreen && pCursorInfo->shouldBeUp) {
|
|
|
|
SPRITE_DEBUG(("BlockHandler restore\n"));
|
|
|
|
miSpriteRestoreCursor(pDev, pScreen);
|
2010-12-30 18:19:40 +01:00
|
|
|
if (!pCursorInfo->isUp)
|
|
|
|
WorkToDo = TRUE;
|
2006-11-20 08:28:30 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2010-12-30 18:19:40 +01:00
|
|
|
|
|
|
|
SCREEN_PROLOGUE(pPriv, pScreen, BlockHandler);
|
|
|
|
|
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
|
|
|
(*pScreen->BlockHandler) (pScreen, pTimeout, pReadmask);
|
2010-12-30 18:19:40 +01:00
|
|
|
|
|
|
|
if (WorkToDo)
|
|
|
|
SCREEN_EPILOGUE(pPriv, pScreen, BlockHandler);
|
|
|
|
else
|
|
|
|
pPriv->BlockHandler = NULL;
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-03-21 20:55:09 +01:00
|
|
|
miSpriteInstallColormap(ColormapPtr pMap)
|
2003-11-14 16:54:54 +01:00
|
|
|
{
|
2012-03-21 20:55:09 +01:00
|
|
|
ScreenPtr pScreen = pMap->pScreen;
|
|
|
|
miSpriteScreenPtr pPriv = GetSpriteScreen(pScreen);
|
2003-11-14 16:54:54 +01:00
|
|
|
|
2010-12-30 18:19:37 +01:00
|
|
|
SCREEN_PROLOGUE(pPriv, pScreen, InstallColormap);
|
2008-06-17 03:13:36 +02:00
|
|
|
|
2003-11-14 16:54:54 +01:00
|
|
|
(*pScreen->InstallColormap) (pMap);
|
|
|
|
|
2010-12-30 18:19:37 +01:00
|
|
|
SCREEN_EPILOGUE(pPriv, pScreen, InstallColormap);
|
2003-11-14 16:54:54 +01:00
|
|
|
|
2007-04-09 12:01:59 +02:00
|
|
|
/* InstallColormap can be called before devices are initialized. */
|
|
|
|
pPriv->pInstalledMap = pMap;
|
2012-03-21 20:55:09 +01:00
|
|
|
if (pPriv->pColormap != pMap) {
|
2007-04-09 12:01:59 +02:00
|
|
|
DeviceIntPtr pDev;
|
2012-03-21 20:55:09 +01:00
|
|
|
miCursorInfoPtr pCursorInfo;
|
|
|
|
|
|
|
|
for (pDev = inputInfo.devices; pDev; pDev = pDev->next) {
|
|
|
|
if (DevHasCursor(pDev)) {
|
2007-04-09 12:01:59 +02:00
|
|
|
pCursorInfo = MISPRITE(pDev);
|
|
|
|
pCursorInfo->checkPixels = TRUE;
|
2007-04-26 14:48:35 +02:00
|
|
|
if (pCursorInfo->isUp && pCursorInfo->pScreen == pScreen)
|
2007-04-09 12:01:59 +02:00
|
|
|
miSpriteRemoveCursor(pDev, pScreen);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2006-11-21 11:01:30 +01:00
|
|
|
}
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-03-21 20:55:09 +01:00
|
|
|
miSpriteStoreColors(ColormapPtr pMap, int ndef, xColorItem * pdef)
|
2003-11-14 16:54:54 +01:00
|
|
|
{
|
2012-03-21 20:55:09 +01:00
|
|
|
ScreenPtr pScreen = pMap->pScreen;
|
|
|
|
miSpriteScreenPtr pPriv = GetSpriteScreen(pScreen);
|
|
|
|
int i;
|
|
|
|
int updated;
|
|
|
|
VisualPtr pVisual;
|
|
|
|
DeviceIntPtr pDev;
|
|
|
|
miCursorInfoPtr pCursorInfo;
|
2003-11-14 16:54:54 +01:00
|
|
|
|
2010-12-30 18:19:37 +01:00
|
|
|
SCREEN_PROLOGUE(pPriv, pScreen, StoreColors);
|
2008-06-17 03:13:36 +02:00
|
|
|
|
2003-11-14 16:54:54 +01:00
|
|
|
(*pScreen->StoreColors) (pMap, ndef, pdef);
|
|
|
|
|
2010-12-30 18:19:37 +01:00
|
|
|
SCREEN_EPILOGUE(pPriv, pScreen, StoreColors);
|
2003-11-14 16:54:54 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
if (pPriv->pColormap == pMap) {
|
2007-04-09 12:01:59 +02:00
|
|
|
updated = 0;
|
|
|
|
pVisual = pMap->pVisual;
|
2012-03-21 20:55:09 +01:00
|
|
|
if (pVisual->class == DirectColor) {
|
2007-04-09 12:01:59 +02:00
|
|
|
/* Direct color - match on any of the subfields */
|
|
|
|
|
2003-11-14 17:49:22 +01:00
|
|
|
#define MaskMatch(a,b,mask) (((a) & (pVisual->mask)) == ((b) & (pVisual->mask)))
|
2003-11-14 16:54:54 +01:00
|
|
|
|
2006-11-20 08:28:30 +01:00
|
|
|
#define UpdateDAC(dev, plane,dac,mask) {\
|
|
|
|
if (MaskMatch (dev->colors[plane].pixel,pdef[i].pixel,mask)) {\
|
|
|
|
dev->colors[plane].dac = pdef[i].dac; \
|
2003-11-14 16:54:54 +01:00
|
|
|
updated = 1; \
|
|
|
|
} \
|
|
|
|
}
|
|
|
|
|
2006-11-20 08:28:30 +01:00
|
|
|
#define CheckDirect(dev, plane) \
|
|
|
|
UpdateDAC(dev, plane,red,redMask) \
|
|
|
|
UpdateDAC(dev, plane,green,greenMask) \
|
|
|
|
UpdateDAC(dev, plane,blue,blueMask)
|
2003-11-14 16:54:54 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
for (i = 0; i < ndef; i++) {
|
|
|
|
CheckDirect(pPriv, SOURCE_COLOR)
|
|
|
|
CheckDirect(pPriv, MASK_COLOR)
|
2007-04-09 12:01:59 +02:00
|
|
|
}
|
|
|
|
}
|
2012-03-21 20:55:09 +01:00
|
|
|
else {
|
2007-04-09 12:01:59 +02:00
|
|
|
/* PseudoColor/GrayScale - match on exact pixel */
|
2012-03-21 20:55:09 +01:00
|
|
|
for (i = 0; i < ndef; i++) {
|
|
|
|
if (pdef[i].pixel == pPriv->colors[SOURCE_COLOR].pixel) {
|
2007-04-09 12:01:59 +02:00
|
|
|
pPriv->colors[SOURCE_COLOR] = pdef[i];
|
|
|
|
if (++updated == 2)
|
|
|
|
break;
|
2006-11-20 08:28:30 +01:00
|
|
|
}
|
2012-03-21 20:55:09 +01:00
|
|
|
if (pdef[i].pixel == pPriv->colors[MASK_COLOR].pixel) {
|
2007-04-09 12:01:59 +02:00
|
|
|
pPriv->colors[MASK_COLOR] = pdef[i];
|
|
|
|
if (++updated == 2)
|
|
|
|
break;
|
2006-11-20 08:28:30 +01:00
|
|
|
}
|
2007-04-09 12:01:59 +02:00
|
|
|
}
|
|
|
|
}
|
2012-03-21 20:55:09 +01:00
|
|
|
if (updated) {
|
|
|
|
for (pDev = inputInfo.devices; pDev; pDev = pDev->next) {
|
|
|
|
if (DevHasCursor(pDev)) {
|
2007-04-09 12:01:59 +02:00
|
|
|
pCursorInfo = MISPRITE(pDev);
|
2006-11-27 05:17:23 +01:00
|
|
|
pCursorInfo->checkPixels = TRUE;
|
2007-04-26 14:48:35 +02:00
|
|
|
if (pCursorInfo->isUp && pCursorInfo->pScreen == pScreen)
|
2012-03-21 20:55:09 +01:00
|
|
|
miSpriteRemoveCursor(pDev, pScreen);
|
2006-11-20 08:28:30 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2006-11-21 11:01:30 +01:00
|
|
|
}
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-03-21 20:55:09 +01:00
|
|
|
miSpriteFindColors(miCursorInfoPtr pDevCursor, ScreenPtr pScreen)
|
2003-11-14 16:54:54 +01:00
|
|
|
{
|
2012-03-21 20:55:09 +01:00
|
|
|
miSpriteScreenPtr pScreenPriv = GetSpriteScreen(pScreen);
|
|
|
|
CursorPtr pCursor;
|
|
|
|
xColorItem *sourceColor, *maskColor;
|
2003-11-14 16:54:54 +01:00
|
|
|
|
2006-11-20 08:28:30 +01:00
|
|
|
pCursor = pDevCursor->pCursor;
|
2007-04-09 12:01:59 +02:00
|
|
|
sourceColor = &pScreenPriv->colors[SOURCE_COLOR];
|
|
|
|
maskColor = &pScreenPriv->colors[MASK_COLOR];
|
|
|
|
if (pScreenPriv->pColormap != pScreenPriv->pInstalledMap ||
|
2012-03-21 20:55:09 +01:00
|
|
|
!(pCursor->foreRed == sourceColor->red &&
|
|
|
|
pCursor->foreGreen == sourceColor->green &&
|
2003-11-14 16:54:54 +01:00
|
|
|
pCursor->foreBlue == sourceColor->blue &&
|
2012-03-21 20:55:09 +01:00
|
|
|
pCursor->backRed == maskColor->red &&
|
|
|
|
pCursor->backGreen == maskColor->green &&
|
|
|
|
pCursor->backBlue == maskColor->blue)) {
|
|
|
|
pScreenPriv->pColormap = pScreenPriv->pInstalledMap;
|
|
|
|
sourceColor->red = pCursor->foreRed;
|
|
|
|
sourceColor->green = pCursor->foreGreen;
|
|
|
|
sourceColor->blue = pCursor->foreBlue;
|
|
|
|
FakeAllocColor(pScreenPriv->pColormap, sourceColor);
|
|
|
|
maskColor->red = pCursor->backRed;
|
|
|
|
maskColor->green = pCursor->backGreen;
|
|
|
|
maskColor->blue = pCursor->backBlue;
|
|
|
|
FakeAllocColor(pScreenPriv->pColormap, maskColor);
|
|
|
|
/* "free" the pixels right away, don't let this confuse you */
|
|
|
|
FakeFreeColor(pScreenPriv->pColormap, sourceColor->pixel);
|
|
|
|
FakeFreeColor(pScreenPriv->pColormap, maskColor->pixel);
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
2006-11-20 08:28:30 +01:00
|
|
|
|
|
|
|
pDevCursor->checkPixels = FALSE;
|
|
|
|
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
2004-08-07 03:23:07 +02:00
|
|
|
* miPointer interface routines
|
2003-11-14 16:54:54 +01:00
|
|
|
*/
|
|
|
|
|
2004-08-07 03:23:07 +02:00
|
|
|
#define SPRITE_PAD 8
|
2003-11-14 16:54:54 +01:00
|
|
|
|
2004-08-07 03:23:07 +02:00
|
|
|
static Bool
|
2012-03-21 20:55:09 +01:00
|
|
|
miSpriteRealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor)
|
2003-11-14 16:54:54 +01:00
|
|
|
{
|
2006-11-27 05:17:23 +01:00
|
|
|
miCursorInfoPtr pCursorInfo;
|
2003-11-14 16:54:54 +01:00
|
|
|
|
2011-02-11 03:47:37 +01:00
|
|
|
if (IsFloating(pDev))
|
2007-10-17 02:22:30 +02:00
|
|
|
return FALSE;
|
2010-03-23 05:35:56 +01:00
|
|
|
|
2007-04-09 12:01:59 +02:00
|
|
|
pCursorInfo = MISPRITE(pDev);
|
2006-11-20 08:28:30 +01:00
|
|
|
|
2006-11-27 05:17:23 +01:00
|
|
|
if (pCursor == pCursorInfo->pCursor)
|
2012-03-21 20:55:09 +01:00
|
|
|
pCursorInfo->checkPixels = TRUE;
|
2006-11-27 05:17:23 +01:00
|
|
|
|
2010-05-19 01:48:08 +02:00
|
|
|
return miDCRealizeCursor(pScreen, pCursor);
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
|
|
|
|
2004-08-07 03:23:07 +02:00
|
|
|
static Bool
|
2008-05-28 04:57:07 +02:00
|
|
|
miSpriteUnrealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor)
|
2003-11-14 16:54:54 +01:00
|
|
|
{
|
2010-05-19 01:48:08 +02:00
|
|
|
return miDCUnrealizeCursor(pScreen, pCursor);
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-03-21 20:55:09 +01:00
|
|
|
miSpriteSetCursor(DeviceIntPtr pDev, ScreenPtr pScreen,
|
|
|
|
CursorPtr pCursor, int x, int y)
|
2003-11-14 16:54:54 +01:00
|
|
|
{
|
2012-03-21 20:55:09 +01:00
|
|
|
miCursorInfoPtr pPointer;
|
|
|
|
miSpriteScreenPtr pScreenPriv;
|
2003-11-14 16:54:54 +01:00
|
|
|
|
2011-02-11 03:47:37 +01:00
|
|
|
if (IsFloating(pDev))
|
2007-10-17 02:22:30 +02:00
|
|
|
return;
|
2010-03-23 05:35:56 +01:00
|
|
|
|
2007-10-17 02:22:30 +02:00
|
|
|
pPointer = MISPRITE(pDev);
|
2010-12-30 18:19:39 +01:00
|
|
|
pScreenPriv = GetSpriteScreen(pScreen);
|
2006-11-20 08:28:30 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
if (!pCursor) {
|
|
|
|
if (pPointer->shouldBeUp)
|
|
|
|
--pScreenPriv->numberOfCursors;
|
|
|
|
pPointer->shouldBeUp = FALSE;
|
|
|
|
if (pPointer->isUp)
|
|
|
|
miSpriteRemoveCursor(pDev, pScreen);
|
|
|
|
if (pScreenPriv->numberOfCursors == 0)
|
|
|
|
miSpriteDisableDamage(pScreen, pScreenPriv);
|
|
|
|
pPointer->pCursor = 0;
|
|
|
|
return;
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
2010-12-30 18:19:39 +01:00
|
|
|
if (!pPointer->shouldBeUp)
|
2012-03-21 20:55:09 +01:00
|
|
|
pScreenPriv->numberOfCursors++;
|
2006-11-21 11:01:30 +01:00
|
|
|
pPointer->shouldBeUp = TRUE;
|
2010-12-30 18:19:40 +01:00
|
|
|
if (!pPointer->isUp)
|
2012-03-21 20:55:09 +01:00
|
|
|
miSpriteRegisterBlockHandler(pScreen, pScreenPriv);
|
2006-11-21 11:01:30 +01:00
|
|
|
if (pPointer->x == x &&
|
2012-03-21 20:55:09 +01:00
|
|
|
pPointer->y == y &&
|
|
|
|
pPointer->pCursor == pCursor && !pPointer->checkPixels) {
|
|
|
|
return;
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
2006-11-21 11:01:30 +01:00
|
|
|
pPointer->x = x;
|
|
|
|
pPointer->y = y;
|
|
|
|
pPointer->pCacheWin = NullWindow;
|
2012-03-21 20:55:09 +01:00
|
|
|
if (pPointer->checkPixels || pPointer->pCursor != pCursor) {
|
|
|
|
pPointer->pCursor = pCursor;
|
|
|
|
miSpriteFindColors(pPointer, pScreen);
|
2004-08-07 03:23:07 +02:00
|
|
|
}
|
2006-11-21 11:01:30 +01:00
|
|
|
if (pPointer->isUp) {
|
2012-03-21 20:55:09 +01:00
|
|
|
/* TODO: reimplement flicker-free MoveCursor */
|
|
|
|
SPRITE_DEBUG(("SetCursor remove %d\n", pDev->id));
|
|
|
|
miSpriteRemoveCursor(pDev, pScreen);
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
2006-11-20 08:28:30 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
if (!pPointer->isUp && pPointer->pCursor) {
|
|
|
|
SPRITE_DEBUG(("SetCursor restore %d\n", pDev->id));
|
2007-01-29 06:40:03 +01:00
|
|
|
miSpriteSaveUnderCursor(pDev, pScreen);
|
2012-03-21 20:55:09 +01:00
|
|
|
miSpriteRestoreCursor(pDev, pScreen);
|
2004-08-07 03:23:07 +02:00
|
|
|
}
|
2006-11-20 08:28:30 +01:00
|
|
|
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-03-21 20:55:09 +01:00
|
|
|
miSpriteMoveCursor(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y)
|
2003-11-14 16:54:54 +01:00
|
|
|
{
|
2006-11-17 08:33:43 +01:00
|
|
|
CursorPtr pCursor;
|
2003-11-14 16:54:54 +01:00
|
|
|
|
2011-02-11 03:47:37 +01:00
|
|
|
if (IsFloating(pDev))
|
2007-10-17 02:22:30 +02:00
|
|
|
return;
|
2010-03-23 05:35:56 +01:00
|
|
|
|
2007-04-09 12:01:59 +02:00
|
|
|
pCursor = MISPRITE(pDev)->pCursor;
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
miSpriteSetCursor(pDev, pScreen, pCursor, x, y);
|
2007-04-09 12:01:59 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static Bool
|
2008-05-28 04:57:07 +02:00
|
|
|
miSpriteDeviceCursorInitialize(DeviceIntPtr pDev, ScreenPtr pScreen)
|
2007-04-09 12:01:59 +02:00
|
|
|
{
|
2011-03-09 16:29:14 +01:00
|
|
|
int ret = miDCDeviceInitialize(pDev, pScreen);
|
2006-11-20 08:28:30 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
if (ret) {
|
2011-03-09 16:29:14 +01:00
|
|
|
miCursorInfoPtr pCursorInfo;
|
2012-03-21 20:55:09 +01:00
|
|
|
|
|
|
|
pCursorInfo =
|
|
|
|
dixLookupPrivate(&pDev->devPrivates, miSpriteDevPrivatesKey);
|
2011-03-09 16:29:14 +01:00
|
|
|
pCursorInfo->pCursor = NULL;
|
|
|
|
pCursorInfo->x = 0;
|
|
|
|
pCursorInfo->y = 0;
|
|
|
|
pCursorInfo->isUp = FALSE;
|
|
|
|
pCursorInfo->shouldBeUp = FALSE;
|
|
|
|
pCursorInfo->pCacheWin = NullWindow;
|
|
|
|
pCursorInfo->isInCacheWin = FALSE;
|
|
|
|
pCursorInfo->checkPixels = TRUE;
|
|
|
|
pCursorInfo->pScreen = FALSE;
|
2008-01-03 07:34:54 +01:00
|
|
|
}
|
2011-03-09 16:29:14 +01:00
|
|
|
|
2007-04-09 12:01:59 +02:00
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2008-05-28 04:57:07 +02:00
|
|
|
miSpriteDeviceCursorCleanup(DeviceIntPtr pDev, ScreenPtr pScreen)
|
2007-04-09 12:01:59 +02:00
|
|
|
{
|
2012-03-21 20:55:09 +01:00
|
|
|
miCursorInfoPtr pCursorInfo =
|
|
|
|
dixLookupPrivate(&pDev->devPrivates, miSpriteDevPrivatesKey);
|
2011-03-09 16:29:14 +01:00
|
|
|
|
2006-12-18 06:03:54 +01:00
|
|
|
if (DevHasCursor(pDev))
|
2010-05-19 01:48:08 +02:00
|
|
|
miDCDeviceCleanup(pDev, pScreen);
|
2011-03-09 16:29:14 +01:00
|
|
|
|
|
|
|
memset(pCursorInfo, 0, sizeof(miCursorInfoRec));
|
2007-04-09 12:01:59 +02:00
|
|
|
}
|
|
|
|
|
2003-11-14 16:54:54 +01:00
|
|
|
/*
|
|
|
|
* undraw/draw cursor
|
|
|
|
*/
|
|
|
|
|
|
|
|
static void
|
2012-03-21 20:55:09 +01:00
|
|
|
miSpriteRemoveCursor(DeviceIntPtr pDev, ScreenPtr pScreen)
|
2003-11-14 16:54:54 +01:00
|
|
|
{
|
2012-03-21 20:55:09 +01:00
|
|
|
miSpriteScreenPtr pScreenPriv;
|
|
|
|
miCursorInfoPtr pCursorInfo;
|
2003-11-14 16:54:54 +01:00
|
|
|
|
2011-02-11 03:47:37 +01:00
|
|
|
if (IsFloating(pDev))
|
2007-10-17 02:22:30 +02:00
|
|
|
return;
|
2010-03-23 05:35:56 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
DamageDrawInternal(pScreen, TRUE);
|
2010-12-30 18:19:36 +01:00
|
|
|
pScreenPriv = GetSpriteScreen(pScreen);
|
2007-04-09 12:01:59 +02:00
|
|
|
pCursorInfo = MISPRITE(pDev);
|
2006-11-27 05:17:23 +01:00
|
|
|
|
2008-08-19 20:47:10 +02:00
|
|
|
miSpriteIsDown(pCursorInfo);
|
2010-12-30 18:19:40 +01:00
|
|
|
miSpriteRegisterBlockHandler(pScreen, pScreenPriv);
|
2006-11-27 05:17:23 +01:00
|
|
|
pCursorInfo->pCacheWin = NullWindow;
|
2007-01-29 06:40:03 +01:00
|
|
|
miSpriteDisableDamage(pScreen, pScreenPriv);
|
2010-05-19 01:48:08 +02:00
|
|
|
if (!miDCRestoreUnderCursor(pDev,
|
|
|
|
pScreen,
|
|
|
|
pCursorInfo->saved.x1,
|
|
|
|
pCursorInfo->saved.y1,
|
|
|
|
pCursorInfo->saved.x2 -
|
|
|
|
pCursorInfo->saved.x1,
|
|
|
|
pCursorInfo->saved.y2 -
|
2012-03-21 20:55:09 +01:00
|
|
|
pCursorInfo->saved.y1)) {
|
2010-05-19 01:48:08 +02:00
|
|
|
miSpriteIsUp(pCursorInfo);
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
2007-01-29 06:40:03 +01:00
|
|
|
miSpriteEnableDamage(pScreen, pScreenPriv);
|
2012-03-21 20:55:09 +01:00
|
|
|
DamageDrawInternal(pScreen, FALSE);
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
2007-01-29 06:40:03 +01:00
|
|
|
* Called from the block handler, saves area under cursor
|
2003-11-14 16:54:54 +01:00
|
|
|
* before waiting for something to do.
|
|
|
|
*/
|
|
|
|
|
2008-05-28 04:57:07 +02:00
|
|
|
static void
|
|
|
|
miSpriteSaveUnderCursor(DeviceIntPtr pDev, ScreenPtr pScreen)
|
2003-11-14 16:54:54 +01:00
|
|
|
{
|
2012-03-21 20:55:09 +01:00
|
|
|
miSpriteScreenPtr pScreenPriv;
|
|
|
|
miCursorInfoPtr pCursorInfo;
|
2003-11-14 16:54:54 +01:00
|
|
|
|
2011-02-11 03:47:37 +01:00
|
|
|
if (IsFloating(pDev))
|
2007-10-17 02:22:30 +02:00
|
|
|
return;
|
2010-03-23 05:35:56 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
DamageDrawInternal(pScreen, TRUE);
|
2010-12-30 18:19:36 +01:00
|
|
|
pScreenPriv = GetSpriteScreen(pScreen);
|
2007-04-09 12:01:59 +02:00
|
|
|
pCursorInfo = MISPRITE(pDev);
|
2006-11-27 05:17:23 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
miSpriteComputeSaved(pDev, pScreen);
|
2006-11-27 05:17:23 +01:00
|
|
|
|
2007-01-29 06:40:03 +01:00
|
|
|
miSpriteDisableDamage(pScreen, pScreenPriv);
|
|
|
|
|
2010-05-19 01:48:08 +02:00
|
|
|
miDCSaveUnderCursor(pDev,
|
|
|
|
pScreen,
|
|
|
|
pCursorInfo->saved.x1,
|
|
|
|
pCursorInfo->saved.y1,
|
|
|
|
pCursorInfo->saved.x2 -
|
|
|
|
pCursorInfo->saved.x1,
|
2012-03-21 20:55:09 +01:00
|
|
|
pCursorInfo->saved.y2 - pCursorInfo->saved.y1);
|
2007-01-29 06:40:03 +01:00
|
|
|
SPRITE_DEBUG(("SaveUnderCursor %d\n", pDev->id));
|
|
|
|
miSpriteEnableDamage(pScreen, pScreenPriv);
|
2012-03-21 20:55:09 +01:00
|
|
|
DamageDrawInternal(pScreen, FALSE);
|
2007-01-29 06:40:03 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Called from the block handler, restores the cursor
|
|
|
|
* before waiting for something to do.
|
|
|
|
*/
|
|
|
|
|
|
|
|
static void
|
2012-03-21 20:55:09 +01:00
|
|
|
miSpriteRestoreCursor(DeviceIntPtr pDev, ScreenPtr pScreen)
|
2007-01-29 06:40:03 +01:00
|
|
|
{
|
2012-03-21 20:55:09 +01:00
|
|
|
miSpriteScreenPtr pScreenPriv;
|
|
|
|
int x, y;
|
|
|
|
CursorPtr pCursor;
|
|
|
|
miCursorInfoPtr pCursorInfo;
|
2008-06-17 03:13:36 +02:00
|
|
|
|
2011-02-11 03:47:37 +01:00
|
|
|
if (IsFloating(pDev))
|
2007-10-17 02:22:30 +02:00
|
|
|
return;
|
2007-01-29 06:40:03 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
DamageDrawInternal(pScreen, TRUE);
|
2010-12-30 18:19:36 +01:00
|
|
|
pScreenPriv = GetSpriteScreen(pScreen);
|
2007-04-09 12:01:59 +02:00
|
|
|
pCursorInfo = MISPRITE(pDev);
|
2007-01-29 06:40:03 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
miSpriteComputeSaved(pDev, pScreen);
|
2007-01-29 06:40:03 +01:00
|
|
|
pCursor = pCursorInfo->pCursor;
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
x = pCursorInfo->x - (int) pCursor->bits->xhot;
|
|
|
|
y = pCursorInfo->y - (int) pCursor->bits->yhot;
|
2007-01-29 06:40:03 +01:00
|
|
|
miSpriteDisableDamage(pScreen, pScreenPriv);
|
|
|
|
SPRITE_DEBUG(("RestoreCursor %d\n", pDev->id));
|
|
|
|
if (pCursorInfo->checkPixels)
|
2012-03-21 20:55:09 +01:00
|
|
|
miSpriteFindColors(pCursorInfo, pScreen);
|
2010-05-19 01:48:08 +02:00
|
|
|
if (miDCPutUpCursor(pDev, pScreen,
|
2012-03-21 20:55:09 +01:00
|
|
|
pCursor, x, y,
|
|
|
|
pScreenPriv->colors[SOURCE_COLOR].pixel,
|
|
|
|
pScreenPriv->colors[MASK_COLOR].pixel)) {
|
2008-08-19 20:47:10 +02:00
|
|
|
miSpriteIsUp(pCursorInfo);
|
2007-04-26 14:48:35 +02:00
|
|
|
pCursorInfo->pScreen = pScreen;
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
2007-01-29 06:40:03 +01:00
|
|
|
miSpriteEnableDamage(pScreen, pScreenPriv);
|
2012-03-21 20:55:09 +01:00
|
|
|
DamageDrawInternal(pScreen, FALSE);
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* compute the desired area of the screen to save
|
|
|
|
*/
|
|
|
|
|
|
|
|
static void
|
2012-03-21 20:55:09 +01:00
|
|
|
miSpriteComputeSaved(DeviceIntPtr pDev, ScreenPtr pScreen)
|
2003-11-14 16:54:54 +01:00
|
|
|
{
|
2012-03-21 20:55:09 +01:00
|
|
|
int x, y, w, h;
|
|
|
|
int wpad, hpad;
|
|
|
|
CursorPtr pCursor;
|
2006-11-27 05:17:23 +01:00
|
|
|
miCursorInfoPtr pCursorInfo;
|
2003-11-14 16:54:54 +01:00
|
|
|
|
2011-02-11 03:47:37 +01:00
|
|
|
if (IsFloating(pDev))
|
2007-10-17 02:22:30 +02:00
|
|
|
return;
|
2010-03-23 05:35:56 +01:00
|
|
|
|
2007-04-09 12:01:59 +02:00
|
|
|
pCursorInfo = MISPRITE(pDev);
|
2006-11-27 05:17:23 +01:00
|
|
|
|
|
|
|
pCursor = pCursorInfo->pCursor;
|
2012-03-21 20:55:09 +01:00
|
|
|
x = pCursorInfo->x - (int) pCursor->bits->xhot;
|
|
|
|
y = pCursorInfo->y - (int) pCursor->bits->yhot;
|
2003-11-14 16:54:54 +01:00
|
|
|
w = pCursor->bits->width;
|
|
|
|
h = pCursor->bits->height;
|
|
|
|
wpad = SPRITE_PAD;
|
|
|
|
hpad = SPRITE_PAD;
|
2006-11-27 05:17:23 +01:00
|
|
|
pCursorInfo->saved.x1 = x - wpad;
|
|
|
|
pCursorInfo->saved.y1 = y - hpad;
|
|
|
|
pCursorInfo->saved.x2 = pCursorInfo->saved.x1 + w + wpad * 2;
|
|
|
|
pCursorInfo->saved.y2 = pCursorInfo->saved.y1 + h + hpad * 2;
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|