Module Name:    xsrc
Committed By:   mrg
Date:           Sun Feb 23 10:26:23 UTC 2020

Modified Files:
        xsrc/external/mit/xorg-server/dist: configure configure.ac
        xsrc/external/mit/xorg-server/dist/Xext: shm.c sync.c
        xsrc/external/mit/xorg-server/dist/dix: dispatch.c events.c
        xsrc/external/mit/xorg-server/dist/glx: glxcmds.c
        xsrc/external/mit/xorg-server/dist/hw/xfree86/common: compiler.h
        xsrc/external/mit/xorg-server/dist/hw/xfree86/drivers/modesetting:
            driver.h present.c vblank.c
        xsrc/external/mit/xorg-server/dist/hw/xfree86/modes: xf86RandR12.c
        xsrc/external/mit/xorg-server/dist/include: dix-config.h.in
        xsrc/external/mit/xorg-server/dist/mi: miscrinit.c
        xsrc/external/mit/xorg-server/dist/os: connection.c
        xsrc/external/mit/xorg-server/dist/render: render.c
        xsrc/external/mit/xorg-server/dist/xkb: xkb.c

Log Message:
merge xorg-server 1.20.6.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 xsrc/external/mit/xorg-server/dist/configure
cvs rdiff -u -r1.8 -r1.9 xsrc/external/mit/xorg-server/dist/configure.ac
cvs rdiff -u -r1.7 -r1.8 xsrc/external/mit/xorg-server/dist/Xext/shm.c
cvs rdiff -u -r1.11 -r1.12 xsrc/external/mit/xorg-server/dist/Xext/sync.c
cvs rdiff -u -r1.5 -r1.6 xsrc/external/mit/xorg-server/dist/dix/dispatch.c
cvs rdiff -u -r1.3 -r1.4 xsrc/external/mit/xorg-server/dist/dix/events.c
cvs rdiff -u -r1.12 -r1.13 xsrc/external/mit/xorg-server/dist/glx/glxcmds.c
cvs rdiff -u -r1.15 -r1.16 \
    xsrc/external/mit/xorg-server/dist/hw/xfree86/common/compiler.h
cvs rdiff -u -r1.3 -r1.4 \
    xsrc/external/mit/xorg-server/dist/hw/xfree86/drivers/modesetting/driver.h \
    xsrc/external/mit/xorg-server/dist/hw/xfree86/drivers/modesetting/present.c
cvs rdiff -u -r1.4 -r1.5 \
    xsrc/external/mit/xorg-server/dist/hw/xfree86/drivers/modesetting/vblank.c
cvs rdiff -u -r1.5 -r1.6 \
    xsrc/external/mit/xorg-server/dist/hw/xfree86/modes/xf86RandR12.c
cvs rdiff -u -r1.4 -r1.5 \
    xsrc/external/mit/xorg-server/dist/include/dix-config.h.in
cvs rdiff -u -r1.6 -r1.7 xsrc/external/mit/xorg-server/dist/mi/miscrinit.c
cvs rdiff -u -r1.4 -r1.5 xsrc/external/mit/xorg-server/dist/os/connection.c
cvs rdiff -u -r1.6 -r1.7 xsrc/external/mit/xorg-server/dist/render/render.c
cvs rdiff -u -r1.4 -r1.5 xsrc/external/mit/xorg-server/dist/xkb/xkb.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: xsrc/external/mit/xorg-server/dist/configure
diff -u xsrc/external/mit/xorg-server/dist/configure:1.6 xsrc/external/mit/xorg-server/dist/configure:1.7
--- xsrc/external/mit/xorg-server/dist/configure:1.6	Sat Jun  1 06:55:44 2019
+++ xsrc/external/mit/xorg-server/dist/configure	Sun Feb 23 10:26:21 2020
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for xorg-server 1.20.5.
+# Generated by GNU Autoconf 2.69 for xorg-server 1.20.6.
 #
 # Report bugs to <https://gitlab.freedesktop.org/xorg/xserver/issues>.
 #
@@ -651,8 +651,8 @@ MAKEFLAGS=
 # Identity of this package.
 PACKAGE_NAME='xorg-server'
 PACKAGE_TARNAME='xorg-server'
-PACKAGE_VERSION='1.20.5'
-PACKAGE_STRING='xorg-server 1.20.5'
+PACKAGE_VERSION='1.20.6'
+PACKAGE_STRING='xorg-server 1.20.6'
 PACKAGE_BUGREPORT='https://gitlab.freedesktop.org/xorg/xserver/issues'
 PACKAGE_URL=''
 
@@ -1383,7 +1383,6 @@ enable_local_transport
 enable_secure_rpc
 enable_input_thread
 with_systemd_daemon
-with_shared_memory_dir
 enable_xtrans_send_fds
 with_xkb_bin_directory
 with_sha1
