summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2012-10-10 14:13:39 +1000
committerDave Airlie <airlied@redhat.com>2012-10-10 14:13:39 +1000
commitce51699744b951f3f0929a4c8cd6d2d003edec9c (patch)
treebe7c6800f1595033ee241cb310e0872dda23266f
parent2e34b59e364442cf56bd6b885e98ccaea1bcbc4d (diff)
sourcevalidate: add a screen
-rw-r--r--composite/compinit.c5
-rw-r--r--dix/impedance.c15
-rw-r--r--exa/exa_unaccel.c6
-rw-r--r--hw/xfree86/common/xf86VGAarbiter.c6
-rw-r--r--hw/xfree86/common/xf86VGAarbiterPriv.h2
-rw-r--r--include/scrnintstr.h3
-rw-r--r--mi/micopy.c2
-rw-r--r--mi/misprite.c8
-rw-r--r--miext/rootless/rootlessScreen.c12
-rw-r--r--render/mipict.c4
10 files changed, 37 insertions, 26 deletions
diff --git a/composite/compinit.c b/composite/compinit.c
index 38033f215..45d3d8ce5 100644
--- a/composite/compinit.c
+++ b/composite/compinit.c
@@ -149,18 +149,17 @@ compGetImage(ScreenPtr pScreen, DrawablePtr pDrawable,
}
static void
-compSourceValidate(DrawablePtr pDrawable,
+compSourceValidate(ScreenPtr pScreen, DrawablePtr pDrawable,
int x, int y,
int width, int height, unsigned int subWindowMode)
{
- ScreenPtr pScreen = pDrawable->pScreen;
CompScreenPtr cs = GetCompScreen(pScreen);
pScreen->SourceValidate = cs->SourceValidate;
if (pDrawable->type == DRAWABLE_WINDOW && subWindowMode == IncludeInferiors)
compPaintChildrenToWindow((WindowPtr) pDrawable);
if (pScreen->SourceValidate)
- (*pScreen->SourceValidate) (pDrawable, x, y, width, height,
+ (*pScreen->SourceValidate) (pScreen, pDrawable, x, y, width, height,
subWindowMode);
cs->SourceValidate = pScreen->SourceValidate;
pScreen->SourceValidate = compSourceValidate;
diff --git a/dix/impedance.c b/dix/impedance.c
index cbb7f444e..8fa728a0a 100644
--- a/dix/impedance.c
+++ b/dix/impedance.c
@@ -788,6 +788,20 @@ impedModifyPixmapScreenCoord(PixmapPtr pPixmap, int x, int y)
miModifyPixmapScreenCoord(pPixmap, x, y);
}
+static void
+impedSourceValidate(ScreenPtr pScreen,
+ DrawablePtr pDrawable,
+ int x, int y,
+ int width, int height,
+ unsigned int subWindowMode)
+{
+ int i = pScreen->primary_gpu_index;
+
+ if (pScreen->gpu[i]->SourceValidate)
+ pScreen->gpu[i]->SourceValidate(pScreen->gpu[i], pDrawable, x, y,
+ width, height, subWindowMode);
+}
+
Bool
impedSetupScreen(ScreenPtr pScreen)
{
@@ -828,6 +842,7 @@ impedSetupScreen(ScreenPtr pScreen)
pScreen->BitmapToRegion = impedBitmapToRegion;
+ pScreen->SourceValidate = impedSourceValidate;
return TRUE;
}
diff --git a/exa/exa_unaccel.c b/exa/exa_unaccel.c
index fefe552b9..12aaf0e96 100644
--- a/exa/exa_unaccel.c
+++ b/exa/exa_unaccel.c
@@ -424,11 +424,9 @@ ExaCheckGetSpans(ScreenPtr pScreen, DrawablePtr pDrawable,
}
static void
-ExaSrcValidate(DrawablePtr pDrawable,
+ExaSrcValidate(ScreenPtr pScreen, DrawablePtr pDrawable,
int x, int y, int width, int height, unsigned int subWindowMode)
{
- ScreenPtr pScreen = pDrawable->pScreen;
-
ExaScreenPriv(pScreen);
PixmapPtr pPix = exaGetDrawablePixmap(pScreen, pDrawable);
BoxRec box;
@@ -451,7 +449,7 @@ ExaSrcValidate(DrawablePtr pDrawable,
if (pExaScr->SavedSourceValidate) {
swap(pExaScr, pScreen, SourceValidate);
- pScreen->SourceValidate(pDrawable, x, y, width, height, subWindowMode);
+ pScreen->SourceValidate(pScreen, pDrawable, x, y, width, height, subWindowMode);
swap(pExaScr, pScreen, SourceValidate);
}
}
diff --git a/hw/xfree86/common/xf86VGAarbiter.c b/hw/xfree86/common/xf86VGAarbiter.c
index a206f98a2..a319aa1f9 100644
--- a/hw/xfree86/common/xf86VGAarbiter.c
+++ b/hw/xfree86/common/xf86VGAarbiter.c
@@ -311,16 +311,14 @@ VGAarbiterGetSpans(ScreenPtr pScreen, DrawablePtr pDrawable,
}
static void
-VGAarbiterSourceValidate(DrawablePtr pDrawable,
+VGAarbiterSourceValidate(ScreenPtr pScreen, DrawablePtr pDrawable,
int x, int y, int width, int height,
unsigned int subWindowMode)
{
- ScreenPtr pScreen = pDrawable->pScreen;
-
SCREEN_PROLOG(SourceValidate);
VGAGet(pScreen);
if (pScreen->SourceValidate)
- (*pScreen->SourceValidate) (pDrawable, x, y, width, height,
+ (*pScreen->SourceValidate) (pScreen, pDrawable, x, y, width, height,
subWindowMode);
VGAPut();
SCREEN_EPILOG(SourceValidate, VGAarbiterSourceValidate);
diff --git a/hw/xfree86/common/xf86VGAarbiterPriv.h b/hw/xfree86/common/xf86VGAarbiterPriv.h
index 10b39da0d..ce1b27ae4 100644
--- a/hw/xfree86/common/xf86VGAarbiterPriv.h
+++ b/hw/xfree86/common/xf86VGAarbiterPriv.h
@@ -152,7 +152,7 @@ static void VGAarbiterGetImage(ScreenPtr pScreen, DrawablePtr pDrawable, int sx,
unsigned long planemask, char *pdstLine);
static void VGAarbiterGetSpans(ScreenPtr pScreen, DrawablePtr pDrawable, int wMax, DDXPointPtr ppt,
int *pwidth, int nspans, char *pdstStart);
-static void VGAarbiterSourceValidate(DrawablePtr pDrawable, int x, int y,
+static void VGAarbiterSourceValidate(ScreenPtr pScreen, DrawablePtr pDrawable, int x, int y,
int width, int height,
unsigned int subWindowMode);
static void VGAarbiterCopyWindow(ScreenPtr pScreen, WindowPtr pWin, DDXPointRec ptOldOrg,
diff --git a/include/scrnintstr.h b/include/scrnintstr.h
index 4605f6837..a333b3050 100644
--- a/include/scrnintstr.h
+++ b/include/scrnintstr.h
@@ -124,7 +124,8 @@ typedef void (*GetSpansProcPtr) (ScreenPtr /* pScreen */,
int /*nspans */ ,
char * /*pdstStart */ );
-typedef void (*SourceValidateProcPtr) (DrawablePtr /*pDrawable */ ,
+typedef void (*SourceValidateProcPtr) (ScreenPtr /*pScreen */ ,
+ DrawablePtr /*pDrawable */ ,
int /*x */ ,
int /*y */ ,
int /*width */ ,
diff --git a/mi/micopy.c b/mi/micopy.c
index 30795114d..94caf1132 100644
--- a/mi/micopy.c
+++ b/mi/micopy.c
@@ -160,7 +160,7 @@ miDoCopy(DrawablePtr pSrcDrawable,
}
if (pSrcDrawable->pScreen->SourceValidate) {
- (*pSrcDrawable->pScreen->SourceValidate) (pSrcDrawable, xIn, yIn,
+ (*pSrcDrawable->pScreen->SourceValidate) (pSrcDrawable->pScreen, pSrcDrawable, xIn, yIn,
widthSrc, heightSrc,
pGC->subWindowMode);
}
diff --git a/mi/misprite.c b/mi/misprite.c
index f71dc4d62..52d7f02e6 100644
--- a/mi/misprite.c
+++ b/mi/misprite.c
@@ -198,7 +198,8 @@ static void miSpriteGetImage(ScreenPtr pScreen, DrawablePtr pDrawable, int sx, i
static void miSpriteGetSpans(ScreenPtr pScreen, DrawablePtr pDrawable, int wMax,
DDXPointPtr ppt, int *pwidth, int nspans,
char *pdstStart);
-static void miSpriteSourceValidate(DrawablePtr pDrawable, int x, int y,
+static void miSpriteSourceValidate(ScreenPtr pScreen, DrawablePtr pDrawable,
+ int x, int y,
int width, int height,
unsigned int subWindowMode);
static void miSpriteCopyWindow(ScreenPtr pScreen, WindowPtr pWindow,
@@ -458,10 +459,9 @@ miSpriteGetSpans(ScreenPtr pScreen, DrawablePtr pDrawable, int wMax, DDXPointPtr
}
static void
-miSpriteSourceValidate(DrawablePtr pDrawable, int x, int y, int width,
+miSpriteSourceValidate(ScreenPtr pScreen, DrawablePtr pDrawable, int x, int y, int width,
int height, unsigned int subWindowMode)
{
- ScreenPtr pScreen = pDrawable->pScreen;
DeviceIntPtr pDev;
miCursorInfoPtr pCursorInfo;
miSpriteScreenPtr pPriv = GetSpriteScreen(pScreen);
@@ -483,7 +483,7 @@ miSpriteSourceValidate(DrawablePtr pDrawable, int x, int y, int width,
}
if (pScreen->SourceValidate)
- (*pScreen->SourceValidate) (pDrawable, x, y, width, height,
+ (*pScreen->SourceValidate) (pScreen, pDrawable, x, y, width, height,
subWindowMode);
SCREEN_EPILOGUE(pPriv, pScreen, SourceValidate);
diff --git a/miext/rootless/rootlessScreen.c b/miext/rootless/rootlessScreen.c
index a1af3e7ac..780a1b5ef 100644
--- a/miext/rootless/rootlessScreen.c
+++ b/miext/rootless/rootlessScreen.c
@@ -219,20 +219,20 @@ RootlessGetImage(DrawablePtr pDrawable, int sx, int sy, int w, int h,
* here and leave StopDrawing for the block handler.
*/
static void
-RootlessSourceValidate(DrawablePtr pDrawable, int x, int y, int w, int h,
+RootlessSourceValidate(ScreenPtr pScreen, DrawablePtr pDrawable, int x, int y, int w, int h,
unsigned int subWindowMode)
{
- SCREEN_UNWRAP(pDrawable->pScreen, SourceValidate);
+ SCREEN_UNWRAP(pScreen, SourceValidate);
if (pDrawable->type == DRAWABLE_WINDOW) {
WindowPtr pWin = (WindowPtr) pDrawable;
RootlessStartDrawing(pWin);
}
- if (pDrawable->pScreen->SourceValidate) {
- pDrawable->pScreen->SourceValidate(pDrawable, x, y, w, h,
- subWindowMode);
+ if (pScreen->SourceValidate) {
+ pScreen->SourceValidate(pScreen, pDrawable, x, y, w, h,
+ subWindowMode);
}
- SCREEN_WRAP(pDrawable->pScreen, SourceValidate);
+ SCREEN_WRAP(pScreen, SourceValidate);
}
static void
diff --git a/render/mipict.c b/render/mipict.c
index 6407ff35a..8dbadbe9e 100644
--- a/render/mipict.c
+++ b/render/mipict.c
@@ -312,10 +312,10 @@ SourceValidateOnePicture(PicturePtr pPicture)
if (!pDrawable)
return;
- pScreen = pDrawable->pScreen;
+ pScreen = pPicture->pScreen;
if (pScreen->SourceValidate) {
- pScreen->SourceValidate(pDrawable, 0, 0, pDrawable->width,
+ pScreen->SourceValidate(pPicture->pScreen, pDrawable, 0, 0, pDrawable->width,
pDrawable->height, pPicture->subWindowMode);
}
}