diff --git a/.gitignore b/.gitignore index 73879ee..83a710c 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -SOURCES/xorg-server-1.19.5.tar.bz2 +SOURCES/xorg-server-1.20.1.tar.bz2 diff --git a/.xorg-x11-server.metadata b/.xorg-x11-server.metadata index 3bee643..b0e4c3f 100644 --- a/.xorg-x11-server.metadata +++ b/.xorg-x11-server.metadata @@ -1 +1 @@ -307d3405f709f7e41966c850b37deefe7f83eb9b SOURCES/xorg-server-1.19.5.tar.bz2 +fd43367c2b7bbb1a4b1dd90b06a021e68a9db240 SOURCES/xorg-server-1.20.1.tar.bz2 diff --git a/SOURCES/0001-autobind-GPUs-to-the-screen.patch b/SOURCES/0001-autobind-GPUs-to-the-screen.patch new file mode 100644 index 0000000..86b96a2 --- /dev/null +++ b/SOURCES/0001-autobind-GPUs-to-the-screen.patch @@ -0,0 +1,293 @@ +From 471289fa1dc359555ceed6302f7d9605ab6be3ea Mon Sep 17 00:00:00 2001 +From: Dave Airlie +Date: Mon, 2 Apr 2018 16:49:02 -0400 +Subject: [PATCH] autobind GPUs to the screen + +This is a modified version of a patch we've been carry-ing in Fedora and +RHEL for years now. This patch automatically adds secondary GPUs to the +master as output sink / offload source making e.g. the use of +slave-outputs just work, with requiring the user to manually run +"xrandr --setprovideroutputsource" before he can hookup an external +monitor to his hybrid graphics laptop. + +There is one problem with this patch, which is why it was not upstreamed +before. What to do when a secondary GPU gets detected really is a policy +decission (e.g. one may want to autobind PCI GPUs but not USB ones) and +as such should be under control of the Desktop Environment. + +Unconditionally adding autobinding support to the xserver will result +in races between the DE dealing with the hotplug of a secondary GPU +and the server itself dealing with it. + +However we've waited for years for any Desktop Environments to actually +start doing some sort of autoconfiguration of secondary GPUs and there +is still not a single DE dealing with this, so I believe that it is +time to upstream this now. + +To avoid potential future problems if any DEs get support for doing +secondary GPU configuration themselves, the new autobind functionality +is made optional. Since no DEs currently support doing this themselves it +is enabled by default. When DEs grow support for doing this themselves +they can disable the servers autobinding through the servers cmdline or a +xorg.conf snippet. + +Signed-off-by: Dave Airlie +[hdegoede@redhat.com: Make configurable, fix with nvidia, submit upstream] +Signed-off-by: Hans de Goede +--- + hw/xfree86/common/xf86Config.c | 19 +++++++++++++++++++ + hw/xfree86/common/xf86Globals.c | 2 ++ + hw/xfree86/common/xf86Init.c | 20 ++++++++++++++++++++ + hw/xfree86/common/xf86Priv.h | 1 + + hw/xfree86/common/xf86Privstr.h | 1 + + hw/xfree86/common/xf86platformBus.c | 4 ++++ + hw/xfree86/man/Xorg.man | 7 +++++++ + hw/xfree86/man/xorg.conf.man | 6 ++++++ + randr/randrstr.h | 3 +++ + randr/rrprovider.c | 22 ++++++++++++++++++++++ + 10 files changed, 85 insertions(+) + +diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c +index 2c1d335..d7d7c2e 100644 +--- a/hw/xfree86/common/xf86Config.c ++++ b/hw/xfree86/common/xf86Config.c +@@ -643,6 +643,7 @@ typedef enum { + FLAG_DRI2, + FLAG_USE_SIGIO, + FLAG_AUTO_ADD_GPU, ++ FLAG_AUTO_BIND_GPU, + FLAG_MAX_CLIENTS, + FLAG_IGLX, + FLAG_DEBUG, +@@ -699,6 +700,8 @@ static OptionInfoRec FlagOptions[] = { + {0}, FALSE}, + {FLAG_AUTO_ADD_GPU, "AutoAddGPU", OPTV_BOOLEAN, + {0}, FALSE}, ++ {FLAG_AUTO_BIND_GPU, "AutoBindGPU", OPTV_BOOLEAN, ++ {0}, FALSE}, + {FLAG_MAX_CLIENTS, "MaxClients", OPTV_INTEGER, + {0}, FALSE }, + {FLAG_IGLX, "IndirectGLX", OPTV_BOOLEAN, +@@ -779,6 +782,22 @@ configServerFlags(XF86ConfFlagsPtr flagsconf, XF86OptionPtr layoutopts) + } + xf86Msg(from, "%sutomatically adding GPU devices\n", + xf86Info.autoAddGPU ? "A" : "Not a"); ++ ++ if (xf86AutoBindGPUDisabled) { ++ xf86Info.autoBindGPU = FALSE; ++ from = X_CMDLINE; ++ } ++ else if (xf86IsOptionSet(FlagOptions, FLAG_AUTO_BIND_GPU)) { ++ xf86GetOptValBool(FlagOptions, FLAG_AUTO_BIND_GPU, ++ &xf86Info.autoBindGPU); ++ from = X_CONFIG; ++ } ++ else { ++ from = X_DEFAULT; ++ } ++ xf86Msg(from, "%sutomatically binding GPU devices\n", ++ xf86Info.autoBindGPU ? "A" : "Not a"); ++ + /* + * Set things up based on the config file information. Some of these + * settings may be overridden later when the command line options are +diff --git a/hw/xfree86/common/xf86Globals.c b/hw/xfree86/common/xf86Globals.c +index e890f05..7b27b4c 100644 +--- a/hw/xfree86/common/xf86Globals.c ++++ b/hw/xfree86/common/xf86Globals.c +@@ -131,6 +131,7 @@ xf86InfoRec xf86Info = { + #else + .autoAddGPU = FALSE, + #endif ++ .autoBindGPU = TRUE, + }; + + const char *xf86ConfigFile = NULL; +@@ -191,6 +192,7 @@ Bool xf86FlipPixels = FALSE; + Gamma xf86Gamma = { 0.0, 0.0, 0.0 }; + + Bool xf86AllowMouseOpenFail = FALSE; ++Bool xf86AutoBindGPUDisabled = FALSE; + + #ifdef XF86VIDMODE + Bool xf86VidModeDisabled = FALSE; +diff --git a/hw/xfree86/common/xf86Init.c b/hw/xfree86/common/xf86Init.c +index ea42ec9..ec255b6 100644 +--- a/hw/xfree86/common/xf86Init.c ++++ b/hw/xfree86/common/xf86Init.c +@@ -76,6 +76,7 @@ + #include "xf86DDC.h" + #include "xf86Xinput.h" + #include "xf86InPriv.h" ++#include "xf86Crtc.h" + #include "picturestr.h" + #include "randrstr.h" + #include "glxvndabi.h" +@@ -237,6 +238,19 @@ xf86PrivsElevated(void) + return PrivsElevated(); + } + ++static void ++xf86AutoConfigOutputDevices(void) ++{ ++ int i; ++ ++ if (!xf86Info.autoBindGPU) ++ return; ++ ++ for (i = 0; i < xf86NumGPUScreens; i++) ++ RRProviderAutoConfigGpuScreen(xf86ScrnToScreen(xf86GPUScreens[i]), ++ xf86ScrnToScreen(xf86Screens[0])); ++} ++ + static void + TrapSignals(void) + { +@@ -770,6 +784,8 @@ InitOutput(ScreenInfo * pScreenInfo, int argc, char **argv) + for (i = 0; i < xf86NumGPUScreens; i++) + AttachUnboundGPU(xf86Screens[0]->pScreen, xf86GPUScreens[i]->pScreen); + ++ xf86AutoConfigOutputDevices(); ++ + xf86VGAarbiterWrapFunctions(); + if (sigio_blocked) + input_unlock(); +@@ -1278,6 +1294,10 @@ ddxProcessArgument(int argc, char **argv, int i) + xf86Info.iglxFrom = X_CMDLINE; + return 0; + } ++ if (!strcmp(argv[i], "-noautoBindGPU")) { ++ xf86AutoBindGPUDisabled = TRUE; ++ return 1; ++ } + + /* OS-specific processing */ + return xf86ProcessArgument(argc, argv, i); +diff --git a/hw/xfree86/common/xf86Priv.h b/hw/xfree86/common/xf86Priv.h +index 4fe2b5f..6566622 100644 +--- a/hw/xfree86/common/xf86Priv.h ++++ b/hw/xfree86/common/xf86Priv.h +@@ -46,6 +46,7 @@ + extern _X_EXPORT const char *xf86ConfigFile; + extern _X_EXPORT const char *xf86ConfigDir; + extern _X_EXPORT Bool xf86AllowMouseOpenFail; ++extern _X_EXPORT Bool xf86AutoBindGPUDisabled; + + #ifdef XF86VIDMODE + extern _X_EXPORT Bool xf86VidModeDisabled; +diff --git a/hw/xfree86/common/xf86Privstr.h b/hw/xfree86/common/xf86Privstr.h +index 21c2e1f..6c71863 100644 +--- a/hw/xfree86/common/xf86Privstr.h ++++ b/hw/xfree86/common/xf86Privstr.h +@@ -98,6 +98,7 @@ typedef struct { + + Bool autoAddGPU; + const char *debug; ++ Bool autoBindGPU; + } xf86InfoRec, *xf86InfoPtr; + + /* ISC's cc can't handle ~ of UL constants, so explicitly type cast them. */ +diff --git a/hw/xfree86/common/xf86platformBus.c b/hw/xfree86/common/xf86platformBus.c +index cef47da..913a324 100644 +--- a/hw/xfree86/common/xf86platformBus.c ++++ b/hw/xfree86/common/xf86platformBus.c +@@ -49,6 +49,7 @@ + #include "Pci.h" + #include "xf86platformBus.h" + #include "xf86Config.h" ++#include "xf86Crtc.h" + + #include "randrstr.h" + int platformSlotClaimed; +@@ -665,6 +666,9 @@ xf86platformAddDevice(int index) + } + /* attach unbound to 0 protocol screen */ + AttachUnboundGPU(xf86Screens[0]->pScreen, xf86GPUScreens[i]->pScreen); ++ if (xf86Info.autoBindGPU) ++ RRProviderAutoConfigGpuScreen(xf86ScrnToScreen(xf86GPUScreens[i]), ++ xf86ScrnToScreen(xf86Screens[0])); + + RRResourcesChanged(xf86Screens[0]->pScreen); + RRTellChanged(xf86Screens[0]->pScreen); +diff --git a/hw/xfree86/man/Xorg.man b/hw/xfree86/man/Xorg.man +index 13a9dc3..745f986 100644 +--- a/hw/xfree86/man/Xorg.man ++++ b/hw/xfree86/man/Xorg.man +@@ -283,6 +283,13 @@ is a comma separated list of directories to search for + server modules. This option is only available when the server is run + as root (i.e, with real-uid 0). + .TP 8 ++.B \-noautoBindGPU ++Disable automatically setting secondary GPUs up as output sinks and offload ++sources. This is equivalent to setting the ++.B AutoBindGPU ++xorg.conf(__filemansuffix__) file option. To ++.B false. ++.TP 8 + .B \-nosilk + Disable Silken Mouse support. + .TP 8 +diff --git a/hw/xfree86/man/xorg.conf.man b/hw/xfree86/man/xorg.conf.man +index 9589262..8d51e06 100644 +--- a/hw/xfree86/man/xorg.conf.man ++++ b/hw/xfree86/man/xorg.conf.man +@@ -672,6 +672,12 @@ Enabled by default. + If this option is disabled, then no GPU devices will be added from the udev + backend. Enabled by default. (May need to be disabled to setup Xinerama). + .TP 7 ++.BI "Option \*qAutoBindGPU\*q \*q" boolean \*q ++If enabled then secondary GPUs will be automatically set up as output-sinks and ++offload-sources. Making e.g. laptop outputs connected only to the secondary ++GPU directly available for use without needing to run ++"xrandr --setprovideroutputsource". Enabled by default. ++.TP 7 + .BI "Option \*qLog\*q \*q" string \*q + This option controls whether the log is flushed and/or synced to disk after + each message. +diff --git a/randr/randrstr.h b/randr/randrstr.h +index f94174b..092d726 100644 +--- a/randr/randrstr.h ++++ b/randr/randrstr.h +@@ -1039,6 +1039,9 @@ RRProviderLookup(XID id, RRProviderPtr *provider_p); + extern _X_EXPORT void + RRDeliverProviderEvent(ClientPtr client, WindowPtr pWin, RRProviderPtr provider); + ++extern _X_EXPORT void ++RRProviderAutoConfigGpuScreen(ScreenPtr pScreen, ScreenPtr masterScreen); ++ + /* rrproviderproperty.c */ + + extern _X_EXPORT void +diff --git a/randr/rrprovider.c b/randr/rrprovider.c +index e4bc2bf..e04c18f 100644 +--- a/randr/rrprovider.c ++++ b/randr/rrprovider.c +@@ -485,3 +485,25 @@ RRDeliverProviderEvent(ClientPtr client, WindowPtr pWin, RRProviderPtr provider) + + WriteEventsToClient(client, 1, (xEvent *) &pe); + } ++ ++void ++RRProviderAutoConfigGpuScreen(ScreenPtr pScreen, ScreenPtr masterScreen) ++{ ++ rrScrPrivPtr pScrPriv = rrGetScrPriv(pScreen); ++ rrScrPrivPtr masterPriv = rrGetScrPriv(masterScreen); ++ RRProviderPtr provider = pScrPriv->provider; ++ RRProviderPtr master_provider = masterPriv->provider; ++ ++ if (!provider || !master_provider) ++ return; ++ ++ if ((provider->capabilities & RR_Capability_SinkOutput) && ++ (master_provider->capabilities & RR_Capability_SourceOutput)) { ++ pScrPriv->rrProviderSetOutputSource(pScreen, provider, master_provider); ++ RRInitPrimeSyncProps(pScreen); ++ } ++ ++ if ((provider->capabilities & RR_Capability_SourceOffload) && ++ (master_provider->capabilities & RR_Capability_SinkOffload)) ++ pScrPriv->rrProviderSetOffloadSink(pScreen, provider, master_provider); ++} +-- +2.16.2 + diff --git a/SOURCES/0001-glamor_egl-Don-t-initialize-on-llvmpipe.patch b/SOURCES/0001-glamor_egl-Don-t-initialize-on-llvmpipe.patch new file mode 100644 index 0000000..ab99365 --- /dev/null +++ b/SOURCES/0001-glamor_egl-Don-t-initialize-on-llvmpipe.patch @@ -0,0 +1,48 @@ +From 722dc4717a4bb1c0ff84f45d0251e3e456476a28 Mon Sep 17 00:00:00 2001 +From: Adam Jackson +Date: Fri, 14 Sep 2018 11:33:43 -0400 +Subject: [PATCH xserver] glamor_egl: Don't initialize on llvmpipe + +--- + glamor/glamor_egl.c | 11 ++++++++++- + 1 file changed, 10 insertions(+), 1 deletion(-) + +diff --git a/glamor/glamor_egl.c b/glamor/glamor_egl.c +index df278b1a1a..2f06d6587d 100644 +--- a/glamor/glamor_egl.c ++++ b/glamor/glamor_egl.c +@@ -898,6 +898,7 @@ Bool + glamor_egl_init(ScrnInfoPtr scrn, int fd) + { + struct glamor_egl_screen_private *glamor_egl; ++ const GLubyte *renderer; + + glamor_egl = calloc(sizeof(*glamor_egl), 1); + if (glamor_egl == NULL) +@@ -992,6 +993,14 @@ glamor_egl_init(ScrnInfoPtr scrn, int fd) + "Failed to make EGL context current\n"); + goto error; + } ++ ++ renderer = glGetString(GL_RENDERER); ++ if (strstr(renderer, "llvmpipe")) { ++ xf86DrvMsg(scrn->scrnIndex, X_INFO, ++ "Refusing to try glamor on llvmpipe\n"); ++ goto error; ++ } ++ + /* + * Force the next glamor_make_current call to set the right context + * (in case of multiple GPUs using glamor) +@@ -1005,7 +1014,7 @@ glamor_egl_init(ScrnInfoPtr scrn, int fd) + } + + xf86DrvMsg(scrn->scrnIndex, X_INFO, "glamor X acceleration enabled on %s\n", +- glGetString(GL_RENDERER)); ++ renderer); + + #ifdef GBM_BO_WITH_MODIFIERS + if (epoxy_has_egl_extension(glamor_egl->display, +-- +2.17.1 + diff --git a/SOURCES/0001-handle-NullCursor-to-avoid-crash.patch b/SOURCES/0001-handle-NullCursor-to-avoid-crash.patch deleted file mode 100644 index 64f343e..0000000 --- a/SOURCES/0001-handle-NullCursor-to-avoid-crash.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 54564059c2d4c841a80c65f6a730e36412ee451e Mon Sep 17 00:00:00 2001 -From: rpm-build -Date: Fri, 9 Jun 2017 13:35:47 +1000 -Subject: [PATCH] handle NullCursor to avoid crash - ---- - hw/xfree86/drivers/modesetting/drmmode_display.c | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/hw/xfree86/drivers/modesetting/drmmode_display.c b/hw/xfree86/drivers/modesetting/drmmode_display.c -index 6e755e9..431f63d 100644 ---- a/hw/xfree86/drivers/modesetting/drmmode_display.c -+++ b/hw/xfree86/drivers/modesetting/drmmode_display.c -@@ -760,6 +760,8 @@ drmmode_set_cursor(xf86CrtcPtr crtc) - - if (!drmmode_crtc->set_cursor2_failed) { - CursorPtr cursor = xf86CurrentCursor(crtc->scrn->pScreen); -+ if (cursor == NullCursor) -+ return TRUE; - - ret = - drmModeSetCursor2(drmmode->fd, drmmode_crtc->mode_crtc->crtc_id, --- -2.9.4 - diff --git a/SOURCES/0001-link-with-z-now.patch b/SOURCES/0001-link-with-z-now.patch index bbc09d5..aae9147 100644 --- a/SOURCES/0001-link-with-z-now.patch +++ b/SOURCES/0001-link-with-z-now.patch @@ -1,18 +1,17 @@ -From c24c9c3ac032c17dd63120d0adba1ef32edcf8dd Mon Sep 17 00:00:00 2001 +From 15a6d58414b85867f39237518f2b3bac7bba6a20 Mon Sep 17 00:00:00 2001 From: Adam Jackson -Date: Wed, 15 Apr 2015 12:44:49 -0400 +Date: Tue, 29 May 2018 15:11:54 -0400 Subject: [PATCH] link with -z now -Signed-off-by: Adam Jackson --- hw/xfree86/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/xfree86/Makefile.am b/hw/xfree86/Makefile.am -index 27f2cc6..116eeb2 100644 +index a7a1be2..197701d 100644 --- a/hw/xfree86/Makefile.am +++ b/hw/xfree86/Makefile.am -@@ -79,7 +79,7 @@ Xorg_LDADD = \ +@@ -78,7 +78,7 @@ Xorg_LDADD = \ $(XSERVER_SYS_LIBS) Xorg_DEPENDENCIES = $(LOCAL_LIBS) @@ -20,7 +19,7 @@ index 27f2cc6..116eeb2 100644 +Xorg_LDFLAGS = $(LD_EXPORT_SYMBOLS_FLAG) -Wl,-z,now -pie if SUID_WRAPPER - wrapdir = $(SUID_WRAPPER_DIR) + wrapexecdir = $(SUID_WRAPPER_DIR) -- -2.1.0 +2.17.0 diff --git a/SOURCES/0001-linux-Make-platform-device-probe-less-fragile.patch b/SOURCES/0001-linux-Make-platform-device-probe-less-fragile.patch new file mode 100644 index 0000000..7eaf5c3 --- /dev/null +++ b/SOURCES/0001-linux-Make-platform-device-probe-less-fragile.patch @@ -0,0 +1,76 @@ +From b96e7972e90144a697401f393ae8e1e12b3e767c Mon Sep 17 00:00:00 2001 +From: Adam Jackson +Date: Tue, 18 Sep 2018 14:37:51 -0400 +Subject: [PATCH] linux: Make platform device probe less fragile + +If we have platform devices - and we usually do - we would really want +them to bind through the platform bus code not PCI. At the point where +get_drm_info runs, however, we haven't yet taken our own VT, which means +we can't perform drm "master" operations on the device. This is tragic, +because the operation we need to perform here is fishing the bus id out +of the kernel, which we can only do after drmSetInterfaceVersion, which +for some reason stores that knowledge on the device not the file handle +and thus needs master access. Since we fail, the probe logic gets very +confused. + +Fortunately we know the format of the busid string (it's our own, drm +copied it from xfree86), so we can scrape that out of the sysfs path. We +do still potentially do the whole SetInterfaceVersion dance later on, +but it's harmless at that point because we've taken the VT by then. + +This should all be vastly simplified, but that is not the cat we're +skinning today. +--- + hw/xfree86/os-support/linux/lnx_platform.c | 22 ++++++++++++---------- + 1 file changed, 12 insertions(+), 10 deletions(-) + +diff --git a/hw/xfree86/os-support/linux/lnx_platform.c b/hw/xfree86/os-support/linux/lnx_platform.c +index 70374ac..cbf7dd2 100644 +--- a/hw/xfree86/os-support/linux/lnx_platform.c ++++ b/hw/xfree86/os-support/linux/lnx_platform.c +@@ -29,6 +29,9 @@ get_drm_info(struct OdevAttributes *attribs, char *path, int delayed_index) + int fd; + int err = 0; + Bool paused, server_fd = FALSE; ++ const char pci_prefix[] = "/sys/devices/pci"; ++ ++ LogMessage(X_INFO, "Platform probe for %s\n", attribs->syspath); + + fd = systemd_logind_take_fd(attribs->major, attribs->minor, path, &paused); + if (fd != -1) { +@@ -53,13 +56,6 @@ get_drm_info(struct OdevAttributes *attribs, char *path, int delayed_index) + sv.drm_dd_major = -1; /* Don't care */ + sv.drm_dd_minor = -1; /* Don't care */ + +- err = drmSetInterfaceVersion(fd, &sv); +- if (err) { +- xf86Msg(X_ERROR, "%s: failed to set DRM interface version 1.4: %s\n", +- path, strerror(-err)); +- goto out; +- } +- + /* for a delayed probe we've already added the device */ + if (delayed_index == -1) { + xf86_add_platform_device(attribs, FALSE); +@@ -69,9 +65,15 @@ get_drm_info(struct OdevAttributes *attribs, char *path, int delayed_index) + if (server_fd) + xf86_platform_devices[delayed_index].flags |= XF86_PDEV_SERVER_FD; + +- buf = drmGetBusid(fd); +- xf86_platform_odev_attributes(delayed_index)->busid = XNFstrdup(buf); +- drmFreeBusid(buf); ++ /* parse out a bus id */ ++ if (!strncmp(attribs->syspath, pci_prefix, strlen(pci_prefix))) { ++ char *dbdf = attribs->syspath + strlen(pci_prefix) + strlen("XXXX:XX") + 1; ++ asprintf(&xf86_platform_odev_attributes(delayed_index)->busid, ++ "pci:%.12s", dbdf); ++ LogMessage(X_INFO, "Platform PCI device at %s\n", ++ xf86_platform_odev_attributes(delayed_index)->busid); ++ } ++ + + v = drmGetVersion(fd); + if (!v) { +-- +2.17.1 + diff --git a/SOURCES/0001-miarc-Style-cleanup-for-miWideArc.patch b/SOURCES/0001-miarc-Style-cleanup-for-miWideArc.patch deleted file mode 100644 index 4e97a78..0000000 --- a/SOURCES/0001-miarc-Style-cleanup-for-miWideArc.patch +++ /dev/null @@ -1,419 +0,0 @@ -From 9426c5500b72e1fe004fef4c3b259023c4ec49f7 Mon Sep 17 00:00:00 2001 -From: Adam Jackson -Date: Wed, 1 Mar 2017 16:13:57 -0500 -Subject: [PATCH 1/3] miarc: Style cleanup for miWideArc - -Outdent, normalize comment formatting, and use 'goto out' idiom for -error paths. No functional change. - -Reviewed-by: Keith Packard -Signed-off-by: Adam Jackson ---- - mi/miarc.c | 368 ++++++++++++++++++++++++++++++------------------------------- - 1 file changed, 179 insertions(+), 189 deletions(-) - -diff --git a/mi/miarc.c b/mi/miarc.c -index 2588ee48a..fed5c9fa3 100644 ---- a/mi/miarc.c -+++ b/mi/miarc.c -@@ -894,7 +894,7 @@ miWideArc(DrawablePtr pDraw, GCPtr pGC, int narcs, xArc * parcs) - int xMin, xMax, yMin, yMax; - int pixmapWidth = 0, pixmapHeight = 0; - int xOrg = 0, yOrg = 0; -- int width; -+ int width = pGC->lineWidth; - Bool fTricky; - DrawablePtr pDrawTo; - CARD32 fg, bg; -@@ -904,210 +904,200 @@ miWideArc(DrawablePtr pDraw, GCPtr pGC, int narcs, xArc * parcs) - int iphase; - int halfWidth; - -- width = pGC->lineWidth; - if (width == 0 && pGC->lineStyle == LineSolid) { - for (i = narcs, parc = parcs; --i >= 0; parc++) -- miArcSegment(pDraw, pGC, *parc, (miArcFacePtr) 0, (miArcFacePtr) 0); -+ miArcSegment(pDraw, pGC, *parc, NULL, NULL); - fillSpans(pDraw, pGC); -+ return; - } -- else { -- if ((pGC->lineStyle == LineSolid) && narcs) { -- while (parcs->width && parcs->height && -- (parcs->angle2 >= FULLCIRCLE || -- parcs->angle2 <= -FULLCIRCLE)) { -- miFillWideEllipse(pDraw, pGC, parcs); -- if (!--narcs) -- return; -- parcs++; -- } -- } -- -- /* Set up pDrawTo and pGCTo based on the rasterop */ -- switch (pGC->alu) { -- case GXclear: /* 0 */ -- case GXcopy: /* src */ -- case GXcopyInverted: /* NOT src */ -- case GXset: /* 1 */ -- fTricky = FALSE; -- pDrawTo = pDraw; -- pGCTo = pGC; -- break; -- default: -- fTricky = TRUE; -- -- /* find bounding box around arcs */ -- xMin = yMin = MAXSHORT; -- xMax = yMax = MINSHORT; -- -- for (i = narcs, parc = parcs; --i >= 0; parc++) { -- xMin = min(xMin, parc->x); -- yMin = min(yMin, parc->y); -- xMax = max(xMax, (parc->x + (int) parc->width)); -- yMax = max(yMax, (parc->y + (int) parc->height)); -- } -- -- /* expand box to deal with line widths */ -- halfWidth = (width + 1) / 2; -- xMin -= halfWidth; -- yMin -= halfWidth; -- xMax += halfWidth; -- yMax += halfWidth; -- -- /* compute pixmap size; limit it to size of drawable */ -- xOrg = max(xMin, 0); -- yOrg = max(yMin, 0); -- pixmapWidth = min(xMax, pDraw->width) - xOrg; -- pixmapHeight = min(yMax, pDraw->height) - yOrg; -- -- /* if nothing left, return */ -- if ((pixmapWidth <= 0) || (pixmapHeight <= 0)) -- return; -- -- for (i = narcs, parc = parcs; --i >= 0; parc++) { -- parc->x -= xOrg; -- parc->y -= yOrg; -- } -- if (pGC->miTranslate) { -- xOrg += pDraw->x; -- yOrg += pDraw->y; -- } -- -- /* set up scratch GC */ -- -- pGCTo = GetScratchGC(1, pDraw->pScreen); -- if (!pGCTo) -- return; -- { -- ChangeGCVal gcvals[6]; -- -- gcvals[0].val = GXcopy; -- gcvals[1].val = 1; -- gcvals[2].val = 0; -- gcvals[3].val = pGC->lineWidth; -- gcvals[4].val = pGC->capStyle; -- gcvals[5].val = pGC->joinStyle; -- ChangeGC(NullClient, pGCTo, GCFunction | -- GCForeground | GCBackground | GCLineWidth | -- GCCapStyle | GCJoinStyle, gcvals); -- } - -- /* allocate a 1 bit deep pixmap of the appropriate size, and -- * validate it */ -- pDrawTo = (DrawablePtr) (*pDraw->pScreen->CreatePixmap) -- (pDraw->pScreen, pixmapWidth, pixmapHeight, 1, -- CREATE_PIXMAP_USAGE_SCRATCH); -- if (!pDrawTo) { -- FreeScratchGC(pGCTo); -+ if ((pGC->lineStyle == LineSolid) && narcs) { -+ while (parcs->width && parcs->height && -+ (parcs->angle2 >= FULLCIRCLE || parcs->angle2 <= -FULLCIRCLE)) { -+ miFillWideEllipse(pDraw, pGC, parcs); -+ if (!--narcs) - return; -- } -- ValidateGC(pDrawTo, pGCTo); -- miClearDrawable(pDrawTo, pGCTo); -+ parcs++; - } -+ } - -- fg = pGC->fgPixel; -- bg = pGC->bgPixel; -- if ((pGC->fillStyle == FillTiled) || -- (pGC->fillStyle == FillOpaqueStippled)) -- bg = fg; /* the protocol sez these don't cause color changes */ -+ /* Set up pDrawTo and pGCTo based on the rasterop */ -+ switch (pGC->alu) { -+ case GXclear: /* 0 */ -+ case GXcopy: /* src */ -+ case GXcopyInverted: /* NOT src */ -+ case GXset: /* 1 */ -+ fTricky = FALSE; -+ pDrawTo = pDraw; -+ pGCTo = pGC; -+ break; -+ default: -+ fTricky = TRUE; -+ -+ /* find bounding box around arcs */ -+ xMin = yMin = MAXSHORT; -+ xMax = yMax = MINSHORT; -+ -+ for (i = narcs, parc = parcs; --i >= 0; parc++) { -+ xMin = min(xMin, parc->x); -+ yMin = min(yMin, parc->y); -+ xMax = max(xMax, (parc->x + (int) parc->width)); -+ yMax = max(yMax, (parc->y + (int) parc->height)); -+ } -+ -+ /* expand box to deal with line widths */ -+ halfWidth = (width + 1) / 2; -+ xMin -= halfWidth; -+ yMin -= halfWidth; -+ xMax += halfWidth; -+ yMax += halfWidth; -+ -+ /* compute pixmap size; limit it to size of drawable */ -+ xOrg = max(xMin, 0); -+ yOrg = max(yMin, 0); -+ pixmapWidth = min(xMax, pDraw->width) - xOrg; -+ pixmapHeight = min(yMax, pDraw->height) - yOrg; -+ -+ /* if nothing left, return */ -+ if ((pixmapWidth <= 0) || (pixmapHeight <= 0)) -+ return; - -- polyArcs = miComputeArcs(parcs, narcs, pGC); -+ for (i = narcs, parc = parcs; --i >= 0; parc++) { -+ parc->x -= xOrg; -+ parc->y -= yOrg; -+ } -+ if (pGC->miTranslate) { -+ xOrg += pDraw->x; -+ yOrg += pDraw->y; -+ } - -- if (!polyArcs) { -- if (fTricky) { -- (*pDraw->pScreen->DestroyPixmap) ((PixmapPtr) pDrawTo); -- FreeScratchGC(pGCTo); -- } -+ /* set up scratch GC */ -+ pGCTo = GetScratchGC(1, pDraw->pScreen); -+ if (!pGCTo) -+ return; -+ { -+ ChangeGCVal gcvals[6]; -+ -+ gcvals[0].val = GXcopy; -+ gcvals[1].val = 1; -+ gcvals[2].val = 0; -+ gcvals[3].val = pGC->lineWidth; -+ gcvals[4].val = pGC->capStyle; -+ gcvals[5].val = pGC->joinStyle; -+ ChangeGC(NullClient, pGCTo, GCFunction | -+ GCForeground | GCBackground | GCLineWidth | -+ GCCapStyle | GCJoinStyle, gcvals); -+ } -+ -+ /* allocate a bitmap of the appropriate size, and validate it */ -+ pDrawTo = (DrawablePtr) (*pDraw->pScreen->CreatePixmap) -+ (pDraw->pScreen, pixmapWidth, pixmapHeight, 1, -+ CREATE_PIXMAP_USAGE_SCRATCH); -+ if (!pDrawTo) { -+ FreeScratchGC(pGCTo); - return; - } -- -- cap[0] = cap[1] = 0; -- join[0] = join[1] = 0; -- for (iphase = ((pGC->lineStyle == LineDoubleDash) ? 1 : 0); -- iphase >= 0; iphase--) { -- ChangeGCVal gcval; -- -- if (iphase == 1) { -- gcval.val = bg; -- ChangeGC(NullClient, pGC, GCForeground, &gcval); -- ValidateGC(pDraw, pGC); -- } -- else if (pGC->lineStyle == LineDoubleDash) { -- gcval.val = fg; -- ChangeGC(NullClient, pGC, GCForeground, &gcval); -- ValidateGC(pDraw, pGC); -- } -- for (i = 0; i < polyArcs[iphase].narcs; i++) { -- miArcDataPtr arcData; -- -- arcData = &polyArcs[iphase].arcs[i]; -- miArcSegment(pDrawTo, pGCTo, arcData->arc, -- &arcData->bounds[RIGHT_END], -- &arcData->bounds[LEFT_END]); -- if (polyArcs[iphase].arcs[i].render) { -- fillSpans(pDrawTo, pGCTo); -- /* -- * don't cap self-joining arcs -- */ -- if (polyArcs[iphase].arcs[i].selfJoin && -- cap[iphase] < polyArcs[iphase].arcs[i].cap) -- cap[iphase]++; -- while (cap[iphase] < polyArcs[iphase].arcs[i].cap) { -- int arcIndex, end; -- miArcDataPtr arcData0; -- -- arcIndex = polyArcs[iphase].caps[cap[iphase]].arcIndex; -- end = polyArcs[iphase].caps[cap[iphase]].end; -- arcData0 = &polyArcs[iphase].arcs[arcIndex]; -- miArcCap(pDrawTo, pGCTo, -- &arcData0->bounds[end], end, -- arcData0->arc.x, arcData0->arc.y, -- (double) arcData0->arc.width / 2.0, -- (double) arcData0->arc.height / 2.0); -- ++cap[iphase]; -- } -- while (join[iphase] < polyArcs[iphase].arcs[i].join) { -- int arcIndex0, arcIndex1, end0, end1; -- int phase0, phase1; -- miArcDataPtr arcData0, arcData1; -- miArcJoinPtr joinp; -- -- joinp = &polyArcs[iphase].joins[join[iphase]]; -- arcIndex0 = joinp->arcIndex0; -- end0 = joinp->end0; -- arcIndex1 = joinp->arcIndex1; -- end1 = joinp->end1; -- phase0 = joinp->phase0; -- phase1 = joinp->phase1; -- arcData0 = &polyArcs[phase0].arcs[arcIndex0]; -- arcData1 = &polyArcs[phase1].arcs[arcIndex1]; -- miArcJoin(pDrawTo, pGCTo, -- &arcData0->bounds[end0], -- &arcData1->bounds[end1], -- arcData0->arc.x, arcData0->arc.y, -- (double) arcData0->arc.width / 2.0, -- (double) arcData0->arc.height / 2.0, -- arcData1->arc.x, arcData1->arc.y, -- (double) arcData1->arc.width / 2.0, -- (double) arcData1->arc.height / 2.0); -- ++join[iphase]; -- } -- if (fTricky) { -- if (pGC->serialNumber != pDraw->serialNumber) -- ValidateGC(pDraw, pGC); -- (*pGC->ops->PushPixels) (pGC, (PixmapPtr) pDrawTo, -- pDraw, pixmapWidth, -- pixmapHeight, xOrg, yOrg); -- miClearDrawable((DrawablePtr) pDrawTo, pGCTo); -- } -+ ValidateGC(pDrawTo, pGCTo); -+ miClearDrawable(pDrawTo, pGCTo); -+ } -+ -+ fg = pGC->fgPixel; -+ bg = pGC->bgPixel; -+ -+ /* the protocol sez these don't cause color changes */ -+ if ((pGC->fillStyle == FillTiled) || -+ (pGC->fillStyle == FillOpaqueStippled)) -+ bg = fg; -+ -+ polyArcs = miComputeArcs(parcs, narcs, pGC); -+ if (!polyArcs) -+ goto out; -+ -+ cap[0] = cap[1] = 0; -+ join[0] = join[1] = 0; -+ for (iphase = (pGC->lineStyle == LineDoubleDash); iphase >= 0; iphase--) { -+ ChangeGCVal gcval; -+ -+ if (iphase == 1) { -+ gcval.val = bg; -+ ChangeGC(NullClient, pGC, GCForeground, &gcval); -+ ValidateGC(pDraw, pGC); -+ } -+ else if (pGC->lineStyle == LineDoubleDash) { -+ gcval.val = fg; -+ ChangeGC(NullClient, pGC, GCForeground, &gcval); -+ ValidateGC(pDraw, pGC); -+ } -+ for (i = 0; i < polyArcs[iphase].narcs; i++) { -+ miArcDataPtr arcData; -+ -+ arcData = &polyArcs[iphase].arcs[i]; -+ miArcSegment(pDrawTo, pGCTo, arcData->arc, -+ &arcData->bounds[RIGHT_END], -+ &arcData->bounds[LEFT_END]); -+ if (polyArcs[iphase].arcs[i].render) { -+ fillSpans(pDrawTo, pGCTo); -+ /* don't cap self-joining arcs */ -+ if (polyArcs[iphase].arcs[i].selfJoin && -+ cap[iphase] < polyArcs[iphase].arcs[i].cap) -+ cap[iphase]++; -+ while (cap[iphase] < polyArcs[iphase].arcs[i].cap) { -+ int arcIndex, end; -+ miArcDataPtr arcData0; -+ -+ arcIndex = polyArcs[iphase].caps[cap[iphase]].arcIndex; -+ end = polyArcs[iphase].caps[cap[iphase]].end; -+ arcData0 = &polyArcs[iphase].arcs[arcIndex]; -+ miArcCap(pDrawTo, pGCTo, -+ &arcData0->bounds[end], end, -+ arcData0->arc.x, arcData0->arc.y, -+ (double) arcData0->arc.width / 2.0, -+ (double) arcData0->arc.height / 2.0); -+ ++cap[iphase]; -+ } -+ while (join[iphase] < polyArcs[iphase].arcs[i].join) { -+ int arcIndex0, arcIndex1, end0, end1; -+ int phase0, phase1; -+ miArcDataPtr arcData0, arcData1; -+ miArcJoinPtr joinp; -+ -+ joinp = &polyArcs[iphase].joins[join[iphase]]; -+ arcIndex0 = joinp->arcIndex0; -+ end0 = joinp->end0; -+ arcIndex1 = joinp->arcIndex1; -+ end1 = joinp->end1; -+ phase0 = joinp->phase0; -+ phase1 = joinp->phase1; -+ arcData0 = &polyArcs[phase0].arcs[arcIndex0]; -+ arcData1 = &polyArcs[phase1].arcs[arcIndex1]; -+ miArcJoin(pDrawTo, pGCTo, -+ &arcData0->bounds[end0], -+ &arcData1->bounds[end1], -+ arcData0->arc.x, arcData0->arc.y, -+ (double) arcData0->arc.width / 2.0, -+ (double) arcData0->arc.height / 2.0, -+ arcData1->arc.x, arcData1->arc.y, -+ (double) arcData1->arc.width / 2.0, -+ (double) arcData1->arc.height / 2.0); -+ ++join[iphase]; -+ } -+ if (fTricky) { -+ if (pGC->serialNumber != pDraw->serialNumber) -+ ValidateGC(pDraw, pGC); -+ (*pGC->ops->PushPixels) (pGC, (PixmapPtr) pDrawTo, -+ pDraw, pixmapWidth, -+ pixmapHeight, xOrg, yOrg); -+ miClearDrawable((DrawablePtr) pDrawTo, pGCTo); - } - } - } -- miFreeArcs(polyArcs, pGC); -+ } -+ miFreeArcs(polyArcs, pGC); - -- if (fTricky) { -- (*pGCTo->pScreen->DestroyPixmap) ((PixmapPtr) pDrawTo); -- FreeScratchGC(pGCTo); -- } -+out: -+ if (fTricky) { -+ (*pGCTo->pScreen->DestroyPixmap) ((PixmapPtr) pDrawTo); -+ FreeScratchGC(pGCTo); - } - } - --- -2.12.0 - diff --git a/SOURCES/0001-modesetting-Fix-PCI-initialization-on-non-zero-domai.patch b/SOURCES/0001-modesetting-Fix-PCI-initialization-on-non-zero-domai.patch deleted file mode 100644 index 3e3bc60..0000000 --- a/SOURCES/0001-modesetting-Fix-PCI-initialization-on-non-zero-domai.patch +++ /dev/null @@ -1,46 +0,0 @@ -From bc6ccb0bdcdc27c90c95a02e821d5883ad1dc7a0 Mon Sep 17 00:00:00 2001 -From: Adam Jackson -Date: Mon, 26 Jun 2017 12:37:56 -0400 -Subject: [PATCH] modesetting: Fix PCI initialization on non-zero domains - -libdrm's busid matching for the legacy three-integer bus string format -simply ignores the domain number, rather than what we were doing here of -packing the domain into the bus number. Whatever, just use the existing -code to build a busid string, since that gets the domain right. - -[rhel: also remove the if !pciaccess code - ajax] - -Signed-off-by: Adam Jackson - -diff --git a/hw/xfree86/drivers/modesetting/driver.c b/hw/xfree86/drivers/modesetting/driver.c -index 791ab90..3fac07c 100644 ---- a/hw/xfree86/drivers/modesetting/driver.c -+++ b/hw/xfree86/drivers/modesetting/driver.c -@@ -849,20 +849,11 @@ ms_get_drm_master_fd(ScrnInfoPtr pScrn) - if (pEnt->location.type == BUS_PCI) { - ms->PciInfo = xf86GetPciInfoForEntity(ms->pEnt->index); - if (ms->PciInfo) { -- BusID = XNFalloc(64); -- sprintf(BusID, "PCI:%d:%d:%d", --#if XSERVER_LIBPCIACCESS -- ((ms->PciInfo->domain << 8) | ms->PciInfo->bus), -- ms->PciInfo->dev, ms->PciInfo->func --#else -- ((pciConfigPtr) ms->PciInfo->thisCard)->busnum, -- ((pciConfigPtr) ms->PciInfo->thisCard)->devnum, -- ((pciConfigPtr) ms->PciInfo->thisCard)->funcnum --#endif -- ); -+ if ((BusID = ms_DRICreatePCIBusID(ms->PciInfo)) != NULL) { -+ ms->fd = drmOpen(NULL, BusID); -+ free(BusID); -+ } - } -- ms->fd = drmOpen(NULL, BusID); -- free(BusID); - } - else { - const char *devicename; --- -2.13.0 - diff --git a/SOURCES/0001-rpath-hack.patch b/SOURCES/0001-rpath-hack.patch deleted file mode 100644 index 8aba68d..0000000 --- a/SOURCES/0001-rpath-hack.patch +++ /dev/null @@ -1,28 +0,0 @@ -From e562763e58cd58b0a23e5d034aafedb608e3eda3 Mon Sep 17 00:00:00 2001 -From: Adam Jackson -Date: Thu, 12 Nov 2015 11:10:11 -0500 -Subject: [PATCH] rpath hack - -Normally, rpath is undesirable. But for the X server we _know_ we need -Mesa's libGL, which will always be in %{_libdir}, and not any third-party -libGL that may be configured using ld.so.conf. ---- - configure.ac | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/configure.ac b/configure.ac -index 190d039..2ce40f4 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -1352,7 +1352,7 @@ if test "x$GLX" = xyes; then - AC_SUBST(XLIB_CFLAGS) - AC_DEFINE(GLXEXT, 1, [Build GLX extension]) - GLX_LIBS='$(top_builddir)/glx/libglx.la' -- GLX_SYS_LIBS="$GLX_SYS_LIBS $GL_LIBS" -+ GLX_SYS_LIBS="$GLX_SYS_LIBS $GL_LIBS -Wl,-rpath=\$(libdir)" - else - GLX=no - fi --- -2.9.3 - diff --git a/SOURCES/0001-xephyr-Check-for-host-XVideo-support-before-trying-t.patch b/SOURCES/0001-xephyr-Check-for-host-XVideo-support-before-trying-t.patch deleted file mode 100644 index 382cfce..0000000 --- a/SOURCES/0001-xephyr-Check-for-host-XVideo-support-before-trying-t.patch +++ /dev/null @@ -1,35 +0,0 @@ -From 88c59206bffee264250142ea28713206df62d853 Mon Sep 17 00:00:00 2001 -From: Adam Jackson -Date: Thu, 6 Apr 2017 17:22:28 -0400 -Subject: [PATCH xserver] xephyr: Check for host XVideo support before trying - to use it - -Otherwise xcb will treat our attempt to send xv requests as a connection -error (quite reasonably: we're asking it to emit a request for which -there is no defined major opcode), and we'll die quietly the first time -we hit KdBlockhandler. - -Signed-off-by: Adam Jackson ---- - hw/kdrive/ephyr/ephyrvideo.c | 5 +++++ - 1 file changed, 5 insertions(+) - -diff --git a/hw/kdrive/ephyr/ephyrvideo.c b/hw/kdrive/ephyr/ephyrvideo.c -index 9c9c78d..671a0dd 100644 ---- a/hw/kdrive/ephyr/ephyrvideo.c -+++ b/hw/kdrive/ephyr/ephyrvideo.c -@@ -226,6 +226,11 @@ ephyrInitVideo(ScreenPtr pScreen) - return FALSE; - } - -+ if (!hostx_has_extension(&xcb_xv_id)) { -+ EPHYR_LOG_ERROR("Host has no XVideo extension\n"); -+ return FALSE; -+ } -+ - if (!xv_priv) { - xv_priv = ephyrXVPrivNew(); - } --- -2.9.3 - diff --git a/SOURCES/0001-xfixes-Remove-the-CursorCurrent-array.patch b/SOURCES/0001-xfixes-Remove-the-CursorCurrent-array.patch deleted file mode 100644 index 6f27ada..0000000 --- a/SOURCES/0001-xfixes-Remove-the-CursorCurrent-array.patch +++ /dev/null @@ -1,105 +0,0 @@ -From a5e2c313721615d40ebf328f3619286a88dae238 Mon Sep 17 00:00:00 2001 -From: Adam Jackson -Date: Wed, 17 May 2017 14:17:01 -0400 -Subject: [PATCH xserver] xfixes: Remove the CursorCurrent array - -We're not wrapping all the ways a cursor can be destroyed, so this array -ends up with stale data. Rather than try harder to wrap more code paths, -just look up the cursor when we need it. - -Signed-off-by: Adam Jackson ---- - xfixes/cursor.c | 28 +++++++++++++++++++++------- - 1 file changed, 21 insertions(+), 7 deletions(-) - -diff --git a/xfixes/cursor.c b/xfixes/cursor.c -index c1ab3beda..b7c47bc00 100644 ---- a/xfixes/cursor.c -+++ b/xfixes/cursor.c -@@ -61,7 +61,6 @@ - static RESTYPE CursorClientType; - static RESTYPE CursorHideCountType; - static RESTYPE CursorWindowType; --static CursorPtr CursorCurrent[MAXDEVICES]; - - static DevPrivateKeyRec CursorScreenPrivateKeyRec; - -@@ -132,10 +131,26 @@ typedef struct _CursorScreen { - Bool CursorVisible = FALSE; - Bool EnableCursor = TRUE; - -+static CursorPtr -+CursorForDevice(DeviceIntPtr pDev) -+{ -+ if (pDev && pDev->spriteInfo && pDev->spriteInfo->sprite) -+ return pDev->spriteInfo->sprite->current; -+ -+ return NULL; -+} -+ -+static CursorPtr -+CursorForClient(ClientPtr client) -+{ -+ return CursorForDevice(PickPointer(client)); -+} -+ - static Bool - CursorDisplayCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor) - { - CursorScreenPtr cs = GetCursorScreen(pScreen); -+ CursorPtr pOldCursor = CursorForDevice(pDev); - Bool ret; - DisplayCursorProcPtr backupProc; - -@@ -150,11 +165,10 @@ CursorDisplayCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor) - ret = (*pScreen->DisplayCursor) (pDev, pScreen, pCursor); - } - -- if (pCursor != CursorCurrent[pDev->id]) { -+ if (pCursor != pOldCursor) { - CursorEventPtr e; - - UpdateCurrentTimeIf(); -- CursorCurrent[pDev->id] = pCursor; - for (e = cursorEvents; e; e = e->next) { - if ((e->eventMask & XFixesDisplayCursorNotifyMask)) { - xXFixesCursorNotifyEvent ev = { -@@ -350,7 +364,7 @@ ProcXFixesGetCursorImage(ClientPtr client) - int npixels, width, height, rc, x, y; - - REQUEST_SIZE_MATCH(xXFixesGetCursorImageReq); -- pCursor = CursorCurrent[PickPointer(client)->id]; -+ pCursor = CursorForClient(client); - if (!pCursor) - return BadCursor; - rc = XaceHook(XACE_RESOURCE_ACCESS, client, pCursor->id, RT_CURSOR, -@@ -499,7 +513,7 @@ ProcXFixesGetCursorImageAndName(ClientPtr client) - int rc, x, y; - - REQUEST_SIZE_MATCH(xXFixesGetCursorImageAndNameReq); -- pCursor = CursorCurrent[PickPointer(client)->id]; -+ pCursor = CursorForClient(client); - if (!pCursor) - return BadCursor; - rc = XaceHook(XACE_RESOURCE_ACCESS, client, pCursor->id, RT_CURSOR, -@@ -873,7 +887,7 @@ ProcXFixesHideCursor(ClientPtr client) - for (dev = inputInfo.devices; dev; dev = dev->next) { - if (IsMaster(dev) && IsPointerDevice(dev)) - CursorDisplayCursor(dev, pWin->drawable.pScreen, -- CursorCurrent[dev->id]); -+ CursorForDevice(dev)); - } - } - -@@ -968,7 +982,7 @@ CursorFreeHideCount(void *data, XID id) - deleteCursorHideCount(pChc, pChc->pScreen); - for (dev = inputInfo.devices; dev; dev = dev->next) { - if (IsMaster(dev) && IsPointerDevice(dev)) -- CursorDisplayCursor(dev, pScreen, CursorCurrent[dev->id]); -+ CursorDisplayCursor(dev, pScreen, CursorForDevice(dev)); - } - - return 1; --- -2.13.0 - diff --git a/SOURCES/0001-xfree86-Allow-mixed-fbdev-and-pci-setups.patch b/SOURCES/0001-xfree86-Allow-mixed-fbdev-and-pci-setups.patch index 7439e80..0ad784d 100644 --- a/SOURCES/0001-xfree86-Allow-mixed-fbdev-and-pci-setups.patch +++ b/SOURCES/0001-xfree86-Allow-mixed-fbdev-and-pci-setups.patch @@ -1,4 +1,4 @@ -From ca183b2a3c6e3877b93b6444acb1280356834a04 Mon Sep 17 00:00:00 2001 +From 3c12c28f448fa76d17e9009995c89f56cccb0abb Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Tue, 5 Aug 2014 12:16:31 -0400 Subject: [PATCH] xfree86: Allow mixed fbdev and pci setups @@ -31,18 +31,18 @@ goal. Signed-off-by: Adam Jackson --- - hw/xfree86/common/xf86Bus.c | 16 ---------------- + hw/xfree86/common/xf86Bus.c | 15 --------------- hw/xfree86/fbdevhw/fbdevhw.c | 18 +++++++++++++++--- - 2 files changed, 15 insertions(+), 19 deletions(-) + 2 files changed, 15 insertions(+), 18 deletions(-) diff --git a/hw/xfree86/common/xf86Bus.c b/hw/xfree86/common/xf86Bus.c -index d463e91..5adff0b 100644 +index 6bbf489..3186478 100644 --- a/hw/xfree86/common/xf86Bus.c +++ b/hw/xfree86/common/xf86Bus.c -@@ -548,22 +548,6 @@ xf86PostProbe(void) +@@ -536,21 +536,6 @@ xf86GetDevFromEntity(int entityIndex, int instance) + void + xf86PostProbe(void) { - int i; - - if (fbSlotClaimed && ( -#if (defined(__sparc__) || defined(__sparc)) && !defined(__OpenBSD__) - sbusSlotClaimed || @@ -58,15 +58,14 @@ index d463e91..5adff0b 100644 - )) - FatalError("Cannot run in framebuffer mode. Please specify busIDs " - " for all framebuffer devices\n"); -- - for (i = 0; i < xf86NumEntities; i++) - if (xf86Entities[i]->entityInit) - xf86Entities[i]->entityInit(i, xf86Entities[i]->private); + } + + int diff --git a/hw/xfree86/fbdevhw/fbdevhw.c b/hw/xfree86/fbdevhw/fbdevhw.c -index cbb4093..657fc49 100644 +index 0bd77df..a2cf78f 100644 --- a/hw/xfree86/fbdevhw/fbdevhw.c +++ b/hw/xfree86/fbdevhw/fbdevhw.c -@@ -347,7 +347,7 @@ fbdevHWProbe(struct pci_device *pPci, char *device, char **namep) +@@ -351,7 +351,7 @@ fbdevHWProbe(struct pci_device *pPci, char *device, char **namep) { int fd; @@ -75,7 +74,7 @@ index cbb4093..657fc49 100644 fd = fbdev_open_pci(pPci, namep); else fd = fbdev_open(-1, device, namep); -@@ -361,16 +361,28 @@ fbdevHWProbe(struct pci_device *pPci, char *device, char **namep) +@@ -365,16 +365,28 @@ fbdevHWProbe(struct pci_device *pPci, char *device, char **namep) Bool fbdevHWInit(ScrnInfoPtr pScrn, struct pci_device *pPci, char *device) { @@ -107,5 +106,5 @@ index cbb4093..657fc49 100644 xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Failed to open framebuffer device, consult warnings" -- -2.1.0 +2.17.0 diff --git a/SOURCES/0001-xfree86-Don-t-autoconfigure-vesa-or-fbdev.patch b/SOURCES/0001-xfree86-Don-t-autoconfigure-vesa-or-fbdev.patch index 4b6d617..e97e961 100644 --- a/SOURCES/0001-xfree86-Don-t-autoconfigure-vesa-or-fbdev.patch +++ b/SOURCES/0001-xfree86-Don-t-autoconfigure-vesa-or-fbdev.patch @@ -1,26 +1,27 @@ -From 5c7617de1777845d1609b301c0f470c90338d06f Mon Sep 17 00:00:00 2001 -From: rpm-build -Date: Mon, 23 Oct 2017 14:48:51 -0400 -Subject: [PATCH] 0001-xfree86-Don-t-autoconfigure-vesa-or-fbdev.patch +From e4dce2bfaf4a61dd8a8ac099638489d4fdff9024 Mon Sep 17 00:00:00 2001 +From: Adam Jackson +Date: Tue, 29 May 2018 15:05:10 -0400 +Subject: [PATCH] xfree86: Don't autoconfigure vesa or fbdev +Signed-off-by: Adam Jackson --- - hw/xfree86/common/xf86Config.c | 1 - - hw/xfree86/loader/loadmod.c | 2 ++ - 2 files changed, 2 insertions(+), 1 deletion(-) + hw/xfree86/loader/loadmod.c | 3 +++ + 1 file changed, 3 insertions(+) diff --git a/hw/xfree86/loader/loadmod.c b/hw/xfree86/loader/loadmod.c -index 940f5fc..2f9d915 100644 +index a6356bd..1c1c2b1 100644 --- a/hw/xfree86/loader/loadmod.c +++ b/hw/xfree86/loader/loadmod.c -@@ -525,6 +525,8 @@ LoaderListDirs(const char **subdirlist, const char **patternlist) - if (!(stat(buf, &stat_buf) == 0 && - S_ISREG(stat_buf.st_mode))) - continue; -+ if (strstr(dp->d_name, "vesa") || strstr(dp->d_name, "fbdev")) -+ continue; - for (p = patterns; p->pattern; p++) { - if (regexec(&p->rex, dp->d_name, 2, match, 0) == 0 && - match[1].rm_so != -1) { +@@ -383,6 +383,9 @@ LoaderListDir(const char *subdir, const char **patternlist) + strcpy(fp, dp->d_name); + if (!(stat(buf, &stat_buf) == 0 && S_ISREG(stat_buf.st_mode))) + continue; ++ if (!strcmp(subdir, "drivers") && ++ (strstr(dp->d_name, "vesa") || strstr(dp->d_name, "fbdev"))) ++ continue; + for (p = patterns; p->pattern; p++) { + if (regexec(&p->rex, dp->d_name, 2, match, 0) == 0 && + match[1].rm_so != -1) { -- -2.14.2 +2.17.0 diff --git a/SOURCES/0001-xfree86-Fix-off-by-one-in-X-configure.patch b/SOURCES/0001-xfree86-Fix-off-by-one-in-X-configure.patch deleted file mode 100644 index fc22e7f..0000000 --- a/SOURCES/0001-xfree86-Fix-off-by-one-in-X-configure.patch +++ /dev/null @@ -1,36 +0,0 @@ -From e437e3cae10b730d3d8bb64e0b720064f39ca0b6 Mon Sep 17 00:00:00 2001 -From: Adam Jackson -Date: Mon, 26 Jun 2017 17:31:14 -0400 -Subject: [PATCH] xfree86: Fix off-by-one in X -configure - -Signed-off-by: Adam Jackson ---- -diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c -index df3ca50..3994805 100644 ---- a/hw/xfree86/common/xf86Config.c -+++ b/hw/xfree86/common/xf86Config.c -@@ -545,11 +545,11 @@ driver_sort(const void *_l, const void *_r) - return strcmp(l, r); - - /* left is a fallback */ -- if (left >= 0) -+ if (left >= 0 && right < 0) - return 1; - - /* right is a fallback */ -- if (right >= 0) -+ if (right >= 0 && left > 0) - return -1; - - /* both are fallbacks, which is worse */ -@@ -563,7 +563,6 @@ fixup_video_driver_list(const char **drivers) - - /* walk to the end of the list */ - for (end = drivers; *end && **end; end++); -- end--; - - qsort(drivers, end - drivers, sizeof(const char *), driver_sort); - } --- -2.13.0 - diff --git a/SOURCES/0001-xfree86-try-harder-to-span-on-multihead.patch b/SOURCES/0001-xfree86-try-harder-to-span-on-multihead.patch new file mode 100644 index 0000000..4303409 --- /dev/null +++ b/SOURCES/0001-xfree86-try-harder-to-span-on-multihead.patch @@ -0,0 +1,190 @@ +From 326f992a90dae7a747da45626e588fa3c1dfa5dc Mon Sep 17 00:00:00 2001 +From: Ray Strode +Date: Fri, 21 Sep 2018 14:38:31 -0400 +Subject: [PATCH xserver] xfree86: try harder to span on multihead + +right now if one of the monitors can't give +it's native resolution because of bandwidth limitations, +X decides to avoid spanning and instead clone. + +That's suboptimal, spanning is normally the right +thing to do (with the exception of some projector +use cases and other edge cases) + +This commit tries harder to make spanning work. +--- + hw/xfree86/modes/xf86Crtc.c | 33 +++++++++++++++++++++++++++++---- + 1 file changed, 29 insertions(+), 4 deletions(-) + +diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c +index 37a45bb3a..686cb51b8 100644 +--- a/hw/xfree86/modes/xf86Crtc.c ++++ b/hw/xfree86/modes/xf86Crtc.c +@@ -2132,135 +2132,160 @@ bestModeForAspect(xf86CrtcConfigPtr config, Bool *enabled, float aspect) + if (test->HDisplay != mode->HDisplay || + test->VDisplay != mode->VDisplay) { + test = NULL; + break; + } + } + + /* if we didn't match it on all outputs, try the next one */ + if (!test) + continue; + + /* if it's bigger than the last one, save it */ + if (!match || (test->HDisplay > match->HDisplay)) + match = test; + } + + /* return the biggest one found */ + return match; + } + + static int + numEnabledOutputs(xf86CrtcConfigPtr config, Bool *enabled) + { + int i = 0, p; + + for (i = 0, p = -1; nextEnabledOutput(config, enabled, &p); i++) ; + + return i; + } + ++static DisplayModePtr ++findReasonableMode(xf86CrtcConfigPtr config, xf86OutputPtr output, Bool *enabled, int width, int height) ++{ ++ DisplayModePtr mode = ++ xf86OutputHasPreferredMode(output, width, height); ++ ++ /* if there's no preferred mode, just try to find a reasonable one */ ++ if (!mode) { ++ float aspect = 0.0; ++ DisplayModePtr a = NULL, b = NULL; ++ ++ if (output->mm_height) ++ aspect = (float) output->mm_width / ++ (float) output->mm_height; ++ ++ a = bestModeForAspect(config, enabled, 4.0/3.0); ++ if (aspect) ++ b = bestModeForAspect(config, enabled, aspect); ++ ++ mode = biggestMode(a, b); ++ } ++ ++ return mode; ++} ++ + static Bool + xf86TargetRightOf(ScrnInfoPtr scrn, xf86CrtcConfigPtr config, + DisplayModePtr *modes, Bool *enabled, + int width, int height) + { + int o; + int w = 0; + Bool has_tile = FALSE; + uint32_t configured_outputs; + + xf86GetOptValBool(config->options, OPTION_PREFER_CLONEMODE, + &scrn->preferClone); + if (scrn->preferClone) + return FALSE; + + if (numEnabledOutputs(config, enabled) < 2) + return FALSE; + + for (o = -1; nextEnabledOutput(config, enabled, &o); ) { + DisplayModePtr mode = +- xf86OutputHasPreferredMode(config->output[o], width, height); ++ findReasonableMode(config, config->output[o], enabled, width, height); + + if (!mode) + return FALSE; + + w += mode->HDisplay; + } + + if (w > width) + return FALSE; + + w = 0; + configured_outputs = 0; + + for (o = -1; nextEnabledOutput(config, enabled, &o); ) { + DisplayModePtr mode = +- xf86OutputHasPreferredMode(config->output[o], width, height); ++ findReasonableMode(config, config->output[o], enabled, width, height); + + if (configured_outputs & (1 << o)) + continue; + + if (config->output[o]->tile_info.group_id) { + has_tile = TRUE; + continue; + } + + config->output[o]->initial_x = w; + w += mode->HDisplay; + + configured_outputs |= (1 << o); + modes[o] = mode; + } + + if (has_tile) { + for (o = -1; nextEnabledOutput(config, enabled, &o); ) { + int ht, vt, ot; + int add_x, cur_x = w; + struct xf86CrtcTileInfo *tile_info = &config->output[o]->tile_info, *this_tile; + if (configured_outputs & (1 << o)) + continue; + if (!tile_info->group_id) + continue; + + if (tile_info->tile_h_loc != 0 && tile_info->tile_v_loc != 0) + continue; + + for (ht = 0; ht < tile_info->num_h_tile; ht++) { + int cur_y = 0; + add_x = 0; + for (vt = 0; vt < tile_info->num_v_tile; vt++) { + + for (ot = -1; nextEnabledOutput(config, enabled, &ot); ) { +- + DisplayModePtr mode = +- xf86OutputHasPreferredMode(config->output[ot], width, height); ++ findReasonableMode(config, config->output[ot], enabled, width, height); ++ + if (!config->output[ot]->tile_info.group_id) + continue; + + this_tile = &config->output[ot]->tile_info; + if (this_tile->group_id != tile_info->group_id) + continue; + + if (this_tile->tile_h_loc != ht || + this_tile->tile_v_loc != vt) + continue; + + config->output[ot]->initial_x = cur_x; + config->output[ot]->initial_y = cur_y; + + if (vt == 0) + add_x = this_tile->tile_h_size; + cur_y += this_tile->tile_v_size; + configured_outputs |= (1 << ot); + modes[ot] = mode; + } + } + cur_x += add_x; + } + w = cur_x; + } + } + return TRUE; + } + + static Bool +-- +2.17.1 + diff --git a/SOURCES/0001-xwayland-Depend-on-wayland-protocols-to-build-tablet.patch b/SOURCES/0001-xwayland-Depend-on-wayland-protocols-to-build-tablet.patch deleted file mode 100644 index e16b405..0000000 --- a/SOURCES/0001-xwayland-Depend-on-wayland-protocols-to-build-tablet.patch +++ /dev/null @@ -1,73 +0,0 @@ -From 7f22271ca7ace43f6fa1168a2acea9af6f2d5896 Mon Sep 17 00:00:00 2001 -From: Jason Gerecke -Date: Thu, 13 Oct 2016 10:39:46 -0700 -Subject: [PATCH xserver 01/12] xwayland: Depend on wayland-protocols to build - tablet protocol headers - -Signed-off-by: Jason Gerecke -Signed-off-by: Carlos Garnacho -Reviewed-by: Peter Hutterer -Signed-off-by: Peter Hutterer -Acked-by: Ping Cheng -(cherry picked from commit 89c841915ac4fba6d2a5ad0051c778f1a76ffbf3) ---- - configure.ac | 2 +- - hw/xwayland/Makefile.am | 9 ++++++++- - hw/xwayland/xwayland-input.c | 1 + - 3 files changed, 10 insertions(+), 2 deletions(-) - -diff --git a/configure.ac b/configure.ac -index e6c5b35de..d34e10538 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -2503,7 +2503,7 @@ AM_CONDITIONAL(XFAKESERVER, [test "x$KDRIVE" = xyes && test "x$XFAKE" = xyes]) - - dnl Xwayland DDX - --XWAYLANDMODULES="wayland-client >= 1.3.0 wayland-protocols >= 1.1 $LIBDRM epoxy" -+XWAYLANDMODULES="wayland-client >= 1.3.0 wayland-protocols >= 1.5 $LIBDRM epoxy" - if test "x$XF86VIDMODE" = xyes; then - XWAYLANDMODULES="$XWAYLANDMODULES $VIDMODEPROTO" - fi -diff --git a/hw/xwayland/Makefile.am b/hw/xwayland/Makefile.am -index a3c9fce48..e376f09dd 100644 ---- a/hw/xwayland/Makefile.am -+++ b/hw/xwayland/Makefile.am -@@ -56,7 +56,9 @@ Xwayland_built_sources += \ - relative-pointer-unstable-v1-client-protocol.h \ - relative-pointer-unstable-v1-protocol.c \ - pointer-constraints-unstable-v1-client-protocol.h \ -- pointer-constraints-unstable-v1-protocol.c -+ pointer-constraints-unstable-v1-protocol.c \ -+ tablet-unstable-v2-client-protocol.h \ -+ tablet-unstable-v2-protocol.c - - nodist_Xwayland_SOURCES = $(Xwayland_built_sources) - CLEANFILES = $(Xwayland_built_sources) -@@ -79,6 +81,11 @@ pointer-constraints-unstable-v1-protocol.c : $(WAYLAND_PROTOCOLS_DATADIR)/unstab - pointer-constraints-unstable-v1-client-protocol.h : $(WAYLAND_PROTOCOLS_DATADIR)/unstable/pointer-constraints/pointer-constraints-unstable-v1.xml - $(AM_V_GEN)$(WAYLAND_SCANNER) client-header < $< > $@ - -+tablet-unstable-v2-protocol.c: $(WAYLAND_PROTOCOLS_DATADIR)/unstable/tablet/tablet-unstable-v2.xml -+ $(AM_V_GEN)$(WAYLAND_SCANNER) code < $< > $@ -+tablet-unstable-v2-client-protocol.h: $(WAYLAND_PROTOCOLS_DATADIR)/unstable/tablet/tablet-unstable-v2.xml -+ $(AM_V_GEN)$(WAYLAND_SCANNER) client-header < $< > $@ -+ - %-protocol.c : %.xml - $(AM_V_GEN)$(WAYLAND_SCANNER) code < $< > $@ - -diff --git a/hw/xwayland/xwayland-input.c b/hw/xwayland/xwayland-input.c -index f2564d5d3..8fdc875ea 100644 ---- a/hw/xwayland/xwayland-input.c -+++ b/hw/xwayland/xwayland-input.c -@@ -34,6 +34,7 @@ - #include - #include - #include -+#include "tablet-unstable-v2-client-protocol.h" - - /* Copied from mipointer.c */ - #define MIPOINTER(dev) \ --- -2.13.5 - diff --git a/SOURCES/0001-xwayland-Don-t-initialize-glamor-on-llvmpipe.patch b/SOURCES/0001-xwayland-Don-t-initialize-glamor-on-llvmpipe.patch new file mode 100644 index 0000000..e5c0300 --- /dev/null +++ b/SOURCES/0001-xwayland-Don-t-initialize-glamor-on-llvmpipe.patch @@ -0,0 +1,29 @@ +From c64865691df6d2ad18aeecaecb0cb9a94b5d71eb Mon Sep 17 00:00:00 2001 +From: Adam Jackson +Date: Wed, 19 Sep 2018 10:56:29 -0400 +Subject: [PATCH] xwayland: Don't initialize glamor on llvmpipe + +Signed-off-by: Adam Jackson +--- + hw/xwayland/xwayland-glamor-gbm.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/hw/xwayland/xwayland-glamor-gbm.c b/hw/xwayland/xwayland-glamor-gbm.c +index 06fcf52..2144af7 100644 +--- a/hw/xwayland/xwayland-glamor-gbm.c ++++ b/hw/xwayland/xwayland-glamor-gbm.c +@@ -843,6 +843,11 @@ xwl_glamor_gbm_init_egl(struct xwl_screen *xwl_screen) + goto error; + } + ++ if (strstr(glGetString(GL_RENDERER), "llvmpipe")) { ++ ErrorF("Refusing to try glamor with llvmpipe\n"); ++ goto error; ++ } ++ + if (!epoxy_has_gl_extension("GL_OES_EGL_image")) { + ErrorF("GL_OES_EGL_image not available\n"); + goto error; +-- +2.17.1 + diff --git a/SOURCES/0001-xwayland-Keep-separate-variables-for-pointer-and-tab.patch b/SOURCES/0001-xwayland-Keep-separate-variables-for-pointer-and-tab.patch deleted file mode 100644 index 571fc93..0000000 --- a/SOURCES/0001-xwayland-Keep-separate-variables-for-pointer-and-tab.patch +++ /dev/null @@ -1,135 +0,0 @@ -From 60f4646ae10f0b57790fce46682baa531512b53e Mon Sep 17 00:00:00 2001 -From: Carlos Garnacho -Date: Mon, 4 Dec 2017 16:55:13 +0100 -Subject: [PATCH xserver] xwayland: Keep separate variables for pointer and - tablet foci - -The tablet/stylus interfaces reused xwl_seat->focus_window, which -would leave a somewhat inconsistent state of that variable for -wl_pointer purposes (basically, everything) if the pointer happened -to lay on the same surface than the stylus while proximity_out -happens. - -We just want the stylus xwl_window to correctly determine we have -stylus focus, and to correctly translate surface-local coordinates -to root coordinates, this can be done using a different variable. - -Signed-off-by: Carlos Garnacho -Acked-by: Jason Gerecke -Tested-by: Olivier Fourdan ---- - hw/xwayland/xwayland-input.c | 20 ++++++++++---------- - hw/xwayland/xwayland.c | 2 ++ - hw/xwayland/xwayland.h | 1 + - 3 files changed, 13 insertions(+), 10 deletions(-) - -diff --git a/hw/xwayland/xwayland-input.c b/hw/xwayland/xwayland-input.c -index 68e365051..439903032 100644 ---- a/hw/xwayland/xwayland-input.c -+++ b/hw/xwayland/xwayland-input.c -@@ -1514,7 +1514,7 @@ tablet_tool_proximity_in(void *data, struct zwp_tablet_tool_v2 *tool, - return; - - xwl_tablet_tool->proximity_in_serial = serial; -- xwl_seat->focus_window = wl_surface_get_user_data(wl_surface); -+ xwl_seat->tablet_focus_window = wl_surface_get_user_data(wl_surface); - - xwl_tablet_tool_set_cursor(xwl_tablet_tool); - } -@@ -1526,7 +1526,7 @@ tablet_tool_proximity_out(void *data, struct zwp_tablet_tool_v2 *tool) - struct xwl_seat *xwl_seat = xwl_tablet_tool->seat; - - xwl_tablet_tool->proximity_in_serial = 0; -- xwl_seat->focus_window = NULL; -+ xwl_seat->tablet_focus_window = NULL; - - xwl_tablet_tool->pressure = 0; - xwl_tablet_tool->tilt_x = 0; -@@ -1568,11 +1568,11 @@ tablet_tool_motion(void *data, struct zwp_tablet_tool_v2 *tool, - int sx = wl_fixed_to_int(x); - int sy = wl_fixed_to_int(y); - -- if (!xwl_seat->focus_window) -+ if (!xwl_seat->tablet_focus_window) - return; - -- dx = xwl_seat->focus_window->window->drawable.x; -- dy = xwl_seat->focus_window->window->drawable.y; -+ dx = xwl_seat->tablet_focus_window->window->drawable.x; -+ dy = xwl_seat->tablet_focus_window->window->drawable.y; - - xwl_tablet_tool->x = dx + sx; - xwl_tablet_tool->y = dy + sy; -@@ -1585,7 +1585,7 @@ tablet_tool_pressure(void *data, struct zwp_tablet_tool_v2 *tool, - struct xwl_tablet_tool *xwl_tablet_tool = data; - struct xwl_seat *xwl_seat = xwl_tablet_tool->seat; - -- if (!xwl_seat->focus_window) -+ if (!xwl_seat->tablet_focus_window) - return; - - /* normalized to 65535 already */ -@@ -1605,7 +1605,7 @@ tablet_tool_tilt(void *data, struct zwp_tablet_tool_v2 *tool, - struct xwl_tablet_tool *xwl_tablet_tool = data; - struct xwl_seat *xwl_seat = xwl_tablet_tool->seat; - -- if (!xwl_seat->focus_window) -+ if (!xwl_seat->tablet_focus_window) - return; - - xwl_tablet_tool->tilt_x = wl_fixed_to_double(tilt_x); -@@ -1620,7 +1620,7 @@ tablet_tool_rotation(void *data, struct zwp_tablet_tool_v2 *tool, - struct xwl_seat *xwl_seat = xwl_tablet_tool->seat; - double rotation = wl_fixed_to_double(angle); - -- if (!xwl_seat->focus_window) -+ if (!xwl_seat->tablet_focus_window) - return; - - /* change origin (buttons facing right [libinput +90 degrees]) and -@@ -1639,7 +1639,7 @@ tablet_tool_slider(void *data, struct zwp_tablet_tool_v2 *tool, - struct xwl_seat *xwl_seat = xwl_tablet_tool->seat; - float position = position_raw / 65535.0; - -- if (!xwl_seat->focus_window) -+ if (!xwl_seat->tablet_focus_window) - return; - - xwl_tablet_tool->slider = (position * 1799.0f) - 900.0f; -@@ -1652,7 +1652,7 @@ tablet_tool_wheel(void *data, struct zwp_tablet_tool_v2 *tool, - struct xwl_tablet_tool *xwl_tablet_tool = data; - struct xwl_seat *xwl_seat = xwl_tablet_tool->seat; - -- if (!xwl_seat->focus_window) -+ if (!xwl_seat->tablet_focus_window) - return; - - xwl_tablet_tool->wheel_clicks = clicks; -diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c -index 79deead8d..638022180 100644 ---- a/hw/xwayland/xwayland.c -+++ b/hw/xwayland/xwayland.c -@@ -545,6 +545,8 @@ xwl_unrealize_window(WindowPtr window) - xorg_list_for_each_entry(xwl_seat, &xwl_screen->seat_list, link) { - if (xwl_seat->focus_window && xwl_seat->focus_window->window == window) - xwl_seat->focus_window = NULL; -+ if (xwl_seat->tablet_focus_window && xwl_seat->tablet_focus_window->window == window) -+ xwl_seat->tablet_focus_window = NULL; - if (xwl_seat->last_xwindow == window) - xwl_seat->last_xwindow = NullWindow; - if (xwl_seat->cursor_confinement_window && -diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h -index 3adee82fa..e6eb37bec 100644 ---- a/hw/xwayland/xwayland.h -+++ b/hw/xwayland/xwayland.h -@@ -154,6 +154,7 @@ struct xwl_seat { - struct zwp_tablet_seat_v2 *tablet_seat; - struct wl_array keys; - struct xwl_window *focus_window; -+ struct xwl_window *tablet_focus_window; - uint32_t id; - uint32_t pointer_enter_serial; - struct xorg_list link; --- -2.14.3 - diff --git a/SOURCES/0001-xwayland-add-envvar-XWAYLAND_NO_GLAMOR.patch b/SOURCES/0001-xwayland-add-envvar-XWAYLAND_NO_GLAMOR.patch deleted file mode 100644 index e195272..0000000 --- a/SOURCES/0001-xwayland-add-envvar-XWAYLAND_NO_GLAMOR.patch +++ /dev/null @@ -1,41 +0,0 @@ -From 74cd913b98ddeaffdccc97735c017fae660e101b Mon Sep 17 00:00:00 2001 -From: Olivier Fourdan -Date: Thu, 2 Mar 2017 11:03:15 +0100 -Subject: [PATCH xserver] xwayland: add envvar XWAYLAND_NO_GLAMOR - -Not all compositors allow for customizing the Xwayland command line, -gnome-shell/mutter for example have the command line and path to -Xwayland binary hardcoded, which makes it harder for users to disable -glamor acceleration in Xwayland (glamor being used by default). - -Add an environment variable XWAYLAND_NO_GLAMOR to disable glamor support -in Xwayland. - -Signed-off-by: Olivier Fourdan -Reviewed-by: Eric Engestrom -(cherry picked from commit 1089d5d518a315963a8cda6c7d47a0ce09de0979) ---- - hw/xwayland/xwayland-glamor.c | 7 +++++++ - 1 file changed, 7 insertions(+) - -diff --git a/hw/xwayland/xwayland-glamor.c b/hw/xwayland/xwayland-glamor.c -index 63f230369..00c8334c5 100644 ---- a/hw/xwayland/xwayland-glamor.c -+++ b/hw/xwayland/xwayland-glamor.c -@@ -583,6 +583,13 @@ Bool - xwl_glamor_init(struct xwl_screen *xwl_screen) - { - ScreenPtr screen = xwl_screen->screen; -+ const char *no_glamor_env; -+ -+ no_glamor_env = getenv("XWAYLAND_NO_GLAMOR"); -+ if (no_glamor_env && *no_glamor_env != '0') { -+ ErrorF("Disabling glamor and dri3 support, XWAYLAND_NO_GLAMOR is set\n"); -+ return FALSE; -+ } - - if (xwl_screen->egl_context == EGL_NO_CONTEXT) { - ErrorF("Disabling glamor and dri3, EGL setup failed\n"); --- -2.13.5 - diff --git a/SOURCES/0002-animcur-Use-fixed-size-screen-private.patch b/SOURCES/0002-animcur-Use-fixed-size-screen-private.patch deleted file mode 100644 index e3e918d..0000000 --- a/SOURCES/0002-animcur-Use-fixed-size-screen-private.patch +++ /dev/null @@ -1,70 +0,0 @@ -From cb99ddee85ef8f5b98239a8625ad20ab5b10b911 Mon Sep 17 00:00:00 2001 -From: Adam Jackson -Date: Thu, 26 Oct 2017 13:40:57 -0400 -Subject: [PATCH xserver 2/6] animcur: Use fixed-size screen private - -Reviewed-by: Robert Morell -Tested-by: Robert Morell -Signed-off-by: Adam Jackson -(cherry picked from commit 3abbdb7318018584a27220737bd92081ce8ee67c) ---- - render/animcur.c | 16 ++++------------ - 1 file changed, 4 insertions(+), 12 deletions(-) - -diff --git a/render/animcur.c b/render/animcur.c -index 52e6b8b79..3f85f9a4f 100644 ---- a/render/animcur.c -+++ b/render/animcur.c -@@ -77,12 +77,9 @@ static CursorBits animCursorBits = { - - static DevPrivateKeyRec AnimCurScreenPrivateKeyRec; - --#define AnimCurScreenPrivateKey (&AnimCurScreenPrivateKeyRec) -- - #define IsAnimCur(c) ((c) && ((c)->bits == &animCursorBits)) - #define GetAnimCur(c) ((AnimCurPtr) ((((char *)(c) + CURSOR_REC_SIZE)))) --#define GetAnimCurScreen(s) ((AnimCurScreenPtr)dixLookupPrivate(&(s)->devPrivates, AnimCurScreenPrivateKey)) --#define SetAnimCurScreen(s,p) dixSetPrivate(&(s)->devPrivates, AnimCurScreenPrivateKey, p) -+#define GetAnimCurScreen(s) ((AnimCurScreenPtr)dixLookupPrivate(&(s)->devPrivates, &AnimCurScreenPrivateKeyRec)) - - #define Wrap(as,s,elt,func) (((as)->elt = (s)->elt), (s)->elt = func) - #define Unwrap(as,s,elt) ((s)->elt = (as)->elt) -@@ -101,9 +98,7 @@ AnimCurCloseScreen(ScreenPtr pScreen) - Unwrap(as, pScreen, RealizeCursor); - Unwrap(as, pScreen, UnrealizeCursor); - Unwrap(as, pScreen, RecolorCursor); -- SetAnimCurScreen(pScreen, 0); - ret = (*pScreen->CloseScreen) (pScreen); -- free(as); - return ret; - } - -@@ -308,15 +303,13 @@ AnimCurInit(ScreenPtr pScreen) - { - AnimCurScreenPtr as; - -- if (!dixRegisterPrivateKey(&AnimCurScreenPrivateKeyRec, PRIVATE_SCREEN, 0)) -+ if (!dixRegisterPrivateKey(&AnimCurScreenPrivateKeyRec, PRIVATE_SCREEN, -+ sizeof(AnimCurScreenRec))) - return FALSE; - -- as = (AnimCurScreenPtr) malloc(sizeof(AnimCurScreenRec)); -- if (!as) -- return FALSE; -+ as = GetAnimCurScreen(pScreen); - as->timer = TimerSet(NULL, TimerAbsolute, 0, AnimCurTimerNotify, pScreen); - if (!as->timer) { -- free(as); - return FALSE; - } - as->timer_set = FALSE; -@@ -329,7 +322,6 @@ AnimCurInit(ScreenPtr pScreen) - Wrap(as, pScreen, RealizeCursor, AnimCurRealizeCursor); - Wrap(as, pScreen, UnrealizeCursor, AnimCurUnrealizeCursor); - Wrap(as, pScreen, RecolorCursor, AnimCurRecolorCursor); -- SetAnimCurScreen(pScreen, as); - return TRUE; - } - --- -2.14.3 diff --git a/SOURCES/0002-miarc-Make-the-caller-free-the-arc-span-data.patch b/SOURCES/0002-miarc-Make-the-caller-free-the-arc-span-data.patch deleted file mode 100644 index 31055ae..0000000 --- a/SOURCES/0002-miarc-Make-the-caller-free-the-arc-span-data.patch +++ /dev/null @@ -1,167 +0,0 @@ -From 849c825855b82caf44d25edb8155bc9f17869256 Mon Sep 17 00:00:00 2001 -From: Adam Jackson -Date: Wed, 1 Mar 2017 16:13:58 -0500 -Subject: [PATCH 2/3] miarc: Make the caller free the arc span data - -drawArc does some fairly expensive computation, but it's only sensitive -to arc width/height. Thread the span data up through the call chain so -it's at least possible for the caller to cache things. - -Reviewed-by: Keith Packard -Signed-off-by: Adam Jackson ---- - mi/miarc.c | 64 ++++++++++++++++++++++++++++++++++---------------------------- - 1 file changed, 35 insertions(+), 29 deletions(-) - -diff --git a/mi/miarc.c b/mi/miarc.c -index fed5c9fa3..d6be99000 100644 ---- a/mi/miarc.c -+++ b/mi/miarc.c -@@ -215,10 +215,21 @@ typedef struct _miPolyArc { - miArcJoinPtr joins; - } miPolyArcRec, *miPolyArcPtr; - -+typedef struct { -+ short lx, lw, rx, rw; -+} miArcSpan; -+ -+typedef struct { -+ miArcSpan *spans; -+ int count1, count2, k; -+ char top, bot, hole; -+} miArcSpanData; -+ - static void fillSpans(DrawablePtr pDrawable, GCPtr pGC); - static void newFinalSpan(int y, int xmin, int xmax); --static void drawArc(xArc * tarc, int l, int a0, int a1, miArcFacePtr right, -- miArcFacePtr left); -+static miArcSpanData *drawArc(xArc * tarc, int l, int a0, int a1, -+ miArcFacePtr right, miArcFacePtr left, -+ miArcSpanData *spdata); - static void drawZeroArc(DrawablePtr pDraw, GCPtr pGC, xArc * tarc, int lw, - miArcFacePtr left, miArcFacePtr right); - static void miArcJoin(DrawablePtr pDraw, GCPtr pGC, miArcFacePtr pLeft, -@@ -244,9 +255,9 @@ static int miGetArcPts(SppArcPtr parc, int cpt, SppPointPtr * ppPts); - * draw one segment of the arc using the arc spans generation routines - */ - --static void --miArcSegment(DrawablePtr pDraw, -- GCPtr pGC, xArc tarc, miArcFacePtr right, miArcFacePtr left) -+static miArcSpanData * -+miArcSegment(DrawablePtr pDraw, GCPtr pGC, xArc tarc, miArcFacePtr right, -+ miArcFacePtr left, miArcSpanData *spdata) - { - int l = pGC->lineWidth; - int a0, a1, startAngle, endAngle; -@@ -257,7 +268,7 @@ miArcSegment(DrawablePtr pDraw, - - if (tarc.width == 0 || tarc.height == 0) { - drawZeroArc(pDraw, pGC, &tarc, l, left, right); -- return; -+ return spdata; - } - - if (pGC->miTranslate) { -@@ -298,7 +309,7 @@ miArcSegment(DrawablePtr pDraw, - endAngle = FULLCIRCLE; - } - -- drawArc(&tarc, l, startAngle, endAngle, right, left); -+ return drawArc(&tarc, l, startAngle, endAngle, right, left, spdata); - } - - /* -@@ -364,16 +375,6 @@ correspond to the inner and outer boundaries. - - */ - --typedef struct { -- short lx, lw, rx, rw; --} miArcSpan; -- --typedef struct { -- miArcSpan *spans; -- int count1, count2, k; -- char top, bot, hole; --} miArcSpanData; -- - static void drawQuadrant(struct arc_def *def, struct accelerators *acc, - int a0, int a1, int mask, miArcFacePtr right, - miArcFacePtr left, miArcSpanData * spdata); -@@ -905,8 +906,11 @@ miWideArc(DrawablePtr pDraw, GCPtr pGC, int narcs, xArc * parcs) - int halfWidth; - - if (width == 0 && pGC->lineStyle == LineSolid) { -- for (i = narcs, parc = parcs; --i >= 0; parc++) -- miArcSegment(pDraw, pGC, *parc, NULL, NULL); -+ for (i = narcs, parc = parcs; --i >= 0; parc++) { -+ miArcSpanData *spdata; -+ spdata = miArcSegment(pDraw, pGC, *parc, NULL, NULL, NULL); -+ free(spdata); -+ } - fillSpans(pDraw, pGC); - return; - } -@@ -1016,6 +1020,7 @@ miWideArc(DrawablePtr pDraw, GCPtr pGC, int narcs, xArc * parcs) - cap[0] = cap[1] = 0; - join[0] = join[1] = 0; - for (iphase = (pGC->lineStyle == LineDoubleDash); iphase >= 0; iphase--) { -+ miArcSpanData *spdata = NULL; - ChangeGCVal gcval; - - if (iphase == 1) { -@@ -1032,9 +1037,10 @@ miWideArc(DrawablePtr pDraw, GCPtr pGC, int narcs, xArc * parcs) - miArcDataPtr arcData; - - arcData = &polyArcs[iphase].arcs[i]; -- miArcSegment(pDrawTo, pGCTo, arcData->arc, -- &arcData->bounds[RIGHT_END], -- &arcData->bounds[LEFT_END]); -+ spdata = miArcSegment(pDrawTo, pGCTo, arcData->arc, -+ &arcData->bounds[RIGHT_END], -+ &arcData->bounds[LEFT_END], spdata); -+ free(spdata); - if (polyArcs[iphase].arcs[i].render) { - fillSpans(pDrawTo, pGCTo); - /* don't cap self-joining arcs */ -@@ -3240,9 +3246,9 @@ mirrorSppPoint(int quadrant, SppPointPtr sppPoint) - * first quadrant. - */ - --static void --drawArc(xArc * tarc, -- int l, int a0, int a1, miArcFacePtr right, miArcFacePtr left) -+static miArcSpanData * -+drawArc(xArc * tarc, int l, int a0, int a1, miArcFacePtr right, -+ miArcFacePtr left, miArcSpanData *spdata) - { /* save end line points */ - struct arc_def def; - struct accelerators acc; -@@ -3258,11 +3264,11 @@ drawArc(xArc * tarc, - int i, j; - int flipRight = 0, flipLeft = 0; - int copyEnd = 0; -- miArcSpanData *spdata; - -- spdata = miComputeWideEllipse(l, tarc); - if (!spdata) -- return; -+ spdata = miComputeWideEllipse(l, tarc); -+ if (!spdata) -+ return NULL; - - if (a1 < a0) - a1 += 360 * 64; -@@ -3472,7 +3478,7 @@ drawArc(xArc * tarc, - left->counterClock = temp; - } - } -- free(spdata); -+ return spdata; - } - - static void --- -2.12.0 - diff --git a/SOURCES/0002-xwayland-Bind-to-wp_tablet_manager-if-available-and-.patch b/SOURCES/0002-xwayland-Bind-to-wp_tablet_manager-if-available-and-.patch deleted file mode 100644 index 9e750cb..0000000 --- a/SOURCES/0002-xwayland-Bind-to-wp_tablet_manager-if-available-and-.patch +++ /dev/null @@ -1,166 +0,0 @@ -From 8dcc03fb4a5db18fb52377ee578a2a673d691a1e Mon Sep 17 00:00:00 2001 -From: Jason Gerecke -Date: Fri, 15 Jan 2016 17:29:37 -0800 -Subject: [PATCH xserver 02/12] xwayland: Bind to wp_tablet_manager if - available and get its seats - -If we're notified about the existence of the wp_tablet_manager interface, -we bind to it so that we can make use of any tablets that are (or later -become) available. For each seat that exists or comes into existance at -a later point, obtain the associated tablet_seat. - -Signed-off-by: Jason Gerecke -Signed-off-by: Carlos Garnacho -Reviewed-by: Peter Hutterer -Signed-off-by: Peter Hutterer -Acked-by: Ping Cheng -(cherry picked from commit 7d48b758a601ce0252ebd21297a7c42263adfaaf) ---- - hw/xwayland/xwayland-input.c | 59 ++++++++++++++++++++++++++++++++++++++++++++ - hw/xwayland/xwayland.c | 2 ++ - hw/xwayland/xwayland.h | 4 +++ - 3 files changed, 65 insertions(+) - -diff --git a/hw/xwayland/xwayland-input.c b/hw/xwayland/xwayland-input.c -index 8fdc875ea..1d2be978e 100644 ---- a/hw/xwayland/xwayland-input.c -+++ b/hw/xwayland/xwayland-input.c -@@ -63,6 +63,12 @@ static void - xwl_seat_destroy_confined_pointer(struct xwl_seat *xwl_seat); - - static void -+init_tablet_manager_seat(struct xwl_screen *xwl_screen, -+ struct xwl_seat *xwl_seat); -+static void -+release_tablet_manager_seat(struct xwl_seat *xwl_seat); -+ -+static void - xwl_pointer_control(DeviceIntPtr device, PtrCtrl *ctrl) - { - /* Nothing to do, dix handles all settings */ -@@ -1147,6 +1153,9 @@ create_input_device(struct xwl_screen *xwl_screen, uint32_t id, uint32_t version - - xwl_seat->cursor = wl_compositor_create_surface(xwl_screen->compositor); - wl_seat_add_listener(xwl_seat->seat, &seat_listener, xwl_seat); -+ -+ init_tablet_manager_seat(xwl_screen, xwl_seat); -+ - wl_array_init(&xwl_seat->keys); - - xorg_list_init(&xwl_seat->touches); -@@ -1170,6 +1179,8 @@ xwl_seat_destroy(struct xwl_seat *xwl_seat) - free (p); - } - -+ release_tablet_manager_seat(xwl_seat); -+ - wl_seat_destroy(xwl_seat->seat); - wl_surface_destroy(xwl_seat->cursor); - if (xwl_seat->cursor_frame_cb) -@@ -1178,6 +1189,52 @@ xwl_seat_destroy(struct xwl_seat *xwl_seat) - free(xwl_seat); - } - -+ -+static void -+init_tablet_manager_seat(struct xwl_screen *xwl_screen, -+ struct xwl_seat *xwl_seat) -+{ -+ if (!xwl_screen->tablet_manager) -+ return; -+ -+ xwl_seat->tablet_seat = -+ zwp_tablet_manager_v2_get_tablet_seat(xwl_screen->tablet_manager, -+ xwl_seat->seat); -+} -+ -+static void -+release_tablet_manager_seat(struct xwl_seat *xwl_seat) -+{ -+ if (xwl_seat->tablet_seat) { -+ zwp_tablet_seat_v2_destroy(xwl_seat->tablet_seat); -+ xwl_seat->tablet_seat = NULL; -+ } -+} -+ -+static void -+init_tablet_manager(struct xwl_screen *xwl_screen, uint32_t id, uint32_t version) -+{ -+ struct xwl_seat *xwl_seat; -+ -+ xwl_screen->tablet_manager = wl_registry_bind(xwl_screen->registry, -+ id, -+ &zwp_tablet_manager_v2_interface, -+ min(version,1)); -+ -+ xorg_list_for_each_entry(xwl_seat, &xwl_screen->seat_list, link) { -+ init_tablet_manager_seat(xwl_screen, xwl_seat); -+ } -+} -+ -+void -+xwl_screen_release_tablet_manager(struct xwl_screen *xwl_screen) -+{ -+ if (xwl_screen->tablet_manager) { -+ zwp_tablet_manager_v2_destroy(xwl_screen->tablet_manager); -+ xwl_screen->tablet_manager = NULL; -+ } -+} -+ - static void - init_relative_pointer_manager(struct xwl_screen *xwl_screen, - uint32_t id, uint32_t version) -@@ -1211,6 +1268,8 @@ input_handler(void *data, struct wl_registry *registry, uint32_t id, - init_relative_pointer_manager(xwl_screen, id, version); - } else if (strcmp(interface, "zwp_pointer_constraints_v1") == 0) { - init_pointer_constraints(xwl_screen, id, version); -+ } else if (strcmp(interface, "zwp_tablet_manager_v2") == 0) { -+ init_tablet_manager(xwl_screen, id, version); - } - } - -diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c -index 939f3392c..fa7b81c7a 100644 ---- a/hw/xwayland/xwayland.c -+++ b/hw/xwayland/xwayland.c -@@ -130,6 +130,8 @@ xwl_close_screen(ScreenPtr screen) - &xwl_screen->seat_list, link) - xwl_seat_destroy(xwl_seat); - -+ xwl_screen_release_tablet_manager(xwl_screen); -+ - RemoveNotifyFd(xwl_screen->wayland_fd); - - wl_display_disconnect(xwl_screen->display); -diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h -index 5e5624be0..2752d731c 100644 ---- a/hw/xwayland/xwayland.h -+++ b/hw/xwayland/xwayland.h -@@ -76,6 +76,7 @@ struct xwl_screen { - struct wl_registry *registry; - struct wl_registry *input_registry; - struct wl_compositor *compositor; -+ struct zwp_tablet_manager_v2 *tablet_manager; - struct wl_shm *shm; - struct wl_shell *shell; - struct zwp_relative_pointer_manager_v1 *relative_pointer_manager; -@@ -137,6 +138,7 @@ struct xwl_seat { - struct zwp_relative_pointer_v1 *wp_relative_pointer; - struct wl_keyboard *wl_keyboard; - struct wl_touch *wl_touch; -+ struct zwp_tablet_seat_v2 *tablet_seat; - struct wl_array keys; - struct xwl_window *focus_window; - uint32_t id; -@@ -241,6 +243,8 @@ Bool xwl_screen_init_glamor(struct xwl_screen *xwl_screen, - uint32_t id, uint32_t version); - struct wl_buffer *xwl_glamor_pixmap_get_wl_buffer(PixmapPtr pixmap); - -+void xwl_screen_release_tablet_manager(struct xwl_screen *xwl_screen); -+ - #ifdef XV - /* glamor Xv Adaptor */ - Bool xwl_glamor_xv_init(ScreenPtr pScreen); --- -2.13.5 - diff --git a/SOURCES/0003-animcur-Return-the-next-interval-directly-from-the-t.patch b/SOURCES/0003-animcur-Return-the-next-interval-directly-from-the-t.patch deleted file mode 100644 index 1d104d9..0000000 --- a/SOURCES/0003-animcur-Return-the-next-interval-directly-from-the-t.patch +++ /dev/null @@ -1,37 +0,0 @@ -From 8c72c85c76a003beaad9fe841ec4338dacd4b265 Mon Sep 17 00:00:00 2001 -From: Adam Jackson -Date: Thu, 26 Oct 2017 13:53:06 -0400 -Subject: [PATCH xserver 3/6] animcur: Return the next interval directly from - the timer callback - -If the return value is non-zero here, DoTimer() will automatically rearm -the timer for the new (relative) delay. 'soonest' is in absolute time, -so subtract off 'now' and return that. - -Reviewed-by: Robert Morell -Tested-by: Robert Morell -Signed-off-by: Adam Jackson -(cherry picked from commit cc3241a712684f8c7147f5688e9ee3ecb5a93b87) ---- - render/animcur.c | 5 ++--- - 1 file changed, 2 insertions(+), 3 deletions(-) - -diff --git a/render/animcur.c b/render/animcur.c -index 3f85f9a4f..26a6026ae 100644 ---- a/render/animcur.c -+++ b/render/animcur.c -@@ -169,10 +169,9 @@ AnimCurTimerNotify(OsTimerPtr timer, CARD32 now, void *arg) - } - - if (activeDevice) -- TimerSet(as->timer, TimerAbsolute, soonest, AnimCurTimerNotify, pScreen); -- else -- as->timer_set = FALSE; -+ return soonest - now; - -+ as->timer_set = FALSE; - return 0; - } - --- -2.14.3 diff --git a/SOURCES/0003-miarc-Cache-arc-span-data-for-dashed-arcs.patch b/SOURCES/0003-miarc-Cache-arc-span-data-for-dashed-arcs.patch deleted file mode 100644 index 75ea549..0000000 --- a/SOURCES/0003-miarc-Cache-arc-span-data-for-dashed-arcs.patch +++ /dev/null @@ -1,71 +0,0 @@ -From 0d7f05ed99b71a4641415c9f26e245c3bb24a9a0 Mon Sep 17 00:00:00 2001 -From: Adam Jackson -Date: Wed, 1 Mar 2017 16:13:59 -0500 -Subject: [PATCH 3/3] miarc: "Cache" arc span data for dashed arcs - -This avoids recomputing the span data for every dash. x11perf thinks -this is a pretty modest speedup: - - 832919.4 840471.1 ( 1.009) 100-pixel dashed ellipse - 672353.1 680652.2 ( 1.012) 100-pixel double-dashed ellipse - 13748.9 24287.9 ( 1.767) 100-pixel wide dashed ellipse - 9236.3 21298.2 ( 2.306) 100-pixel wide double-dashed ellipse - -But part of the reason it's so modest there is that the arcs are -relatively small (100 pixel diameter at line width 10, so ~6000 pixels) -and the dashes relatively large (30 on 20 off so ~6 dashes per -quadrant). - -With larger arcs and finer dashes this is much more impressive. A fairly -trivial testcase of a single 15000x13000 arc with the default {2, 2} -dash pattern drops from ~3500 milliseconds to 10 milliseconds. - -Reviewed-by: Keith Packard -Signed-off-by: Adam Jackson ---- - mi/miarc.c | 12 +++++++++++- - 1 file changed, 11 insertions(+), 1 deletion(-) - -diff --git a/mi/miarc.c b/mi/miarc.c -index d6be99000..71df4ab64 100644 ---- a/mi/miarc.c -+++ b/mi/miarc.c -@@ -1021,6 +1021,7 @@ miWideArc(DrawablePtr pDraw, GCPtr pGC, int narcs, xArc * parcs) - join[0] = join[1] = 0; - for (iphase = (pGC->lineStyle == LineDoubleDash); iphase >= 0; iphase--) { - miArcSpanData *spdata = NULL; -+ xArc lastArc; - ChangeGCVal gcval; - - if (iphase == 1) { -@@ -1037,10 +1038,17 @@ miWideArc(DrawablePtr pDraw, GCPtr pGC, int narcs, xArc * parcs) - miArcDataPtr arcData; - - arcData = &polyArcs[iphase].arcs[i]; -+ if (spdata) { -+ if (lastArc.width != arcData->arc.width || -+ lastArc.height != arcData->arc.height) { -+ free(spdata); -+ spdata = NULL; -+ } -+ } -+ memcpy(&lastArc, &arcData->arc, sizeof(xArc)); - spdata = miArcSegment(pDrawTo, pGCTo, arcData->arc, - &arcData->bounds[RIGHT_END], - &arcData->bounds[LEFT_END], spdata); -- free(spdata); - if (polyArcs[iphase].arcs[i].render) { - fillSpans(pDrawTo, pGCTo); - /* don't cap self-joining arcs */ -@@ -1097,6 +1105,8 @@ miWideArc(DrawablePtr pDraw, GCPtr pGC, int narcs, xArc * parcs) - } - } - } -+ free(spdata); -+ spdata = NULL; - } - miFreeArcs(polyArcs, pGC); - --- -2.12.0 - diff --git a/SOURCES/0003-xwayland-Listen-for-wp_tablet_seat-events.patch b/SOURCES/0003-xwayland-Listen-for-wp_tablet_seat-events.patch deleted file mode 100644 index 308331f..0000000 --- a/SOURCES/0003-xwayland-Listen-for-wp_tablet_seat-events.patch +++ /dev/null @@ -1,173 +0,0 @@ -From 243eadc7979e35756a4f0e349ee97bbbd3a268c3 Mon Sep 17 00:00:00 2001 -From: Jason Gerecke -Date: Fri, 14 Oct 2016 14:50:18 -0700 -Subject: [PATCH xserver 03/12] xwayland: Listen for wp_tablet_seat events - -The wp_tablet_seat interface provides us with notifications as tablets, -tools, and pads are connected to the system. Add listener functions and -store references to the obtained devices. - -Signed-off-by: Jason Gerecke -Signed-off-by: Carlos Garnacho -Reviewed-by: Peter Hutterer -Signed-off-by: Peter Hutterer -Acked-by: Ping Cheng -(cherry picked from commit 47c4415912b5b16b115135be365beb370858df76) ---- - hw/xwayland/xwayland-input.c | 94 ++++++++++++++++++++++++++++++++++++++++++++ - hw/xwayland/xwayland.h | 22 +++++++++++ - 2 files changed, 116 insertions(+) - -diff --git a/hw/xwayland/xwayland-input.c b/hw/xwayland/xwayland-input.c -index 1d2be978e..d5d12933c 100644 ---- a/hw/xwayland/xwayland-input.c -+++ b/hw/xwayland/xwayland-input.c -@@ -1191,6 +1191,69 @@ xwl_seat_destroy(struct xwl_seat *xwl_seat) - - - static void -+tablet_seat_handle_add_tablet(void *data, struct zwp_tablet_seat_v2 *tablet_seat, -+ struct zwp_tablet_v2 *tablet) -+{ -+ struct xwl_seat *xwl_seat = data; -+ struct xwl_tablet *xwl_tablet; -+ -+ xwl_tablet = calloc(sizeof *xwl_tablet, 1); -+ if (xwl_tablet == NULL) { -+ ErrorF("%s ENOMEM\n", __func__); -+ return; -+ } -+ -+ xwl_tablet->tablet = tablet; -+ xwl_tablet->seat = xwl_seat; -+ -+ xorg_list_add(&xwl_tablet->link, &xwl_seat->tablets); -+} -+ -+static void -+tablet_seat_handle_add_tool(void *data, struct zwp_tablet_seat_v2 *tablet_seat, -+ struct zwp_tablet_tool_v2 *tool) -+{ -+ struct xwl_seat *xwl_seat = data; -+ struct xwl_tablet_tool *xwl_tablet_tool; -+ -+ xwl_tablet_tool = calloc(sizeof *xwl_tablet_tool, 1); -+ if (xwl_tablet_tool == NULL) { -+ ErrorF("%s ENOMEM\n", __func__); -+ return; -+ } -+ -+ xwl_tablet_tool->tool = tool; -+ xwl_tablet_tool->seat = xwl_seat; -+ -+ xorg_list_add(&xwl_tablet_tool->link, &xwl_seat->tablet_tools); -+} -+ -+static void -+tablet_seat_handle_add_pad(void *data, struct zwp_tablet_seat_v2 *tablet_seat, -+ struct zwp_tablet_pad_v2 *pad) -+{ -+ struct xwl_seat *xwl_seat = data; -+ struct xwl_tablet_pad *xwl_tablet_pad; -+ -+ xwl_tablet_pad = calloc(sizeof *xwl_tablet_pad, 1); -+ if (xwl_tablet_pad == NULL) { -+ ErrorF("%s ENOMEM\n", __func__); -+ return; -+ } -+ -+ xwl_tablet_pad->pad = pad; -+ xwl_tablet_pad->seat = xwl_seat; -+ -+ xorg_list_add(&xwl_tablet_pad->link, &xwl_seat->tablet_pads); -+} -+ -+static const struct zwp_tablet_seat_v2_listener tablet_seat_listener = { -+ tablet_seat_handle_add_tablet, -+ tablet_seat_handle_add_tool, -+ tablet_seat_handle_add_pad -+}; -+ -+static void - init_tablet_manager_seat(struct xwl_screen *xwl_screen, - struct xwl_seat *xwl_seat) - { -@@ -1200,11 +1263,42 @@ init_tablet_manager_seat(struct xwl_screen *xwl_screen, - xwl_seat->tablet_seat = - zwp_tablet_manager_v2_get_tablet_seat(xwl_screen->tablet_manager, - xwl_seat->seat); -+ -+ xorg_list_init(&xwl_seat->tablets); -+ xorg_list_init(&xwl_seat->tablet_tools); -+ xorg_list_init(&xwl_seat->tablet_pads); -+ -+ zwp_tablet_seat_v2_add_listener(xwl_seat->tablet_seat, &tablet_seat_listener, xwl_seat); - } - - static void - release_tablet_manager_seat(struct xwl_seat *xwl_seat) - { -+ struct xwl_tablet *xwl_tablet, *next_xwl_tablet; -+ struct xwl_tablet_tool *xwl_tablet_tool, *next_xwl_tablet_tool; -+ struct xwl_tablet_pad *xwl_tablet_pad, *next_xwl_tablet_pad; -+ -+ xorg_list_for_each_entry_safe(xwl_tablet_pad, next_xwl_tablet_pad, -+ &xwl_seat->tablet_pads, link) { -+ xorg_list_del(&xwl_tablet_pad->link); -+ zwp_tablet_pad_v2_destroy(xwl_tablet_pad->pad); -+ free(xwl_tablet_pad); -+ } -+ -+ xorg_list_for_each_entry_safe(xwl_tablet_tool, next_xwl_tablet_tool, -+ &xwl_seat->tablet_tools, link) { -+ xorg_list_del(&xwl_tablet_tool->link); -+ zwp_tablet_tool_v2_destroy(xwl_tablet_tool->tool); -+ free(xwl_tablet_tool); -+ } -+ -+ xorg_list_for_each_entry_safe(xwl_tablet, next_xwl_tablet, -+ &xwl_seat->tablets, link) { -+ xorg_list_del(&xwl_tablet->link); -+ zwp_tablet_v2_destroy(xwl_tablet->tablet); -+ free(xwl_tablet); -+ } -+ - if (xwl_seat->tablet_seat) { - zwp_tablet_seat_v2_destroy(xwl_seat->tablet_seat); - xwl_seat->tablet_seat = NULL; -diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h -index 2752d731c..a7f30b3c8 100644 ---- a/hw/xwayland/xwayland.h -+++ b/hw/xwayland/xwayland.h -@@ -174,6 +174,28 @@ struct xwl_seat { - double dx_unaccel; - double dy_unaccel; - } pending_pointer_event; -+ -+ struct xorg_list tablets; -+ struct xorg_list tablet_tools; -+ struct xorg_list tablet_pads; -+}; -+ -+struct xwl_tablet { -+ struct xorg_list link; -+ struct zwp_tablet_v2 *tablet; -+ struct xwl_seat *seat; -+}; -+ -+struct xwl_tablet_tool { -+ struct xorg_list link; -+ struct zwp_tablet_tool_v2 *tool; -+ struct xwl_seat *seat; -+}; -+ -+struct xwl_tablet_pad { -+ struct xorg_list link; -+ struct zwp_tablet_pad_v2 *pad; -+ struct xwl_seat *seat; - }; - - struct xwl_output { --- -2.13.5 - diff --git a/SOURCES/0004-animcur-Run-the-timer-from-the-device-not-the-screen.patch b/SOURCES/0004-animcur-Run-the-timer-from-the-device-not-the-screen.patch deleted file mode 100644 index 542a10a..0000000 --- a/SOURCES/0004-animcur-Run-the-timer-from-the-device-not-the-screen.patch +++ /dev/null @@ -1,187 +0,0 @@ -From 2a798845c62f54c921d6fad7fa7fab596dc7e11b Mon Sep 17 00:00:00 2001 -From: Adam Jackson -Date: Thu, 26 Oct 2017 15:24:39 -0400 -Subject: [PATCH xserver 4/6] animcur: Run the timer from the device, not the - screen - -This is very slightly more efficient since the callback now doesn't need -to walk every input device, instead we know exactly which device's -cursor is being updated. AnimCurTimerNotify() gets outdented nicely as a -result. A more important side effect is that we can stop using the -TimerAbsolute mode and just pass in the relative delay. - -In AnimCurSetCursorPosition, we no longer need to rearm the timer with -the new screen; it is enough to update the device's state. In -AnimCurDisplayCursor we need to notice when we're switching from -animated cursor to regular and cancel the existing timer. - -Reviewed-by: Robert Morell -Tested-by: Robert Morell -Signed-off-by: Adam Jackson -(cherry picked from commit 094a63d56fbfb9e23210cc9ac538fb198af37cee) ---- - render/animcur.c | 85 +++++++++++++++++++------------------------------------- - 1 file changed, 28 insertions(+), 57 deletions(-) - -diff --git a/render/animcur.c b/render/animcur.c -index 26a6026ae..9393b4018 100644 ---- a/render/animcur.c -+++ b/render/animcur.c -@@ -55,6 +55,7 @@ typedef struct _AnimCurElt { - typedef struct _AnimCur { - int nelt; /* number of elements in the elts array */ - AnimCurElt *elts; /* actually allocated right after the structure */ -+ OsTimerPtr timer; - } AnimCurRec, *AnimCurPtr; - - typedef struct _AnimScrPriv { -@@ -65,8 +66,6 @@ typedef struct _AnimScrPriv { - RealizeCursorProcPtr RealizeCursor; - UnrealizeCursorProcPtr UnrealizeCursor; - RecolorCursorProcPtr RecolorCursor; -- OsTimerPtr timer; -- Bool timer_set; - } AnimCurScreenRec, *AnimCurScreenPtr; - - static unsigned char empty[4]; -@@ -130,49 +129,27 @@ AnimCurCursorLimits(DeviceIntPtr pDev, - static CARD32 - AnimCurTimerNotify(OsTimerPtr timer, CARD32 now, void *arg) - { -- ScreenPtr pScreen = arg; -+ DeviceIntPtr dev = arg; -+ ScreenPtr pScreen = dev->spriteInfo->anim.pScreen; - AnimCurScreenPtr as = GetAnimCurScreen(pScreen); -- DeviceIntPtr dev; -- Bool activeDevice = FALSE; -- CARD32 soonest = ~0; /* earliest time to wakeup again */ - -- for (dev = inputInfo.devices; dev; dev = dev->next) { -- if (IsPointerDevice(dev) && pScreen == dev->spriteInfo->anim.pScreen) { -- if (!activeDevice) -- activeDevice = TRUE; -+ AnimCurPtr ac = GetAnimCur(dev->spriteInfo->anim.pCursor); -+ int elt = (dev->spriteInfo->anim.elt + 1) % ac->nelt; -+ DisplayCursorProcPtr DisplayCursor = pScreen->DisplayCursor; - -- if ((INT32) (now - dev->spriteInfo->anim.time) >= 0) { -- AnimCurPtr ac = GetAnimCur(dev->spriteInfo->anim.pCursor); -- int elt = (dev->spriteInfo->anim.elt + 1) % ac->nelt; -- DisplayCursorProcPtr DisplayCursor; -+ /* -+ * Not a simple Unwrap/Wrap as this isn't called along the DisplayCursor -+ * wrapper chain. -+ */ -+ pScreen->DisplayCursor = as->DisplayCursor; -+ (void) (*pScreen->DisplayCursor) (dev, pScreen, ac->elts[elt].pCursor); -+ as->DisplayCursor = pScreen->DisplayCursor; -+ pScreen->DisplayCursor = DisplayCursor; - -- /* -- * Not a simple Unwrap/Wrap as this -- * isn't called along the DisplayCursor -- * wrapper chain. -- */ -- DisplayCursor = pScreen->DisplayCursor; -- pScreen->DisplayCursor = as->DisplayCursor; -- (void) (*pScreen->DisplayCursor) (dev, -- pScreen, -- ac->elts[elt].pCursor); -- as->DisplayCursor = pScreen->DisplayCursor; -- pScreen->DisplayCursor = DisplayCursor; -+ dev->spriteInfo->anim.elt = elt; -+ dev->spriteInfo->anim.time = now + ac->elts[elt].delay; - -- dev->spriteInfo->anim.elt = elt; -- dev->spriteInfo->anim.time = now + ac->elts[elt].delay; -- } -- -- if (soonest > dev->spriteInfo->anim.time) -- soonest = dev->spriteInfo->anim.time; -- } -- } -- -- if (activeDevice) -- return soonest - now; -- -- as->timer_set = FALSE; -- return 0; -+ return ac->elts[elt].delay; - } - - static Bool -@@ -198,17 +175,19 @@ AnimCurDisplayCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor) - pDev->spriteInfo->anim.pCursor = pCursor; - pDev->spriteInfo->anim.pScreen = pScreen; - -- if (!as->timer_set) { -- TimerSet(as->timer, TimerAbsolute, pDev->spriteInfo->anim.time, -- AnimCurTimerNotify, pScreen); -- as->timer_set = TRUE; -- } -+ ac->timer = TimerSet(ac->timer, 0, ac->elts[0].delay, -+ AnimCurTimerNotify, pDev); - } - } - else - ret = TRUE; - } - else { -+ CursorPtr old = pDev->spriteInfo->anim.pCursor; -+ -+ if (old && IsAnimCur(old)) -+ TimerCancel(GetAnimCur(old)->timer); -+ - pDev->spriteInfo->anim.pCursor = 0; - pDev->spriteInfo->anim.pScreen = 0; - ret = (*pScreen->DisplayCursor) (pDev, pScreen, pCursor); -@@ -227,12 +206,6 @@ AnimCurSetCursorPosition(DeviceIntPtr pDev, - Unwrap(as, pScreen, SetCursorPosition); - if (pDev->spriteInfo->anim.pCursor) { - pDev->spriteInfo->anim.pScreen = pScreen; -- -- if (!as->timer_set) { -- TimerSet(as->timer, TimerAbsolute, pDev->spriteInfo->anim.time, -- AnimCurTimerNotify, pScreen); -- as->timer_set = TRUE; -- } - } - ret = (*pScreen->SetCursorPosition) (pDev, pScreen, x, y, generateEvent); - Wrap(as, pScreen, SetCursorPosition, AnimCurSetCursorPosition); -@@ -307,11 +280,6 @@ AnimCurInit(ScreenPtr pScreen) - return FALSE; - - as = GetAnimCurScreen(pScreen); -- as->timer = TimerSet(NULL, TimerAbsolute, 0, AnimCurTimerNotify, pScreen); -- if (!as->timer) { -- return FALSE; -- } -- as->timer_set = FALSE; - - Wrap(as, pScreen, CloseScreen, AnimCurCloseScreen); - -@@ -359,10 +327,14 @@ AnimCursorCreate(CursorPtr *cursors, CARD32 *deltas, int ncursor, - - pCursor->id = cid; - -+ ac = GetAnimCur(pCursor); -+ ac->timer = TimerSet(NULL, 0, 0, AnimCurTimerNotify, NULL); -+ - /* security creation/labeling check */ - rc = XaceHook(XACE_RESOURCE_ACCESS, client, cid, RT_CURSOR, pCursor, - RT_NONE, NULL, DixCreateAccess); - if (rc != Success) { -+ TimerFree(ac->timer); - dixFiniPrivates(pCursor, PRIVATE_CURSOR); - free(pCursor); - return rc; -@@ -372,7 +344,6 @@ AnimCursorCreate(CursorPtr *cursors, CARD32 *deltas, int ncursor, - * Fill in the AnimCurRec - */ - animCursorBits.refcnt++; -- ac = GetAnimCur(pCursor); - ac->nelt = ncursor; - ac->elts = (AnimCurElt *) (ac + 1); - --- -2.14.3 diff --git a/SOURCES/0004-xwayland-Handle-wp_tablet-events.patch b/SOURCES/0004-xwayland-Handle-wp_tablet-events.patch deleted file mode 100644 index 4fb4453..0000000 --- a/SOURCES/0004-xwayland-Handle-wp_tablet-events.patch +++ /dev/null @@ -1,211 +0,0 @@ -From 591b08b3311c5217969a8ceb3ed58b58fabc4891 Mon Sep 17 00:00:00 2001 -From: Jason Gerecke -Date: Fri, 15 Jan 2016 17:01:38 -0800 -Subject: [PATCH xserver 04/12] xwayland: Handle wp_tablet events - -Creates and maintains the canonical trio of X devices (stylus, eraser, -and cursor) to be shared by all connected tablets. A per-tablet trio -could be created instead, but there are very few benefits to such a -configuration since all tablets still ultimately share control of a -single master pointer. - -The three X devices are modeled after those created by xf86-input-wacom -but use a generic maximum X and Y that should be large enough to -accurately represent values from even the largest currently-available -tablets. - -Signed-off-by: Jason Gerecke -Signed-off-by: Carlos Garnacho -Reviewed-by: Peter Hutterer -Signed-off-by: Peter Hutterer -Acked-by: Ping Cheng -(cherry picked from commit 5812d1c28f4fb7b7de8b96a81415a21425561fd4) ---- - hw/xwayland/xwayland-input.c | 142 +++++++++++++++++++++++++++++++++++++++++++ - hw/xwayland/xwayland.h | 3 + - 2 files changed, 145 insertions(+) - -diff --git a/hw/xwayland/xwayland-input.c b/hw/xwayland/xwayland-input.c -index d5d12933c..64655de5f 100644 ---- a/hw/xwayland/xwayland-input.c -+++ b/hw/xwayland/xwayland-input.c -@@ -294,6 +294,75 @@ xwl_touch_proc(DeviceIntPtr device, int what) - #undef NTOUCHPOINTS - } - -+static int -+xwl_tablet_proc(DeviceIntPtr device, int what) -+{ -+#define NBUTTONS 9 -+#define NAXES 6 -+ Atom btn_labels[NBUTTONS] = { 0 }; -+ Atom axes_labels[NAXES] = { 0 }; -+ BYTE map[NBUTTONS + 1] = { 0 }; -+ int i; -+ -+ switch (what) { -+ case DEVICE_INIT: -+ device->public.on = FALSE; -+ -+ for (i = 1; i <= NBUTTONS; i++) -+ map[i] = i; -+ -+ axes_labels[0] = XIGetKnownProperty(AXIS_LABEL_PROP_ABS_X); -+ axes_labels[1] = XIGetKnownProperty(AXIS_LABEL_PROP_ABS_Y); -+ axes_labels[2] = XIGetKnownProperty(AXIS_LABEL_PROP_ABS_PRESSURE); -+ axes_labels[3] = XIGetKnownProperty(AXIS_LABEL_PROP_ABS_TILT_X); -+ axes_labels[4] = XIGetKnownProperty(AXIS_LABEL_PROP_ABS_TILT_Y); -+ axes_labels[5] = XIGetKnownProperty(AXIS_LABEL_PROP_ABS_WHEEL); -+ -+ if (!InitValuatorClassDeviceStruct(device, NAXES, axes_labels, -+ GetMotionHistorySize(), Absolute)) -+ return BadValue; -+ -+ /* Valuators - match the xf86-input-wacom ranges */ -+ InitValuatorAxisStruct(device, 0, axes_labels[0], -+ 0, 262143, 10000, 0, 10000, Absolute); -+ InitValuatorAxisStruct(device, 1, axes_labels[1], -+ 0, 262143, 10000, 0, 10000, Absolute); -+ /* pressure */ -+ InitValuatorAxisStruct(device, 2, axes_labels[2], -+ 0, 65535, 1, 0, 1, Absolute); -+ /* tilt x */ -+ InitValuatorAxisStruct(device, 3, axes_labels[3], -+ -64, 63, 57, 0, 57, Absolute); -+ /* tilt y */ -+ InitValuatorAxisStruct(device, 4, axes_labels[4], -+ -64, 63, 57, 0, 57, Absolute); -+ /* abs wheel (airbrush) or rotation (artpen) */ -+ InitValuatorAxisStruct(device, 5, axes_labels[5], -+ -900, 899, 1, 0, 1, Absolute); -+ -+ if (!InitPtrFeedbackClassDeviceStruct(device, xwl_pointer_control)) -+ return BadValue; -+ -+ if (!InitButtonClassDeviceStruct(device, NBUTTONS, btn_labels, map)) -+ return BadValue; -+ -+ return Success; -+ -+ case DEVICE_ON: -+ device->public.on = TRUE; -+ return Success; -+ -+ case DEVICE_OFF: -+ case DEVICE_CLOSE: -+ device->public.on = FALSE; -+ return Success; -+ } -+ -+ return BadMatch; -+#undef NAXES -+#undef NBUTTONS -+} -+ - static void - pointer_handle_enter(void *data, struct wl_pointer *pointer, - uint32_t serial, struct wl_surface *surface, -@@ -1189,6 +1258,77 @@ xwl_seat_destroy(struct xwl_seat *xwl_seat) - free(xwl_seat); - } - -+static void -+tablet_handle_name(void *data, struct zwp_tablet_v2 *tablet, const char *name) -+{ -+} -+ -+static void -+tablet_handle_id(void *data, struct zwp_tablet_v2 *tablet, uint32_t vid, -+ uint32_t pid) -+{ -+} -+ -+static void -+tablet_handle_path(void *data, struct zwp_tablet_v2 *tablet, const char *path) -+{ -+} -+ -+static void -+tablet_handle_done(void *data, struct zwp_tablet_v2 *tablet) -+{ -+ struct xwl_tablet *xwl_tablet = data; -+ struct xwl_seat *xwl_seat = xwl_tablet->seat; -+ -+ if (xwl_seat->stylus == NULL) { -+ xwl_seat->stylus = add_device(xwl_seat, "xwayland-stylus", xwl_tablet_proc); -+ ActivateDevice(xwl_seat->stylus, TRUE); -+ } -+ EnableDevice(xwl_seat->stylus, TRUE); -+ -+ if (xwl_seat->eraser == NULL) { -+ xwl_seat->eraser = add_device(xwl_seat, "xwayland-eraser", xwl_tablet_proc); -+ ActivateDevice(xwl_seat->eraser, TRUE); -+ } -+ EnableDevice(xwl_seat->eraser, TRUE); -+ -+ if (xwl_seat->puck == NULL) { -+ xwl_seat->puck = add_device(xwl_seat, "xwayland-cursor", xwl_tablet_proc); -+ ActivateDevice(xwl_seat->puck, TRUE); -+ } -+ EnableDevice(xwl_seat->puck, TRUE); -+} -+ -+static void -+tablet_handle_removed(void *data, struct zwp_tablet_v2 *tablet) -+{ -+ struct xwl_tablet *xwl_tablet = data; -+ struct xwl_seat *xwl_seat = xwl_tablet->seat; -+ -+ xorg_list_del(&xwl_tablet->link); -+ -+ /* The tablet is merely disabled, not removed. The next tablet -+ will re-use the same X devices */ -+ if (xorg_list_is_empty(&xwl_seat->tablets)) { -+ if (xwl_seat->stylus) -+ DisableDevice(xwl_seat->stylus, TRUE); -+ if (xwl_seat->eraser) -+ DisableDevice(xwl_seat->eraser, TRUE); -+ if (xwl_seat->puck) -+ DisableDevice(xwl_seat->puck, TRUE); -+ } -+ -+ zwp_tablet_v2_destroy(tablet); -+ free(xwl_tablet); -+} -+ -+static const struct zwp_tablet_v2_listener tablet_listener = { -+ tablet_handle_name, -+ tablet_handle_id, -+ tablet_handle_path, -+ tablet_handle_done, -+ tablet_handle_removed -+}; - - static void - tablet_seat_handle_add_tablet(void *data, struct zwp_tablet_seat_v2 *tablet_seat, -@@ -1207,6 +1347,8 @@ tablet_seat_handle_add_tablet(void *data, struct zwp_tablet_seat_v2 *tablet_seat - xwl_tablet->seat = xwl_seat; - - xorg_list_add(&xwl_tablet->link, &xwl_seat->tablets); -+ -+ zwp_tablet_v2_add_listener(tablet, &tablet_listener, xwl_tablet); - } - - static void -diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h -index a7f30b3c8..e7e62882b 100644 ---- a/hw/xwayland/xwayland.h -+++ b/hw/xwayland/xwayland.h -@@ -132,6 +132,9 @@ struct xwl_seat { - DeviceIntPtr relative_pointer; - DeviceIntPtr keyboard; - DeviceIntPtr touch; -+ DeviceIntPtr stylus; -+ DeviceIntPtr eraser; -+ DeviceIntPtr puck; - struct xwl_screen *xwl_screen; - struct wl_seat *seat; - struct wl_pointer *wl_pointer; --- -2.13.5 - diff --git a/SOURCES/0005-animcur-Fix-transitions-between-animated-cursors.patch b/SOURCES/0005-animcur-Fix-transitions-between-animated-cursors.patch deleted file mode 100644 index 9b23045..0000000 --- a/SOURCES/0005-animcur-Fix-transitions-between-animated-cursors.patch +++ /dev/null @@ -1,77 +0,0 @@ -From a8f8ecdde495fb2a6ecdeca306b55c22b5fd3a6d Mon Sep 17 00:00:00 2001 -From: Adam Jackson -Date: Tue, 9 Jan 2018 10:54:05 -0500 -Subject: [PATCH xserver 5/6] animcur: Fix transitions between animated cursors - -We weren't cancelling the old timer when changing cursors, making things -go all crashy. Logically we could always cancel the timer first, but -then we'd have to call TimerSet to re-arm ourselves, and GetTimeInMillis -is potentially expensive. - -Reported-by: https://devtalk.nvidia.com/default/topic/1028172/linux/titan-v-ubuntu-16-04lts-and-387-34-driver-crashes-badly/post/5230967/#5230967 -Signed-off-by: Adam Jackson -Reviewed-by: Aaron Plattner -Tested-by: Aaron Plattner -(cherry picked from commit de60245e05c0d2528d4ff42557a044387e53315c) ---- - render/animcur.c | 25 +++++++++++++++---------- - 1 file changed, 15 insertions(+), 10 deletions(-) - -diff --git a/render/animcur.c b/render/animcur.c -index 9393b4018..e585a8f23 100644 ---- a/render/animcur.c -+++ b/render/animcur.c -@@ -152,11 +152,20 @@ AnimCurTimerNotify(OsTimerPtr timer, CARD32 now, void *arg) - return ac->elts[elt].delay; - } - -+static void -+AnimCurCancelTimer(DeviceIntPtr pDev) -+{ -+ CursorPtr cur = pDev->spriteInfo->anim.pCursor; -+ -+ if (IsAnimCur(cur)) -+ TimerCancel(GetAnimCur(cur)->timer); -+} -+ - static Bool - AnimCurDisplayCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor) - { - AnimCurScreenPtr as = GetAnimCurScreen(pScreen); -- Bool ret; -+ Bool ret = TRUE; - - if (IsFloating(pDev)) - return FALSE; -@@ -166,8 +175,10 @@ AnimCurDisplayCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor) - if (pCursor != pDev->spriteInfo->anim.pCursor) { - AnimCurPtr ac = GetAnimCur(pCursor); - -- ret = (*pScreen->DisplayCursor) -- (pDev, pScreen, ac->elts[0].pCursor); -+ AnimCurCancelTimer(pDev); -+ ret = (*pScreen->DisplayCursor) (pDev, pScreen, -+ ac->elts[0].pCursor); -+ - if (ret) { - pDev->spriteInfo->anim.elt = 0; - pDev->spriteInfo->anim.time = -@@ -179,15 +190,9 @@ AnimCurDisplayCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor) - AnimCurTimerNotify, pDev); - } - } -- else -- ret = TRUE; - } - else { -- CursorPtr old = pDev->spriteInfo->anim.pCursor; -- -- if (old && IsAnimCur(old)) -- TimerCancel(GetAnimCur(old)->timer); -- -+ AnimCurCancelTimer(pDev); - pDev->spriteInfo->anim.pCursor = 0; - pDev->spriteInfo->anim.pScreen = 0; - ret = (*pScreen->DisplayCursor) (pDev, pScreen, pCursor); --- -2.14.3 diff --git a/SOURCES/0005-xwayland-Handle-tablet_tool-events.patch b/SOURCES/0005-xwayland-Handle-tablet_tool-events.patch deleted file mode 100644 index 5ebc618..0000000 --- a/SOURCES/0005-xwayland-Handle-tablet_tool-events.patch +++ /dev/null @@ -1,374 +0,0 @@ -From 4354336014ca0c29270a6cdf83e9f9e5fe16080e Mon Sep 17 00:00:00 2001 -From: Jason Gerecke -Date: Fri, 14 Oct 2016 14:31:46 -0700 -Subject: [PATCH xserver 05/12] xwayland: Handle tablet_tool events - -Translates Wayland tablet events into corresponding X11 tablet events. As -with the prior commit, these events are modeled after those created by the -xf86-input-wacom driver to maximize compatibility with existing applications. - -Signed-off-by: Jason Gerecke -Signed-off-by: Carlos Garnacho -Reviewed-by: Peter Hutterer -Signed-off-by: Peter Hutterer -Acked-by: Ping Cheng -(cherry picked from commit 8a1defcc634daddbb3570519d69ec5c9e39a8b56) ---- - hw/xwayland/xwayland-input.c | 313 +++++++++++++++++++++++++++++++++++++++++++ - hw/xwayland/xwayland.h | 9 ++ - 2 files changed, 322 insertions(+) - -diff --git a/hw/xwayland/xwayland-input.c b/hw/xwayland/xwayland-input.c -index 64655de5f..142862f7e 100644 ---- a/hw/xwayland/xwayland-input.c -+++ b/hw/xwayland/xwayland-input.c -@@ -1331,6 +1331,317 @@ static const struct zwp_tablet_v2_listener tablet_listener = { - }; - - static void -+tablet_tool_receive_type(void *data, struct zwp_tablet_tool_v2 *tool, -+ uint32_t type) -+{ -+ struct xwl_tablet_tool *xwl_tablet_tool = data; -+ struct xwl_seat *xwl_seat = xwl_tablet_tool->seat; -+ -+ switch (type) { -+ case ZWP_TABLET_TOOL_V2_TYPE_ERASER: -+ xwl_tablet_tool->xdevice = xwl_seat->eraser; -+ break; -+ case ZWP_TABLET_TOOL_V2_TYPE_MOUSE: -+ case ZWP_TABLET_TOOL_V2_TYPE_LENS: -+ xwl_tablet_tool->xdevice = xwl_seat->puck; -+ break; -+ default: -+ xwl_tablet_tool->xdevice = xwl_seat->stylus; -+ break; -+ } -+} -+ -+static void -+tablet_tool_receive_hardware_serial(void *data, struct zwp_tablet_tool_v2 *tool, -+ uint32_t hi, uint32_t low) -+{ -+} -+ -+static void -+tablet_tool_receive_hardware_id_wacom(void *data, struct zwp_tablet_tool_v2 *tool, -+ uint32_t hi, uint32_t low) -+{ -+} -+ -+static void -+tablet_tool_receive_capability(void *data, struct zwp_tablet_tool_v2 *tool, -+ uint32_t capability) -+{ -+} -+ -+static void -+tablet_tool_receive_done(void *data, struct zwp_tablet_tool_v2 *tool) -+{ -+} -+ -+static void -+tablet_tool_receive_removed(void *data, struct zwp_tablet_tool_v2 *tool) -+{ -+ struct xwl_tablet_tool *xwl_tablet_tool = data; -+ -+ xorg_list_del(&xwl_tablet_tool->link); -+ zwp_tablet_tool_v2_destroy(tool); -+ free(xwl_tablet_tool); -+} -+ -+static void -+tablet_tool_proximity_in(void *data, struct zwp_tablet_tool_v2 *tool, -+ uint32_t serial, struct zwp_tablet_v2 *tablet, -+ struct wl_surface *wl_surface) -+{ -+ struct xwl_tablet_tool *xwl_tablet_tool = data; -+ struct xwl_seat *xwl_seat = xwl_tablet_tool->seat; -+ -+ /* There's a race here where if we create and then immediately -+ * destroy a surface, we might end up in a state where the Wayland -+ * compositor sends us an event for a surface that doesn't exist. -+ * -+ * Don't process enter events in this case. -+ * -+ * see pointer_handle_enter() -+ */ -+ if (wl_surface == NULL) -+ return; -+ -+ xwl_seat->focus_window = wl_surface_get_user_data(wl_surface); -+} -+ -+static void -+tablet_tool_proximity_out(void *data, struct zwp_tablet_tool_v2 *tool) -+{ -+ struct xwl_tablet_tool *xwl_tablet_tool = data; -+ struct xwl_seat *xwl_seat = xwl_tablet_tool->seat; -+ -+ xwl_seat->focus_window = NULL; -+ -+ xwl_tablet_tool->pressure = 0; -+ xwl_tablet_tool->tilt_x = 0; -+ xwl_tablet_tool->tilt_y = 0; -+ xwl_tablet_tool->rotation = 0; -+ xwl_tablet_tool->slider = 0; -+} -+ -+static void -+tablet_tool_down(void *data, struct zwp_tablet_tool_v2 *tool, uint32_t serial) -+{ -+ struct xwl_tablet_tool *xwl_tablet_tool = data; -+ struct xwl_seat *xwl_seat = xwl_tablet_tool->seat; -+ ValuatorMask mask; -+ -+ xwl_seat->xwl_screen->serial = serial; -+ -+ valuator_mask_zero(&mask); -+ QueuePointerEvents(xwl_tablet_tool->xdevice, ButtonPress, 1, 0, &mask); -+} -+ -+static void -+tablet_tool_up(void *data, struct zwp_tablet_tool_v2 *tool) -+{ -+ struct xwl_tablet_tool *xwl_tablet_tool = data; -+ ValuatorMask mask; -+ -+ valuator_mask_zero(&mask); -+ QueuePointerEvents(xwl_tablet_tool->xdevice, ButtonRelease, 1, 0, &mask); -+} -+ -+static void -+tablet_tool_motion(void *data, struct zwp_tablet_tool_v2 *tool, -+ wl_fixed_t x, wl_fixed_t y) -+{ -+ struct xwl_tablet_tool *xwl_tablet_tool = data; -+ struct xwl_seat *xwl_seat = xwl_tablet_tool->seat; -+ int32_t dx, dy; -+ int sx = wl_fixed_to_int(x); -+ int sy = wl_fixed_to_int(y); -+ -+ if (!xwl_seat->focus_window) -+ return; -+ -+ dx = xwl_seat->focus_window->window->drawable.x; -+ dy = xwl_seat->focus_window->window->drawable.y; -+ -+ xwl_tablet_tool->x = dx + sx; -+ xwl_tablet_tool->y = dy + sy; -+} -+ -+static void -+tablet_tool_pressure(void *data, struct zwp_tablet_tool_v2 *tool, -+ uint32_t pressure) -+{ -+ struct xwl_tablet_tool *xwl_tablet_tool = data; -+ struct xwl_seat *xwl_seat = xwl_tablet_tool->seat; -+ -+ if (!xwl_seat->focus_window) -+ return; -+ -+ /* normalized to 65535 already */ -+ xwl_tablet_tool->pressure = pressure; -+} -+ -+static void -+tablet_tool_distance(void *data, struct zwp_tablet_tool_v2 *tool, -+ uint32_t distance_raw) -+{ -+} -+ -+static void -+tablet_tool_tilt(void *data, struct zwp_tablet_tool_v2 *tool, -+ wl_fixed_t tilt_x, wl_fixed_t tilt_y) -+{ -+ struct xwl_tablet_tool *xwl_tablet_tool = data; -+ struct xwl_seat *xwl_seat = xwl_tablet_tool->seat; -+ -+ if (!xwl_seat->focus_window) -+ return; -+ -+ xwl_tablet_tool->tilt_x = wl_fixed_to_double(tilt_x); -+ xwl_tablet_tool->tilt_y = wl_fixed_to_double(tilt_y); -+} -+ -+static void -+tablet_tool_rotation(void *data, struct zwp_tablet_tool_v2 *tool, -+ wl_fixed_t angle) -+{ -+ struct xwl_tablet_tool *xwl_tablet_tool = data; -+ struct xwl_seat *xwl_seat = xwl_tablet_tool->seat; -+ double rotation = wl_fixed_to_double(angle); -+ -+ if (!xwl_seat->focus_window) -+ return; -+ -+ /* change origin (buttons facing right [libinput +90 degrees]) and -+ * scaling (5 points per degree) to match wacom driver behavior -+ */ -+ rotation = remainderf(rotation + 90.0f, 360.0f); -+ rotation *= 5.0f; -+ xwl_tablet_tool->rotation = rotation; -+} -+ -+static void -+tablet_tool_slider(void *data, struct zwp_tablet_tool_v2 *tool, -+ int32_t position_raw) -+{ -+ struct xwl_tablet_tool *xwl_tablet_tool = data; -+ struct xwl_seat *xwl_seat = xwl_tablet_tool->seat; -+ float position = position_raw / 65535.0; -+ -+ if (!xwl_seat->focus_window) -+ return; -+ -+ xwl_tablet_tool->slider = (position * 1799.0f) - 900.0f; -+} -+ -+static void -+tablet_tool_wheel(void *data, struct zwp_tablet_tool_v2 *tool, -+ wl_fixed_t degrees, int32_t clicks) -+{ -+} -+ -+static void -+tablet_tool_button_state(void *data, struct zwp_tablet_tool_v2 *tool, -+ uint32_t serial, uint32_t button, uint32_t state) -+{ -+ struct xwl_tablet_tool *xwl_tablet_tool = data; -+ struct xwl_seat *xwl_seat = xwl_tablet_tool->seat; -+ int xbtn = 0; -+ ValuatorMask mask; -+ -+ /* BTN_0 .. BTN_9 */ -+ if (button >= 0x100 && button <= 0x109) { -+ xbtn = button - 0x100 + 1; -+ } -+ /* BTN_A .. BTN_Z */ -+ else if (button >= 0x130 && button <= 0x135) { -+ xbtn = button - 0x130 + 10; -+ } -+ /* BTN_BASE .. BTN_BASE6 */ -+ else if (button >= 0x126 && button <= 0x12b) { -+ xbtn = button - 0x126 + 16; -+ } -+ else { -+ switch (button) { -+ case 0x110: /* BTN_LEFT */ -+ case 0x14a: /* BTN_TOUCH */ -+ xbtn = 1; -+ break; -+ -+ case 0x112: /* BTN_MIDDLE */ -+ case 0x14b: /* BTN_STYLUS */ -+ xbtn = 2; -+ break; -+ -+ case 0x111: /* BTN_RIGHT */ -+ case 0x14c: /* BTN_STYLUS2 */ -+ xbtn = 3; -+ break; -+ -+ case 0x113: /* BTN_SIDE */ -+ case 0x116: /* BTN_BACK */ -+ xbtn = 8; -+ break; -+ -+ case 0x114: /* BTN_EXTRA */ -+ case 0x115: /* BTN_FORWARD */ -+ xbtn = 9; -+ break; -+ } -+ } -+ -+ if (!xbtn) { -+ ErrorF("unknown tablet button number %d\n", button); -+ return; -+ } -+ -+ xwl_seat->xwl_screen->serial = serial; -+ -+ valuator_mask_zero(&mask); -+ QueuePointerEvents(xwl_tablet_tool->xdevice, -+ state ? ButtonPress : ButtonRelease, xbtn, 0, &mask); -+} -+ -+static void -+tablet_tool_frame(void *data, struct zwp_tablet_tool_v2 *tool, uint32_t time) -+{ -+ struct xwl_tablet_tool *xwl_tablet_tool = data; -+ ValuatorMask mask; -+ -+ valuator_mask_zero(&mask); -+ valuator_mask_set(&mask, 0, xwl_tablet_tool->x); -+ valuator_mask_set(&mask, 1, xwl_tablet_tool->y); -+ valuator_mask_set(&mask, 2, xwl_tablet_tool->pressure); -+ valuator_mask_set(&mask, 3, xwl_tablet_tool->tilt_x); -+ valuator_mask_set(&mask, 4, xwl_tablet_tool->tilt_y); -+ valuator_mask_set(&mask, 5, xwl_tablet_tool->rotation + xwl_tablet_tool->slider); -+ -+ /* FIXME: Store button mask in xwl_tablet_tool and send events *HERE* if -+ changed */ -+ QueuePointerEvents(xwl_tablet_tool->xdevice, MotionNotify, 0, -+ POINTER_ABSOLUTE | POINTER_SCREEN, &mask); -+} -+ -+static const struct zwp_tablet_tool_v2_listener tablet_tool_listener = { -+ tablet_tool_receive_type, -+ tablet_tool_receive_hardware_serial, -+ tablet_tool_receive_hardware_id_wacom, -+ tablet_tool_receive_capability, -+ tablet_tool_receive_done, -+ tablet_tool_receive_removed, -+ tablet_tool_proximity_in, -+ tablet_tool_proximity_out, -+ tablet_tool_down, -+ tablet_tool_up, -+ tablet_tool_motion, -+ tablet_tool_pressure, -+ tablet_tool_distance, -+ tablet_tool_tilt, -+ tablet_tool_rotation, -+ tablet_tool_slider, -+ tablet_tool_wheel, -+ tablet_tool_button_state, -+ tablet_tool_frame -+}; -+ -+static void - tablet_seat_handle_add_tablet(void *data, struct zwp_tablet_seat_v2 *tablet_seat, - struct zwp_tablet_v2 *tablet) - { -@@ -1368,6 +1679,8 @@ tablet_seat_handle_add_tool(void *data, struct zwp_tablet_seat_v2 *tablet_seat, - xwl_tablet_tool->seat = xwl_seat; - - xorg_list_add(&xwl_tablet_tool->link, &xwl_seat->tablet_tools); -+ -+ zwp_tablet_tool_v2_add_listener(tool, &tablet_tool_listener, xwl_tablet_tool); - } - - static void -diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h -index e7e62882b..fb9ac4804 100644 ---- a/hw/xwayland/xwayland.h -+++ b/hw/xwayland/xwayland.h -@@ -193,6 +193,15 @@ struct xwl_tablet_tool { - struct xorg_list link; - struct zwp_tablet_tool_v2 *tool; - struct xwl_seat *seat; -+ -+ DeviceIntPtr xdevice; -+ uint32_t x; -+ uint32_t y; -+ uint32_t pressure; -+ float tilt_x; -+ float tilt_y; -+ float rotation; -+ float slider; - }; - - struct xwl_tablet_pad { --- -2.13.5 - diff --git a/SOURCES/0006-animcur-Change-which-CursorPtr-we-save-in-external-s.patch b/SOURCES/0006-animcur-Change-which-CursorPtr-we-save-in-external-s.patch deleted file mode 100644 index bb3ec37..0000000 --- a/SOURCES/0006-animcur-Change-which-CursorPtr-we-save-in-external-s.patch +++ /dev/null @@ -1,78 +0,0 @@ -From b8e4a6a4b78946e2155e0413ce396d587ab35a66 Mon Sep 17 00:00:00 2001 -From: Adam Jackson -Date: Fri, 9 Feb 2018 16:03:38 -0500 -Subject: [PATCH xserver 6/6] animcur: Change which CursorPtr we save in - external state - -Formerly spriteInfo->anim.pCursor would point to the animated cursor (or -NULL if not animated). That value would also be available in -spriteInfo->sprite->current, so instead lets use anim.pCursor to point -to the current animation element. - -(Also: having done this, look that one up from the XFixes requests) - -Signed-off-by: Adam Jackson -(cherry picked from commit e4edcaca33d3b23f612d5a91a93f52770d8fab3e) ---- - render/animcur.c | 7 ++++--- - xfixes/cursor.c | 5 ++++- - 2 files changed, 8 insertions(+), 4 deletions(-) - -diff --git a/render/animcur.c b/render/animcur.c -index e585a8f23..50e254d01 100644 ---- a/render/animcur.c -+++ b/render/animcur.c -@@ -133,7 +133,7 @@ AnimCurTimerNotify(OsTimerPtr timer, CARD32 now, void *arg) - ScreenPtr pScreen = dev->spriteInfo->anim.pScreen; - AnimCurScreenPtr as = GetAnimCurScreen(pScreen); - -- AnimCurPtr ac = GetAnimCur(dev->spriteInfo->anim.pCursor); -+ AnimCurPtr ac = GetAnimCur(dev->spriteInfo->sprite->current); - int elt = (dev->spriteInfo->anim.elt + 1) % ac->nelt; - DisplayCursorProcPtr DisplayCursor = pScreen->DisplayCursor; - -@@ -148,6 +148,7 @@ AnimCurTimerNotify(OsTimerPtr timer, CARD32 now, void *arg) - - dev->spriteInfo->anim.elt = elt; - dev->spriteInfo->anim.time = now + ac->elts[elt].delay; -+ dev->spriteInfo->anim.pCursor = ac->elts[elt].pCursor; - - return ac->elts[elt].delay; - } -@@ -155,7 +156,7 @@ AnimCurTimerNotify(OsTimerPtr timer, CARD32 now, void *arg) - static void - AnimCurCancelTimer(DeviceIntPtr pDev) - { -- CursorPtr cur = pDev->spriteInfo->anim.pCursor; -+ CursorPtr cur = pDev->spriteInfo->sprite->current; - - if (IsAnimCur(cur)) - TimerCancel(GetAnimCur(cur)->timer); -@@ -172,7 +173,7 @@ AnimCurDisplayCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor) - - Unwrap(as, pScreen, DisplayCursor); - if (IsAnimCur(pCursor)) { -- if (pCursor != pDev->spriteInfo->anim.pCursor) { -+ if (pCursor != pDev->spriteInfo->sprite->current) { - AnimCurPtr ac = GetAnimCur(pCursor); - - AnimCurCancelTimer(pDev); -diff --git a/xfixes/cursor.c b/xfixes/cursor.c -index a150f450b..a1fbd562e 100644 ---- a/xfixes/cursor.c -+++ b/xfixes/cursor.c -@@ -134,8 +134,11 @@ Bool EnableCursor = TRUE; - static CursorPtr - CursorForDevice(DeviceIntPtr pDev) - { -- if (pDev && pDev->spriteInfo && pDev->spriteInfo->sprite) -+ if (pDev && pDev->spriteInfo && pDev->spriteInfo->sprite) { -+ if (pDev->spriteInfo->anim.pCursor) -+ return pDev->spriteInfo->anim.pCursor; - return pDev->spriteInfo->sprite->current; -+ } - - return NULL; - } --- -2.14.3 diff --git a/SOURCES/0006-xwayland-handle-button-events-after-motion-events.patch b/SOURCES/0006-xwayland-handle-button-events-after-motion-events.patch deleted file mode 100644 index 97b0c48..0000000 --- a/SOURCES/0006-xwayland-handle-button-events-after-motion-events.patch +++ /dev/null @@ -1,121 +0,0 @@ -From 317ce1201a2ec848f9066294ea544b756f735385 Mon Sep 17 00:00:00 2001 -From: Peter Hutterer -Date: Tue, 7 Feb 2017 12:23:46 +1000 -Subject: [PATCH xserver 06/12] xwayland: handle button events after motion - events - -Make sure the button events are sent after the motion events into the new -position. - -Signed-off-by: Peter Hutterer -Acked-by: Ping Cheng -(cherry picked from commit 773b04748d0c839bc8b12e33f74bb8d11c447f5b) ---- - hw/xwayland/xwayland-input.c | 44 +++++++++++++++++++++++++++++++++++++------- - hw/xwayland/xwayland.h | 3 +++ - 2 files changed, 40 insertions(+), 7 deletions(-) - -diff --git a/hw/xwayland/xwayland-input.c b/hw/xwayland/xwayland-input.c -index 142862f7e..50da10839 100644 ---- a/hw/xwayland/xwayland-input.c -+++ b/hw/xwayland/xwayland-input.c -@@ -34,6 +34,7 @@ - #include - #include - #include -+#include - #include "tablet-unstable-v2-client-protocol.h" - - /* Copied from mipointer.c */ -@@ -1543,8 +1544,8 @@ tablet_tool_button_state(void *data, struct zwp_tablet_tool_v2 *tool, - { - struct xwl_tablet_tool *xwl_tablet_tool = data; - struct xwl_seat *xwl_seat = xwl_tablet_tool->seat; -+ uint32_t *mask = &xwl_tablet_tool->buttons_now; - int xbtn = 0; -- ValuatorMask mask; - - /* BTN_0 .. BTN_9 */ - if (button >= 0x100 && button <= 0x109) { -@@ -1592,11 +1593,14 @@ tablet_tool_button_state(void *data, struct zwp_tablet_tool_v2 *tool, - return; - } - -- xwl_seat->xwl_screen->serial = serial; -+ BUG_RETURN(xbtn >= 8 * sizeof(*mask)); - -- valuator_mask_zero(&mask); -- QueuePointerEvents(xwl_tablet_tool->xdevice, -- state ? ButtonPress : ButtonRelease, xbtn, 0, &mask); -+ if (state) -+ SetBit(mask, xbtn); -+ else -+ ClearBit(mask, xbtn); -+ -+ xwl_seat->xwl_screen->serial = serial; - } - - static void -@@ -1604,6 +1608,8 @@ tablet_tool_frame(void *data, struct zwp_tablet_tool_v2 *tool, uint32_t time) - { - struct xwl_tablet_tool *xwl_tablet_tool = data; - ValuatorMask mask; -+ uint32_t released, pressed, diff; -+ int button; - - valuator_mask_zero(&mask); - valuator_mask_set(&mask, 0, xwl_tablet_tool->x); -@@ -1613,10 +1619,34 @@ tablet_tool_frame(void *data, struct zwp_tablet_tool_v2 *tool, uint32_t time) - valuator_mask_set(&mask, 4, xwl_tablet_tool->tilt_y); - valuator_mask_set(&mask, 5, xwl_tablet_tool->rotation + xwl_tablet_tool->slider); - -- /* FIXME: Store button mask in xwl_tablet_tool and send events *HERE* if -- changed */ - QueuePointerEvents(xwl_tablet_tool->xdevice, MotionNotify, 0, - POINTER_ABSOLUTE | POINTER_SCREEN, &mask); -+ -+ valuator_mask_zero(&mask); -+ -+ diff = xwl_tablet_tool->buttons_prev ^ xwl_tablet_tool->buttons_now; -+ released = diff & ~xwl_tablet_tool->buttons_now; -+ pressed = diff & xwl_tablet_tool->buttons_now; -+ -+ button = 1; -+ while (released) { -+ if (released & 0x1) -+ QueuePointerEvents(xwl_tablet_tool->xdevice, -+ ButtonRelease, button, 0, &mask); -+ button++; -+ released >>= 1; -+ } -+ -+ button = 1; -+ while (pressed) { -+ if (pressed & 0x1) -+ QueuePointerEvents(xwl_tablet_tool->xdevice, -+ ButtonPress, button, 0, &mask); -+ button++; -+ pressed >>= 1; -+ } -+ -+ xwl_tablet_tool->buttons_prev = xwl_tablet_tool->buttons_now; - } - - static const struct zwp_tablet_tool_v2_listener tablet_tool_listener = { -diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h -index fb9ac4804..bb119dad7 100644 ---- a/hw/xwayland/xwayland.h -+++ b/hw/xwayland/xwayland.h -@@ -202,6 +202,9 @@ struct xwl_tablet_tool { - float tilt_y; - float rotation; - float slider; -+ -+ uint32_t buttons_now, -+ buttons_prev; - }; - - struct xwl_tablet_pad { --- -2.13.5 - diff --git a/SOURCES/0007-xwayland-Refactor-cursor-management-into-xwl_cursor.patch b/SOURCES/0007-xwayland-Refactor-cursor-management-into-xwl_cursor.patch deleted file mode 100644 index c3bcd11..0000000 --- a/SOURCES/0007-xwayland-Refactor-cursor-management-into-xwl_cursor.patch +++ /dev/null @@ -1,213 +0,0 @@ -From 94a88b752a9373656bb0f62897513c8f5e552127 Mon Sep 17 00:00:00 2001 -From: Carlos Garnacho -Date: Fri, 4 Nov 2016 19:36:10 +0100 -Subject: [PATCH xserver 07/12] xwayland: Refactor cursor management into - xwl_cursor - -This struct takes away the cursor info in xwl_seat, and has -an update function so we can share the frame handling code -across several xwl_cursors. - -Signed-off-by: Carlos Garnacho -Reviewed-by: Peter Hutterer -Signed-off-by: Peter Hutterer -Acked-by: Ping Cheng -(cherry picked from commit 6d1ad39fe6c18220dd39b0653fd1e4145140e2dc) ---- - hw/xwayland/xwayland-cursor.c | 39 ++++++++++++++++++++------------------- - hw/xwayland/xwayland-input.c | 38 +++++++++++++++++++++++++++++++------- - hw/xwayland/xwayland.h | 11 ++++++++--- - 3 files changed, 59 insertions(+), 29 deletions(-) - -diff --git a/hw/xwayland/xwayland-cursor.c b/hw/xwayland/xwayland-cursor.c -index f334f1ca5..fdae3ce85 100644 ---- a/hw/xwayland/xwayland-cursor.c -+++ b/hw/xwayland/xwayland-cursor.c -@@ -96,11 +96,11 @@ xwl_unrealize_cursor(DeviceIntPtr device, ScreenPtr screen, CursorPtr cursor) - } - - static void --clear_cursor_frame_callback(struct xwl_seat *xwl_seat) -+clear_cursor_frame_callback(struct xwl_cursor *xwl_cursor) - { -- if (xwl_seat->cursor_frame_cb) { -- wl_callback_destroy (xwl_seat->cursor_frame_cb); -- xwl_seat->cursor_frame_cb = NULL; -+ if (xwl_cursor->frame_cb) { -+ wl_callback_destroy (xwl_cursor->frame_cb); -+ xwl_cursor->frame_cb = NULL; - } - } - -@@ -109,12 +109,12 @@ frame_callback(void *data, - struct wl_callback *callback, - uint32_t time) - { -- struct xwl_seat *xwl_seat = data; -+ struct xwl_cursor *xwl_cursor = data; - -- clear_cursor_frame_callback(xwl_seat); -- if (xwl_seat->cursor_needs_update) { -- xwl_seat->cursor_needs_update = FALSE; -- xwl_seat_set_cursor(xwl_seat); -+ clear_cursor_frame_callback(xwl_cursor); -+ if (xwl_cursor->needs_update) { -+ xwl_cursor->needs_update = FALSE; -+ xwl_cursor->update_proc(xwl_cursor); - } - } - -@@ -125,6 +125,7 @@ static const struct wl_callback_listener frame_listener = { - void - xwl_seat_set_cursor(struct xwl_seat *xwl_seat) - { -+ struct xwl_cursor *xwl_cursor = &xwl_seat->cursor; - PixmapPtr pixmap; - CursorPtr cursor; - int stride; -@@ -135,13 +136,13 @@ xwl_seat_set_cursor(struct xwl_seat *xwl_seat) - if (!xwl_seat->x_cursor) { - wl_pointer_set_cursor(xwl_seat->wl_pointer, - xwl_seat->pointer_enter_serial, NULL, 0, 0); -- clear_cursor_frame_callback(xwl_seat); -- xwl_seat->cursor_needs_update = FALSE; -+ clear_cursor_frame_callback(xwl_cursor); -+ xwl_cursor->needs_update = FALSE; - return; - } - -- if (xwl_seat->cursor_frame_cb) { -- xwl_seat->cursor_needs_update = TRUE; -+ if (xwl_cursor->frame_cb) { -+ xwl_cursor->needs_update = TRUE; - return; - } - -@@ -159,19 +160,19 @@ xwl_seat_set_cursor(struct xwl_seat *xwl_seat) - - wl_pointer_set_cursor(xwl_seat->wl_pointer, - xwl_seat->pointer_enter_serial, -- xwl_seat->cursor, -+ xwl_cursor->surface, - xwl_seat->x_cursor->bits->xhot, - xwl_seat->x_cursor->bits->yhot); -- wl_surface_attach(xwl_seat->cursor, -+ wl_surface_attach(xwl_cursor->surface, - xwl_shm_pixmap_get_wl_buffer(pixmap), 0, 0); -- wl_surface_damage(xwl_seat->cursor, 0, 0, -+ wl_surface_damage(xwl_cursor->surface, 0, 0, - xwl_seat->x_cursor->bits->width, - xwl_seat->x_cursor->bits->height); - -- xwl_seat->cursor_frame_cb = wl_surface_frame(xwl_seat->cursor); -- wl_callback_add_listener(xwl_seat->cursor_frame_cb, &frame_listener, xwl_seat); -+ xwl_cursor->frame_cb = wl_surface_frame(xwl_cursor->surface); -+ wl_callback_add_listener(xwl_cursor->frame_cb, &frame_listener, xwl_cursor); - -- wl_surface_commit(xwl_seat->cursor); -+ wl_surface_commit(xwl_cursor->surface); - } - - static void -diff --git a/hw/xwayland/xwayland-input.c b/hw/xwayland/xwayland-input.c -index 50da10839..bb520e891 100644 ---- a/hw/xwayland/xwayland-input.c -+++ b/hw/xwayland/xwayland-input.c -@@ -424,9 +424,9 @@ pointer_handle_enter(void *data, struct wl_pointer *pointer, - * of our surfaces might not have been shown. In that case we'll - * have a cursor surface frame callback pending which we need to - * clear so that we can continue submitting new cursor frames. */ -- if (xwl_seat->cursor_frame_cb) { -- wl_callback_destroy(xwl_seat->cursor_frame_cb); -- xwl_seat->cursor_frame_cb = NULL; -+ if (xwl_seat->cursor.frame_cb) { -+ wl_callback_destroy(xwl_seat->cursor.frame_cb); -+ xwl_seat->cursor.frame_cb = NULL; - xwl_seat_set_cursor(xwl_seat); - } - -@@ -1203,6 +1203,31 @@ static const struct wl_seat_listener seat_listener = { - }; - - static void -+xwl_cursor_init(struct xwl_cursor *xwl_cursor, struct xwl_screen *xwl_screen, -+ void (* update_proc)(struct xwl_cursor *)) -+{ -+ xwl_cursor->surface = wl_compositor_create_surface(xwl_screen->compositor); -+ xwl_cursor->update_proc = update_proc; -+ xwl_cursor->frame_cb = NULL; -+ xwl_cursor->needs_update = FALSE; -+} -+ -+static void -+xwl_cursor_release(struct xwl_cursor *xwl_cursor) -+{ -+ wl_surface_destroy(xwl_cursor->surface); -+ if (xwl_cursor->frame_cb) -+ wl_callback_destroy(xwl_cursor->frame_cb); -+} -+ -+static void -+xwl_seat_update_cursor(struct xwl_cursor *xwl_cursor) -+{ -+ struct xwl_seat *xwl_seat = wl_container_of(xwl_cursor, xwl_seat, cursor); -+ xwl_seat_set_cursor(xwl_seat); -+} -+ -+static void - create_input_device(struct xwl_screen *xwl_screen, uint32_t id, uint32_t version) - { - struct xwl_seat *xwl_seat; -@@ -1221,7 +1246,8 @@ create_input_device(struct xwl_screen *xwl_screen, uint32_t id, uint32_t version - &wl_seat_interface, min(version, 5)); - xwl_seat->id = id; - -- xwl_seat->cursor = wl_compositor_create_surface(xwl_screen->compositor); -+ xwl_cursor_init(&xwl_seat->cursor, xwl_seat->xwl_screen, -+ xwl_seat_update_cursor); - wl_seat_add_listener(xwl_seat->seat, &seat_listener, xwl_seat); - - init_tablet_manager_seat(xwl_screen, xwl_seat); -@@ -1252,9 +1278,7 @@ xwl_seat_destroy(struct xwl_seat *xwl_seat) - release_tablet_manager_seat(xwl_seat); - - wl_seat_destroy(xwl_seat->seat); -- wl_surface_destroy(xwl_seat->cursor); -- if (xwl_seat->cursor_frame_cb) -- wl_callback_destroy(xwl_seat->cursor_frame_cb); -+ xwl_cursor_release(&xwl_seat->cursor); - wl_array_release(&xwl_seat->keys); - free(xwl_seat); - } -diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h -index bb119dad7..bfa5f47c7 100644 ---- a/hw/xwayland/xwayland.h -+++ b/hw/xwayland/xwayland.h -@@ -127,6 +127,13 @@ struct xwl_pointer_warp_emulator { - struct zwp_locked_pointer_v1 *locked_pointer; - }; - -+struct xwl_cursor { -+ void (* update_proc) (struct xwl_cursor *); -+ struct wl_surface *surface; -+ struct wl_callback *frame_cb; -+ Bool needs_update; -+}; -+ - struct xwl_seat { - DeviceIntPtr pointer; - DeviceIntPtr relative_pointer; -@@ -148,9 +155,7 @@ struct xwl_seat { - uint32_t pointer_enter_serial; - struct xorg_list link; - CursorPtr x_cursor; -- struct wl_surface *cursor; -- struct wl_callback *cursor_frame_cb; -- Bool cursor_needs_update; -+ struct xwl_cursor cursor; - WindowPtr last_xwindow; - - struct xorg_list touches; --- -2.13.5 - diff --git a/SOURCES/0008-xwayland-update-cursor-on-tablet-tools-in-proximity.patch b/SOURCES/0008-xwayland-update-cursor-on-tablet-tools-in-proximity.patch deleted file mode 100644 index fa5472c..0000000 --- a/SOURCES/0008-xwayland-update-cursor-on-tablet-tools-in-proximity.patch +++ /dev/null @@ -1,208 +0,0 @@ -From 78a4493bc8e60da7b97342660dd1ff6de844e951 Mon Sep 17 00:00:00 2001 -From: Carlos Garnacho -Date: Fri, 4 Nov 2016 19:58:04 +0100 -Subject: [PATCH xserver 08/12] xwayland: update cursor on tablet tools in - proximity - -Each xwl_tablet_tool gets a xwl_cursor, as on wayland each of those -will get an independent cursor that can be set through -zwp_tablet_tool.set_cursor. - -However, all tools (and the pointer) share conceptually the same VCP -on Xwayland, so have cursor changes trigger a xwl_cursor update on -every tool (and the pointer, again). Maybe Xwayland could keep track -of the most recent device and only update that cursor to get better -visual results, but this is simpler, and it's going to be odd -anyway... - -Signed-off-by: Carlos Garnacho -Reviewed-by: Peter Hutterer -Signed-off-by: Peter Hutterer -Acked-by: Ping Cheng -(cherry picked from commit f471b5b8eb451b442554517c7cb6f0aa90d218c4) ---- - hw/xwayland/xwayland-cursor.c | 56 +++++++++++++++++++++++++++++++++++++++++++ - hw/xwayland/xwayland-input.c | 17 +++++++++++++ - hw/xwayland/xwayland.h | 5 ++++ - 3 files changed, 78 insertions(+) - -diff --git a/hw/xwayland/xwayland-cursor.c b/hw/xwayland/xwayland-cursor.c -index fdae3ce85..c95f4e830 100644 ---- a/hw/xwayland/xwayland-cursor.c -+++ b/hw/xwayland/xwayland-cursor.c -@@ -175,11 +175,62 @@ xwl_seat_set_cursor(struct xwl_seat *xwl_seat) - wl_surface_commit(xwl_cursor->surface); - } - -+void -+xwl_tablet_tool_set_cursor(struct xwl_tablet_tool *xwl_tablet_tool) -+{ -+ struct xwl_seat *xwl_seat = xwl_tablet_tool->seat; -+ struct xwl_cursor *xwl_cursor = &xwl_tablet_tool->cursor; -+ PixmapPtr pixmap; -+ CursorPtr cursor; -+ int stride; -+ -+ if (!xwl_seat->x_cursor) { -+ zwp_tablet_tool_v2_set_cursor(xwl_tablet_tool->tool, -+ xwl_tablet_tool->proximity_in_serial, -+ NULL, 0, 0); -+ return; -+ } -+ -+ if (xwl_cursor->frame_cb) { -+ xwl_cursor->needs_update = TRUE; -+ return; -+ } -+ -+ cursor = xwl_seat->x_cursor; -+ pixmap = dixGetPrivate(&cursor->devPrivates, &xwl_cursor_private_key); -+ if (!pixmap) -+ return; -+ -+ stride = cursor->bits->width * 4; -+ if (cursor->bits->argb) -+ memcpy(pixmap->devPrivate.ptr, -+ cursor->bits->argb, cursor->bits->height * stride); -+ else -+ expand_source_and_mask(cursor, pixmap->devPrivate.ptr); -+ -+ zwp_tablet_tool_v2_set_cursor(xwl_tablet_tool->tool, -+ xwl_tablet_tool->proximity_in_serial, -+ xwl_cursor->surface, -+ xwl_seat->x_cursor->bits->xhot, -+ xwl_seat->x_cursor->bits->yhot); -+ wl_surface_attach(xwl_cursor->surface, -+ xwl_shm_pixmap_get_wl_buffer(pixmap), 0, 0); -+ wl_surface_damage(xwl_cursor->surface, 0, 0, -+ xwl_seat->x_cursor->bits->width, -+ xwl_seat->x_cursor->bits->height); -+ -+ xwl_cursor->frame_cb = wl_surface_frame(xwl_cursor->surface); -+ wl_callback_add_listener(xwl_cursor->frame_cb, &frame_listener, xwl_cursor); -+ -+ wl_surface_commit(xwl_cursor->surface); -+} -+ - static void - xwl_set_cursor(DeviceIntPtr device, - ScreenPtr screen, CursorPtr cursor, int x, int y) - { - struct xwl_seat *xwl_seat; -+ struct xwl_tablet_tool *xwl_tablet_tool; - Bool cursor_visibility_changed; - - xwl_seat = device->public.devicePrivate; -@@ -194,6 +245,11 @@ xwl_set_cursor(DeviceIntPtr device, - xwl_seat_cursor_visibility_changed(xwl_seat); - - xwl_seat_set_cursor(xwl_seat); -+ -+ xorg_list_for_each_entry(xwl_tablet_tool, &xwl_seat->tablet_tools, link) { -+ if (xwl_tablet_tool->proximity_in_serial != 0) -+ xwl_tablet_tool_set_cursor(xwl_tablet_tool); -+ } - } - - static void -diff --git a/hw/xwayland/xwayland-input.c b/hw/xwayland/xwayland-input.c -index bb520e891..77cd42789 100644 ---- a/hw/xwayland/xwayland-input.c -+++ b/hw/xwayland/xwayland-input.c -@@ -1405,6 +1405,7 @@ tablet_tool_receive_removed(void *data, struct zwp_tablet_tool_v2 *tool) - struct xwl_tablet_tool *xwl_tablet_tool = data; - - xorg_list_del(&xwl_tablet_tool->link); -+ xwl_cursor_release(&xwl_tablet_tool->cursor); - zwp_tablet_tool_v2_destroy(tool); - free(xwl_tablet_tool); - } -@@ -1428,7 +1429,10 @@ tablet_tool_proximity_in(void *data, struct zwp_tablet_tool_v2 *tool, - if (wl_surface == NULL) - return; - -+ xwl_tablet_tool->proximity_in_serial = serial; - xwl_seat->focus_window = wl_surface_get_user_data(wl_surface); -+ -+ xwl_tablet_tool_set_cursor(xwl_tablet_tool); - } - - static void -@@ -1437,6 +1441,7 @@ tablet_tool_proximity_out(void *data, struct zwp_tablet_tool_v2 *tool) - struct xwl_tablet_tool *xwl_tablet_tool = data; - struct xwl_seat *xwl_seat = xwl_tablet_tool->seat; - -+ xwl_tablet_tool->proximity_in_serial = 0; - xwl_seat->focus_window = NULL; - - xwl_tablet_tool->pressure = 0; -@@ -1717,10 +1722,20 @@ tablet_seat_handle_add_tablet(void *data, struct zwp_tablet_seat_v2 *tablet_seat - } - - static void -+xwl_tablet_tool_update_cursor(struct xwl_cursor *xwl_cursor) -+{ -+ struct xwl_tablet_tool *xwl_tablet_tool = wl_container_of(xwl_cursor, -+ xwl_tablet_tool, -+ cursor); -+ xwl_tablet_tool_set_cursor(xwl_tablet_tool); -+} -+ -+static void - tablet_seat_handle_add_tool(void *data, struct zwp_tablet_seat_v2 *tablet_seat, - struct zwp_tablet_tool_v2 *tool) - { - struct xwl_seat *xwl_seat = data; -+ struct xwl_screen *xwl_screen = xwl_seat->xwl_screen; - struct xwl_tablet_tool *xwl_tablet_tool; - - xwl_tablet_tool = calloc(sizeof *xwl_tablet_tool, 1); -@@ -1731,6 +1746,8 @@ tablet_seat_handle_add_tool(void *data, struct zwp_tablet_seat_v2 *tablet_seat, - - xwl_tablet_tool->tool = tool; - xwl_tablet_tool->seat = xwl_seat; -+ xwl_cursor_init(&xwl_tablet_tool->cursor, xwl_screen, -+ xwl_tablet_tool_update_cursor); - - xorg_list_add(&xwl_tablet_tool->link, &xwl_seat->tablet_tools); - -diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h -index bfa5f47c7..02a218c43 100644 ---- a/hw/xwayland/xwayland.h -+++ b/hw/xwayland/xwayland.h -@@ -44,6 +44,7 @@ - - #include "relative-pointer-unstable-v1-client-protocol.h" - #include "pointer-constraints-unstable-v1-client-protocol.h" -+#include "tablet-unstable-v2-client-protocol.h" - - struct xwl_screen { - int width; -@@ -200,6 +201,7 @@ struct xwl_tablet_tool { - struct xwl_seat *seat; - - DeviceIntPtr xdevice; -+ uint32_t proximity_in_serial; - uint32_t x; - uint32_t y; - uint32_t pressure; -@@ -210,6 +212,8 @@ struct xwl_tablet_tool { - - uint32_t buttons_now, - buttons_prev; -+ -+ struct xwl_cursor cursor; - }; - - struct xwl_tablet_pad { -@@ -237,6 +241,7 @@ Bool xwl_screen_init_cursor(struct xwl_screen *xwl_screen); - - struct xwl_screen *xwl_screen_get(ScreenPtr screen); - -+void xwl_tablet_tool_set_cursor(struct xwl_tablet_tool *tool); - void xwl_seat_set_cursor(struct xwl_seat *xwl_seat); - - void xwl_seat_destroy(struct xwl_seat *xwl_seat); --- -2.13.5 - diff --git a/SOURCES/0009-xwayland-add-tablet-pad-support.patch b/SOURCES/0009-xwayland-add-tablet-pad-support.patch deleted file mode 100644 index 8158d92..0000000 --- a/SOURCES/0009-xwayland-add-tablet-pad-support.patch +++ /dev/null @@ -1,511 +0,0 @@ -From 6f79f4993d351a891a715e994ab9574542e64b35 Mon Sep 17 00:00:00 2001 -From: Peter Hutterer -Date: Tue, 7 Feb 2017 15:04:46 +1000 -Subject: [PATCH xserver 09/12] xwayland: add tablet pad support - -Hooked up a bit differently to the other tools. Those tools can be static for -all and be re-used. The wacom driver initializes the pad with the correct -number of buttons though and we can't do this until we have the pad done event. - -If the tablet is removed and we plug a different one in, we should initialize -that correctly, so unlike the other tools the pad is properly removed and -re-initialized on plug. - -Signed-off-by: Peter Hutterer -Acked-by: Ping Cheng -(cherry picked from commit 8475e6360ce31551d50fd63a26f7a44d1e8928f2) ---- - hw/xwayland/xwayland-input.c | 417 +++++++++++++++++++++++++++++++++++++++++++ - hw/xwayland/xwayland.h | 28 +++ - 2 files changed, 445 insertions(+) - -diff --git a/hw/xwayland/xwayland-input.c b/hw/xwayland/xwayland-input.c -index 77cd42789..8011b965c 100644 ---- a/hw/xwayland/xwayland-input.c -+++ b/hw/xwayland/xwayland-input.c -@@ -1341,6 +1341,7 @@ tablet_handle_removed(void *data, struct zwp_tablet_v2 *tablet) - DisableDevice(xwl_seat->eraser, TRUE); - if (xwl_seat->puck) - DisableDevice(xwl_seat->puck, TRUE); -+ /* pads are removed separately */ - } - - zwp_tablet_v2_destroy(tablet); -@@ -1701,6 +1702,418 @@ static const struct zwp_tablet_tool_v2_listener tablet_tool_listener = { - }; - - static void -+tablet_pad_ring_destroy(struct xwl_tablet_pad_ring *ring) -+{ -+ zwp_tablet_pad_ring_v2_destroy(ring->ring); -+ xorg_list_del(&ring->link); -+ free(ring); -+} -+ -+static void -+tablet_pad_ring_source(void *data, -+ struct zwp_tablet_pad_ring_v2 *zwp_tablet_pad_ring_v2, -+ uint32_t source) -+{ -+} -+ -+static void -+tablet_pad_ring_angle(void *data, -+ struct zwp_tablet_pad_ring_v2 *zwp_tablet_pad_ring_v2, -+ wl_fixed_t degrees) -+{ -+ struct xwl_tablet_pad_ring *ring = data; -+ struct xwl_tablet_pad *pad = ring->group->pad; -+ double deg = wl_fixed_to_double(degrees); -+ ValuatorMask mask; -+ -+ valuator_mask_zero(&mask); -+ valuator_mask_set(&mask, 5 + ring->index, deg/360.0 * 71); -+ QueuePointerEvents(pad->xdevice, MotionNotify, 0, 0, &mask); -+} -+ -+static void -+tablet_pad_ring_stop(void *data, -+ struct zwp_tablet_pad_ring_v2 *zwp_tablet_pad_ring_v2) -+{ -+} -+ -+static void -+tablet_pad_ring_frame(void *data, -+ struct zwp_tablet_pad_ring_v2 *zwp_tablet_pad_ring_v2, -+ uint32_t time) -+{ -+} -+ -+static const struct zwp_tablet_pad_ring_v2_listener tablet_pad_ring_listener = { -+ tablet_pad_ring_source, -+ tablet_pad_ring_angle, -+ tablet_pad_ring_stop, -+ tablet_pad_ring_frame, -+}; -+ -+ -+static void -+tablet_pad_strip_destroy(struct xwl_tablet_pad_strip *strip) -+{ -+ zwp_tablet_pad_strip_v2_destroy(strip->strip); -+ xorg_list_del(&strip->link); -+ free(strip); -+} -+ -+static void -+tablet_pad_strip_source(void *data, -+ struct zwp_tablet_pad_strip_v2 *zwp_tablet_pad_strip_v2, -+ uint32_t source) -+{ -+} -+ -+static void -+tablet_pad_strip_position(void *data, -+ struct zwp_tablet_pad_strip_v2 *zwp_tablet_pad_strip_v2, -+ uint32_t position) -+{ -+ struct xwl_tablet_pad_strip *strip = data; -+ struct xwl_tablet_pad *pad = strip->group->pad; -+ ValuatorMask mask; -+ -+ valuator_mask_zero(&mask); -+ valuator_mask_set(&mask, 3 + strip->index, position/65535.0 * 2048); -+ QueuePointerEvents(pad->xdevice, MotionNotify, 0, 0, &mask); -+} -+ -+static void -+tablet_pad_strip_stop(void *data, -+ struct zwp_tablet_pad_strip_v2 *zwp_tablet_pad_strip_v2) -+{ -+} -+ -+static void -+tablet_pad_strip_frame(void *data, -+ struct zwp_tablet_pad_strip_v2 *zwp_tablet_pad_strip_v2, -+ uint32_t time) -+{ -+} -+ -+static const struct zwp_tablet_pad_strip_v2_listener tablet_pad_strip_listener = { -+ tablet_pad_strip_source, -+ tablet_pad_strip_position, -+ tablet_pad_strip_stop, -+ tablet_pad_strip_frame, -+}; -+ -+static void -+tablet_pad_group_destroy(struct xwl_tablet_pad_group *group) -+{ -+ struct xwl_tablet_pad_ring *r, *tr; -+ struct xwl_tablet_pad_strip *s, *ts; -+ -+ xorg_list_for_each_entry_safe(r, tr, -+ &group->pad_group_ring_list, -+ link) -+ tablet_pad_ring_destroy(r); -+ -+ xorg_list_for_each_entry_safe(s, ts, -+ &group->pad_group_strip_list, -+ link) -+ tablet_pad_strip_destroy(s); -+ -+ zwp_tablet_pad_group_v2_destroy(group->group); -+ xorg_list_del(&group->link); -+ free(group); -+} -+ -+static void -+tablet_pad_group_buttons(void *data, -+ struct zwp_tablet_pad_group_v2 *zwp_tablet_pad_group_v2, -+ struct wl_array *buttons) -+{ -+ -+} -+ -+static void -+tablet_pad_group_ring(void *data, -+ struct zwp_tablet_pad_group_v2 *zwp_tablet_pad_group_v2, -+ struct zwp_tablet_pad_ring_v2 *wp_ring) -+{ -+ static unsigned int ring_index = 0; -+ struct xwl_tablet_pad_group *group = data; -+ struct xwl_tablet_pad_ring *ring; -+ -+ ring = calloc(1, sizeof *ring); -+ if (ring == NULL) { -+ ErrorF("%s ENOMEM\n", __func__); -+ return; -+ } -+ -+ ring->index = ring_index++; -+ ring->group = group; -+ ring->ring = wp_ring; -+ -+ xorg_list_add(&ring->link, &group->pad_group_ring_list); -+ -+ zwp_tablet_pad_ring_v2_add_listener(wp_ring, &tablet_pad_ring_listener, -+ ring); -+} -+ -+static void -+tablet_pad_group_strip(void *data, -+ struct zwp_tablet_pad_group_v2 *zwp_tablet_pad_group_v2, -+ struct zwp_tablet_pad_strip_v2 *wp_strip) -+{ -+ static unsigned int strip_index = 0; -+ struct xwl_tablet_pad_group *group = data; -+ struct xwl_tablet_pad_strip *strip; -+ -+ strip = calloc(1, sizeof *strip); -+ if (strip == NULL) { -+ ErrorF("%s ENOMEM\n", __func__); -+ return; -+ } -+ -+ strip->index = strip_index++; -+ strip->group = group; -+ strip->strip = wp_strip; -+ -+ xorg_list_add(&strip->link, &group->pad_group_strip_list); -+ -+ zwp_tablet_pad_strip_v2_add_listener(wp_strip, &tablet_pad_strip_listener, -+ strip); -+} -+ -+static void -+tablet_pad_group_modes(void *data, -+ struct zwp_tablet_pad_group_v2 *zwp_tablet_pad_group_v2, -+ uint32_t modes) -+{ -+ -+} -+ -+static void -+tablet_pad_group_done(void *data, -+ struct zwp_tablet_pad_group_v2 *zwp_tablet_pad_group_v2) -+{ -+ -+} -+ -+static void -+tablet_pad_group_mode_switch(void *data, -+ struct zwp_tablet_pad_group_v2 *zwp_tablet_pad_group_v2, -+ uint32_t time, -+ uint32_t serial, -+ uint32_t mode) -+{ -+ -+} -+ -+static struct zwp_tablet_pad_group_v2_listener tablet_pad_group_listener = { -+ tablet_pad_group_buttons, -+ tablet_pad_group_ring, -+ tablet_pad_group_strip, -+ tablet_pad_group_modes, -+ tablet_pad_group_done, -+ tablet_pad_group_mode_switch, -+}; -+ -+static int -+xwl_tablet_pad_proc(DeviceIntPtr device, int what) -+{ -+ struct xwl_tablet_pad *pad = device->public.devicePrivate; -+ /* Axis layout mirrors that of xf86-input-wacom to have better -+ compatibility with existing clients */ -+#define NAXES 7 -+ Atom axes_labels[NAXES] = { 0 }; -+ BYTE map[MAX_BUTTONS + 1]; -+ int i = 0; -+ Atom btn_labels[MAX_BUTTONS] = { 0 }; /* btn labels are meaningless */ -+ int nbuttons; -+ -+ switch (what) { -+ case DEVICE_INIT: -+ device->public.on = FALSE; -+ -+ axes_labels[0] = XIGetKnownProperty(AXIS_LABEL_PROP_ABS_X); -+ axes_labels[1] = XIGetKnownProperty(AXIS_LABEL_PROP_ABS_Y); -+ /* The others have no good mapping */ -+ -+ if (!InitValuatorClassDeviceStruct(device, NAXES, axes_labels, -+ GetMotionHistorySize(), Absolute)) -+ return BadValue; -+ -+ for (i = 1; i <= MAX_BUTTONS; i++) -+ map[i] = i; -+ -+ /* We need at least 7 buttons to allow scrolling */ -+ nbuttons = min(max(pad->nbuttons + 4, 7), MAX_BUTTONS); -+ -+ if (!InitButtonClassDeviceStruct(device, nbuttons, -+ btn_labels, map)) -+ return BadValue; -+ -+ /* Valuators */ -+ InitValuatorAxisStruct(device, 0, axes_labels[0], -+ 0, 100, 1, 0, 1, Absolute); -+ InitValuatorAxisStruct(device, 1, axes_labels[1], -+ 0, 100, 1, 0, 1, Absolute); -+ /* Pressure - unused, for backwards compat only */ -+ InitValuatorAxisStruct(device, 2, axes_labels[2], -+ 0, 2048, 1, 0, 1, Absolute); -+ /* strip x */ -+ InitValuatorAxisStruct(device, 3, axes_labels[3], -+ 0, 2048, 1, 0, 1, Absolute); -+ /* strip y */ -+ InitValuatorAxisStruct(device, 4, axes_labels[4], -+ 0, 2048, 1, 0, 1, Absolute); -+ /* ring */ -+ InitValuatorAxisStruct(device, 5, axes_labels[5], -+ 0, 71, 1, 0, 1, Absolute); -+ /* ring2 */ -+ InitValuatorAxisStruct(device, 6, axes_labels[6], -+ 0, 71, 1, 0, 1, Absolute); -+ -+ if (!InitPtrFeedbackClassDeviceStruct(device, xwl_pointer_control)) -+ return BadValue; -+ -+ return Success; -+ -+ case DEVICE_ON: -+ device->public.on = TRUE; -+ return Success; -+ -+ case DEVICE_OFF: -+ case DEVICE_CLOSE: -+ device->public.on = FALSE; -+ return Success; -+ } -+ -+ return BadMatch; -+#undef NAXES -+} -+ -+static void -+tablet_pad_group(void *data, -+ struct zwp_tablet_pad_v2 *zwp_tablet_pad_v2, -+ struct zwp_tablet_pad_group_v2 *pad_group) -+{ -+ struct xwl_tablet_pad *pad = data; -+ struct xwl_tablet_pad_group *group; -+ -+ group = calloc(1, sizeof *group); -+ if (pad == NULL) { -+ ErrorF("%s ENOMEM\n", __func__); -+ return; -+ } -+ -+ group->pad = pad; -+ group->group = pad_group; -+ xorg_list_init(&group->pad_group_ring_list); -+ xorg_list_init(&group->pad_group_strip_list); -+ -+ xorg_list_add(&group->link, &pad->pad_group_list); -+ -+ zwp_tablet_pad_group_v2_add_listener(pad_group, -+ &tablet_pad_group_listener, -+ group); -+} -+ -+static void -+tablet_pad_path(void *data, -+ struct zwp_tablet_pad_v2 *zwp_tablet_pad_v2, -+ const char *path) -+{ -+ -+} -+ -+static void -+tablet_pad_buttons(void *data, -+ struct zwp_tablet_pad_v2 *zwp_tablet_pad_v2, -+ uint32_t buttons) -+{ -+ struct xwl_tablet_pad *pad = data; -+ -+ pad->nbuttons = buttons; -+} -+ -+static void -+tablet_pad_done(void *data, -+ struct zwp_tablet_pad_v2 *zwp_tablet_pad_v2) -+{ -+ struct xwl_tablet_pad *pad = data; -+ -+ pad->xdevice = add_device(pad->seat, "xwayland-pad", -+ xwl_tablet_pad_proc); -+ pad->xdevice->public.devicePrivate = pad; -+ ActivateDevice(pad->xdevice, TRUE); -+ EnableDevice(pad->xdevice, TRUE); -+} -+ -+static void -+tablet_pad_button(void *data, -+ struct zwp_tablet_pad_v2 *zwp_tablet_pad_v2, -+ uint32_t time, -+ uint32_t button, -+ uint32_t state) -+{ -+ struct xwl_tablet_pad *pad = data; -+ ValuatorMask mask; -+ -+ button++; /* wayland index vs X's 1-offset */ -+ /* skip scroll wheel buttons 4-7 */ -+ button = button > 3 ? button + 4 : button; -+ -+ valuator_mask_zero(&mask); -+ QueuePointerEvents(pad->xdevice, -+ state ? ButtonPress : ButtonRelease, button, 0, &mask); -+} -+ -+static void -+tablet_pad_enter(void *data, -+ struct zwp_tablet_pad_v2 *zwp_tablet_pad_v2, -+ uint32_t serial, -+ struct zwp_tablet_v2 *tablet, -+ struct wl_surface *surface) -+{ -+ /* pairs the pad with the tablet but also to set the focus. We -+ * don't care about the pairing and always use X's focus */ -+} -+ -+static void -+tablet_pad_leave(void *data, -+ struct zwp_tablet_pad_v2 *zwp_tablet_pad_v2, -+ uint32_t serial, -+ struct wl_surface *surface) -+{ -+ /* pairs the pad with the tablet but also to set the focus. We -+ * don't care about the pairing and always use X's focus */ -+} -+ -+static void -+tablet_pad_removed(void *data, -+ struct zwp_tablet_pad_v2 *zwp_tablet_pad_v2) -+{ -+ struct xwl_tablet_pad *pad = data; -+ struct xwl_tablet_pad_group *g, *tg; -+ -+ xorg_list_for_each_entry_safe(g, tg, &pad->pad_group_list, link) -+ tablet_pad_group_destroy(g); -+ -+ RemoveDevice(pad->xdevice, TRUE); -+ xorg_list_del(&pad->link); -+ zwp_tablet_pad_v2_destroy(pad->pad); -+ free(pad); -+} -+ -+static const struct zwp_tablet_pad_v2_listener tablet_pad_listener = { -+ tablet_pad_group, -+ tablet_pad_path, -+ tablet_pad_buttons, -+ tablet_pad_done, -+ tablet_pad_button, -+ tablet_pad_enter, -+ tablet_pad_leave, -+ tablet_pad_removed, -+}; -+ -+static void - tablet_seat_handle_add_tablet(void *data, struct zwp_tablet_seat_v2 *tablet_seat, - struct zwp_tablet_v2 *tablet) - { -@@ -1769,8 +2182,12 @@ tablet_seat_handle_add_pad(void *data, struct zwp_tablet_seat_v2 *tablet_seat, - - xwl_tablet_pad->pad = pad; - xwl_tablet_pad->seat = xwl_seat; -+ xorg_list_init(&xwl_tablet_pad->pad_group_list); - - xorg_list_add(&xwl_tablet_pad->link, &xwl_seat->tablet_pads); -+ -+ zwp_tablet_pad_v2_add_listener(pad, &tablet_pad_listener, -+ xwl_tablet_pad); - } - - static const struct zwp_tablet_seat_v2_listener tablet_seat_listener = { -diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h -index 02a218c43..250564f73 100644 ---- a/hw/xwayland/xwayland.h -+++ b/hw/xwayland/xwayland.h -@@ -216,10 +216,38 @@ struct xwl_tablet_tool { - struct xwl_cursor cursor; - }; - -+struct xwl_tablet_pad_ring { -+ unsigned int index; -+ struct xorg_list link; -+ struct xwl_tablet_pad_group *group; -+ struct zwp_tablet_pad_ring_v2 *ring; -+}; -+ -+struct xwl_tablet_pad_strip { -+ unsigned int index; -+ struct xorg_list link; -+ struct xwl_tablet_pad_group *group; -+ struct zwp_tablet_pad_strip_v2 *strip; -+}; -+ -+struct xwl_tablet_pad_group { -+ struct xorg_list link; -+ struct xwl_tablet_pad *pad; -+ struct zwp_tablet_pad_group_v2 *group; -+ -+ struct xorg_list pad_group_ring_list; -+ struct xorg_list pad_group_strip_list; -+}; -+ - struct xwl_tablet_pad { - struct xorg_list link; - struct zwp_tablet_pad_v2 *pad; - struct xwl_seat *seat; -+ -+ DeviceIntPtr xdevice; -+ -+ unsigned int nbuttons; -+ struct xorg_list pad_group_list; - }; - - struct xwl_output { --- -2.13.5 - diff --git a/SOURCES/0010-xwayland-Unconditionally-initialize-lists-in-init_ta.patch b/SOURCES/0010-xwayland-Unconditionally-initialize-lists-in-init_ta.patch deleted file mode 100644 index 739b5a4..0000000 --- a/SOURCES/0010-xwayland-Unconditionally-initialize-lists-in-init_ta.patch +++ /dev/null @@ -1,74 +0,0 @@ -From 81d85fb95d71c0d781328506f1417e7b92c68b97 Mon Sep 17 00:00:00 2001 -From: Lyude -Date: Thu, 4 May 2017 18:04:31 -0400 -Subject: [PATCH xserver 10/12] xwayland: Unconditionally initialize lists in - init_tablet_manager_seat() - -In the event that xwayland gets launched on a wayland compositor that -doesn't yet have support for wp_tablet_manager, we end up skipping the -initialization of the lists. This is wrong, because regardless of -whether or not a tablet is present we still attempt to traverse these -lists later in xwl_set_cursor(), expecting that if the lists are empty -from no tablet manager that we simply won't execute any loop iterations. - -(EE) -(EE) Backtrace: -(EE) 0: Xwayland (OsSigHandler+0x3b) [0x4982f9] -(EE) 1: /lib64/libpthread.so.0 (__restore_rt+0x0) [0x7f73722545bf] -(EE) 2: Xwayland (xwl_set_cursor+0x9f) [0x429974] -(EE) 3: Xwayland (miPointerUpdateSprite+0x261) [0x4fe1ca] -(EE) 4: Xwayland (mieqProcessInputEvents+0x239) [0x4f8d33] -(EE) 5: Xwayland (ProcessInputEvents+0x9) [0x4282f0] -(EE) 6: Xwayland (Dispatch+0x42) [0x43e2d4] -(EE) 7: Xwayland (dix_main+0x5c9) [0x44c6dc] -(EE) 8: Xwayland (main+0x28) [0x61c523] -(EE) 9: /lib64/libc.so.6 (__libc_start_main+0xf1) [0x7f7371e9d401] -(EE) 10: Xwayland (_start+0x2a) [0x4208fa] -(EE) 11: ? (?+0x2a) [0x2a] -(EE) -(EE) Segmentation fault at address 0x28 -(EE) -Fatal server error: -(EE) Caught signal 11 (Segmentation fault). Server aborting -(EE) - -Reproduced when trying to run upstream xwayland under fedora 25's weston -package. - -Signed-off-by: Lyude -Reviewed-by: Peter Hutterer -Signed-off-by: Peter Hutterer -(cherry picked from commit a06bb73053d9df56d9070ce325a43af3a3c7a6a2) ---- - hw/xwayland/xwayland-input.c | 8 ++++---- - 1 file changed, 4 insertions(+), 4 deletions(-) - -diff --git a/hw/xwayland/xwayland-input.c b/hw/xwayland/xwayland-input.c -index 8011b965c..ee932be60 100644 ---- a/hw/xwayland/xwayland-input.c -+++ b/hw/xwayland/xwayland-input.c -@@ -2200,6 +2200,10 @@ static void - init_tablet_manager_seat(struct xwl_screen *xwl_screen, - struct xwl_seat *xwl_seat) - { -+ xorg_list_init(&xwl_seat->tablets); -+ xorg_list_init(&xwl_seat->tablet_tools); -+ xorg_list_init(&xwl_seat->tablet_pads); -+ - if (!xwl_screen->tablet_manager) - return; - -@@ -2207,10 +2211,6 @@ init_tablet_manager_seat(struct xwl_screen *xwl_screen, - zwp_tablet_manager_v2_get_tablet_seat(xwl_screen->tablet_manager, - xwl_seat->seat); - -- xorg_list_init(&xwl_seat->tablets); -- xorg_list_init(&xwl_seat->tablet_tools); -- xorg_list_init(&xwl_seat->tablet_pads); -- - zwp_tablet_seat_v2_add_listener(xwl_seat->tablet_seat, &tablet_seat_listener, xwl_seat); - } - --- -2.13.5 - diff --git a/SOURCES/0011-xwayland-Correct-off-by-one-error-in-tablet-button-n.patch b/SOURCES/0011-xwayland-Correct-off-by-one-error-in-tablet-button-n.patch deleted file mode 100644 index 76e95ec..0000000 --- a/SOURCES/0011-xwayland-Correct-off-by-one-error-in-tablet-button-n.patch +++ /dev/null @@ -1,39 +0,0 @@ -From edcc95e914079485b7d693cecbfc436d084ad47d Mon Sep 17 00:00:00 2001 -From: Jason Gerecke -Date: Fri, 9 Jun 2017 16:02:06 -0700 -Subject: [PATCH xserver 11/12] xwayland: Correct off-by-one error in tablet - button numbering - -The 'tablet_tool_frame' function treats the button masks as though they -are zero-indexed, but 'tablet_tool_button_state' treats them as one- -indexed. The result is that an e.g. middle click event recieved from -Wayland will be sent from the X server as a right-click instead. - -Fixes: 773b04748d0 ("xwayland: handle button events after motion events") -Signed-off-by: Jason Gerecke -Reviewed-by: Peter Hutterer -Signed-off-by: Peter Hutterer -(cherry picked from commit fbc9814975fe82be25becf1a55d4f8d34298a956) ---- - hw/xwayland/xwayland-input.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/hw/xwayland/xwayland-input.c b/hw/xwayland/xwayland-input.c -index ee932be60..a6d7d9356 100644 ---- a/hw/xwayland/xwayland-input.c -+++ b/hw/xwayland/xwayland-input.c -@@ -1626,9 +1626,9 @@ tablet_tool_button_state(void *data, struct zwp_tablet_tool_v2 *tool, - BUG_RETURN(xbtn >= 8 * sizeof(*mask)); - - if (state) -- SetBit(mask, xbtn); -+ SetBit(mask, xbtn - 1); - else -- ClearBit(mask, xbtn); -+ ClearBit(mask, xbtn - 1); - - xwl_seat->xwl_screen->serial = serial; - } --- -2.13.5 - diff --git a/SOURCES/0012-xwayland-Implement-tablet_tool_wheel-for-scrolling.patch b/SOURCES/0012-xwayland-Implement-tablet_tool_wheel-for-scrolling.patch deleted file mode 100644 index 097bcb4..0000000 --- a/SOURCES/0012-xwayland-Implement-tablet_tool_wheel-for-scrolling.patch +++ /dev/null @@ -1,78 +0,0 @@ -From d03bf0d1759d7d113216a0311e794b5adb0845de Mon Sep 17 00:00:00 2001 -From: Jason Gerecke -Date: Fri, 9 Jun 2017 16:02:07 -0700 -Subject: [PATCH xserver 12/12] xwayland: Implement tablet_tool_wheel for - scrolling - -The 'tablet_tool_wheel' function for tablet scrolling was added back in -8a1defcc634 but left unimplemented. This commit fills in the necessary -details, using the "clicks" count as the number of discrete scroll up/down -events to send. - -Signed-off-by: Jason Gerecke -Reviewed-by: Peter Hutterer -Signed-off-by: Peter Hutterer -(cherry picked from commit 7c7a540f1e1d6b5466e1c9aa28476a2d7273d5ed) ---- - hw/xwayland/xwayland-input.c | 24 ++++++++++++++++++++++++ - hw/xwayland/xwayland.h | 2 ++ - 2 files changed, 26 insertions(+) - -diff --git a/hw/xwayland/xwayland-input.c b/hw/xwayland/xwayland-input.c -index a6d7d9356..0cf318623 100644 ---- a/hw/xwayland/xwayland-input.c -+++ b/hw/xwayland/xwayland-input.c -@@ -1566,6 +1566,13 @@ static void - tablet_tool_wheel(void *data, struct zwp_tablet_tool_v2 *tool, - wl_fixed_t degrees, int32_t clicks) - { -+ struct xwl_tablet_tool *xwl_tablet_tool = data; -+ struct xwl_seat *xwl_seat = xwl_tablet_tool->seat; -+ -+ if (!xwl_seat->focus_window) -+ return; -+ -+ xwl_tablet_tool->wheel_clicks = clicks; - } - - static void -@@ -1677,6 +1684,23 @@ tablet_tool_frame(void *data, struct zwp_tablet_tool_v2 *tool, uint32_t time) - } - - xwl_tablet_tool->buttons_prev = xwl_tablet_tool->buttons_now; -+ -+ while (xwl_tablet_tool->wheel_clicks) { -+ if (xwl_tablet_tool->wheel_clicks < 0) { -+ button = 4; -+ xwl_tablet_tool->wheel_clicks++; -+ } -+ else { -+ button = 5; -+ xwl_tablet_tool->wheel_clicks--; -+ } -+ -+ QueuePointerEvents(xwl_tablet_tool->xdevice, -+ ButtonPress, button, 0, &mask); -+ QueuePointerEvents(xwl_tablet_tool->xdevice, -+ ButtonRelease, button, 0, &mask); -+ -+ } - } - - static const struct zwp_tablet_tool_v2_listener tablet_tool_listener = { -diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h -index 250564f73..135aa8761 100644 ---- a/hw/xwayland/xwayland.h -+++ b/hw/xwayland/xwayland.h -@@ -213,6 +213,8 @@ struct xwl_tablet_tool { - uint32_t buttons_now, - buttons_prev; - -+ int32_t wheel_clicks; -+ - struct xwl_cursor cursor; - }; - --- -2.13.5 - diff --git a/SOURCES/xserver-1.4.99-ssh-isnt-local.patch b/SOURCES/xserver-1.4.99-ssh-isnt-local.patch deleted file mode 100644 index 2d33bed..0000000 --- a/SOURCES/xserver-1.4.99-ssh-isnt-local.patch +++ /dev/null @@ -1,48 +0,0 @@ -From 66a3b14e118e90db80f96fcab52af4df35bc2377 Mon Sep 17 00:00:00 2001 -From: Adam Jackson -Date: Mon, 10 Dec 2007 11:26:57 -0500 -Subject: [PATCH] Hack for proper MIT-SHM rejection for ssh-forwarded clients. - ---- - Xext/shm.c | 16 ++++++++++++++++ - 1 file changed, 16 insertions(+) - -diff --git a/Xext/shm.c b/Xext/shm.c -index de48020..c011210 100644 ---- a/Xext/shm.c -+++ b/Xext/shm.c -@@ -321,8 +321,21 @@ shm_access(ClientPtr client, SHMPERM_TYPE * perm, int readonly) - mode_t mask; - int uidset = 0, gidset = 0; - LocalClientCredRec *lcc; -+ Bool is_ssh = FALSE; - - if (GetLocalClientCreds(client, &lcc) != -1) { -+#ifdef linux -+ if (lcc->fieldsSet & LCC_PID_SET) { -+ /* ssh isn't actually a local client */ -+ char exe[64], buf[64]; -+ -+ memset(buf, 0, 64); -+ snprintf(exe, 64, "/proc/%d/exe", lcc->pid); -+ readlink(exe, buf, 63); -+ if (strstr(buf, "/ssh")) -+ is_ssh = TRUE; -+ } -+#endif - - if (lcc->fieldsSet & LCC_UID_SET) { - uid = lcc->euid; -@@ -342,6 +355,9 @@ shm_access(ClientPtr client, SHMPERM_TYPE * perm, int readonly) - #endif - FreeLocalClientCreds(lcc); - -+ if (is_ssh) -+ return -1; -+ - if (uidset) { - /* User id 0 always gets access */ - if (uid == 0) { --- -1.7.10.1 - diff --git a/SOURCES/xserver-autobind-hotplug.patch b/SOURCES/xserver-autobind-hotplug.patch deleted file mode 100644 index 8025cbd..0000000 --- a/SOURCES/xserver-autobind-hotplug.patch +++ /dev/null @@ -1,302 +0,0 @@ -From 4471df41ea6e94834a2b10643ca7fcd69682d276 Mon Sep 17 00:00:00 2001 -From: Dave Airlie -Date: Fri, 17 Aug 2012 09:49:24 +1000 -Subject: [PATCH xserver v3] autobind GPUs to the screen - -This is a modified version of a patch we've been carry-ing in Fedora and -RHEL for years now. This patch automatically adds secondary GPUs to the -master as output sink / offload source making e.g. the use of -slave-outputs just work, with requiring the user to manually run -"xrandr --setprovideroutputsource" before he can hookup an external -monitor to his hybrid graphics laptop. - -There is one problem with this patch, which is why it was not upstreamed -before. What to do when a secondary GPU gets detected really is a policy -decission (e.g. one may want to autobind PCI GPUs but not USB ones) and -as such should be under control of the Desktop Environment. - -Unconditionally adding autobinding support to the xserver will result -in races between the DE dealing with the hotplug of a secondary GPU -and the server itself dealing with it. - -However we've waited for years for any Desktop Environments to actually -start doing some sort of autoconfiguration of secondary GPUs and there -is still not a single DE dealing with this, so I believe that it is -time to upstream this now. - -To avoid potential future problems if any DEs get support for doing -secondary GPU configuration themselves, the new autobind functionality -is made optional. Since no DEs currently support doing this themselves it -is enabled by default. When DEs grow support for doing this themselves -they can disable the servers autobinding through the servers cmdline or a -xorg.conf snippet. - -Signed-off-by: Dave Airlie -[hdegoede@redhat.com: Make configurable, fix with nvidia, submit upstream] -Signed-off-by: Hans de Goede ---- -Changes in v2: --Make the default enabled instead of installing a xorg.conf - snippet which enables it unconditionally -Changes in v3: --Handle GPUScreen autoconfig in randr/rrprovider.c, looking at - rrScrPriv->provider, rather then in hw/xfree86/modes/xf86Crtc.c - looking at xf86CrtcConfig->provider. This fixes the autoconfig not - working with the nvidia binary driver ---- - hw/xfree86/common/xf86Config.c | 19 +++++++++++++++++++ - hw/xfree86/common/xf86Globals.c | 2 ++ - hw/xfree86/common/xf86Init.c | 20 ++++++++++++++++++++ - hw/xfree86/common/xf86Priv.h | 1 + - hw/xfree86/common/xf86Privstr.h | 1 + - hw/xfree86/common/xf86platformBus.c | 4 ++++ - hw/xfree86/man/Xorg.man | 7 +++++++ - hw/xfree86/man/xorg.conf.man | 6 ++++++ - randr/randrstr.h | 3 +++ - randr/rrprovider.c | 22 ++++++++++++++++++++++ - 10 files changed, 85 insertions(+) - -diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c -index 21daf1a..df3ca50 100644 ---- a/hw/xfree86/common/xf86Config.c -+++ b/hw/xfree86/common/xf86Config.c -@@ -719,6 +719,7 @@ typedef enum { - FLAG_DRI2, - FLAG_USE_SIGIO, - FLAG_AUTO_ADD_GPU, -+ FLAG_AUTO_BIND_GPU, - FLAG_MAX_CLIENTS, - FLAG_IGLX, - } FlagValues; -@@ -778,6 +779,8 @@ static OptionInfoRec FlagOptions[] = { - {0}, FALSE}, - {FLAG_AUTO_ADD_GPU, "AutoAddGPU", OPTV_BOOLEAN, - {0}, FALSE}, -+ {FLAG_AUTO_BIND_GPU, "AutoBindGPU", OPTV_BOOLEAN, -+ {0}, FALSE}, - {FLAG_MAX_CLIENTS, "MaxClients", OPTV_INTEGER, - {0}, FALSE }, - {FLAG_IGLX, "IndirectGLX", OPTV_BOOLEAN, -@@ -857,6 +860,22 @@ configServerFlags(XF86ConfFlagsPtr flagsconf, XF86OptionPtr layoutopts) - } - xf86Msg(from, "%sutomatically adding GPU devices\n", - xf86Info.autoAddGPU ? "A" : "Not a"); -+ -+ if (xf86AutoBindGPUDisabled) { -+ xf86Info.autoBindGPU = FALSE; -+ from = X_CMDLINE; -+ } -+ else if (xf86IsOptionSet(FlagOptions, FLAG_AUTO_BIND_GPU)) { -+ xf86GetOptValBool(FlagOptions, FLAG_AUTO_BIND_GPU, -+ &xf86Info.autoBindGPU); -+ from = X_CONFIG; -+ } -+ else { -+ from = X_DEFAULT; -+ } -+ xf86Msg(from, "%sutomatically binding GPU devices\n", -+ xf86Info.autoBindGPU ? "A" : "Not a"); -+ - /* - * Set things up based on the config file information. Some of these - * settings may be overridden later when the command line options are -diff --git a/hw/xfree86/common/xf86Globals.c b/hw/xfree86/common/xf86Globals.c -index e962b75..0d1e31b 100644 ---- a/hw/xfree86/common/xf86Globals.c -+++ b/hw/xfree86/common/xf86Globals.c -@@ -136,6 +136,7 @@ xf86InfoRec xf86Info = { - #else - .autoAddGPU = FALSE, - #endif -+ .autoBindGPU = TRUE, - }; - - const char *xf86ConfigFile = NULL; -@@ -197,6 +198,7 @@ Bool xf86FlipPixels = FALSE; - Gamma xf86Gamma = { 0.0, 0.0, 0.0 }; - - Bool xf86AllowMouseOpenFail = FALSE; -+Bool xf86AutoBindGPUDisabled = FALSE; - - #ifdef XF86VIDMODE - Bool xf86VidModeDisabled = FALSE; -diff --git a/hw/xfree86/common/xf86Init.c b/hw/xfree86/common/xf86Init.c -index a544b65..b0cba3d 100644 ---- a/hw/xfree86/common/xf86Init.c -+++ b/hw/xfree86/common/xf86Init.c -@@ -76,6 +76,7 @@ - #include "xf86DDC.h" - #include "xf86Xinput.h" - #include "xf86InPriv.h" -+#include "xf86Crtc.h" - #include "picturestr.h" - - #include "xf86Bus.h" -@@ -298,6 +299,19 @@ xf86PrivsElevated(void) - } - - static void -+xf86AutoConfigOutputDevices(void) -+{ -+ int i; -+ -+ if (!xf86Info.autoBindGPU) -+ return; -+ -+ for (i = 0; i < xf86NumGPUScreens; i++) -+ RRProviderAutoConfigGpuScreen(xf86ScrnToScreen(xf86GPUScreens[i]), -+ xf86ScrnToScreen(xf86Screens[0])); -+} -+ -+static void - InstallSignalHandlers(void) - { - /* -@@ -871,6 +885,8 @@ InitOutput(ScreenInfo * pScreenInfo, int argc, char **argv) - for (i = 0; i < xf86NumGPUScreens; i++) - AttachUnboundGPU(xf86Screens[0]->pScreen, xf86GPUScreens[i]->pScreen); - -+ xf86AutoConfigOutputDevices(); -+ - xf86VGAarbiterWrapFunctions(); - if (sigio_blocked) - input_unlock(); -@@ -1389,6 +1405,10 @@ ddxProcessArgument(int argc, char **argv, int i) - xf86Info.iglxFrom = X_CMDLINE; - return 0; - } -+ if (!strcmp(argv[i], "-noautoBindGPU")) { -+ xf86AutoBindGPUDisabled = TRUE; -+ return 1; -+ } - - /* OS-specific processing */ - return xf86ProcessArgument(argc, argv, i); -diff --git a/hw/xfree86/common/xf86Priv.h b/hw/xfree86/common/xf86Priv.h -index c1f8a18..9a3d0df 100644 ---- a/hw/xfree86/common/xf86Priv.h -+++ b/hw/xfree86/common/xf86Priv.h -@@ -46,6 +46,7 @@ - extern _X_EXPORT const char *xf86ConfigFile; - extern _X_EXPORT const char *xf86ConfigDir; - extern _X_EXPORT Bool xf86AllowMouseOpenFail; -+extern _X_EXPORT Bool xf86AutoBindGPUDisabled; - - #ifdef XF86VIDMODE - extern _X_EXPORT Bool xf86VidModeDisabled; -diff --git a/hw/xfree86/common/xf86Privstr.h b/hw/xfree86/common/xf86Privstr.h -index c29b3cc..4c5f54b 100644 ---- a/hw/xfree86/common/xf86Privstr.h -+++ b/hw/xfree86/common/xf86Privstr.h -@@ -102,6 +102,7 @@ typedef struct { - MessageType dri2From; - - Bool autoAddGPU; -+ Bool autoBindGPU; - } xf86InfoRec, *xf86InfoPtr; - - #ifdef DPMSExtension -diff --git a/hw/xfree86/common/xf86platformBus.c b/hw/xfree86/common/xf86platformBus.c -index 063e81c..42789ca 100644 ---- a/hw/xfree86/common/xf86platformBus.c -+++ b/hw/xfree86/common/xf86platformBus.c -@@ -48,6 +48,7 @@ - #include "Pci.h" - #include "xf86platformBus.h" - #include "xf86Config.h" -+#include "xf86Crtc.h" - - #include "randrstr.h" - int platformSlotClaimed; -@@ -579,6 +580,9 @@ xf86platformAddDevice(int index) - } - /* attach unbound to 0 protocol screen */ - AttachUnboundGPU(xf86Screens[0]->pScreen, xf86GPUScreens[i]->pScreen); -+ if (xf86Info.autoBindGPU) -+ RRProviderAutoConfigGpuScreen(xf86ScrnToScreen(xf86GPUScreens[i]), -+ xf86ScrnToScreen(xf86Screens[0])); - - RRResourcesChanged(xf86Screens[0]->pScreen); - RRTellChanged(xf86Screens[0]->pScreen); -diff --git a/hw/xfree86/man/Xorg.man b/hw/xfree86/man/Xorg.man -index def9bfc..8df6b7d 100644 ---- a/hw/xfree86/man/Xorg.man -+++ b/hw/xfree86/man/Xorg.man -@@ -283,6 +283,13 @@ is a comma separated list of directories to search for - server modules. This option is only available when the server is run - as root (i.e, with real-uid 0). - .TP 8 -+.B \-noautoBindGPU -+Disable automatically setting secondary GPUs up as output sinks and offload -+sources. This is equivalent to setting the -+.B AutoBindGPU -+xorg.conf(__filemansuffix__) file option. To -+.B false. -+.TP 8 - .B \-nosilk - Disable Silken Mouse support. - .TP 8 -diff --git a/hw/xfree86/man/xorg.conf.man b/hw/xfree86/man/xorg.conf.man -index 7d0c524..3e596e4 100644 ---- a/hw/xfree86/man/xorg.conf.man -+++ b/hw/xfree86/man/xorg.conf.man -@@ -673,6 +673,12 @@ Enabled by default. - If this option is disabled, then no GPU devices will be added from the udev - backend. Enabled by default. (May need to be disabled to setup Xinerama). - .TP 7 -+.BI "Option \*qAutoBindGPU\*q \*q" boolean \*q -+If enabled then secondary GPUs will be automatically set up as output-sinks and -+offload-sources. Making e.g. laptop outputs connected only to the secondary -+GPU directly available for use without needing to run -+"xrandr --setprovideroutputsource". Enabled by default. -+.TP 7 - .BI "Option \*qLog\*q \*q" string \*q - This option controls whether the log is flushed and/or synced to disk after - each message. -diff --git a/randr/randrstr.h b/randr/randrstr.h -index 706e9a7..66999d5 100644 ---- a/randr/randrstr.h -+++ b/randr/randrstr.h -@@ -976,6 +976,9 @@ RRProviderLookup(XID id, RRProviderPtr *provider_p); - extern _X_EXPORT void - RRDeliverProviderEvent(ClientPtr client, WindowPtr pWin, RRProviderPtr provider); - -+extern _X_EXPORT void -+RRProviderAutoConfigGpuScreen(ScreenPtr pScreen, ScreenPtr masterScreen); -+ - /* rrproviderproperty.c */ - - extern _X_EXPORT void -diff --git a/randr/rrprovider.c b/randr/rrprovider.c -index f9df67e..abc5685 100644 ---- a/randr/rrprovider.c -+++ b/randr/rrprovider.c -@@ -482,3 +482,25 @@ RRDeliverProviderEvent(ClientPtr client, WindowPtr pWin, RRProviderPtr provider) - - WriteEventsToClient(client, 1, (xEvent *) &pe); - } -+ -+void -+RRProviderAutoConfigGpuScreen(ScreenPtr pScreen, ScreenPtr masterScreen) -+{ -+ rrScrPrivPtr pScrPriv = rrGetScrPriv(pScreen); -+ rrScrPrivPtr masterPriv = rrGetScrPriv(masterScreen); -+ RRProviderPtr provider = pScrPriv->provider; -+ RRProviderPtr master_provider = masterPriv->provider; -+ -+ if (!provider || !master_provider) -+ return; -+ -+ if ((provider->capabilities & RR_Capability_SinkOutput) && -+ (master_provider->capabilities & RR_Capability_SourceOutput)) { -+ pScrPriv->rrProviderSetOutputSource(pScreen, provider, master_provider); -+ RRInitPrimeSyncProps(pScreen); -+ } -+ -+ if ((provider->capabilities & RR_Capability_SourceOffload) && -+ (master_provider->capabilities & RR_Capability_SinkOffload)) -+ pScrPriv->rrProviderSetOffloadSink(pScreen, provider, master_provider); -+} --- -2.9.3 - diff --git a/SPECS/xorg-x11-server.spec b/SPECS/xorg-x11-server.spec index c927981..c733fd6 100644 --- a/SPECS/xorg-x11-server.spec +++ b/SPECS/xorg-x11-server.spec @@ -16,7 +16,7 @@ # source because rpm is a terrible language. %global ansic_major 0 %global ansic_minor 4 -%global videodrv_major 23 +%global videodrv_major 24 %global videodrv_minor 0 %global xinput_major 24 %global xinput_minor 1 @@ -41,8 +41,8 @@ Summary: X.Org X11 X server Name: xorg-x11-server -Version: 1.19.5 -Release: 5.1%{?gitdate:.%{gitdate}}%{?dist} +Version: 1.20.1 +Release: 3%{?gitdate:.%{gitdate}}%{?dist} URL: http://www.x.org License: MIT Group: User Interface/X @@ -90,55 +90,21 @@ Patch105: 0001-xfree86-Don-t-autoconfigure-vesa-or-fbdev.patch # Trivial things to never merge upstream ever: # This really could be done prettier. -Patch5002: xserver-1.4.99-ssh-isnt-local.patch -Patch5004: xserver-autobind-hotplug.patch +Patch5004: 0001-autobind-GPUs-to-the-screen.patch Patch5005: 0001-link-with-z-now.patch # Bug 1166989 - Tcl/tk Canvas draw error Patch9423: RFC-mi-reduce-missing-segments-on-large-ellipse.patch +# Patch9504: 0001-rpath-hack.patch +Patch9710: 0001-modesetting-software-cursor-hack.patch -# Bug 1374198 - Xephyr crashes when launched over ssh X forwarding from Windows -Patch9430: 0001-xephyr-Check-for-host-XVideo-support-before-trying-t.patch - -Patch9504: 0001-rpath-hack.patch - -Patch9701: 0001-miarc-Style-cleanup-for-miWideArc.patch -Patch9702: 0002-miarc-Make-the-caller-free-the-arc-span-data.patch -Patch9703: 0003-miarc-Cache-arc-span-data-for-dashed-arcs.patch +# Bug 1599885 - RFE: enable backing store's Always mode +Patch9750: 0001-composite-Implement-backing-store-Always.patch -Patch9710: 0001-modesetting-software-cursor-hack.patch -Patch9711: 0001-handle-NullCursor-to-avoid-crash.patch -Patch9712: 0001-xfixes-Remove-the-CursorCurrent-array.patch -Patch9715: 0001-modesetting-Fix-PCI-initialization-on-non-zero-domai.patch -Patch9716: 0001-xfree86-Fix-off-by-one-in-X-configure.patch - -# Backport tablet support for Xwayland - *NOT* in server-1.19-branch -Patch9901: 0001-xwayland-Depend-on-wayland-protocols-to-build-tablet.patch -Patch9902: 0002-xwayland-Bind-to-wp_tablet_manager-if-available-and-.patch -Patch9903: 0003-xwayland-Listen-for-wp_tablet_seat-events.patch -Patch9904: 0004-xwayland-Handle-wp_tablet-events.patch -Patch9905: 0005-xwayland-Handle-tablet_tool-events.patch -Patch9906: 0006-xwayland-handle-button-events-after-motion-events.patch -Patch9907: 0007-xwayland-Refactor-cursor-management-into-xwl_cursor.patch -Patch9908: 0008-xwayland-update-cursor-on-tablet-tools-in-proximity.patch -Patch9909: 0009-xwayland-add-tablet-pad-support.patch -Patch9910: 0010-xwayland-Unconditionally-initialize-lists-in-init_ta.patch -Patch9911: 0011-xwayland-Correct-off-by-one-error-in-tablet-button-n.patch -Patch9912: 0012-xwayland-Implement-tablet_tool_wheel-for-scrolling.patch -# Bug 1544442 -Patch9913: 0001-xwayland-Keep-separate-variables-for-pointer-and-tab.patch - -Patch9922: 0002-animcur-Use-fixed-size-screen-private.patch -Patch9923: 0003-animcur-Return-the-next-interval-directly-from-the-t.patch -Patch9924: 0004-animcur-Run-the-timer-from-the-device-not-the-screen.patch -Patch9925: 0005-animcur-Fix-transitions-between-animated-cursors.patch -Patch9926: 0006-animcur-Change-which-CursorPtr-we-save-in-external-s.patch - -# Additional debug feature, allow to disable glamor in Xwayland using -# an envvar, could be useful in el7 - *NOT* in server-1.19-branch -Patch9951: 0001-xwayland-add-envvar-XWAYLAND_NO_GLAMOR.patch - -Patch9960: 0001-composite-Implement-backing-store-Always.patch +Patch9751: 0001-glamor_egl-Don-t-initialize-on-llvmpipe.patch +Patch9752: 0001-xwayland-Don-t-initialize-glamor-on-llvmpipe.patch +Patch9753: 0001-linux-Make-platform-device-probe-less-fragile.patch +Patch9754: 0001-xfree86-try-harder-to-span-on-multihead.patch %global moduledir %{_libdir}/xorg/modules %global drimoduledir %{_libdir}/dri @@ -190,7 +156,7 @@ BuildRequires: pkgconfig(epoxy) BuildRequires: libXv-devel BuildRequires: pixman-devel >= 0.30.0 BuildRequires: libpciaccess-devel >= 0.13.1 openssl-devel byacc flex -BuildRequires: mesa-libGL-devel >= 9.2 mesa-libgbm-devel mesa-libEGL-devel +BuildRequires: pkgconfig(libglvnd) pkgconfig(gl) pkgconfig(gbm) pkgconfig(egl) # XXX silly... BuildRequires: libdrm-devel >= 2.4.0 kernel-headers @@ -400,11 +366,13 @@ test `getminor extension` == %{extension_minor} %if %{with_hw_servers} %global dri_flags --with-dri-driver-path=%{drimoduledir} --enable-dri --enable-dri2 --enable-dri3 --enable-glamor --enable-xshmfence %else -%global dri_flags --disable-dri +# this is mostly for s390's sake, and should be unnecessary, but who wants to +# try fixing configure.ac? nobody, that's who. +%global dri_flags --disable-dri --disable-dri2 --disable-dri3 --disable-glamor %endif # ick -sed -i 's/WAYLAND_SCANNER_RULES.*//g' configure.ac +# sed -i 's/WAYLAND_SCANNER_RULES.*//g' configure.ac # --with-pie ? autoreconf -f -v --install || exit 1 @@ -431,7 +399,7 @@ autoreconf -f -v --install || exit 1 %{?wayland} \ %{dri_flags} %{?bodhi_flags} \ ${CONFIGURE} - + make V=1 %{?_smp_mflags} %install @@ -487,6 +455,7 @@ find . -type f | egrep '.*\.(c|h|am|ac|inc|m4|h.in|pc.in|man.pre|pl|txt)$' | xargs tar cf - | (cd %{inst_srcdir} && tar xf -) # SLEDGEHAMMER find %{inst_srcdir}/hw/xfree86 -name \*.c -delete +find %{inst_srcdir}/hw/xwayland -name \*.[ch] -delete # Remove unwanted files/dirs { @@ -618,9 +587,33 @@ rm -rf $RPM_BUILD_ROOT %{xserver_source_dir} %changelog -* Fri Oct 12 2018 Adam Jackson - 1.19.5-5.1 +* Mon Sep 24 2018 Adam Jackson - 1.20.1-3 +- Try harder to come up with an initial spanning configuration + +* Wed Sep 19 2018 Adam Jackson - 1.20.1-2 +- Make platform device probe a bit less fragile +- Disable glamor on llvmpipe + +* Thu Aug 09 2018 Adam Jackson - 1.20.1-1 +- xserver 1.20.1 - Enable backing store's Always mode +* Thu Jul 19 2018 Peter Hutterer 1.20.0-2 +- Fix glx vendor hash table key size +- Fix memory corruption during PanoramiX setup (#1601742) + +* Tue Jul 10 2018 Adam Jackson - 1.20.0-1 +- Fix 16bpp with modesetting driver + +* Wed Jun 27 2018 Lyude Paul - 1.20.0-0.3 +- Add patches for bz1591978 + +* Wed Jun 27 2018 Lyude Paul - 1.20.0-0.2 +- Add patches for bz1585252 + +* Tue May 29 2018 Adam Jackson - 1.20.0-0.1 +- Initial 1.20 rebuild + * Tue Feb 13 2018 Adam Jackson - 1.19.5-5 - Fix fetching animated cursor images with the XFIXES extension