xserver: Branch 'master' - 4 commits

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Oct 30 16:32:30 UTC 2019


 Xext/panoramiXprocs.c              |   10 +++
 Xext/shm.c                         |    9 +++
 composite/compinit.c               |   46 ------------------
 composite/compint.h                |    2 
 dix/dispatch.c                     |    5 +
 dix/pixmap.c                       |    3 -
 doc/Xserver-spec.xml               |    4 -
 exa/exa_unaccel.c                  |    8 +--
 glx/glxdriswrast.c                 |    1 
 hw/xfree86/common/xf86VGAarbiter.c |    5 -
 hw/xfree86/modes/xf86Rotate.c      |    4 -
 hw/xnest/Screen.c                  |    1 
 mi/mi.h                            |    4 +
 mi/micopy.c                        |    8 +--
 mi/miscrinit.c                     |    9 +++
 mi/misprite.c                      |   93 -------------------------------------
 miext/rootless/rootlessScreen.c    |    6 --
 render/mipict.c                    |    6 --
 render/render.c                    |    5 +
 19 files changed, 63 insertions(+), 166 deletions(-)

New commits:
commit 417e4553f143820acc33998898bbd5c3d4567bcd
Author: Adam Jackson <ajax at redhat.com>
Date:   Wed Oct 9 12:07:00 2019 -0400

    misprite: Stop wrapping GetImage/GetSpans
    
    SourceValidate handles this for us consistently now.
    
    Reviewed-by: Michel Dänzer <mdaenzer at redhat.com>

diff --git a/mi/misprite.c b/mi/misprite.c
index 379dd4883..ce8c57130 100644
--- a/mi/misprite.c
+++ b/mi/misprite.c
@@ -70,8 +70,6 @@ typedef struct {
 typedef struct {
     /* screen procedures */
     CloseScreenProcPtr CloseScreen;
-    GetImageProcPtr GetImage;
-    GetSpansProcPtr GetSpans;
     SourceValidateProcPtr SourceValidate;
 
     /* window procedures */
@@ -190,12 +188,6 @@ miSpriteIsDown(miCursorInfoPtr pDevCursor)
  */
 
 static Bool miSpriteCloseScreen(ScreenPtr pScreen);
-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);
@@ -315,8 +307,6 @@ miSpriteInitialize(ScreenPtr pScreen, miPointerScreenFuncPtr screenFuncs)
          pVisual->vid != pScreen->rootVisual; pVisual++);
     pScreenPriv->pVisual = pVisual;
     pScreenPriv->CloseScreen = pScreen->CloseScreen;
-    pScreenPriv->GetImage = pScreen->GetImage;
-    pScreenPriv->GetSpans = pScreen->GetSpans;
     pScreenPriv->SourceValidate = pScreen->SourceValidate;
 
     pScreenPriv->CopyWindow = pScreen->CopyWindow;
@@ -340,8 +330,6 @@ miSpriteInitialize(ScreenPtr pScreen, miPointerScreenFuncPtr screenFuncs)
     dixSetPrivate(&pScreen->devPrivates, &miSpriteScreenKeyRec, pScreenPriv);
 
     pScreen->CloseScreen = miSpriteCloseScreen;
-    pScreen->GetImage = miSpriteGetImage;
-    pScreen->GetSpans = miSpriteGetSpans;
     pScreen->SourceValidate = miSpriteSourceValidate;
 
     pScreen->CopyWindow = miSpriteCopyWindow;
@@ -366,8 +354,6 @@ miSpriteCloseScreen(ScreenPtr pScreen)
     miSpriteScreenPtr pScreenPriv = GetSpriteScreen(pScreen);
 
     pScreen->CloseScreen = pScreenPriv->CloseScreen;
