[PATCH xserver] composite: Explicitly validate source picture in compNewPixmap

Michel Dänzer michel at daenzer.net
Fri Feb 3 03:28:13 UTC 2017


From: Michel Dänzer <michel.daenzer at amd.com>

CompositePicture also does it, but only after the damage layer is
unwrapped, so no damage is reported.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99220
Signed-off-by: Michel Dänzer <michel.daenzer at amd.com>
---

For some reason, this causes an Xnest link failure without the
configure.ac change:

  CCLD     Xnest
../../composite/.libs/libcomposite.a(compalloc.o): In function `compNewPixmap':
.../../../composite/compalloc.c:590: undefined reference to `miCompositeSourceValidate'
collect2: error: ld returned 1 exit status

 composite/compalloc.c | 9 +++++++++
 configure.ac          | 2 +-
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/composite/compalloc.c b/composite/compalloc.c
index 05ffc7e85..e27ba05e4 100644
--- a/composite/compalloc.c
+++ b/composite/compalloc.c
@@ -45,6 +45,7 @@
 #include <dix-config.h>
 #endif
 
+#include <mipict.h>
 #include "compint.h"
 
 static void
@@ -579,6 +580,14 @@ compNewPixmap(WindowPtr pWin, int x, int y, int w, int h)
                                                serverClient, &error);
 
         if (pSrcPicture && pDstPicture) {
+            /*
+             * Validating the source picture may trigger
+             * compWindowUpdateAutomatic for redirected siblings of this
+             * window. Within CompositePicture, damageComposite unwraps
+             * the damage layer before this happens. Validate the source
+             * here to make sure damage is reported correctly.
+             */
+            miCompositeSourceValidate(pSrcPicture);
             CompositePicture(PictOpSrc,
                              pSrcPicture,
                              NULL,
diff --git a/configure.ac b/configure.ac
index 95aa297da..30dd37eb8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1847,7 +1847,7 @@ if test "x$XNEST" = xyes; then
 	if test "x$have_xnest" = xno; then
 		AC_MSG_ERROR([Xnest build explicitly requested, but required modules not found.])
 	fi
-	XNEST_LIBS="$FB_LIB $FIXES_LIB $MI_LIB $XEXT_LIB $DBE_LIB $RECORD_LIB $GLX_LIBS $RANDR_LIB $RENDER_LIB $DAMAGE_LIB  $DRI3_LIB $PRESENT_LIB $MIEXT_SYNC_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $MAIN_LIB $DIX_LIB $OS_LIB"
+	XNEST_LIBS="$FB_LIB $FIXES_LIB $MI_LIB $XEXT_LIB $DBE_LIB $RECORD_LIB $GLX_LIBS $RANDR_LIB $COMPOSITE_LIB $RENDER_LIB $DAMAGE_LIB  $DRI3_LIB $PRESENT_LIB $MIEXT_SYNC_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $MAIN_LIB $DIX_LIB $OS_LIB"
 	XNEST_SYS_LIBS="$XNESTMODULES_LIBS $GLX_SYS_LIBS"
 	AC_SUBST([XNEST_LIBS])
 	AC_SUBST([XNEST_SYS_LIBS])
-- 
2.11.0



More information about the xorg-devel mailing list