@@ -2033,7 +2032,7 @@ if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures xorg-server 1.20.5 to adapt to many kinds of systems.
+\`configure' configures xorg-server 1.20.6 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -2103,7 +2102,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of xorg-server 1.20.5:";;
+     short | recursive ) echo "Configuration of xorg-server 1.20.6:";;
    esac
   cat <<\_ACEOF
 
@@ -2294,10 +2293,10 @@ Optional Packages:
                           org.x)
   --with-bundle-version=VERSION
                           Version to use for X11.app's CFBundleVersion
-                          (default: 1.20.5)
+                          (default: 1.20.6)
   --with-bundle-version-string=VERSION
                           Version to use for X11.app's
-                          CFBundleShortVersionString (default: 1.20.5)
+                          CFBundleShortVersionString (default: 1.20.6)
   --with-sparkle-feed-url=URL
                           URL for the Sparkle feed (default:
                           https://www.xquartz.org/releases/sparkle/release.xml)
@@ -2305,10 +2304,6 @@ Optional Packages:
                           Path to Khronos OpenGL registry database files
                           (default: auto)
   --with-systemd-daemon   support systemd socket activation (default: auto)
-  --with-shared-memory-dir=PATH
-                          Path to directory in a world-writable temporary
-                          directory for anonymous shared memory (default:
-                          auto)
   --with-xkb-bin-directory=DIR
                           Directory containing xkbcomp program (default: auto)
   --with-sha1=libc|libmd|libnettle|libgcrypt|libcrypto|libsha1|CommonCrypto|CryptoAPI
@@ -2558,7 +2553,7 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-xorg-server configure 1.20.5
+xorg-server configure 1.20.6
 generated by GNU Autoconf 2.69
 
 Copyright (C) 2012 Free Software Foundation, Inc.
@@ -3267,7 +3262,7 @@ cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by xorg-server $as_me 1.20.5, which was
+It was created by xorg-server $as_me 1.20.6, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
@@ -3615,8 +3610,8 @@ ac_link='$CC -o conftest$ac_exeext $CFLA
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
-RELEASE_DATE="2019-05-30"
-RELEASE_NAME="Red Lentil Dal"
+RELEASE_DATE="2019-11-22"
+RELEASE_NAME="Enchiladas de Queso"
 
 
 am__api_version='1.16'
@@ -4134,7 +4129,7 @@ fi
 
 # Define the identity of the package.
  PACKAGE='xorg-server'
- VERSION='1.20.5'
+ VERSION='1.20.6'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -15663,10 +15658,10 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*
 	  x86_64-*linux*)
 	    LD="${LD-ld} -m elf_x86_64"
 	    ;;
-	  powerpcle-*linux*)
+	  powerpcle-*linux*|powerpc64le-*linux*)
 	    LD="${LD-ld} -m elf64lppc"
 	    ;;
-	  powerpc-*linux*)
+	  powerpc-*linux*|powerpc64-*linux*)
 	    LD="${LD-ld} -m elf64ppc"
 	    ;;
 	  s390*-*linux*|s390*-*tpf*)
@@ -19912,7 +19907,14 @@ freebsd* | dragonfly*)
     *) objformat=elf ;;
     esac
   fi
-  version_type=freebsd-$objformat
+  # Handle Gentoo/FreeBSD as it was Linux
+  case $host_vendor in
+    gentoo)
+      version_type=linux ;;
+    *)
+      version_type=freebsd-$objformat ;;
+  esac
+
   case $version_type in
     freebsd-elf*)
       library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
@@ -19924,6 +19926,12 @@ freebsd* | dragonfly*)
       library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
       need_version=yes
       ;;
+    linux)
+      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+      soname_spec='${libname}${release}${shared_ext}$major'
+      need_lib_prefix=no
+      need_version=no
+      ;;
   esac
   shlibpath_var=LD_LIBRARY_PATH
   case $host_os in
@@ -20132,9 +20140,6 @@ fi
   # before this can be enabled.
   hardcode_into_libs=yes
 
-  # Add ABI-specific directories to the system library path.
-  sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib"
-
   # Ideally, we could use ldconfig to report *all* directores which are
   # searched for libraries, however this is still not possible.  Aside from not
   # being certain /sbin/ldconfig is available, command
@@ -20143,7 +20148,7 @@ fi
   # appending ld.so.conf contents (and includes) to the search path.
   if test -f /etc/ld.so.conf; then
     lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[	 ]*hwcap[	 ]/d;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
-    sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra"
+    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
   fi
 
   # We used to test for /lib/ld.so.1 and disable shared libraries on
@@ -22650,7 +22655,7 @@ fi
 for ac_func in backtrace geteuid getuid issetugid getresuid \
 	getdtablesize getifaddrs getpeereid getpeerucred getprogname getzoneid \
 	mmap posix_fallocate seteuid shmctl64 strncasecmp vasprintf vsnprintf \
-	walkcontext setitimer poll epoll_create1 mkostemp
+	walkcontext setitimer poll epoll_create1 mkostemp memfd_create isastream
 do :
   as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
@@ -23701,7 +23706,7 @@ _ACEOF
 if test "${with_bundle_version+set}" = set; then :
   withval=$with_bundle_version;  BUNDLE_VERSION="${withval}"
 else
-   BUNDLE_VERSION="1.20.5"
+   BUNDLE_VERSION="1.20.6"
 fi
 
 
@@ -24487,6 +24492,20 @@ $as_echo "#define LOCALCONN 1" >>confdef
 
  fi
 
+ # Other functions Xtrans may need
+ for ac_func in strcasecmp strlcpy
+do :
+  as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+
 
 
 # Secure RPC detection macro from xtrans.m4
@@ -24750,7 +24769,7 @@ LIBDRI="dri >= 7.8.0"
 LIBDRM="libdrm >= 2.4.89"
 LIBEGL="egl"
 LIBGBM="gbm >= 10.2.0"
-LIBGL="gl >= 7.1.0"
+LIBGL="gl >= 1.2"
 LIBXEXT="xext >= 1.0.99.4"
 LIBXFONT="xfont2 >= 2.0.0"
 LIBXI="xi >= 1.2.99.1"
@@ -26465,7 +26484,7 @@ case "$DRI2,$HAVE_DRI2PROTO" in
 $as_echo "#define DRI2 1" >>confdefs.h
 
 		DRI2=yes
-		LIBGL="gl >= 9.2.0"
+		LIBGL="gl >= 1.2"
 		SDK_REQUIRED_MODULES="$SDK_REQUIRED_MODULES $DRI2PROTO"
 		;;
 esac
@@ -26478,55 +26497,6 @@ else
 fi
 
 
-
-
-# Check whether --with-shared-memory-dir was given.
-if test "${with_shared_memory_dir+set}" = set; then :
-  withval=$with_shared_memory_dir;
-else
-  with_shared_memory_dir=yes
-fi
-
-
-shmdirs="/run/shm /var/tmp /tmp"
-
-case x"$with_shared_memory_dir" in
-xyes)
-	for dir in $shmdirs; do
-		case x"$with_shared_memory_dir" in
-		xyes)
-			echo Checking temp dir "$dir"
-			if test -d "$dir"; then
-				with_shared_memory_dir="$dir"
-			fi
-			;;
-		esac
-	done
-	;;
-x/*)
-	;;
-xno)
-	;;
-*)
-	as_fn_error $? "Invalid directory specified for --with-shared-memory-dir: $with_shared_memory_dir" "$LINENO" 5
-	;;
-esac
-
-case x"$with_shared_memory_dir" in
-xyes)
-	as_fn_error $? "No directory found for shared memory temp files." "$LINENO" 5
-	;;
-xno)
-	;;
-*)
-
-cat >>confdefs.h <<_ACEOF
-#define SHMDIR "$with_shared_memory_dir"
-_ACEOF
-
-	;;
-esac
-
 # Check whether --enable-xtrans-send-fds was given.
 if test "${enable_xtrans_send_fds+set}" = set; then :
   enableval=$enable_xtrans_send_fds; XTRANS_SEND_FDS=$enableval
@@ -26833,7 +26803,7 @@ else
 fi
 
 
-if test "x$DRI" = xyes || test "x$DRI2" = xyes || test "x$DRI3" = xyes || test "x$CONFIG_UDEV_KMS" = xyes; then
+if test "x$DRI" = xyes || test "x$DRI2" = xyes || test "x$DRI3" = xyes || test "x$CONFIG_UDEV_KMS" = xyes || test "x$XORG" = xyes; then
 	if test "x$DRM" = xyes; then
 
 $as_echo "#define WITH_LIBDRM 1" >>confdefs.h
@@ -33562,7 +33532,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_wri
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by xorg-server $as_me 1.20.5, which was
+This file was extended by xorg-server $as_me 1.20.6, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -33628,7 +33598,7 @@ _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-xorg-server config.status 1.20.5
+xorg-server config.status 1.20.6
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 

Index: xsrc/external/mit/xorg-server/dist/configure.ac
diff -u xsrc/external/mit/xorg-server/dist/configure.ac:1.8 xsrc/external/mit/xorg-server/dist/configure.ac:1.9
--- xsrc/external/mit/xorg-server/dist/configure.ac:1.8	Sat Jun  1 06:55:44 2019
+++ xsrc/external/mit/xorg-server/dist/configure.ac	Sun Feb 23 10:26:21 2020
@@ -26,9 +26,9 @@ dnl
 dnl Process this file with autoconf to create configure.
 
 AC_PREREQ(2.60)
-AC_INIT([xorg-server], 1.20.5, [https://gitlab.freedesktop.org/xorg/xserver/issues], xorg-server)
-RELEASE_DATE="2019-05-30"
-RELEASE_NAME="Red Lentil Dal"
+AC_INIT([xorg-server], 1.20.6, [https://gitlab.freedesktop.org/xorg/xserver/issues], xorg-server)
+RELEASE_DATE="2019-11-22"
+RELEASE_NAME="Enchiladas de Queso"
 AC_CONFIG_SRCDIR([Makefile.am])
 AC_CONFIG_MACRO_DIR([m4])
 AM_INIT_AUTOMAKE([foreign dist-bzip2])
@@ -159,7 +159,7 @@ dnl Checks for library functions.
 AC_CHECK_FUNCS([backtrace geteuid getuid issetugid getresuid \
 	getdtablesize getifaddrs getpeereid getpeerucred getprogname getzoneid \
 	mmap posix_fallocate seteuid shmctl64 strncasecmp vasprintf vsnprintf \
-	walkcontext setitimer poll epoll_create1 mkostemp])
+	walkcontext setitimer poll epoll_create1 mkostemp memfd_create isastream])
 AC_CONFIG_LIBOBJ_DIR([os])
 AC_REPLACE_FUNCS([reallocarray strcasecmp strcasestr strlcat strlcpy strndup\
 	timingsafe_memcmp])
@@ -765,7 +765,7 @@ LIBDRI="dri >= 7.8.0"
 LIBDRM="libdrm >= 2.4.89"
 LIBEGL="egl"
 LIBGBM="gbm >= 10.2.0"
-LIBGL="gl >= 7.1.0"
+LIBGL="gl >= 1.2"
 LIBXEXT="xext >= 1.0.99.4"
 LIBXFONT="xfont2 >= 2.0.0"
 LIBXI="xi >= 1.2.99.1"
@@ -1116,55 +1116,12 @@ case "$DRI2,$HAVE_DRI2PROTO" in
 	yes,yes | auto,yes)
 		AC_DEFINE(DRI2, 1, [Build DRI2 extension])
 		DRI2=yes
-		LIBGL="gl >= 9.2.0"
+		LIBGL="gl >= 1.2"
 		SDK_REQUIRED_MODULES="$SDK_REQUIRED_MODULES $DRI2PROTO"
 		;;
 esac
 AM_CONDITIONAL(DRI2, test "x$DRI2" = xyes)
 
-dnl
-dnl Locate a suitable tmp file system for creating shared memeory files
-dnl
-
-AC_ARG_WITH(shared-memory-dir, AS_HELP_STRING([--with-shared-memory-dir=PATH], [Path to directory in a world-writable temporary directory for anonymous shared memory (default: auto)]),
-[],
-[with_shared_memory_dir=yes])
-
-shmdirs="/run/shm /var/tmp /tmp"
-
-case x"$with_shared_memory_dir" in
-xyes)
-	for dir in $shmdirs; do
-		case x"$with_shared_memory_dir" in
-		xyes)
-			echo Checking temp dir "$dir"
-			if test -d "$dir"; then
-				with_shared_memory_dir="$dir"
-			fi
-			;;
-		esac
-	done
-	;;
-x/*)
-	;;
-xno)
-	;;
-*)
-	AC_MSG_ERROR([Invalid directory specified for --with-shared-memory-dir: $with_shared_memory_dir])
-	;;
-esac
-
-case x"$with_shared_memory_dir" in
-xyes)
-	AC_MSG_ERROR([No directory found for shared memory temp files.])
-	;;
-xno)
-	;;
-*)
-	AC_DEFINE_UNQUOTED(SHMDIR, ["$with_shared_memory_dir"], [Directory for shared memory temp files])
-	;;
-esac
-
 AC_ARG_ENABLE(xtrans-send-fds,	AS_HELP_STRING([--disable-xtrans-send-fds], [Use Xtrans support for fd passing (default: auto)]), [XTRANS_SEND_FDS=$enableval], [XTRANS_SEND_FDS=auto])
 
 case "x$XTRANS_SEND_FDS" in
@@ -1281,7 +1238,7 @@ esac
 
 AM_CONDITIONAL(DRI3, test "x$DRI3" = xyes)
 
-if test "x$DRI" = xyes || test "x$DRI2" = xyes || test "x$DRI3" = xyes || test "x$CONFIG_UDEV_KMS" = xyes; then
+if test "x$DRI" = xyes || test "x$DRI2" = xyes || test "x$DRI3" = xyes || test "x$CONFIG_UDEV_KMS" = xyes || test "x$XORG" = xyes; then
 	if test "x$DRM" = xyes; then
 		AC_DEFINE(WITH_LIBDRM, 1, [Building with libdrm support])
 		PKG_CHECK_MODULES([LIBDRM], $LIBDRM)

Index: xsrc/external/mit/xorg-server/dist/Xext/shm.c
diff -u xsrc/external/mit/xorg-server/dist/Xext/shm.c:1.7 xsrc/external/mit/xorg-server/dist/Xext/shm.c:1.8
--- xsrc/external/mit/xorg-server/dist/Xext/shm.c:1.7	Mon Dec 31 09:49:58 2018
+++ xsrc/external/mit/xorg-server/dist/Xext/shm.c	Sun Feb 23 10:26:21 2020
@@ -35,6 +35,9 @@ in this Software without prior written a
 #include <sys/types.h>
 #include <sys/ipc.h>
 #include <sys/shm.h>
+#ifdef HAVE_MEMFD_CREATE
+#include <sys/mman.h>
+#endif
 #include <unistd.h>
 #include <sys/stat.h>
 #include <fcntl.h>
@@ -652,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 ||
@@ -860,6 +866,12 @@ ProcPanoramiXShmGetImage(ClientPtr clien
             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,
@@ -1194,36 +1206,55 @@ ProcShmAttachFd(ClientPtr client)
 static int
 shm_tmpfile(void)
 {
-#ifdef SHMDIR
-	int	fd;
-	char	template[] = SHMDIR "/shmfd-XXXXXX";
+    const char *shmdirs[] = {
+        "/run/shm",
+        "/var/tmp",
+        "/tmp",
+    };
+    int	fd;
+
+#ifdef HAVE_MEMFD_CREATE
+    fd = memfd_create("xorg", MFD_CLOEXEC|MFD_ALLOW_SEALING);
+    if (fd != -1) {
+        fcntl(fd, F_ADD_SEALS, F_SEAL_SHRINK);
+        DebugF ("Using memfd_create\n");
+        return fd;
+    }
+#endif
+
 #ifdef O_TMPFILE
-	fd = open(SHMDIR, O_TMPFILE|O_RDWR|O_CLOEXEC|O_EXCL, 0666);
-	if (fd >= 0) {
-		DebugF ("Using O_TMPFILE\n");
-		return fd;
-	}
-	ErrorF ("Not using O_TMPFILE\n");
+    for (int i = 0; i < ARRAY_SIZE(shmdirs); i++) {
+        fd = open(shmdirs[i], O_TMPFILE|O_RDWR|O_CLOEXEC|O_EXCL, 0666);
+        if (fd >= 0) {
+            DebugF ("Using O_TMPFILE\n");
+            return fd;
+        }
+    }
+    ErrorF ("Not using O_TMPFILE\n");
 #endif
+
+    for (int i = 0; i < ARRAY_SIZE(shmdirs); i++) {
+        char template[PATH_MAX];
+        snprintf(template, ARRAY_SIZE(template), "%s/shmfd-XXXXXX", shmdirs[i]);
 #ifdef HAVE_MKOSTEMP
-	fd = mkostemp(template, O_CLOEXEC);
+        fd = mkostemp(template, O_CLOEXEC);
 #else
-	fd = mkstemp(template);
+        fd = mkstemp(template);
 #endif
-	if (fd < 0)
-		return -1;
-	unlink(template);
+        if (fd < 0)
+            continue;
+        unlink(template);
 #ifndef HAVE_MKOSTEMP
-	int flags = fcntl(fd, F_GETFD);
-	if (flags != -1) {
-		flags |= FD_CLOEXEC;
-		(void) fcntl(fd, F_SETFD, &flags);
-	}
-#endif
-	return fd;
-#else
-        return -1;
+        int flags = fcntl(fd, F_GETFD);
+        if (flags != -1) {
+            flags |= FD_CLOEXEC;
+            (void) fcntl(fd, F_SETFD, &flags);
+        }
 #endif
+        return fd;
+    }
+
+    return -1;
 }
 
 static int

Index: xsrc/external/mit/xorg-server/dist/Xext/sync.c
diff -u xsrc/external/mit/xorg-server/dist/Xext/sync.c:1.11 xsrc/external/mit/xorg-server/dist/Xext/sync.c:1.12
--- xsrc/external/mit/xorg-server/dist/Xext/sync.c:1.11	Mon Dec 31 09:49:58 2018
+++ xsrc/external/mit/xorg-server/dist/Xext/sync.c	Sun Feb 23 10:26:21 2020
@@ -881,18 +881,21 @@ SyncChangeAlarmAttributes(ClientPtr clie
     return Success;
 }
 
-static SyncObject *
+SyncObject *
 SyncCreate(ClientPtr client, XID id, unsigned char type)
 {
     SyncObject *pSync;
+    RESTYPE resType;
 
     switch (type) {
     case SYNC_COUNTER:
         pSync = malloc(sizeof(SyncCounter));
+        resType = RTCounter;
         break;
     case SYNC_FENCE:
         pSync = (SyncObject *) dixAllocateObjectWithPrivates(SyncFence,
                                                              PRIVATE_SYNC_FENCE);
+        resType = RTFence;
         break;
     default:
         return NULL;
@@ -901,6 +904,11 @@ SyncCreate(ClientPtr client, XID id, uns
     if (!pSync)
         return NULL;
 
+    pSync->initialized = FALSE;
+
+    if (!AddResource(id, resType, (void *) pSync))
+        return NULL;
+
     pSync->client = client;
     pSync->id = id;
     pSync->pTriglist = NULL;
@@ -923,13 +931,10 @@ SyncCreateFenceFromFD(ClientPtr client, 
 
     status = miSyncInitFenceFromFD(pDraw, pFence, fd, initially_triggered);
     if (status != Success) {
-        dixFreeObjectWithPrivates(pFence, PRIVATE_SYNC_FENCE);
+        FreeResource(pFence->sync.id, RT_NONE);
         return status;
     }
 
-    if (!AddResource(id, RTFence, (void *) pFence))
-        return BadAlloc;
-
     return Success;
 #else
     return BadImplementation;
@@ -957,8 +962,7 @@ SyncCreateCounter(ClientPtr client, XSyn
     pCounter->value = initialvalue;
     pCounter->pSysCounterInfo = NULL;
 
-    if (!AddResource(id, RTCounter, (void *) pCounter))
-        return NULL;
+    pCounter->sync.initialized = TRUE;
 
     return pCounter;
 }
@@ -1137,21 +1141,26 @@ static int
 FreeCounter(void *env, XID id)
 {
     SyncCounter *pCounter = (SyncCounter *) env;
-    SyncTriggerList *ptl, *pnext;
 
     pCounter->sync.beingDestroyed = TRUE;
-    /* tell all the counter's triggers that the counter has been destroyed */
-    for (ptl = pCounter->sync.pTriglist; ptl; ptl = pnext) {
-        (*ptl->pTrigger->CounterDestroyed) (ptl->pTrigger);
-        pnext = ptl->next;
-        free(ptl);              /* destroy the trigger list as we go */
-    }
-    if (IsSystemCounter(pCounter)) {
-        xorg_list_del(&pCounter->pSysCounterInfo->entry);
-        free(pCounter->pSysCounterInfo->name);
-        free(pCounter->pSysCounterInfo->private);
-        free(pCounter->pSysCounterInfo);
+
+    if (pCounter->sync.initialized) {
+        SyncTriggerList *ptl, *pnext;
+
+        /* tell all the counter's triggers that counter has been destroyed */
+        for (ptl = pCounter->sync.pTriglist; ptl; ptl = pnext) {
+            (*ptl->pTrigger->CounterDestroyed) (ptl->pTrigger);
+            pnext = ptl->next;
+            free(ptl); /* destroy the trigger list as we go */
+        }
+        if (IsSystemCounter(pCounter)) {
+            xorg_list_del(&pCounter->pSysCounterInfo->entry);
+            free(pCounter->pSysCounterInfo->name);
+            free(pCounter->pSysCounterInfo->private);
+            free(pCounter->pSysCounterInfo);
+        }
     }
+
     free(pCounter);
     return Success;
 }
@@ -1889,9 +1898,6 @@ ProcSyncCreateFence(ClientPtr client)
 
     miSyncInitFence(pDraw->pScreen, pFence, stuff->initially_triggered);
 
-    if (!AddResource(stuff->fid, RTFence, (void *) pFence))
-        return BadAlloc;
-
     return Success;
 }
 

Index: xsrc/external/mit/xorg-server/dist/dix/dispatch.c
diff -u xsrc/external/mit/xorg-server/dist/dix/dispatch.c:1.5 xsrc/external/mit/xorg-server/dist/dix/dispatch.c:1.6
--- xsrc/external/mit/xorg-server/dist/dix/dispatch.c:1.5	Mon Dec 31 09:49:59 2018
+++ xsrc/external/mit/xorg-server/dist/dix/dispatch.c	Sun Feb 23 10:26:21 2020
@@ -2196,8 +2196,11 @@ DoGetImage(ClientPtr client, int format,
         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 */

Index: xsrc/external/mit/xorg-server/dist/dix/events.c
diff -u xsrc/external/mit/xorg-server/dist/dix/events.c:1.3 xsrc/external/mit/xorg-server/dist/dix/events.c:1.4
--- xsrc/external/mit/xorg-server/dist/dix/events.c:1.3	Mon Dec 31 09:49:59 2018
+++ xsrc/external/mit/xorg-server/dist/dix/events.c	Sun Feb 23 10:26:21 2020
@@ -597,6 +597,8 @@ XineramaConfineCursorToWindow(DeviceIntP
 
     int x, y, off_x, off_y, i;
 
+    assert(!noPanoramiXExtension);
+
     if (!XineramaSetWindowPntrs(pDev, pWin))
         return;
 

Index: xsrc/external/mit/xorg-server/dist/glx/glxcmds.c
diff -u xsrc/external/mit/xorg-server/dist/glx/glxcmds.c:1.12 xsrc/external/mit/xorg-server/dist/glx/glxcmds.c:1.13
--- xsrc/external/mit/xorg-server/dist/glx/glxcmds.c:1.12	Fri May 31 18:01:11 2019
+++ xsrc/external/mit/xorg-server/dist/glx/glxcmds.c	Sun Feb 23 10:26:22 2020
@@ -574,10 +574,8 @@ xorgGlxMakeCurrent(ClientPtr client, GLX
     /* Look up old context. If we have one, it must be in a usable state. */
     if (tag != 0) {
         prevglxc = glxServer.getContextTagPrivate(client, tag);
-        if (!prevglxc)
-            return __glXError(GLXBadContextTag);
 
-        if (prevglxc->renderMode != GL_RENDER) {
+        if (prevglxc && prevglxc->renderMode != GL_RENDER) {
             /* Oops.  Not in render mode render. */
             client->errorValue = prevglxc->id;
             return __glXError(GLXBadContextState);

Index: xsrc/external/mit/xorg-server/dist/hw/xfree86/common/compiler.h
diff -u xsrc/external/mit/xorg-server/dist/hw/xfree86/common/compiler.h:1.15 xsrc/external/mit/xorg-server/dist/hw/xfree86/common/compiler.h:1.16
--- xsrc/external/mit/xorg-server/dist/hw/xfree86/common/compiler.h:1.15	Mon Dec 31 09:50:00 2018
+++ xsrc/external/mit/xorg-server/dist/hw/xfree86/common/compiler.h	Sun Feb 23 10:26:22 2020
@@ -758,36 +758,6 @@ inl(unsigned short port)
     return xf86ReadMmio32Le((void *) ioBase, port);
 }
 
-#elif defined(__arm__) && defined(__linux__)
-
-/* for Linux on ARM, we use the LIBC inx/outx routines */
-/* note that the appropriate setup via "ioperm" needs to be done */
-/*  *before* any inx/outx is done. */
-
-#include <sys/io.h>
-
-static __inline__ void
-xf_outb(unsigned short port, unsigned char val)
-{
-    outb(val, port);
-}
-
-static __inline__ void
-xf_outw(unsigned short port, unsigned short val)
-{
-    outw(val, port);
-}
-
-static __inline__ void
-xf_outl(unsigned short port, unsigned int val)
-{
-    outl(val, port);
-}
-
-#define outb xf_outb
-#define outw xf_outw
-#define outl xf_outl
-
 #elif defined(__nds32__)
 
 /*

Index: xsrc/external/mit/xorg-server/dist/hw/xfree86/drivers/modesetting/driver.h
diff -u xsrc/external/mit/xorg-server/dist/hw/xfree86/drivers/modesetting/driver.h:1.3 xsrc/external/mit/xorg-server/dist/hw/xfree86/drivers/modesetting/driver.h:1.4
--- xsrc/external/mit/xorg-server/dist/hw/xfree86/drivers/modesetting/driver.h:1.3	Mon Dec 31 09:50:00 2018
+++ xsrc/external/mit/xorg-server/dist/hw/xfree86/drivers/modesetting/driver.h	Sun Feb 23 10:26:22 2020
@@ -147,6 +147,7 @@ void ms_drm_abort_seq(ScrnInfoPtr scrn, 
 Bool ms_crtc_on(xf86CrtcPtr crtc);
 
 xf86CrtcPtr ms_dri2_crtc_covering_drawable(DrawablePtr pDraw);
+RRCrtcPtr   ms_randr_crtc_covering_drawable(DrawablePtr pDraw);
 
 int ms_get_crtc_ust_msc(xf86CrtcPtr crtc, uint64_t *ust, uint64_t *msc);
 
Index: xsrc/external/mit/xorg-server/dist/hw/xfree86/drivers/modesetting/present.c
diff -u xsrc/external/mit/xorg-server/dist/hw/xfree86/drivers/modesetting/present.c:1.3 xsrc/external/mit/xorg-server/dist/hw/xfree86/drivers/modesetting/present.c:1.4
--- xsrc/external/mit/xorg-server/dist/hw/xfree86/drivers/modesetting/present.c:1.3	Mon Dec 31 09:50:00 2018
+++ xsrc/external/mit/xorg-server/dist/hw/xfree86/drivers/modesetting/present.c	Sun Feb 23 10:26:22 2020
@@ -59,8 +59,7 @@ struct ms_present_vblank_event {
 static RRCrtcPtr
 ms_present_get_crtc(WindowPtr window)
 {
-    xf86CrtcPtr xf86_crtc = ms_dri2_crtc_covering_drawable(&window->drawable);
-    return xf86_crtc ? xf86_crtc->randr_crtc : NULL;
+    return ms_randr_crtc_covering_drawable(&window->drawable);
 }
 
 static int

Index: xsrc/external/mit/xorg-server/dist/hw/xfree86/drivers/modesetting/vblank.c
diff -u xsrc/external/mit/xorg-server/dist/hw/xfree86/drivers/modesetting/vblank.c:1.4 xsrc/external/mit/xorg-server/dist/hw/xfree86/drivers/modesetting/vblank.c:1.5
--- xsrc/external/mit/xorg-server/dist/hw/xfree86/drivers/modesetting/vblank.c:1.4	Mon Dec 31 09:50:00 2018
+++ xsrc/external/mit/xorg-server/dist/hw/xfree86/drivers/modesetting/vblank.c	Sun Feb 23 10:26:22 2020
@@ -77,6 +77,28 @@ static void ms_crtc_box(xf86CrtcPtr crtc
         crtc_box->x1 = crtc_box->x2 = crtc_box->y1 = crtc_box->y2 = 0;
 }
 
+static void ms_randr_crtc_box(RRCrtcPtr crtc, BoxPtr crtc_box)
+{
+    if (crtc->mode) {
+        crtc_box->x1 = crtc->x;
+        crtc_box->y1 = crtc->y;
+        switch (crtc->rotation) {
+            case RR_Rotate_0:
+            case RR_Rotate_180:
+            default:
+                crtc_box->x2 = crtc->x + crtc->mode->mode.width;
+                crtc_box->y2 = crtc->y + crtc->mode->mode.height;
+                break;
+            case RR_Rotate_90:
+            case RR_Rotate_270:
+                crtc_box->x2 = crtc->x + crtc->mode->mode.height;
+                crtc_box->y2 = crtc->y + crtc->mode->mode.width;
+                break;
+        }
+    } else
+        crtc_box->x1 = crtc_box->x2 = crtc_box->y1 = crtc_box->y2 = 0;
+}
+
 static int ms_box_area(BoxPtr box)
 {
     return (int)(box->x2 - box->x1) * (int)(box->y2 - box->y1);
@@ -91,12 +113,45 @@ ms_crtc_on(xf86CrtcPtr crtc)
 }
 
 /*
+ * Return the first output which is connected to an active CRTC on this screen.
+ *
+ * RRFirstOutput() will return an output from a slave screen if it is primary,
+ * which is not the behavior that ms_covering_crtc() wants.
+ */
+
+static RROutputPtr ms_first_output(ScreenPtr pScreen)
+{
+    rrScrPriv(pScreen);
+    RROutputPtr output;
+    int i, j;
+
+    if (!pScrPriv)
+        return NULL;
+
+    if (pScrPriv->primaryOutput && pScrPriv->primaryOutput->crtc &&
+        (pScrPriv->primaryOutput->pScreen == pScreen)) {
+        return pScrPriv->primaryOutput;
+    }
+
+    for (i = 0; i < pScrPriv->numCrtcs; i++) {
+        RRCrtcPtr crtc = pScrPriv->crtcs[i];
+
+        for (j = 0; j < pScrPriv->numOutputs; j++) {
+            output = pScrPriv->outputs[j];
+            if (output->crtc == crtc)
+                return output;
+        }
+    }
+    return NULL;
+}
+
+/*
  * Return the crtc covering 'box'. If two crtcs cover a portion of
  * 'box', then prefer the crtc with greater coverage.
  */
 
 static xf86CrtcPtr
-ms_covering_crtc(ScreenPtr pScreen, BoxPtr box, Bool screen_is_ms)
+ms_covering_xf86_crtc(ScreenPtr pScreen, BoxPtr box, Bool screen_is_ms)
 {
     ScrnInfoPtr scrn = xf86ScreenToScrn(pScreen);
     xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
@@ -108,6 +163,10 @@ ms_covering_crtc(ScreenPtr pScreen, BoxP
 
     best_crtc = NULL;
     best_coverage = 0;
+
+    if (!xf86_config)
+        return NULL;
+
     for (c = 0; c < xf86_config->num_crtc; c++) {
         crtc = xf86_config->crtc[c];
 
@@ -135,7 +194,7 @@ ms_covering_crtc(ScreenPtr pScreen, BoxP
         ScreenPtr slave;
 
         if (dixPrivateKeyRegistered(rrPrivKey))
-            primary_output = RRFirstOutput(scrn->pScreen);
+            primary_output = ms_first_output(scrn->pScreen);
         if (!primary_output || !primary_output->crtc)
             return NULL;
 
@@ -147,7 +206,74 @@ ms_covering_crtc(ScreenPtr pScreen, BoxP
             if (!slave->is_output_slave)
                 continue;
 
-            if (ms_covering_crtc(slave, box, FALSE)) {
+            if (ms_covering_xf86_crtc(slave, box, FALSE)) {
+                /* The drawable is on a slave output, return primary crtc */
+                return crtc;
+            }
+        }
+    }
+
+    return best_crtc;
+}
+
+static RRCrtcPtr
+ms_covering_randr_crtc(ScreenPtr pScreen, BoxPtr box, Bool screen_is_ms)
+{
+    ScrnInfoPtr scrn = xf86ScreenToScrn(pScreen);
+    rrScrPrivPtr pScrPriv = rrGetScrPriv(pScreen);
+    RRCrtcPtr crtc, best_crtc;
+    int coverage, best_coverage;
+    int c;
+    BoxRec crtc_box, cover_box;
+    Bool crtc_on;
+
+    best_crtc = NULL;
+    best_coverage = 0;
+
+    if (!pScrPriv)
+        return NULL;
+
+    for (c = 0; c < pScrPriv->numCrtcs; c++) {
+        crtc = pScrPriv->crtcs[c];
+
+        if (screen_is_ms) {
+            crtc_on = ms_crtc_on((xf86CrtcPtr) crtc->devPrivate);
+        } else {
+            crtc_on = !!crtc->mode;
+        }
+
+        /* If the CRTC is off, treat it as not covering */
+        if (!crtc_on)
+            continue;
+
+        ms_randr_crtc_box(crtc, &crtc_box);
+        ms_box_intersect(&cover_box, &crtc_box, box);
+        coverage = ms_box_area(&cover_box);
+        if (coverage > best_coverage) {
+            best_crtc = crtc;
+            best_coverage = coverage;
+        }
+    }
+
+    /* Fallback to primary crtc for drawable's on slave outputs */
+    if (best_crtc == NULL && !pScreen->isGPU) {
+        RROutputPtr primary_output = NULL;
+        ScreenPtr slave;
+
+        if (dixPrivateKeyRegistered(rrPrivKey))
+            primary_output = ms_first_output(scrn->pScreen);
+        if (!primary_output || !primary_output->crtc)
+            return NULL;
+
+        crtc = primary_output->crtc;
+        if (!ms_crtc_on((xf86CrtcPtr) crtc->devPrivate))
+            return NULL;
+
+        xorg_list_for_each_entry(slave, &pScreen->slave_list, slave_head) {
+            if (!slave->is_output_slave)
+                continue;
+
+            if (ms_covering_randr_crtc(slave, box, FALSE)) {
                 /* The drawable is on a slave output, return primary crtc */
                 return crtc;
             }
@@ -168,7 +294,21 @@ ms_dri2_crtc_covering_drawable(DrawableP
     box.x2 = box.x1 + pDraw->width;
     box.y2 = box.y1 + pDraw->height;
 
-    return ms_covering_crtc(pScreen, &box, TRUE);
+    return ms_covering_xf86_crtc(pScreen, &box, TRUE);
+}
+
+RRCrtcPtr
+ms_randr_crtc_covering_drawable(DrawablePtr pDraw)
+{
+    ScreenPtr pScreen = pDraw->pScreen;
+    BoxRec box;
+
+    box.x1 = pDraw->x;
+    box.y1 = pDraw->y;
+    box.x2 = box.x1 + pDraw->width;
+    box.y2 = box.y1 + pDraw->height;
+
+    return ms_covering_randr_crtc(pScreen, &box, TRUE);
 }
 
 static Bool

Index: xsrc/external/mit/xorg-server/dist/hw/xfree86/modes/xf86RandR12.c
diff -u xsrc/external/mit/xorg-server/dist/hw/xfree86/modes/xf86RandR12.c:1.5 xsrc/external/mit/xorg-server/dist/hw/xfree86/modes/xf86RandR12.c:1.6
--- xsrc/external/mit/xorg-server/dist/hw/xfree86/modes/xf86RandR12.c:1.5	Sun Mar  3 22:01:09 2019
+++ xsrc/external/mit/xorg-server/dist/hw/xfree86/modes/xf86RandR12.c	Sun Feb 23 10:26:22 2020
@@ -2226,6 +2226,7 @@ xf86CrtcLeaseTerminated(RRLeasePtr lease
 {
     int c;
     int o;
+    ScrnInfoPtr scrn = xf86ScreenToScrn(lease->screen);
 
     RRLeaseTerminated(lease);
     /*
@@ -2256,6 +2257,10 @@ xf86CrtcLeaseTerminated(RRLeasePtr lease
             xf86CrtcCheckReset(crtc);
         }
     }
+
+    /* Power off if necessary */
+    xf86DisableUnusedFunctions(scrn);
+
     RRLeaseFree(lease);
 }
 

Index: xsrc/external/mit/xorg-server/dist/include/dix-config.h.in
diff -u xsrc/external/mit/xorg-server/dist/include/dix-config.h.in:1.4 xsrc/external/mit/xorg-server/dist/include/dix-config.h.in:1.5
--- xsrc/external/mit/xorg-server/dist/include/dix-config.h.in:1.4	Mon Dec 31 09:50:02 2018
+++ xsrc/external/mit/xorg-server/dist/include/dix-config.h.in	Sun Feb 23 10:26:22 2020
@@ -134,6 +134,9 @@
 /* Define to 1 if you have the <linux/fb.h> header file. */
 #undef HAVE_LINUX_FB_H
 
+/* Define to 1 if you have the `memfd_create' function. */
+#undef HAVE_MEMFD_CREATE
+
 /* Define to 1 if you have the `mkostemp' function. */
 #undef HAVE_MKOSTEMP
 