-    pScreen->GetImage = pScreenPriv->GetImage;
-    pScreen->GetSpans = pScreenPriv->GetSpans;
     pScreen->SourceValidate = pScreenPriv->SourceValidate;
     pScreen->InstallColormap = pScreenPriv->InstallColormap;
     pScreen->StoreColors = pScreenPriv->StoreColors;
@@ -380,80 +366,6 @@ miSpriteCloseScreen(ScreenPtr pScreen)
 }
 
 static void
-miSpriteGetImage(DrawablePtr pDrawable, int sx, int sy, int w, int h,
-                 unsigned int format, unsigned long planemask, char *pdstLine)
-{
-    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 = GetSprite(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);
-                }
-            }
-        }
-    }
-
-    (*pScreen->GetImage) (pDrawable, sx, sy, w, h, format, planemask, pdstLine);
-
-    SCREEN_EPILOGUE(pPriv, pScreen, GetImage);
-}
-
-static void
-miSpriteGetSpans(DrawablePtr pDrawable, int wMax, DDXPointPtr ppt,
-                 int *pwidth, int nspans, char *pdstStart)
-{
-    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)) {
-                pCursorInfo = GetSprite(pDev);
-
-                if (pCursorInfo->isUp && pCursorInfo->pScreen == pScreen) {
-                    DDXPointPtr pts;
-                    int *widths;
-                    int nPts;
-                    int xorg, yorg;
-
-                    xorg = pDrawable->x;
-                    yorg = pDrawable->y;
-
-                    for (pts = ppt, widths = pwidth, nPts = nspans;
-                         nPts--; pts++, widths++) {
-                        if (SPN_OVERLAP(&pCursorInfo->saved, pts->y + yorg,
-                                        pts->x + xorg, *widths)) {
-                            SPRITE_DEBUG(("GetSpans remove\n"));
-                            miSpriteRemoveCursor(pDev, pScreen);
-                            break;
-                        }
-                    }
-                }
-            }
-        }
-    }
-
-    (*pScreen->GetSpans) (pDrawable, wMax, ppt, pwidth, nspans, pdstStart);
-
-    SCREEN_EPILOGUE(pPriv, pScreen, GetSpans);
-}
-
-static void
 miSpriteSourceValidate(DrawablePtr pDrawable, int x, int y, int width,
                        int height, unsigned int subWindowMode)
 {
commit 77f614eb331b0240c699f7aef13a8046c9c2c70a
Author: Adam Jackson <ajax at redhat.com>
Date:   Wed Oct 9 12:05:56 2019 -0400

    composite: Stop wrapping GetImage/GetSpans
    
    SourceValidate handles this for us consistently now.
    
    Reviewed-by: Michel Dänzer <mdaenzer at redhat.com>

diff --git a/composite/compinit.c b/composite/compinit.c
index 69abb0a40..a62c8d3c4 100644
--- a/composite/compinit.c
+++ b/composite/compinit.c
@@ -76,9 +76,6 @@ compCloseScreen(ScreenPtr pScreen)
     pScreen->CreateWindow = cs->CreateWindow;
     pScreen->CopyWindow = cs->CopyWindow;
     pScreen->PositionWindow = cs->PositionWindow;
-
-    pScreen->GetImage = cs->GetImage;
-    pScreen->GetSpans = cs->GetSpans;
     pScreen->SourceValidate = cs->SourceValidate;
 
     free(cs);
@@ -138,38 +135,6 @@ compChangeWindowAttributes(WindowPtr pWin, unsigned long mask)
 }
 
 static void
