--- /dev/null
+diff --git a/unix/xserver/hw/vnc/xorg-version.h b/unix/xserver/hw/vnc/xorg-version.h
+index 9d1c0eb8..16145711 100644
+--- a/unix/xserver/hw/vnc/xorg-version.h
++++ b/unix/xserver/hw/vnc/xorg-version.h
+@@ -52,8 +52,10 @@
+ #define XORG 118
+ #elif XORG_VERSION_CURRENT < ((1 * 10000000) + (19 * 100000) + (99 * 1000))
+ #define XORG 119
++#elif XORG_VERSION_CURRENT < ((1 * 10000000) + (20 * 100000) + (99 * 1000))
++#define XORG 120
+ #else
+-#error "X.Org newer than 1.19 is not supported"
++#error "X.Org newer than 1.20 is not supported"
+ #endif
+
+ #endif
+diff --git a/unix/xserver/hw/vnc/xvnc.c b/unix/xserver/hw/vnc/xvnc.c
+index 57152cd5..9a61b1ef 100644
+--- a/unix/xserver/hw/vnc/xvnc.c
++++ b/unix/xserver/hw/vnc/xvnc.c
+@@ -84,6 +84,7 @@ from the X Consortium.
+ #undef VENDOR_STRING
+ #include "version-config.h"
+ #include "site.h"
++#include <glx_extinit.h>
+
+ #define XVNCVERSION "TigerVNC 1.8.0"
+ #define XVNCCOPYRIGHT ("Copyright (C) 1999-2017 TigerVNC Team and many others (see README.txt)\n" \
+@@ -203,6 +204,7 @@ vfbBitsPerPixel(int depth)
+ static void vfbFreeFramebufferMemory(vfbFramebufferInfoPtr pfb);
+
+ #ifdef DPMSExtension
++#if XORG < 120
+ /* Why support DPMS? Because stupid modern desktop environments
+ such as Unity 2D on Ubuntu 11.10 crashes if DPMS is not
+ available. (DPMSSet is called by dpms.c, but the return value
+@@ -219,6 +221,7 @@ Bool DPMSSupported(void)
+ return FALSE;
+ }
+ #endif
++#endif
+
+ #if XORG < 111
+ void ddxGiveUp()
+@@ -1696,6 +1699,10 @@ InitOutput(ScreenInfo *scrInfo, int argc
+
+ vncPrintBanner();
+
++#if XORG >= 120
++ xorgGlxCreateVendor();
++#else
++
+ #if XORG >= 113
+ #ifdef GLXEXT
+ if (serverGeneration == 1)
+@@ -1707,6 +1714,8 @@ InitOutput(ScreenInfo *scrInfo, int argc
+ #endif
+ #endif
+
++#endif
++
+ /* initialize pixmap formats */
+
+ /* must have a pixmap depth to match every screen depth */
-diff -up xserver/configure.ac.xserver116-rebased xserver/configure.ac
---- xserver/configure.ac.xserver116-rebased 2016-09-29 13:14:45.595441590 +0200
-+++ xserver/configure.ac 2016-09-29 13:14:45.631442006 +0200
+Index: xserver/configure.ac
+===================================================================
+--- xserver.orig/configure.ac
++++ xserver/configure.ac
@@ -74,6 +74,7 @@ dnl forcing an entire recompile.x
AC_CONFIG_HEADERS(include/version-config.h)
AC_PROG_LN_S
LT_PREREQ([2.2])
LT_INIT([disable-static win32-dll])
-@@ -1863,6 +1864,10 @@ if test "x$XVFB" = xyes; then
+@@ -1777,6 +1778,10 @@ if test "x$XVFB" = xyes; then
AC_SUBST([XVFB_SYS_LIBS])
fi
dnl Xnest DDX
-@@ -1898,6 +1903,8 @@ if test "x$XORG" = xauto; then
+@@ -1812,6 +1817,8 @@ if test "x$XORG" = xauto; then
fi
AC_MSG_RESULT([$XORG])
if test "x$XORG" = xyes; then
XORG_DDXINCS='-I$(top_srcdir)/hw/xfree86 -I$(top_srcdir)/hw/xfree86/include -I$(top_srcdir)/hw/xfree86/common'
XORG_OSINCS='-I$(top_srcdir)/hw/xfree86/os-support -I$(top_srcdir)/hw/xfree86/os-support/bus -I$(top_srcdir)/os'
-@@ -2116,7 +2123,6 @@ if test "x$XORG" = xyes; then
+@@ -2029,7 +2036,6 @@ if test "x$XORG" = xyes; then
AC_DEFINE(XORG_SERVER, 1, [Building Xorg server])
AC_DEFINE(XORGSERVER, 1, [Building Xorg server])
AC_DEFINE(XFree86Server, 1, [Building XFree86 server])
AC_DEFINE(NEED_XF86_TYPES, 1, [Need XFree86 typedefs])
AC_DEFINE(NEED_XF86_PROTOTYPES, 1, [Need XFree86 helper functions])
AC_DEFINE(__XSERVERNAME__, "Xorg", [Name of X server])
-@@ -2691,6 +2697,7 @@ hw/dmx/Makefile
+@@ -2565,6 +2571,7 @@ hw/dmx/Makefile
hw/dmx/man/Makefile
hw/vfb/Makefile
hw/vfb/man/Makefile
hw/xnest/Makefile
hw/xnest/man/Makefile
hw/xwin/Makefile
-diff -up xserver/hw/Makefile.am.xserver116-rebased xserver/hw/Makefile.am
---- xserver/hw/Makefile.am.xserver116-rebased 2016-09-29 13:14:45.601441659 +0200
-+++ xserver/hw/Makefile.am 2016-09-29 13:14:45.631442006 +0200
+Index: xserver/hw/Makefile.am
+===================================================================
+--- xserver.orig/hw/Makefile.am
++++ xserver/hw/Makefile.am
@@ -38,7 +38,8 @@ SUBDIRS = \
$(DMX_SUBDIRS) \
$(KDRIVE_SUBDIRS) \
DIST_SUBDIRS = dmx xfree86 vfb xnest xwin xquartz kdrive xwayland
-diff -up xserver/mi/miinitext.c.xserver116-rebased xserver/mi/miinitext.c
---- xserver/mi/miinitext.c.xserver116-rebased 2016-09-29 13:14:45.618441855 +0200
-+++ xserver/mi/miinitext.c 2016-09-29 13:14:45.631442006 +0200
-@@ -114,6 +114,10 @@ SOFTWARE.
- #include "micmap.h"
+Index: xserver/mi/miinitext.c
+===================================================================
+--- xserver.orig/mi/miinitext.c
++++ xserver/mi/miinitext.c
+@@ -107,8 +107,15 @@ SOFTWARE.
+ #include "os.h"
#include "globals.h"
+#ifdef TIGERVNC
-+extern void vncExtensionInit(INITARGS);
++extern void vncExtensionInit(void);
+#endif
+
- /* The following is only a small first step towards run-time
- * configurable extensions.
- */
-@@ -238,6 +242,9 @@ EnableDisableExtensionError(const char *
-
/* List of built-in (statically linked) extensions */
static const ExtensionModule staticExtensions[] = {
+#ifdef TIGERVNC
{GEExtensionInit, "Generic Event Extension", &noGEExtension},
{ShapeExtensionInit, "SHAPE", NULL},
#ifdef MITSHM
---- xserver/include/os.h~ 2016-10-03 09:07:29.000000000 +0200
-+++ xserver/include/os.h 2016-10-03 14:13:00.013654506 +0200
-@@ -621,7 +621,7 @@
- extern _X_EXPORT void
- LogClose(enum ExitCode error);
- extern _X_EXPORT Bool
--LogSetParameter(LogParameter param, int value);
-+LogSetParameter(enum _LogParameter param, int value);
- extern _X_EXPORT void
- LogVWrite(int verb, const char *f, va_list args)
- _X_ATTRIBUTE_PRINTF(2, 0);
+diff -ur xserver.orig/dri3/Makefile.am xserver/dri3/Makefile.am
+--- xserver.orig/dri3/Makefile.am 2018-05-10 16:32:34.000000000 +0000
++++ xserver/dri3/Makefile.am 2018-07-04 13:08:37.614326450 +0000
+@@ -1,7 +1,7 @@
+ noinst_LTLIBRARIES = libdri3.la
+ AM_CFLAGS = \
+ -DHAVE_XORG_CONFIG_H \
+- @DIX_CFLAGS@ @XORG_CFLAGS@
++ @DIX_CFLAGS@ @XORG_CFLAGS@ @LIBDRM_CFLAGS@
+
+ libdri3_la_SOURCES = \
+ dri3.h \