@@ -461,9 +464,6 @@
 /* Wrap SIGBUS to catch MIT-SHM faults */
 #undef BUSFAULT
 
-/* Directory for shared memory temp files */
-#undef SHMDIR
-
 /* Don't let Xdefs.h define 'pointer' */
 #define _XTYPEDEF_POINTER       1
 
@@ -518,4 +518,7 @@
 /* Have epoll_create1() */
 #undef HAVE_EPOLL_CREATE1
 
+/* Have isastream */
+#undef HAVE_ISASTREAM
+
 #endif /* _DIX_CONFIG_H_ */

Index: xsrc/external/mit/xorg-server/dist/mi/miscrinit.c
diff -u xsrc/external/mit/xorg-server/dist/mi/miscrinit.c:1.6 xsrc/external/mit/xorg-server/dist/mi/miscrinit.c:1.7
--- xsrc/external/mit/xorg-server/dist/mi/miscrinit.c:1.6	Thu Aug 11 00:04:35 2016
+++ xsrc/external/mit/xorg-server/dist/mi/miscrinit.c	Sun Feb 23 10:26:22 2020
@@ -124,6 +124,12 @@ miCloseScreen(ScreenPtr pScreen)
     return ((*pScreen->DestroyPixmap) ((PixmapPtr) pScreen->devPrivate));
 }
 