-compGetImage(DrawablePtr pDrawable,
-             int sx, int sy,
-             int w, int h,
-             unsigned int format, unsigned long planemask, char *pdstLine)
-{
-    ScreenPtr pScreen = pDrawable->pScreen;
-    CompScreenPtr cs = GetCompScreen(pScreen);
-
-    pScreen->GetImage = cs->GetImage;
-    if (pDrawable->type == DRAWABLE_WINDOW)
-        compPaintChildrenToWindow((WindowPtr) pDrawable);
-    (*pScreen->GetImage) (pDrawable, sx, sy, w, h, format, planemask, pdstLine);
-    cs->GetImage = pScreen->GetImage;
-    pScreen->GetImage = compGetImage;
-}
-
-static void
-compGetSpans(DrawablePtr pDrawable, int wMax, DDXPointPtr ppt, int *pwidth,
-             int nspans, char *pdstStart)
-{
-    ScreenPtr pScreen = pDrawable->pScreen;
-    CompScreenPtr cs = GetCompScreen(pScreen);
-
-    pScreen->GetSpans = cs->GetSpans;
-    if (pDrawable->type == DRAWABLE_WINDOW)
-        compPaintChildrenToWindow((WindowPtr) pDrawable);
-    (*pScreen->GetSpans) (pDrawable, wMax, ppt, pwidth, nspans, pdstStart);
-    cs->GetSpans = pScreen->GetSpans;
-    pScreen->GetSpans = compGetSpans;
-}
-
-static void
 compSourceValidate(DrawablePtr pDrawable,
                    int x, int y,
                    int width, int height, unsigned int subWindowMode)
@@ -444,12 +409,6 @@ compScreenInit(ScreenPtr pScreen)
     cs->CloseScreen = pScreen->CloseScreen;
     pScreen->CloseScreen = compCloseScreen;
 
-    cs->GetImage = pScreen->GetImage;
-    pScreen->GetImage = compGetImage;
-
-    cs->GetSpans = pScreen->GetSpans;
-    pScreen->GetSpans = compGetSpans;
-
     cs->SourceValidate = pScreen->SourceValidate;
     pScreen->SourceValidate = compSourceValidate;
 
diff --git a/composite/compint.h b/composite/compint.h
index d501bad65..423b641ff 100644
--- a/composite/compint.h
+++ b/composite/compint.h
@@ -168,8 +168,6 @@ typedef struct _CompScreen {
     Window overlayWid;
     CompOverlayClientPtr pOverlayClients;
 
-    GetImageProcPtr GetImage;
-    GetSpansProcPtr GetSpans;
     SourceValidateProcPtr SourceValidate;
 } CompScreenRec, *CompScreenPtr;
 
commit 516e75dbb6bbf97c7af9c2226242ffd9259fec11
Author: Adam Jackson <ajax at redhat.com>
Date:   Wed Oct 9 11:57:18 2019 -0400

    dix: Call SourceValidate before GetImage
    
    This ensures that any prep work for the drawable we're about to read
    from is already done before we call down to GetImage. This should be no
    functional change as most of the callers with a non-trivial
    SourceValidate are already wrapping GetImage and doing the equivalent
    thing, but we'll be simplifying that shortly.
    
    More importantly this ensures that if any of that prep work would
    generate events - like automatic compositing flushing rendering to a
    parent pixmap which then triggers damage - then it happens entirely
    before we start writing the GetImage reply header.
    
    Note that we do not do the same for GetSpans, but that's okay. The only
    way to get to GetSpans is through miCopyArea or miCopyPlane - where the
    callers must already call SourceValidate - or miGetImage - which this
    commit now protects with SourceValidate.
    
    Fixes: xorg/xserver#902
    Reviewed-by: Michel Dänzer <mdaenzer at redhat.com>

diff --git a/Xext/panoramiXprocs.c b/Xext/panoramiXprocs.c
index f31b1e054..32424fcbd 100644
--- a/Xext/panoramiXprocs.c
+++ b/Xext/panoramiXprocs.c
@@ -1105,6 +1105,10 @@ PanoramiXCopyArea(ClientPtr client)
                                    DixGetAttrAccess);
             if (rc != Success)
                 return rc;
+            drawables[j]->pScreen->SourceValidate(drawables[j], 0, 0,
+                                                  drawables[j]->width,
+                                                  drawables[j]->height,
+                                                  IncludeInferiors);
         }
 
         pitch = PixmapBytePad(width, drawables[0]->depth);
