debian/changelog | 17 debian/control | 21 debian/patches/xmir.patch | 8267 +++++++++++++++++++++++++++++++-------- debian/xmir.install | 1 debian/xserver-xorg-xmir.install | 1 5 files changed, 6810 insertions(+), 1497 deletions(-)
New commits: commit 9b443b87d14e528732e090eb9611812e22cb60e7 Author: Timo Aaltonen <tjaal...@debian.org> Date: Wed Jun 3 11:53:48 2015 +0300 xserver-xorg-xmir.install: Removed, not used anymore. diff --git a/debian/changelog b/debian/changelog index b1328e6..743d57b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +xorg-server (2:1.17.1-0ubuntu5) UNRELEASED; urgency=medium + + * xserver-xorg-xmir.install: Removed, not used anymore. + + -- Timo Aaltonen <tjaal...@debian.org> Wed, 03 Jun 2015 11:41:03 +0300 + xorg-server (2:1.17.1-0ubuntu4) wily; urgency=medium * debian/control: diff --git a/debian/xserver-xorg-xmir.install b/debian/xserver-xorg-xmir.install deleted file mode 100644 index d710363..0000000 --- a/debian/xserver-xorg-xmir.install +++ /dev/null @@ -1 +0,0 @@ -main/usr/lib/xorg/modules/extensions/libxmir.so usr/lib/xorg/modules/extensions commit 1f9a32c290ba5744c6ec46c6afd0137a281ecbf7 Author: Timo Aaltonen <tjaal...@debian.org> Date: Wed Jun 3 11:40:14 2015 +0300 import 1.17.1-0ubuntu4 diff --git a/debian/changelog b/debian/changelog index 66888c3..b1328e6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,14 @@ +xorg-server (2:1.17.1-0ubuntu4) wily; urgency=medium + + * debian/control: + - Rename xserver-xorg-xmir to xmir + - Build build-depends on libmirclient to 0.13.1 + * debian/xmir.install: + * debian/patches/xmir.patch: + - Use new XMir implementation + + -- Robert Ancell <robert.anc...@canonical.com> Wed, 03 Jun 2015 14:21:10 +1200 + xorg-server (2:1.17.1-0ubuntu3) vivid; urgency=medium * Add a patch to fix vesa int10 failure. (LP: #1433198) diff --git a/debian/control b/debian/control index 1f23b0c..3fe7c76 100644 --- a/debian/control +++ b/debian/control @@ -96,7 +96,7 @@ Build-Depends: # xwayland libwayland-dev [linux-any], # XMir - libmirclient-dev (>= 0.4.0) [!arm64 !powerpc !ppc64el], + libmirclient-dev (>= 0.13.1) [!arm64 !powerpc !ppc64el], libatomic-ops-dev, Standards-Version: 3.9.2 Vcs-Git: git://git.debian.org/git/pkg-xorg/xserver/xorg-server @@ -363,15 +363,24 @@ Recommends: Description: common files used by various X servers This package provides files necessary for all X.Org based X servers. -Package: xserver-xorg-xmir +Package: xmir Architecture: amd64 armhf i386 Depends: ${shlibs:Depends}, ${misc:Depends}, - xserver-xorg-core (= ${binary:Version}), -Description: Xorg - the X.Org X server (module for running nested in Mir) - xserver-xorg-xmir provides an extension module to support running an - Xorg as a client of an existing Mir compositor. +Description: Xmir X server + This package provides an X server running on top of Mir, using Mir + input devices for input and forwarding either the root window or individual + top-level windows as wayland surfaces. + +Package: xserver-xorg-xmir +Architecture: all +Depends: ${shlibs:Depends}, + ${misc:Depends}, + xmir, +Description: Xmir X server (transitional package) + This is a transitional package to ease upgrades to xmir. + It can be safely removed. Package: xorg-server-source Architecture: all diff --git a/debian/patches/xmir.patch b/debian/patches/xmir.patch index eb90f59..ad40d3a 100644 --- a/debian/patches/xmir.patch +++ b/debian/patches/xmir.patch @@ -1,299 +1,307 @@ +From da18c3b8c7bd4ce3a2a1210d425272cbded19246 Mon Sep 17 00:00:00 2001 +From: Robert Ancell <robert.anc...@canonical.com> +Date: Fri, 15 May 2015 14:58:59 +1200 +Subject: [PATCH 4/5] Add XMir + +--- + composite/compalloc.c | 6 + + composite/compositeext.h | 3 + + configure.ac | 25 + + glx/glxdri2.c | 16 +- + hw/Makefile.am | 9 +- + hw/xmir/.gitignore | 1 + + hw/xmir/Makefile.am | 61 ++ + hw/xmir/dri2/Makefile.am | 14 + + hw/xmir/dri2/dri2.c | 1398 +++++++++++++++++++++++++++++++++++++++++++ + hw/xmir/dri2/dri2.h | 364 +++++++++++ + hw/xmir/dri2/dri2ext.c | 683 +++++++++++++++++++++ + hw/xmir/dri2/dri2int.h | 26 + + hw/xmir/xmir-cursor.c | 214 +++++++ + hw/xmir/xmir-cvt.c | 304 ++++++++++ + hw/xmir/xmir-dri2.c | 473 +++++++++++++++ + hw/xmir/xmir-glamor.c | 1229 +++++++++++++++++++++++++++++++++++++ + hw/xmir/xmir-input.c | 539 +++++++++++++++++ + hw/xmir/xmir-output.c | 454 ++++++++++++++ + hw/xmir/xmir-thread-proxy.c | 132 ++++ + hw/xmir/xmir.c | 1013 +++++++++++++++++++++++++++++++ + hw/xmir/xmir.h | 211 +++++++ + 21 files changed, 7167 insertions(+), 8 deletions(-) + create mode 100644 hw/xmir/.gitignore + create mode 100644 hw/xmir/Makefile.am + create mode 100644 hw/xmir/dri2/Makefile.am + create mode 100644 hw/xmir/dri2/dri2.c + create mode 100644 hw/xmir/dri2/dri2.h + create mode 100644 hw/xmir/dri2/dri2ext.c + create mode 100644 hw/xmir/dri2/dri2int.h + create mode 100644 hw/xmir/xmir-cursor.c + create mode 100644 hw/xmir/xmir-cvt.c + create mode 100644 hw/xmir/xmir-dri2.c + create mode 100644 hw/xmir/xmir-glamor.c + create mode 100644 hw/xmir/xmir-input.c + create mode 100644 hw/xmir/xmir-output.c + create mode 100644 hw/xmir/xmir-thread-proxy.c + create mode 100644 hw/xmir/xmir.c + create mode 100644 hw/xmir/xmir.h + +diff --git a/composite/compalloc.c b/composite/compalloc.c +index 8daded0..fb1b476 100644 +--- a/composite/compalloc.c ++++ b/composite/compalloc.c +@@ -46,6 +46,7 @@ + #endif + + #include "compint.h" ++#include "compositeext.h" + + static void + compScreenUpdate(ScreenPtr pScreen) +@@ -411,6 +412,11 @@ compRedirectSubwindows(ClientPtr pClient, WindowPtr pWin, int update) + return Success; + } + ++int CompositeRedirectSubwindows (WindowPtr pWin, int update) ++{ ++ return compRedirectSubwindows (serverClient, pWin, update); ++} ++ + /* + * Free one of the per-client per-subwindows resources, + * which frees one redirect per subwindow +diff --git a/composite/compositeext.h b/composite/compositeext.h +index b96cb1d..f279013 100644 +--- a/composite/compositeext.h ++++ b/composite/compositeext.h +@@ -35,6 +35,9 @@ extern _X_EXPORT Bool CompositeRegisterAlternateVisuals(ScreenPtr pScreen, + VisualID * vids, + int nVisuals); + ++extern _X_EXPORT int CompositeRedirectSubwindows(WindowPtr pWin, ++ int update); ++ + extern _X_EXPORT Bool CompositeRegisterImplicitRedirectionException(ScreenPtr pScreen, + VisualID parentVisual, + VisualID winVisual); +diff --git a/configure.ac b/configure.ac +index 4e47bbc..7a42775 100644 --- a/configure.ac +++ b/configure.ac -@@ -621,6 +621,7 @@ - AC_ARG_ENABLE(linux_apm, AS_HELP_STRING([--disable-linux-apm], [Disable building APM support on Linux (if available).]), [enable_linux_apm=$enableval], [enable_linux_apm=yes]) - AC_ARG_ENABLE(systemd-logind, AS_HELP_STRING([--enable-systemd-logind], [Build systemd-logind support (default: auto)]), [SYSTEMD_LOGIND=$enableval], [SYSTEMD_LOGIND=auto]) - AC_ARG_ENABLE(suid-wrapper, AS_HELP_STRING([--enable-suid-wrapper], [Build suid-root wrapper for legacy driver support on rootless xserver systems (default: no)]), [SUID_WRAPPER=$enableval], [SUID_WRAPPER=no]) -+AC_ARG_ENABLE(xmir, AS_HELP_STRING([--enable-xmir], [Build support for nesting in Mir (default: auto)]), [XMIR=$enableval], [XMIR=auto]) +@@ -624,6 +624,7 @@ AC_ARG_ENABLE(xvfb, AS_HELP_STRING([--enable-xvfb], [Build Xvfb server + AC_ARG_ENABLE(xnest, AS_HELP_STRING([--enable-xnest], [Build Xnest server (default: auto)]), [XNEST=$enableval], [XNEST=auto]) + AC_ARG_ENABLE(xquartz, AS_HELP_STRING([--enable-xquartz], [Build Xquartz server for OS-X (default: auto)]), [XQUARTZ=$enableval], [XQUARTZ=auto]) + AC_ARG_ENABLE(xwayland, AS_HELP_STRING([--enable-xwayland], [Build Xwayland server (default: auto)]), [XWAYLAND=$enableval], [XWAYLAND=auto]) ++AC_ARG_ENABLE(xmir, AS_HELP_STRING([--enable-xmir], [Build Xmir server (default: auto)]), [XMIR=$enableval], [XMIR=auto]) + AC_ARG_ENABLE(standalone-xpbproxy, AS_HELP_STRING([--enable-standalone-xpbproxy], [Build a standalone xpbproxy (in addition to the one integrated into Xquartz as a separate thread) (default: no)]), [STANDALONE_XPBPROXY=$enableval], [STANDALONE_XPBPROXY=no]) + AC_ARG_ENABLE(xwin, AS_HELP_STRING([--enable-xwin], [Build XWin server (default: auto)]), [XWIN=$enableval], [XWIN=auto]) + AC_ARG_ENABLE(glamor, AS_HELP_STRING([--enable-glamor], [Build glamor dix module (default: no)]), [GLAMOR=$enableval], [GLAMOR=no]) +@@ -745,6 +746,7 @@ case $host_os in + XVFB=no + XNEST=no + XWAYLAND=no ++ XMIR=no - dnl DDXes. - AC_ARG_ENABLE(xorg, AS_HELP_STRING([--enable-xorg], [Build Xorg server (default: auto)]), [XORG=$enableval], [XORG=auto]) -@@ -1368,6 +1369,15 @@ - SDK_REQUIRED_MODULES="$SDK_REQUIRED_MODULES $XINERAMAPROTO" + COMPOSITE=no + DGA=no +@@ -2472,6 +2474,27 @@ if test "x$XWAYLAND" = xyes; then + [${WAYLAND_PREFIX}/bin$PATH_SEPARATOR$PATH]) fi -+if test "x$XMIR" != xno; then -+ PKG_CHECK_MODULES([XMIR], [mirclient], [XMIR=yes], [XMIR=no]) -+ AC_SUBST([XMIR_LIBS]) -+ AC_SUBST([XMIR_CFLAGS]) -+ AC_DEFINE(XMIR, 1, [Support wayland mode]) -+ SDK_REQUIRED_MODULES="$SDK_REQUIRED_MODULES mirclient" ++dnl Xmir DDX ++ ++PKG_CHECK_MODULES(XMIRMODULES, [mirclient >= 0.13.1 libdrm epoxy], [have_xmir=yes], [have_xmir=no]) ++AC_MSG_CHECKING([whether to build Xmir DDX]) ++if test "x$XMIR" = xauto; then ++ XMIR="$have_xmir" +fi ++AC_MSG_RESULT([$XMIR]) +AM_CONDITIONAL(XMIR, [test "x$XMIR" = xyes]) + - AM_CONDITIONAL(XACE, [test "x$XACE" = xyes]) - if test "x$XACE" = xyes; then - AC_DEFINE(XACE, 1, [Build X-ACE extension]) -@@ -2608,6 +2618,7 @@ - hw/xfree86/utils/man/Makefile - hw/xfree86/utils/cvt/Makefile - hw/xfree86/utils/gtf/Makefile -+hw/xfree86/xmir/Makefile - hw/dmx/config/Makefile - hw/dmx/config/man/Makefile - hw/dmx/doc/Makefile ---- a/hw/xfree86/Makefile.am -+++ b/hw/xfree86/Makefile.am -@@ -34,11 +34,15 @@ - INT10_SUBDIR = int10 - endif - -+if XMIR -+XMIR_SUBDIR = xmir -+endif ++if test "x$XMIR" = xyes; then ++ if test "x$have_xmir" = xno; then ++ AC_MSG_ERROR([Xmir build explicitly requested, but required modules not found.]) ++ fi ++ ++ XMIR_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" ++ XMIR_SYS_LIBS="$XMIRMODULES_LIBS $GLX_SYS_LIBS" ++ AC_SUBST([XMIR_LIBS]) ++ AC_SUBST([XMIR_SYS_LIBS]) ++fi + - SUBDIRS = common ddc x86emu $(INT10_SUBDIR) os-support parser \ - ramdac $(VGAHW_SUBDIR) loader modes $(DRI_SUBDIR) \ - $(DRI2_SUBDIR) . $(VBE_SUBDIR) i2c dixmods \ - fbdevhw shadowfb exa $(XF86UTILS_SUBDIR) doc man \ -- $(GLAMOR_EGL_SUBDIR) drivers -+ $(GLAMOR_EGL_SUBDIR) $(XMIR_SUBDIR) drivers - - DIST_SUBDIRS = common ddc i2c x86emu int10 fbdevhw os-support \ - parser ramdac shadowfb vbe vgahw \ ---- a/hw/xfree86/common/xf86Config.c -+++ b/hw/xfree86/common/xf86Config.c -@@ -118,6 +118,7 @@ - {.name = "fb",.toLoad = TRUE,.load_opt = NULL}, - {.name = "shadow",.toLoad = TRUE,.load_opt = NULL}, - #endif -+ {.name = "xmir", .toLoad = FALSE, .load_opt = NULL}, - {.name = NULL,.toLoad = FALSE,.load_opt = NULL} - }; -@@ -272,6 +273,17 @@ - return NULL; + dnl and the rest of these are generic, so they're in config.h + dnl +@@ -2620,6 +2643,8 @@ hw/kdrive/fbdev/Makefile + hw/kdrive/linux/Makefile + hw/kdrive/src/Makefile + hw/xwayland/Makefile ++hw/xmir/Makefile ++hw/xmir/dri2/Makefile + test/Makefile + test/xi1/Makefile + test/xi2/Makefile +diff --git a/glx/glxdri2.c b/glx/glxdri2.c +index bcd57a4..32bfb1b 100644 +--- a/glx/glxdri2.c ++++ b/glx/glxdri2.c +@@ -361,8 +361,10 @@ __glXDRIscreenDestroy(__GLXscreen * baseScreen) + free(screen->driConfigs); } -+ /* -+ * Set the xmir module to autoload if requested. -+ */ -+ if (xorgMir) { -+ for (i=0 ; ModuleDefaults[i].name != NULL ; i++) { -+ if (strcmp(ModuleDefaults[i].name, "xmir") == 0) { -+ ModuleDefaults[i].toLoad = TRUE; -+ } -+ } +- pScrn->EnterVT = screen->enterVT; +- pScrn->LeaveVT = screen->leaveVT; ++ if (pScrn) { ++ pScrn->EnterVT = screen->enterVT; ++ pScrn->LeaveVT = screen->leaveVT; + } -+ - if (xf86configptr->conf_modules) { - /* Walk the disable list and let people know what we've parsed to - * not be loaded ---- a/hw/xfree86/common/xf86Events.c -+++ b/hw/xfree86/common/xf86Events.c -@@ -613,6 +613,10 @@ - { - DebugF("xf86VTSwitch()\n"); -+ /* Host Mir server handles VTs for XMir */ -+ if (xorgMir) -+ return; -+ - #ifdef XFreeXDGA - if (!DGAVTSwitch()) - return; ---- a/hw/xfree86/common/xf86Globals.c -+++ b/hw/xfree86/common/xf86Globals.c -@@ -206,3 +206,6 @@ - #endif - RootWinPropPtr *xf86RegisteredPropertiesTable = NULL; - Bool xorgHWAccess = FALSE; -+Bool xorgMir = FALSE; -+const char *mirID = NULL; -+const char *mirSocket = NULL; ---- a/hw/xfree86/common/xf86Helper.c -+++ b/hw/xfree86/common/xf86Helper.c -@@ -100,7 +100,14 @@ - if (xf86DriverList[drvIndex]->module) - UnloadModule(xf86DriverList[drvIndex]->module); - free(xf86DriverList[drvIndex]); -- xf86DriverList[drvIndex] = NULL; -+ -+ /* Compact xf86DriverList array, update xf86NumDrivers */ -+ xf86NumDrivers--; -+ if(drvIndex != xf86NumDrivers) -+ memmove(xf86DriverList + drvIndex, -+ xf86DriverList + drvIndex + 1, -+ sizeof(DriverPtr) * (xf86NumDrivers - drvIndex)); -+ xf86DriverList = realloc(xf86DriverList, xf86NumDrivers * sizeof(DriverPtr)); - } + free(screen); } +@@ -1007,10 +1009,12 @@ __glXDRIscreenProbe(ScreenPtr pScreen) + screen->base.GLXmajor = 1; + screen->base.GLXminor = 4; ---- a/hw/xfree86/common/xf86Init.c -+++ b/hw/xfree86/common/xf86Init.c -@@ -541,7 +541,7 @@ - * needed at this early stage. - */ - -- for (i = 0; i < xf86NumDrivers; i++) { -+ for (i = 0; i < xf86NumDrivers; ) { - xorgHWFlags flags = HW_IO; - - if (xf86DriverList[i]->Identify != NULL) -@@ -552,12 +552,22 @@ - GET_REQUIRED_HW_INTERFACES, - &flags); - -+ if (xorgMir && -+ (NEED_IO_ENABLED(flags) || !(flags & HW_SKIP_CONSOLE))) { -+ -+ ErrorF("Driver needs flags %lu, incompatible with nested, deleting.\n", flags); -+ xf86DeleteDriver(i); -+ continue; -+ } -+ - if (NEED_IO_ENABLED(flags)) - want_hw_access = TRUE; - - /* Non-seat0 X servers should not open console */ - if (!(flags & HW_SKIP_CONSOLE) && !ServerIsNotSeat0()) - xorgHWOpenConsole = TRUE; -+ -+ i++; - } - - if (xorgHWOpenConsole) -@@ -652,9 +662,13 @@ - } - - /* Remove (unload) drivers that are not required */ -- for (i = 0; i < xf86NumDrivers; i++) -- if (xf86DriverList[i] && xf86DriverList[i]->refCount <= 0) -+ for (i = 0; i < xf86NumDrivers; ) -+ if (xf86DriverList[i] && -+ !xf86DriverHasEntities(xf86DriverList[i]) && -+ xf86DriverList[i]->refCount <= 0) - xf86DeleteDriver(i); -+ else -+ i++; - - /* - * At this stage we know how many screens there are. -@@ -1492,6 +1506,17 @@ - xf86Info.ShareVTs = TRUE; - return 1; - } -+ if (!strcmp(argv[i], "-mir")) { -+ CHECK_FOR_REQUIRED_ARGUMENT(); -+ mirID = argv[++i]; -+ xorgMir = TRUE; -+ return 2; -+ } -+ if (!strcmp(argv[i], "-mirSocket")) { -+ CHECK_FOR_REQUIRED_ARGUMENT(); -+ mirSocket = argv[++i]; -+ return 2; +- screen->enterVT = pScrn->EnterVT; +- pScrn->EnterVT = glxDRIEnterVT; +- screen->leaveVT = pScrn->LeaveVT; +- pScrn->LeaveVT = glxDRILeaveVT; ++ if (pScrn) { ++ screen->enterVT = pScrn->EnterVT; ++ pScrn->EnterVT = glxDRIEnterVT; ++ screen->leaveVT = pScrn->LeaveVT; ++ pScrn->LeaveVT = glxDRILeaveVT; + } - /* OS-specific processing */ - return xf86ProcessArgument(argc, argv, i); -@@ -1565,6 +1590,8 @@ - ErrorF - ("-novtswitch don't automatically switch VT at reset & exit\n"); - ErrorF("-sharevts share VTs with another X server\n"); -+ ErrorF -+ ("-mir MirID run nested in a Mir compositor with app id MirID\n"); - /* OS-specific usage */ - xf86UseMsg(); - ErrorF("\n"); ---- a/hw/xfree86/common/xf86Priv.h -+++ b/hw/xfree86/common/xf86Priv.h -@@ -93,6 +93,9 @@ - extern _X_EXPORT const char *xf86VisualNames[]; - extern _X_EXPORT int xf86Verbose; /* verbosity level */ - extern _X_EXPORT int xf86LogVerbose; /* log file verbosity level */ -+extern _X_EXPORT Bool xorgMir; -+extern _X_EXPORT const char *mirID; -+extern _X_EXPORT const char *mirSocket; + __glXsetGetProcAddress(glXGetProcAddressARB); - extern _X_EXPORT RootWinPropPtr *xf86RegisteredPropertiesTable; - -@@ -150,6 +153,7 @@ - int num); - extern _X_EXPORT pmWait (*xf86PMConfirmEventToOs) (int fd, pmEvent event); +diff --git a/hw/Makefile.am b/hw/Makefile.am +index 19895dc..b7b958c 100644 +--- a/hw/Makefile.am ++++ b/hw/Makefile.am +@@ -30,6 +30,10 @@ if XWAYLAND + XWAYLAND_SUBDIRS = xwayland + endif ++if XMIR ++XMIR_SUBDIRS = xmir ++endif + - /* xf86Helper.c */ - extern _X_EXPORT void - xf86LogInit(void); ---- a/hw/xfree86/ramdac/xf86Cursor.c -+++ b/hw/xfree86/ramdac/xf86Cursor.c -@@ -58,7 +58,12 @@ - xf86CursorScreenPtr ScreenPriv; - miPointerScreenPtr PointPriv; - -- if (!xf86InitHardwareCursor(pScreen, infoPtr)) -+ infoPtr->pScrn = xf86ScreenToScrn(pScreen); -+ -+ /* If we can't create a hardware cursor don't bother initialising HW cursor support */ -+ if (infoPtr->MaxWidth != 0 && -+ infoPtr->MaxHeight != 0 && -+ !xf86InitHardwareCursor(pScreen, infoPtr)) - return FALSE; - - if (!dixRegisterPrivateKey(&xf86CursorScreenKeyRec, PRIVATE_SCREEN, 0)) ---- a/hw/xfree86/ramdac/xf86HWCurs.c -+++ b/hw/xfree86/ramdac/xf86HWCurs.c -@@ -114,8 +114,6 @@ - infoPtr->RealizeCursor = RealizeCursorInterleave0; - } + SUBDIRS = \ + $(XORG_SUBDIRS) \ + $(XWIN_SUBDIRS) \ +@@ -38,9 +42,10 @@ SUBDIRS = \ + $(DMX_SUBDIRS) \ + $(KDRIVE_SUBDIRS) \ + $(XQUARTZ_SUBDIRS) \ +- $(XWAYLAND_SUBDIRS) ++ $(XWAYLAND_SUBDIRS) \ ++ $(XMIR_SUBDIRS) -- infoPtr->pScrn = xf86ScreenToScrn(pScreen); -- - return TRUE; - } +-DIST_SUBDIRS = dmx xfree86 vfb xnest xwin xquartz kdrive xwayland ++DIST_SUBDIRS = dmx xfree86 vfb xnest xwin xquartz kdrive xwayland xmir + relink: + $(AM_V_at)for i in $(SUBDIRS) ; do $(MAKE) -C $$i relink || exit 1 ; done +diff --git a/hw/xmir/.gitignore b/hw/xmir/.gitignore +new file mode 100644 +index 0000000..b6a16d4 --- /dev/null -+++ b/hw/xfree86/xmir/#xmir.h# -@@ -0,0 +1,14 @@ ++++ b/hw/xmir/.gitignore +@@ -0,0 +1 @@ ++Xmir +diff --git a/hw/xmir/Makefile.am b/hw/xmir/Makefile.am +new file mode 100644 +index 0000000..e494091 +--- /dev/null ++++ b/hw/xmir/Makefile.am +@@ -0,0 +1,61 @@ ++bin_PROGRAMS = Xmir + -+typedef struct MirBufferInfo { -+ uint32_t name; -+ uint32_t stride; -+} MirBufferInfo; ++if DRI2 ++SUBDIRS = dri2 ++endif + -+typedef void (*XMirBufferReceivedProcPtr)(WindowPtr window, -+ MirBufferInfo *info); ++Xmir_CFLAGS = \ ++ -I$(top_srcdir)/glamor \ ++ -I$(srcdir)/dri2 \ ++ -I$(top_srcdir)/glx \ ++ -DHAVE_DIX_CONFIG_H \ ++ $(XMIRMODULES_CFLAGS) \ ++ $(DIX_CFLAGS) \ ++ $(GLAMOR_CFLAGS) \ ++ $(GBM_CFLAGS) ++ ++Xmir_SOURCES = \ ++ xmir.c \ ++ xmir-cursor.c \ ++ xmir-input.c \ ++ xmir-output.c \ ++ xmir-cvt.c \ ++ xmir-thread-proxy.c \ ++ xmir.h \ ++ $(top_srcdir)/Xi/stubs.c \ ++ $(top_srcdir)/mi/miinitext.c ++ ++Xmir_LDADD = \ ++ $(glamor_lib) \ ++ $(aiglx_lib) \ ++ $(XMIR_LIBS) \ ++ $(XMIR_SYS_LIBS) \ ++ $(XSERVER_SYS_LIBS) ++Xmir_LDFLAGS = $(LD_EXPORT_SYMBOLS_FLAG) ++ ++if GLAMOR_EGL ++Xmir_SOURCES += xmir-glamor.c ++ ++glamor_lib = $(top_builddir)/glamor/libglamor.la ++ ++if DRI2 ++Xmir_SOURCES += xmir-dri2.c ++endif + -+typedef struct xmir_screen { -+ XMirBufferReceivedProcPtr BufferNotify; -+ MirSurface *root_surf; -+ RealizeWindowProcPtr RealizeWindow; -+} xmir_screen; ++Xmir_LDADD += $(GLAMOR_LIBS) $(GBM_LIBS) -lEGL -lGL ++endif ++ ++if DRI2 ++Xmir_LDADD += dri2/libdri2.la ++endif ++ ++#dnl FIXME: Needed? ++if AIGLX_DRI_LOADER ++aiglx_lib = $(top_builddir)/glx/libglxdri.la ++if NO_UNDEFINED ++aiglx_lib += $(LIBDRM_LIBS) $(PIXMAN_LIBS) ++endif ++endif ++ ++relink: ++ $(AM_V_at)rm -f Xmir$(EXEEXT) && $(MAKE) Xmir$(EXEEXT) +diff --git a/hw/xmir/dri2/Makefile.am b/hw/xmir/dri2/Makefile.am +new file mode 100644 +index 0000000..696240c --- /dev/null -+++ b/hw/xfree86/xmir/Makefile.am -@@ -0,0 +1,26 @@ -+INCLUDES = \ -+ $(XORG_INCS) \ -+ -I$(srcdir)/../ddc \ -+ -I$(srcdir)/../ramdac \ -+ -I$(srcdir)/../i2c \ -+ -I$(srcdir)/../parser \ -+ -I$(srcdir)/../modes -+ -+libxmir_la_LTLIBRARIES = libxmir.la -+libxmir_la_CFLAGS = \ -+ -DHAVE_XORG_CONFIG_H \ -+ $(DRI_CFLAGS) \ -+ $(DIX_CFLAGS) $(XORG_CFLAGS) $(LIBDRM_CFLAGS) \ -+ $(XMIR_CFLAGS) -+ -+libxmir_la_LDFLAGS = -module -avoid-version $(LIBDRM_LIBS) $(XMIR_LIBS) -+libxmir_ladir = $(moduledir)/extensions -+libxmir_la_SOURCES = \ -+ xmir.c \ -+ xmir-window.c \ -+ xmir-output.c \ -+ xmir-thread-proxy.c \ -+ xmir.h \ -+ xmir-private.h -+ -+sdk_HEADERS = xmir.h ++++ b/hw/xmir/dri2/Makefile.am +@@ -0,0 +1,14 @@ ++noinst_LTLIBRARIES = libdri2.la ++ ++AM_CFLAGS = \ ++ -DHAVE_DIX_CONFIG_H \ ++ -I$(top_srcdir)/hw/xmir \ ++ $(DIX_CFLAGS) \ ++ $(XMIRMODULES_CFLAGS) ++ ++libdri2_la_SOURCES = \ ++ dri2.c \ ++ dri2.h \ ++ dri2ext.c \ ++ dri2int.h ++ +diff --git a/hw/xmir/dri2/dri2.c b/hw/xmir/dri2/dri2.c +new file mode 100644 +index 0000000..6aa19ba --- /dev/null -+++ b/hw/xfree86/xmir/xmir-output.c -@@ -0,0 +1,678 @@ ++++ b/hw/xmir/dri2/dri2.c +@@ -0,0 +1,1398 @@ +/* -+ * Copyright © 2012 Canonical, Inc ++ * Copyright © 2007, 2008 Red Hat, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Soft- @@ -321,768 +329,5723 @@ + * the copyright holder. + * + * Authors: -+ * Christopher James Halse Rogers (christopher.halse.rog...@canonical.com) ++ * Kristian Høgsberg (k...@redhat.com) + */ + -+#include <stdlib.h> -+#include <stdio.h> -+#include <math.h> ++#include <dix-config.h> + -+#include <xorg-config.h> -+#include "xmir.h" -+#include "xmir-private.h" -+#include "xf86Crtc.h" -+#include "xf86Priv.h" -+ -+struct xmir_crtc { -+ xmir_screen *xmir; -+ xmir_window *root_fragment; -+ MirDisplayConfiguration *config; -+}; ++#include <errno.h> ++#include "list.h" ++#include "scrnintstr.h" ++#include "windowstr.h" ++#include "dixstruct.h" ++#include "dri2.h" ++#include "dri2int.h" ++#include "damage.h" ++ ++CARD8 dri2_major; /* version of DRI2 supported by DDX */ ++CARD8 dri2_minor; ++ ++static DevPrivateKeyRec dri2ScreenPrivateKeyRec; ++ ++#define dri2ScreenPrivateKey (&dri2ScreenPrivateKeyRec) ++ ++static DevPrivateKeyRec dri2WindowPrivateKeyRec; ++ ++#define dri2WindowPrivateKey (&dri2WindowPrivateKeyRec) ++ ++static DevPrivateKeyRec dri2PixmapPrivateKeyRec; ++ ++#define dri2PixmapPrivateKey (&dri2PixmapPrivateKeyRec) ++ ++static RESTYPE dri2DrawableRes; ++ ++typedef struct _DRI2Screen *DRI2ScreenPtr; ++ ++typedef struct _DRI2Drawable { ++ DRI2ScreenPtr dri2_screen; ++ DrawablePtr drawable; ++ struct xorg_list reference_list; ++ int width; ++ int height; ++ DRI2BufferPtr *buffers; ++ int bufferCount; ++ unsigned int swapsPending; ++ ClientPtr blockedClient; ++ Bool blockedOnMsc; ++ int swap_interval; ++ CARD64 swap_count; ++ int64_t target_sbc; /* -1 means no SBC wait outstanding */ ++ CARD64 last_swap_target; /* most recently queued swap target */ ++ CARD64 last_swap_msc; /* msc at completion of most recent swap */ ++ CARD64 last_swap_ust; /* ust at completion of most recent swap */ ++ int swap_limit; /* for N-buffering */ ++ Bool needInvalidate; ++} DRI2DrawableRec, *DRI2DrawablePtr; ++ ++typedef struct _DRI2Screen { ++ ScreenPtr screen; ++ int refcnt; ++ unsigned int numDrivers; ++ const char **driverNames; ++ const char *deviceName; ++ int fd; ++ unsigned int lastSequence; ++ ++ DRI2CreateBufferProcPtr CreateBuffer; ++ DRI2DestroyBufferProcPtr DestroyBuffer; ++ DRI2CopyRegionProcPtr CopyRegion; ++ DRI2ScheduleSwapProcPtr ScheduleSwap; ++ DRI2GetMSCProcPtr GetMSC; ++ DRI2ScheduleWaitMSCProcPtr ScheduleWaitMSC; ++ DRI2AuthMagic2ProcPtr AuthMagic; ++ DRI2AuthMagicProcPtr LegacyAuthMagic; ++ DRI2ReuseBufferNotifyProcPtr ReuseBufferNotify; ++ DRI2SwapLimitValidateProcPtr SwapLimitValidate; ++ DRI2GetParamProcPtr GetParam; ++ ++ ConfigNotifyProcPtr ConfigNotify; ++ SetWindowPixmapProcPtr SetWindowPixmap; ++ DRI2CreateBuffer2ProcPtr CreateBuffer2; ++ DRI2DestroyBuffer2ProcPtr DestroyBuffer2; ++ DRI2CopyRegion2ProcPtr CopyRegion2; ++} DRI2ScreenRec; + -+static const char * -+xmir_mir_dpms_mode_description(MirPowerMode mode) ++static void ++destroy_buffer(DrawablePtr pDraw, DRI2BufferPtr buffer); ++ ++static DRI2ScreenPtr ++DRI2GetScreen(ScreenPtr pScreen) +{ -+ switch (mode) -+ { -+ case mir_power_mode_on: -+ return "mir_power_mode_on"; -+ case mir_power_mode_standby: -+ return "mir_power_mode_standby"; -+ case mir_power_mode_suspend: -+ return "mir_power_mode_suspend"; -+ case mir_power_mode_off: -+ return "mir_power_mode_off"; ++ return dixLookupPrivate(&pScreen->devPrivates, dri2ScreenPrivateKey); ++} ++ ++static DRI2DrawablePtr ++DRI2GetDrawable(DrawablePtr pDraw) ++{ ++ WindowPtr pWin; ++ PixmapPtr pPixmap; ++ ++ switch (pDraw->type) { ++ case DRAWABLE_WINDOW: ++ pWin = (WindowPtr) pDraw; ++ return dixLookupPrivate(&pWin->devPrivates, dri2WindowPrivateKey); ++ case DRAWABLE_PIXMAP: ++ pPixmap = (PixmapPtr) pDraw; ++ return dixLookupPrivate(&pPixmap->devPrivates, dri2PixmapPrivateKey); + default: -+ return "OMGUNKNOWN!"; ++ return NULL; + } +} + -+static void -+xmir_crtc_dpms(xf86CrtcPtr crtc, int mode) -+{ -+ xf86CrtcConfigPtr crtc_cfg = XF86_CRTC_CONFIG_PTR(crtc->scrn); -+ struct xmir_crtc *xmir_crtc = crtc->driver_private; -+ -+ for (int i = 0; i < crtc_cfg->num_output; i++) { -+ /* If this output should be driven by our "CRTC", set DPMS mode */ -+ MirDisplayOutput *output = crtc_cfg->output[i]->driver_private; -+ if (crtc_cfg->output[i]->crtc == crtc) { -+ xf86Msg(X_INFO, "Setting DPMS mode for output %d to %d\n", i, mode); -+ switch (mode) { -+ case DPMSModeOn: -+ output->power_mode = mir_power_mode_on; -+ xmir_crtc->xmir->dpms_on = TRUE; -+ break; -+ case DPMSModeStandby: -+ output->power_mode = mir_power_mode_standby; -+ xmir_crtc->xmir->dpms_on = FALSE; -+ break; -+ case DPMSModeSuspend: -+ output->power_mode = mir_power_mode_suspend; -+ xmir_crtc->xmir->dpms_on = FALSE; -+ break; -+ case DPMSModeOff: -+ output->power_mode = mir_power_mode_off; -+ xmir_crtc->xmir->dpms_on = FALSE; -+ break; -+ } -+ } ++static DRI2DrawablePtr ++DRI2AllocateDrawable(DrawablePtr pDraw) ++{ ++ DRI2ScreenPtr ds = DRI2GetScreen(pDraw->pScreen); ++ DRI2DrawablePtr pPriv; ++ CARD64 ust; ++ WindowPtr pWin; ++ PixmapPtr pPixmap; ++ ++ pPriv = malloc(sizeof *pPriv); ++ if (pPriv == NULL) ++ return NULL; ++ ++ pPriv->dri2_screen = ds; ++ pPriv->drawable = pDraw; ++ pPriv->width = pDraw->width; ++ pPriv->height = pDraw->height; ++ pPriv->buffers = NULL; ++ pPriv->bufferCount = 0; ++ pPriv->swapsPending = 0; ++ pPriv->blockedClient = NULL; ++ pPriv->blockedOnMsc = FALSE; ++ pPriv->swap_count = 0; ++ pPriv->target_sbc = -1; ++ pPriv->swap_interval = 1; ++ /* Initialize last swap target from DDX if possible */ ++ if (!ds->GetMSC || !(*ds->GetMSC) (pDraw, &ust, &pPriv->last_swap_target)) ++ pPriv->last_swap_target = 0; ++ ++ pPriv->swap_limit = 1; /* default to double buffering */ ++ pPriv->last_swap_msc = 0; ++ pPriv->last_swap_ust = 0; ++ xorg_list_init(&pPriv->reference_list); ++ pPriv->needInvalidate = FALSE; ++ if (pDraw->type == DRAWABLE_WINDOW) { ++ pWin = (WindowPtr) pDraw; ++ dixSetPrivate(&pWin->devPrivates, dri2WindowPrivateKey, pPriv); ++ } ++ else { ++ pPixmap = (PixmapPtr) pDraw; ++ dixSetPrivate(&pPixmap->devPrivates, dri2PixmapPrivateKey, pPriv); + } -+ mir_wait_for(mir_connection_apply_display_config(xmir_connection_get(), -+ xmir_crtc->config)); ++ ++ return pPriv; +} + -+static const char* -+xmir_get_output_type_str(MirDisplayOutput *mir_output) ++Bool ++DRI2SwapLimit(DrawablePtr pDraw, int swap_limit) +{ -+ const char *str = "Invalid"; ++ DRI2DrawablePtr pPriv = DRI2GetDrawable(pDraw); ++ DRI2ScreenPtr ds; + -+ switch(mir_output->type) -+ { -+ case mir_display_output_type_vga: str = "VGA"; break; -+ case mir_display_output_type_dvii: str = "DVI"; break; -+ case mir_display_output_type_dvid: str = "DVI"; break; -+ case mir_display_output_type_dvia: str = "DVI"; break; -+ case mir_display_output_type_composite: str = "Composite"; break; -+ case mir_display_output_type_svideo: str = "TV"; break; -+ case mir_display_output_type_lvds: str = "LVDS"; break; -+ case mir_display_output_type_component: str = "CTV"; break; -+ case mir_display_output_type_ninepindin: str = "DIN"; break; -+ case mir_display_output_type_displayport: str = "DP"; break; -+ case mir_display_output_type_hdmia: str = "HDMI"; break; -+ case mir_display_output_type_hdmib: str = "HDMI"; break; -+ case mir_display_output_type_tv: str = "TV"; break; -+ case mir_display_output_type_edp: str = "eDP"; break; ++ if (!pPriv) ++ return FALSE; + -+ case mir_display_output_type_unknown: str = "None"; break; -+ default: break; ++ ds = pPriv->dri2_screen; ++ ++ if (!ds->SwapLimitValidate || !ds->SwapLimitValidate(pDraw, swap_limit)) ++ return FALSE; ++ ++ pPriv->swap_limit = swap_limit; ++ ++ /* Check throttling */ ++ if (pPriv->swapsPending >= pPriv->swap_limit) ++ return TRUE; ++ ++ if (pPriv->target_sbc == -1 && !pPriv->blockedOnMsc) { ++ if (pPriv->blockedClient) { ++ AttendClient(pPriv->blockedClient); ++ pPriv->blockedClient = NULL; ++ } + } + -+ return str; ++ return TRUE; +} + -+static void -+xmir_output_populate(xf86OutputPtr xf86output, MirDisplayOutput *output) ++typedef struct DRI2DrawableRefRec { ++ XID id; ++ XID dri2_id; ++ DRI2InvalidateProcPtr invalidate; ++ void *priv; ++ struct xorg_list link; ++} DRI2DrawableRefRec, *DRI2DrawableRefPtr; ++ ++static DRI2DrawableRefPtr ++DRI2LookupDrawableRef(DRI2DrawablePtr pPriv, XID id) +{ -+ /* We can always arbitrarily clone and output */ -+ xf86output->possible_crtcs = 0xffffffff; -+ xf86output->possible_clones = 0xffffffff; ++ DRI2DrawableRefPtr ref; + -+ xf86output->driver_private = output; ++ xorg_list_for_each_entry(ref, &pPriv->reference_list, link) { ++ if (ref->id == id) ++ return ref; ++ } + -+ xf86output->interlaceAllowed = FALSE; -+ xf86output->doubleScanAllowed = FALSE; -+ xf86output->mm_width = output->physical_width_mm; -+ xf86output->mm_height = output->physical_height_mm; -+ /* TODO: Subpixel order from Mir */ -+ xf86output->subpixel_order = SubPixelUnknown; ++ return NULL; +} + -+static DisplayModePtr -+xmir_create_xf86mode(const struct MirDisplayMode *mir_mode) ++static int ++DRI2AddDrawableRef(DRI2DrawablePtr pPriv, XID id, XID dri2_id, ++ DRI2InvalidateProcPtr invalidate, void *priv) +{ -+ DisplayModePtr mode; ++ DRI2DrawableRefPtr ref; + -+ mode = xf86CVTMode(mir_mode->horizontal_resolution, -+ mir_mode->vertical_resolution, -+ mir_mode->refresh_rate, -+ FALSE, FALSE); ++ ref = malloc(sizeof *ref); -- To UNSUBSCRIBE, email to debian-x-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org Archive: https://lists.debian.org/e1z04uq-0004km...@moszumanska.debian.org