+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
@@ -243,7 +249,7 @@ miScreenInit(ScreenPtr pScreen, void *pb
     }
     /* else CloseScreen */
     /* QueryBestSize, SaveScreen, GetImage, GetSpans */
-    pScreen->SourceValidate = (SourceValidateProcPtr) 0;
+    pScreen->SourceValidate = miSourceValidate;
     /* CreateWindow, DestroyWindow, PositionWindow, ChangeWindowAttributes */
     /* RealizeWindow, UnrealizeWindow */
     pScreen->ValidateTree = miValidateTree;

Index: xsrc/external/mit/xorg-server/dist/os/connection.c
diff -u xsrc/external/mit/xorg-server/dist/os/connection.c:1.4 xsrc/external/mit/xorg-server/dist/os/connection.c:1.5
--- xsrc/external/mit/xorg-server/dist/os/connection.c:1.4	Mon Dec 31 09:50:02 2018
+++ xsrc/external/mit/xorg-server/dist/os/connection.c	Sun Feb 23 10:26:22 2020
@@ -937,6 +937,14 @@ AttendClient(ClientPtr client)
 {
     OsCommPtr oc = (OsCommPtr) client->osPrivate;
 
+    if (client->clientGone) {
+        /*
+         * client is gone, so any pending requests will be dropped and its
+         * ignore count doesn't matter.
+         */
+        return;
+    }
+
     client->ignoreCount--;
     if (client->ignoreCount)
         return;

Index: xsrc/external/mit/xorg-server/dist/render/render.c
diff -u xsrc/external/mit/xorg-server/dist/render/render.c:1.6 xsrc/external/mit/xorg-server/dist/render/render.c:1.7
--- xsrc/external/mit/xorg-server/dist/render/render.c:1.6	Thu Jan 10 16:48:37 2019
+++ xsrc/external/mit/xorg-server/dist/render/render.c	Sun Feb 23 10:26:22 2020
@@ -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,

Index: xsrc/external/mit/xorg-server/dist/xkb/xkb.c
diff -u xsrc/external/mit/xorg-server/dist/xkb/xkb.c:1.4 xsrc/external/mit/xorg-server/dist/xkb/xkb.c:1.5
--- xsrc/external/mit/xorg-server/dist/xkb/xkb.c:1.4	Mon Dec 31 09:50:03 2018
+++ xsrc/external/mit/xorg-server/dist/xkb/xkb.c	Sun Feb 23 10:26:23 2020
@@ -2110,6 +2110,9 @@ SetKeySyms(ClientPtr client,
                 }
             }
         }
+        if (XkbKeyHasActions(xkb, i + req->firstKeySym))
+            XkbResizeKeyActions(xkb, i + req->firstKeySym,
+                                XkbNumGroups(wire->groupInfo) * wire->width);
         oldMap->kt_index[0] = wire->ktIndex[0];
         oldMap->kt_index[1] = wire->ktIndex[1];
         oldMap->kt_index[2] = wire->ktIndex[2];
@@ -2383,6 +2386,9 @@ _XkbSetMapChecks(ClientPtr client, Devic
     XkbSymMapPtr map;
     int i;
 
+    if (!dev->key)
+        return 0;
+
     xkbi = dev->key->xkbInfo;
     xkb = xkbi->desc;
 
@@ -2495,6 +2501,9 @@ _XkbSetMap(ClientPtr client, DeviceIntPt
     XkbSrvInfoPtr xkbi;
     XkbDescPtr xkb;
 
+    if (!dev->key)
+        return Success;
+
     xkbi = dev->key->xkbInfo;
     xkb = xkbi->desc;
 

Reply via email to