@@ -2007,6 +2011,12 @@ PanoramiXGetImage(ClientPtr client)
         if (rc != Success)
             return rc;
     }
+    FOR_NSCREENS_FORWARD(i) {
+        drawables[i]->pScreen->SourceValidate(drawables[i], 0, 0,
+                                              drawables[i]->width,
+                                              drawables[i]->height,
+                                              IncludeInferiors);
+    }
 
     xgi = (xGetImageReply) {
         .type = X_Reply,
diff --git a/Xext/shm.c b/Xext/shm.c
index 506fd4df1..24c6b1087 100644
--- a/Xext/shm.c
+++ b/Xext/shm.c
@@ -655,6 +655,9 @@ ProcShmGetImage(ClientPtr client)
         visual = wVisual(((WindowPtr) pDraw));
         if (pDraw->type == DRAWABLE_WINDOW)
             pVisibleRegion = &((WindowPtr) pDraw)->borderClip;
+        pDraw->pScreen->SourceValidate(pDraw, stuff->x, stuff->y,
+                                       stuff->width, stuff->height,
+                                       IncludeInferiors);
     }
     else {
         if (stuff->x < 0 ||
@@ -863,6 +866,12 @@ ProcPanoramiXShmGetImage(ClientPtr client)
             return rc;
         }
     }
+    FOR_NSCREENS_FORWARD(i) {
+        drawables[i]->pScreen->SourceValidate(drawables[i], 0, 0,
+                                              drawables[i]->width,
+                                              drawables[i]->height,
+                                              IncludeInferiors);
+    }
 
     xgi = (xShmGetImageReply) {
         .type = X_Reply,
diff --git a/dix/dispatch.c b/dix/dispatch.c
index 90a49dbf2..f20e1963e 100644
--- a/dix/dispatch.c
+++ b/dix/dispatch.c
@@ -2210,8 +2210,11 @@ DoGetImage(ClientPtr client, int format, Drawable drawable,
         return BadAlloc;
     WriteReplyToClient(client, sizeof(xGetImageReply), &xgi);
 
-    if (pDraw->type == DRAWABLE_WINDOW)
+    if (pDraw->type == DRAWABLE_WINDOW) {
         pVisibleRegion = &((WindowPtr) pDraw)->borderClip;
+        pDraw->pScreen->SourceValidate(pDraw, x, y, width, height,
+                                       IncludeInferiors);
+    }
 
     if (linesPerBuf == 0) {
         /* nothing to do */
diff --git a/glx/glxdriswrast.c b/glx/glxdriswrast.c
index 2858312de..c57d80db7 100644
--- a/glx/glxdriswrast.c
+++ b/glx/glxdriswrast.c
@@ -324,6 +324,7 @@ swrastGetImage(__DRIdrawable * draw,
     ScreenPtr pScreen = pDraw->pScreen;
     __GLXcontext *cx = lastGLContext;
 
+    pScreen->SourceValidate(pDraw, x, y, w, h, IncludeInferiors);
     pScreen->GetImage(pDraw, x, y, w, h, ZPixmap, ~0L, data);
     if (cx != lastGLContext) {
         lastGLContext = cx;
diff --git a/render/render.c b/render/render.c
index 7d94bd5ff..c376090ca 100644
--- a/render/render.c
+++ b/render/render.c
@@ -1492,6 +1492,11 @@ ProcRenderCreateCursor(ClientPtr client)
         return BadAlloc;
     }
 
+    /* what kind of maniac creates a cursor from a window picture though */
+    if (pSrc->pDrawable->type == DRAWABLE_WINDOW)
+        pScreen->SourceValidate(pSrc->pDrawable, 0, 0, width, height,
+                                IncludeInferiors);
+
     if (pSrc->format == PICT_a8r8g8b8) {
         (*pScreen->GetImage) (pSrc->pDrawable,
                               0, 0, width, height, ZPixmap,
commit ff310903f34ac34c916ad74e919d1ac12aea4715
Author: Adam Jackson <ajax at redhat.com>
Date:   Wed Oct 9 11:27:12 2019 -0400

    mi: Add a default no-op miSourceValidate
    
    Slightly simplifies the callers since they don't need to check for
    non-NULL anymore.
    
    I do extremely hate the workarounds here to suppress misprite taking the
    cursor down though. Surely there's a better way.
    
    Reviewed-by: Michel Dänzer <mdaenzer at redhat.com>

diff --git a/composite/compinit.c b/composite/compinit.c
index b19b3da62..69abb0a40 100644
--- a/composite/compinit.c
+++ b/composite/compinit.c
@@ -180,9 +180,8 @@ compSourceValidate(DrawablePtr pDrawable,
     pScreen->SourceValidate = cs->SourceValidate;
     if (pDrawable->type == DRAWABLE_WINDOW && subWindowMode == IncludeInferiors)
         compPaintChildrenToWindow((WindowPtr) pDrawable);
-    if (pScreen->SourceValidate)
-        (*pScreen->SourceValidate) (pDrawable, x, y, width, height,
-                                    subWindowMode);
+    (*pScreen->SourceValidate) (pDrawable, x, y, width, height,
+                                subWindowMode);
     cs->SourceValidate = pScreen->SourceValidate;
     pScreen->SourceValidate = compSourceValidate;
 }
diff --git a/dix/pixmap.c b/dix/pixmap.c
index ad3254cb4..c970438ed 100644
--- a/dix/pixmap.c
+++ b/dix/pixmap.c
@@ -32,6 +32,7 @@ from The Open Group.
 
 #include <X11/X.h>
 #include "scrnintstr.h"
+#include "mi.h"
 #include "misc.h"
 #include "os.h"
 #include "windowstr.h"
@@ -394,7 +395,7 @@ Bool PixmapSyncDirtyHelper(PixmapDirtyUpdatePtr dirty)
      * leaves the software cursor in place
      */
     SourceValidate = pScreen->SourceValidate;
-    pScreen->SourceValidate = NULL;
+    pScreen->SourceValidate = miSourceValidate;
 
     RegionTranslate(&pixregion, dirty->x, dirty->y);
     RegionIntersect(&pixregion, &pixregion, region);
diff --git a/doc/Xserver-spec.xml b/doc/Xserver-spec.xml
index c89ec527c..2c7e17a86 100644
--- a/doc/Xserver-spec.xml
+++ b/doc/Xserver-spec.xml
@@ -2918,8 +2918,8 @@ The sample server implementation is in Xserver/fb/fbscreen.c.</para>
 		unsigned int subWindowMode;
 
 </programlisting></blockquote>
-SourceValidate should be called by CopyArea/CopyPlane primitives when
-the SourceValidate function pointer in the screen is non-null.  If you know that
+SourceValidate should be called by any primitive that reads from pDrawable.
+If you know that
 you will never need SourceValidate, you can avoid this check.  Currently,
 SourceValidate is used by the mi software cursor code to remove the cursor
 from the screen when the source rectangle overlaps the cursor position.
diff --git a/exa/exa_unaccel.c b/exa/exa_unaccel.c
index 73eada9c2..ed1401a98 100644
--- a/exa/exa_unaccel.c
+++ b/exa/exa_unaccel.c
@@ -459,11 +459,9 @@ ExaSrcValidate(DrawablePtr pDrawable,
     RegionUnion(dst, dst, &reg);
     RegionUninit(&reg);
 
-    if (pExaScr->SavedSourceValidate) {
-        swap(pExaScr, pScreen, SourceValidate);
-        pScreen->SourceValidate(pDrawable, x, y, width, height, subWindowMode);
-        swap(pExaScr, pScreen, SourceValidate);
-    }
+    swap(pExaScr, pScreen, SourceValidate);
+    pScreen->SourceValidate(pDrawable, x, y, width, height, subWindowMode);
+    swap(pExaScr, pScreen, SourceValidate);
 }
 
 static Bool
diff --git a/hw/xfree86/common/xf86VGAarbiter.c b/hw/xfree86/common/xf86VGAarbiter.c
index 40f241aee..9db8d044f 100644
--- a/hw/xfree86/common/xf86VGAarbiter.c
+++ b/hw/xfree86/common/xf86VGAarbiter.c
@@ -321,9 +321,8 @@ VGAarbiterSourceValidate(DrawablePtr pDrawable,
 
     SCREEN_PROLOG(SourceValidate);
     VGAGet(pScreen);
-    if (pScreen->SourceValidate)
-        (*pScreen->SourceValidate) (pDrawable, x, y, width, height,
-                                    subWindowMode);
+    (*pScreen->SourceValidate) (pDrawable, x, y, width, height,
+                                subWindowMode);
     VGAPut();
     SCREEN_EPILOG(SourceValidate, VGAarbiterSourceValidate);
 }
diff --git a/hw/xfree86/modes/xf86Rotate.c b/hw/xfree86/modes/xf86Rotate.c
index 85ab9b8c7..a8f1e615c 100644
--- a/hw/xfree86/modes/xf86Rotate.c
+++ b/hw/xfree86/modes/xf86Rotate.c
@@ -28,7 +28,7 @@
 #include <stddef.h>
 #include <string.h>
 #include <stdio.h>
-
+#include "mi.h"
 #include "xf86.h"
 #include "xf86DDC.h"
 #include "windowstr.h"
@@ -191,7 +191,7 @@ xf86RotateRedisplay(ScreenPtr pScreen)
          * leaves the software cursor in place
          */
         SourceValidate = pScreen->SourceValidate;
-        pScreen->SourceValidate = NULL;
+        pScreen->SourceValidate = miSourceValidate;
 
         for (c = 0; c < xf86_config->num_crtc; c++) {
             xf86CrtcPtr crtc = xf86_config->crtc[c];
diff --git a/hw/xnest/Screen.c b/hw/xnest/Screen.c
index 30c6a4623..ac01c248c 100644
--- a/hw/xnest/Screen.c
+++ b/hw/xnest/Screen.c
@@ -263,7 +263,6 @@ xnestOpenScreen(ScreenPtr pScreen, int argc, char *argv[])
     pScreen->SaveScreen = xnestSaveScreen;
     pScreen->GetImage = xnestGetImage;
     pScreen->GetSpans = xnestGetSpans;
-    pScreen->SourceValidate = NULL;
 
     /* Window Procedures */
 
diff --git a/mi/mi.h b/mi/mi.h
index db62c9166..2cd3066c1 100644
--- a/mi/mi.h
+++ b/mi/mi.h
@@ -360,6 +360,10 @@ extern _X_EXPORT void miPushPixels(GCPtr /*pGC */ ,
 
 /* miscrinit.c */
 
+extern _X_EXPORT void
+miSourceValidate(DrawablePtr pDrawable, int x, int y, int w, int h,
+                 unsigned int subWindowMode);
+
 extern _X_EXPORT Bool miModifyPixmapHeader(PixmapPtr pPixmap,
                                            int width,
                                            int height,
diff --git a/mi/micopy.c b/mi/micopy.c
index d563ea682..dd40ec0e3 100644
--- a/mi/micopy.c
+++ b/mi/micopy.c
@@ -158,11 +158,9 @@ miDoCopy(DrawablePtr pSrcDrawable,
         return NULL;
     }
 
-    if (pSrcDrawable->pScreen->SourceValidate) {
-        (*pSrcDrawable->pScreen->SourceValidate) (pSrcDrawable, xIn, yIn,
-                                                  widthSrc, heightSrc,
-                                                  pGC->subWindowMode);
-    }
+    (*pSrcDrawable->pScreen->SourceValidate) (pSrcDrawable, xIn, yIn,
+                                              widthSrc, heightSrc,
+                                              pGC->subWindowMode);
 
     /* Compute source clip region */
     if (pSrcDrawable->type == DRAWABLE_PIXMAP) {
diff --git a/mi/miscrinit.c b/mi/miscrinit.c
index f38298266..64a160b0c 100644
--- a/mi/miscrinit.c
+++ b/mi/miscrinit.c
@@ -130,6 +130,13 @@ miSaveScreen(ScreenPtr pScreen, int on)
     return TRUE;
 }
 
+void
+miSourceValidate(DrawablePtr pDrawable, int x, int y, int w, int h,
+                 unsigned int subWindowMode)
+{
+}
+
+
 /* With the introduction of pixmap privates, the "screen pixmap" can no
  * longer be created in miScreenInit, since all the modules that could
  * possibly ask for pixmap private space have not been initialized at
@@ -251,7 +258,7 @@ miScreenInit(ScreenPtr pScreen, void *pbits,  /* pointer to screen bits */
     /* QueryBestSize */
     pScreen->SaveScreen = miSaveScreen;
     /* GetImage, GetSpans */
-    pScreen->SourceValidate = (SourceValidateProcPtr) 0;
+    pScreen->SourceValidate = miSourceValidate;
     /* CreateWindow, DestroyWindow, PositionWindow, ChangeWindowAttributes */
     /* RealizeWindow, UnrealizeWindow */
     pScreen->ValidateTree = miValidateTree;
diff --git a/mi/misprite.c b/mi/misprite.c
index add2c5505..379dd4883 100644
--- a/mi/misprite.c
+++ b/mi/misprite.c
@@ -478,9 +478,8 @@ miSpriteSourceValidate(DrawablePtr pDrawable, int x, int y, int width,
         }
     }
 
-    if (pScreen->SourceValidate)
-        (*pScreen->SourceValidate) (pDrawable, x, y, width, height,
-                                    subWindowMode);
+    (*pScreen->SourceValidate) (pDrawable, x, y, width, height,
+                                subWindowMode);
 
     SCREEN_EPILOGUE(pPriv, pScreen, SourceValidate);
 }
diff --git a/miext/rootless/rootlessScreen.c b/miext/rootless/rootlessScreen.c
index 2ec0ae54d..a99a2d158 100644
--- a/miext/rootless/rootlessScreen.c
+++ b/miext/rootless/rootlessScreen.c
@@ -228,10 +228,8 @@ RootlessSourceValidate(DrawablePtr pDrawable, int x, int y, int w, int h,
 
         RootlessStartDrawing(pWin);
     }
-    if (pDrawable->pScreen->SourceValidate) {
-        pDrawable->pScreen->SourceValidate(pDrawable, x, y, w, h,
-                                           subWindowMode);
-    }
+    pDrawable->pScreen->SourceValidate(pDrawable, x, y, w, h,
+                                       subWindowMode);
     SCREEN_WRAP(pDrawable->pScreen, SourceValidate);
 }
 
diff --git a/render/mipict.c b/render/mipict.c
index 4b855122e..7fb03435b 100644
--- a/render/mipict.c
+++ b/render/mipict.c
@@ -294,10 +294,8 @@ SourceValidateOnePicture(PicturePtr pPicture)
 
     pScreen = pDrawable->pScreen;
 
-    if (pScreen->SourceValidate) {
-        pScreen->SourceValidate(pDrawable, 0, 0, pDrawable->width,
-                                pDrawable->height, pPicture->subWindowMode);
-    }
+    pScreen->SourceValidate(pDrawable, 0, 0, pDrawable->width,
+                            pDrawable->height, pPicture->subWindowMode);
 }
 
 void


More information about the xorg-commit mailing list