diff --git a/.gitignore b/.gitignore index 29790d0..ae892e8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,36 @@ +xorg-server-1.9.1.tar.bz2 +/xorg-server-20101125.tar.xz +/xorg-server-20101201.tar.xz +/xorg-server-1.10.0.tar.bz2 +/xorg-server-20110418.tar.xz +/xorg-server-20110510.tar.xz +/xorg-server-20110818.tar.xz +/xorg-server-1.11.0.tar.bz2 +/xorg-server-1.11.1.tar.bz2 +/xorg-server-20111109.tar.xz +/xorg-server-20120103.tar.xz +/xorg-server-20120124.tar.xz +/xorg-server-20120215.tar.xz +/xorg-server-1.12.0.tar.bz2 +/xorg-server-1.12.1.tar.bz2 +/xorg-server-1.12.2.tar.bz2 +/xorg-server-1.12.3.tar.bz2 +/xorg-server-20120717.tar.xz +/xorg-server-20120726.tar.xz +/xorg-server-20120808.tar.xz +/xorg-server-20120822.tar.xz +/xorg-server-1.13.0.tar.bz2 +/xorg-server-1.13.1.tar.bz2 +/xorg-server-20130109.tar.xz +/xorg-server-20130215.tar.xz +/xorg-server-1.14.0.tar.bz2 +/xorg-server-1.14.1.tar.bz2 +/xorg-server-1.14.1.901.tar.bz2 +/xorg-server-1.14.2.tar.bz2 +/xorg-server-1.14.3.tar.bz2 +/xorg-server-1.14.99.3.tar.bz2 +/xorg-server-1.14.99.901.tar.bz2 +/xorg-server-1.14.99.902.tar.bz2 *.bz2 *.xz -*.gz +/xorg-x11-server-1.15.0-1.fc21.src.rpm diff --git a/0001-Always-install-vbe-and-int10-sdk-headers.patch b/0001-Always-install-vbe-and-int10-sdk-headers.patch new file mode 100644 index 0000000..c613eb8 --- /dev/null +++ b/0001-Always-install-vbe-and-int10-sdk-headers.patch @@ -0,0 +1,37 @@ +From e96a83d9b1b5a52a41213c7a4840dc96b4f5b06f Mon Sep 17 00:00:00 2001 +From: Adam Jackson +Date: Wed, 15 Aug 2012 12:35:21 -0400 +Subject: [PATCH] Always install vbe and int10 sdk headers + +Signed-off-by: Adam Jackson +--- + hw/xfree86/Makefile.am | 12 ++---------- + 1 file changed, 2 insertions(+), 10 deletions(-) + +diff --git a/hw/xfree86/Makefile.am b/hw/xfree86/Makefile.am +index b876b79..a170b58 100644 +--- a/hw/xfree86/Makefile.am ++++ b/hw/xfree86/Makefile.am +@@ -26,17 +26,9 @@ if VGAHW + VGAHW_SUBDIR = vgahw + endif + +-if VBE +-VBE_SUBDIR = vbe +-endif +- +-if INT10MODULE +-INT10_SUBDIR = int10 +-endif +- +-SUBDIRS = common ddc x86emu $(INT10_SUBDIR) os-support parser \ ++SUBDIRS = common ddc x86emu int10 os-support parser \ + ramdac $(VGAHW_SUBDIR) loader modes $(DRI_SUBDIR) \ +- $(DRI2_SUBDIR) . $(VBE_SUBDIR) i2c dixmods xkb \ ++ $(DRI2_SUBDIR) . vbe i2c dixmods xkb \ + fbdevhw shadowfb exa $(XF86UTILS_SUBDIR) doc man \ + $(GLAMOR_EGL_SUBDIR) drivers + +-- +2.13.6 + diff --git a/0001-config-fix-NULL-value-detection-for-ID_INPUT-being-u.patch b/0001-config-fix-NULL-value-detection-for-ID_INPUT-being-u.patch new file mode 100644 index 0000000..15ba8e7 --- /dev/null +++ b/0001-config-fix-NULL-value-detection-for-ID_INPUT-being-u.patch @@ -0,0 +1,33 @@ +From a309323328d9d6e0bf5d9ea1d75920e53b9beef3 Mon Sep 17 00:00:00 2001 +From: Peter Hutterer +Date: Fri, 5 Jan 2018 11:58:42 +1000 +Subject: [PATCH xserver] config: fix NULL value detection for ID_INPUT being + unset + +Erroneous condition caused us to keep going with all devices that didn't have +ID_INPUT set. + +Fixes: 5aad81445c8c3d6 +Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=104382 +Reviewed-by: Adam Jackson +Signed-off-by: Peter Hutterer +--- + config/udev.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/config/udev.c b/config/udev.c +index e198e8609..3a73189e2 100644 +--- a/config/udev.c ++++ b/config/udev.c +@@ -135,7 +135,7 @@ device_added(struct udev_device *udev_device) + #endif + + value = udev_device_get_property_value(udev_device, "ID_INPUT"); +- if (value && !strcmp(value, "0")) { ++ if (!value || !strcmp(value, "0")) { + LogMessageVerb(X_INFO, 10, + "config/udev: ignoring device %s without " + "property ID_INPUT set\n", path); +-- +2.14.3 + diff --git a/0001-xf86-dri2-Use-va_gl-as-vdpau_driver-for-Intel-i965-G.patch b/0001-xf86-dri2-Use-va_gl-as-vdpau_driver-for-Intel-i965-G.patch index 2134a44..b0a44e4 100644 --- a/0001-xf86-dri2-Use-va_gl-as-vdpau_driver-for-Intel-i965-G.patch +++ b/0001-xf86-dri2-Use-va_gl-as-vdpau_driver-for-Intel-i965-G.patch @@ -1,4 +1,4 @@ -From acf5a0100c98a040e5e07a79ecf4a83627da770e Mon Sep 17 00:00:00 2001 +From 27043630ebb54fd1915c5d1814ab62079ca3eca9 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Thu, 23 Mar 2017 12:54:07 +0100 Subject: [PATCH xserver] xf86: dri2: Use va_gl as vdpau_driver for Intel i965 @@ -22,15 +22,15 @@ BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1413733 Cc: kwizart@gmail.com Signed-off-by: Hans de Goede --- - hw/xfree86/dri2/dri2.c | 31 +++++++++++++-------- - hw/xfree86/dri2/pci_ids/pci_id_driver_map.h | 21 +++++++------- - 2 files changed, 31 insertions(+), 21 deletions(-) + hw/xfree86/dri2/dri2.c | 36 +++++++++++++++++++---------- + hw/xfree86/dri2/pci_ids/pci_id_driver_map.h | 21 +++++++++-------- + 2 files changed, 35 insertions(+), 22 deletions(-) diff --git a/hw/xfree86/dri2/dri2.c b/hw/xfree86/dri2/dri2.c -index 6619e3aa7..1f8ad14bc 100644 +index 2165603..d0366746 100644 --- a/hw/xfree86/dri2/dri2.c +++ b/hw/xfree86/dri2/dri2.c -@@ -1437,14 +1437,18 @@ get_prime_id(void) +@@ -1437,14 +1437,19 @@ get_prime_id(void) #include "pci_ids/pci_id_driver_map.h" @@ -41,18 +41,24 @@ index 6619e3aa7..1f8ad14bc 100644 + const char **dri_driver_ret, + const char **vdpau_driver_ret) { - #ifdef WITH_LIBDRM + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); + EntityInfoPtr pEnt = xf86GetEntityInfo(pScrn->entityList[0]); + struct pci_device *pdev = NULL; int i, j; -- char *driver = NULL; - drmDevicePtr dev; + *dri_driver_ret = NULL; + *vdpau_driver_ret = NULL; + - /* For non-PCI devices and drmGetDevice fail, just assume that - * the 3D driver is named the same as the kernel driver. This is - * currently true for vc4 and msm (freedreno). -@@ -1454,12 +1458,14 @@ dri2_probe_driver_name(ScreenPtr pScreen, DRI2InfoPtr info) + if (pEnt) + pdev = xf86GetPciInfoForEntity(pEnt->index); + +@@ -1454,30 +1459,37 @@ dri2_probe_driver_name(ScreenPtr pScreen, DRI2InfoPtr info) + */ + if (!pdev) { + drmVersionPtr version = drmGetVersion(info->fd); +- char *kernel_driver; + + if (!version) { xf86DrvMsg(pScreen->myNum, X_ERROR, "[DRI2] Couldn't drmGetVersion() on non-PCI device, " "no driver name found.\n"); @@ -60,61 +66,61 @@ index 6619e3aa7..1f8ad14bc 100644 + return; } -- driver = strndup(version->name, version->name_len); +- kernel_driver = strndup(version->name, version->name_len); + /* FIXME this gets leaked */ + *dri_driver_ret = strndup(version->name, version->name_len); + *vdpau_driver_ret = *dri_driver_ret; drmFreeVersion(version); -- return driver; +- return kernel_driver; + return; } for (i = 0; driver_map[i].driver; i++) { -@@ -1467,13 +1473,15 @@ dri2_probe_driver_name(ScreenPtr pScreen, DRI2InfoPtr info) + if (pdev->vendor_id != driver_map[i].vendor_id) continue; - if (driver_map[i].num_chips_ids == -1) { -- driver = strdup(driver_map[i].driver); +- if (driver_map[i].num_chips_ids == -1) +- return strdup(driver_map[i].driver); ++ if (driver_map[i].num_chips_ids == -1) { + *dri_driver_ret = driver_map[i].driver; + *vdpau_driver_ret = driver_map[i].vdpau_driver; - goto out; - } ++ return; ++ } for (j = 0; j < driver_map[i].num_chips_ids; j++) { - if (driver_map[i].chip_ids[j] == dev->deviceinfo.pci->device_id) { -- driver = strdup(driver_map[i].driver); +- if (driver_map[i].chip_ids[j] == pdev->device_id) +- return strdup(driver_map[i].driver); ++ if (driver_map[i].chip_ids[j] == pdev->device_id) { + *dri_driver_ret = driver_map[i].driver; + *vdpau_driver_ret = driver_map[i].vdpau_driver; - goto out; - } ++ return; ++ } } -@@ -1485,9 +1493,9 @@ dri2_probe_driver_name(ScreenPtr pScreen, DRI2InfoPtr info) - dev->deviceinfo.pci->vendor_id, dev->deviceinfo.pci->device_id); - out: - drmFreeDevice(&dev); -- return driver; - #else + } + +@@ -1485,7 +1497,6 @@ dri2_probe_driver_name(ScreenPtr pScreen, DRI2InfoPtr info) + "[DRI2] No driver mapping found for PCI device " + "0x%04x / 0x%04x\n", + pdev->vendor_id, pdev->device_id); - return NULL; -+ *dri_driver_ret = NULL; -+ *vdpau_driver_ret = NULL; - #endif } -@@ -1604,7 +1612,8 @@ DRI2ScreenInit(ScreenPtr pScreen, DRI2InfoPtr info) + Bool +@@ -1606,7 +1617,8 @@ DRI2ScreenInit(ScreenPtr pScreen, DRI2InfoPtr info) + if (info->driverName) { + ds->driverNames[0] = info->driverName; } else { - /* FIXME dri2_probe_driver_name() returns a strdup-ed string, - * currently this gets leaked */ - ds->driverNames[0] = ds->driverNames[1] = dri2_probe_driver_name(pScreen, info); + dri2_probe_driver_name(pScreen, info, + &ds->driverNames[0], &ds->driverNames[1]); if (!ds->driverNames[0]) return FALSE; - + } diff --git a/hw/xfree86/dri2/pci_ids/pci_id_driver_map.h b/hw/xfree86/dri2/pci_ids/pci_id_driver_map.h -index da7ea1c1e..7036d1003 100644 +index da7ea1c..7036d10 100644 --- a/hw/xfree86/dri2/pci_ids/pci_id_driver_map.h +++ b/hw/xfree86/dri2/pci_ids/pci_id_driver_map.h -@@ -60,23 +60,24 @@ static const int vmwgfx_chip_ids[] = { +@@ -66,21 +66,22 @@ static const int vmwgfx_chip_ids[] = { static const struct { int vendor_id; const char *driver; @@ -124,10 +130,8 @@ index da7ea1c1e..7036d1003 100644 } driver_map[] = { - { 0x8086, "i915", i915_chip_ids, ARRAY_SIZE(i915_chip_ids) }, - { 0x8086, "i965", i965_chip_ids, ARRAY_SIZE(i965_chip_ids) }, -- { 0x8086, "i965", NULL, -1 }, + { 0x8086, "i915", "i915", i915_chip_ids, ARRAY_SIZE(i915_chip_ids) }, + { 0x8086, "i965", "va_gl", i965_chip_ids, ARRAY_SIZE(i965_chip_ids) }, -+ { 0x8086, "i965", "va_gl", NULL, -1 }, #ifndef DRIVER_MAP_GALLIUM_ONLY - { 0x1002, "radeon", r100_chip_ids, ARRAY_SIZE(r100_chip_ids) }, - { 0x1002, "r200", r200_chip_ids, ARRAY_SIZE(r200_chip_ids) }, @@ -136,18 +140,19 @@ index da7ea1c1e..7036d1003 100644 #endif - { 0x1002, "r300", r300_chip_ids, ARRAY_SIZE(r300_chip_ids) }, - { 0x1002, "r600", r600_chip_ids, ARRAY_SIZE(r600_chip_ids) }, -- { 0x1002, "radeonsi", NULL, -1 }, +- { 0x1002, "radeonsi", radeonsi_chip_ids, ARRAY_SIZE(radeonsi_chip_ids) }, - { 0x10de, "nouveau", NULL, -1 }, - { 0x1af4, "virtio_gpu", virtio_gpu_chip_ids, ARRAY_SIZE(virtio_gpu_chip_ids) }, - { 0x15ad, "vmwgfx", vmwgfx_chip_ids, ARRAY_SIZE(vmwgfx_chip_ids) }, -- { 0x0000, NULL, NULL, 0 }, + { 0x1002, "r300", "r300", r300_chip_ids, ARRAY_SIZE(r300_chip_ids) }, -+ { 0x1002, "r600", "r600", r600_chip_ids, ARRAY_SIZE(r600_chip_ids) }, -+ { 0x1002, "radeonsi", "radeonsi", NULL, -1 }, ++ { 0x1002, "r600","r600", r600_chip_ids, ARRAY_SIZE(r600_chip_ids) }, ++ { 0x1002, "radeonsi", "radeonsi", radeonsi_chip_ids, ARRAY_SIZE(radeonsi_chip_ids) }, + { 0x10de, "nouveau", "nouveau", NULL, -1 }, + { 0x1af4, "virtio_gpu", "virtio_gpu", virtio_gpu_chip_ids, ARRAY_SIZE(virtio_gpu_chip_ids) }, + { 0x15ad, "vmwgfx", "vmwgfx", vmwgfx_chip_ids, ARRAY_SIZE(vmwgfx_chip_ids) }, -+ { 0x0000, NULL, NULL, NULL, 0 }, + { 0x0000, NULL, NULL, 0 }, }; - #endif /* _PCI_ID_DRIVER_MAP_H_ */ +-- +2.9.3 + diff --git a/0001-xfree86-Free-devlist-returned-by-xf86MatchDevice.patch b/0001-xfree86-Free-devlist-returned-by-xf86MatchDevice.patch new file mode 100644 index 0000000..36a3730 --- /dev/null +++ b/0001-xfree86-Free-devlist-returned-by-xf86MatchDevice.patch @@ -0,0 +1,39 @@ +From c57c1e53ea3d76ebba5b2a23b7260817d3e6b921 Mon Sep 17 00:00:00 2001 +From: Hans De Goede +Date: Mon, 12 Dec 2016 17:03:12 +0100 +Subject: [PATCH xserver 1/6] xfree86: Free devlist returned by xf86MatchDevice + +xf86MatchDevice returns a dynamically allocated list of GDevPtr-s, +free this when we're done with it. + +Reviewed-by: Adam Jackson +Signed-off-by: Hans de Goede +--- + hw/xfree86/common/xf86platformBus.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/hw/xfree86/common/xf86platformBus.c b/hw/xfree86/common/xf86platformBus.c +index 063e81c..16d934f 100644 +--- a/hw/xfree86/common/xf86platformBus.c ++++ b/hw/xfree86/common/xf86platformBus.c +@@ -479,6 +479,8 @@ xf86platformProbeDev(DriverPtr drvp) + isGPUDevice(devList[i]) ? PLATFORM_PROBE_GPU_SCREEN : 0); + } + ++ free(devList); ++ + return foundScreen; + } + +@@ -505,6 +507,8 @@ xf86platformAddGPUDevices(DriverPtr drvp) + } + } + ++ free(devList); ++ + return foundScreen; + } + +-- +2.9.3 + diff --git a/0001-xfree86-add-default-modes-for-16-9-and-16-10.patch b/0001-xfree86-add-default-modes-for-16-9-and-16-10.patch new file mode 100644 index 0000000..c9ed462 --- /dev/null +++ b/0001-xfree86-add-default-modes-for-16-9-and-16-10.patch @@ -0,0 +1,171 @@ +From 8be1dbeacf5f29c0b538414e87d47c9d5af08d9d Mon Sep 17 00:00:00 2001 +From: Martin Wilck +Date: Tue, 9 Jan 2018 20:33:09 +0100 +Subject: xfree86: add default modes for 16:9 and 16:10 + +Improve the user experience for users with wide screens by adding standard +16:9 and 16:10 modes to extramodes, as suggested previously +(https://lists.x.org/archives/xorg-devel/2016-February/048866.html). +Tested successfully on my laptop. Feedback welcome. + +See also https://bugs.freedesktop.org/show_bug.cgi?id=37858. + +Signed-off-by: Martin Wilck +Reviewed-by: Adam Jackson +(cherry picked from commit a5e9bcad7ad0887f804905b482894b85751519fb) +--- + hw/xfree86/common/extramodes | 141 +++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 141 insertions(+) + +diff --git a/hw/xfree86/common/extramodes b/hw/xfree86/common/extramodes +index 4505026..006b5cb 100644 +--- a/hw/xfree86/common/extramodes ++++ b/hw/xfree86/common/extramodes +@@ -25,3 +25,144 @@ Modeline "2048x1536" 340.48 2048 2216 2440 2832 1536 1537 1540 1603 -hsync +vs + # 2048x1536 @ 85Hz (VESA GTF) hsync: 137.0kHz + Modeline "2048x1536" 388.04 2048 2216 2440 2832 1536 1537 1540 1612 -hsync +vsync + ++### 16:9 modelines generated by cvt ++ ++# 640x360 59.32 Hz (CVT 0.23M9-R) hsync: 22.19 kHz; pclk: 17.75 MHz ++Modeline "640x360R" 17.75 640 688 720 800 360 363 368 374 +hsync -vsync ++ ++# 640x360 59.84 Hz (CVT 0.23M9) hsync: 22.50 kHz; pclk: 18.00 MHz ++Modeline "640x360" 18.00 640 664 720 800 360 363 368 376 -hsync +vsync ++ ++# 720x405 58.99 Hz (CVT 0.29M9-R) hsync: 24.72 kHz; pclk: 21.75 MHz ++Modeline "720x405R" 21.75 720 768 800 880 405 408 413 419 +hsync -vsync ++ ++# 720x405 59.51 Hz (CVT 0.29M9) hsync: 25.11 kHz; pclk: 22.50 MHz ++Modeline "720x405" 22.50 720 744 808 896 405 408 413 422 -hsync +vsync ++ ++# 864x486 59.57 Hz (CVT 0.42M9-R) hsync: 29.79 kHz; pclk: 30.50 MHz ++Modeline "864x486R" 30.50 864 912 944 1024 486 489 494 500 +hsync -vsync ++ ++# 864x486 59.92 Hz (CVT 0.42M9) hsync: 30.32 kHz; pclk: 32.50 MHz ++Modeline "864x486" 32.50 864 888 968 1072 486 489 494 506 -hsync +vsync ++ ++# 960x540 59.82 Hz (CVT 0.52M9-R) hsync: 33.26 kHz; pclk: 37.25 MHz ++Modeline "960x540R" 37.25 960 1008 1040 1120 540 543 548 556 +hsync -vsync ++ ++# 960x540 59.63 Hz (CVT 0.52M9) hsync: 33.51 kHz; pclk: 40.75 MHz ++Modeline "960x540" 40.75 960 992 1088 1216 540 543 548 562 -hsync +vsync ++ ++# 1024x576 59.82 Hz (CVT 0.59M9-R) hsync: 35.47 kHz; pclk: 42.00 MHz ++Modeline "1024x576R" 42.00 1024 1072 1104 1184 576 579 584 593 +hsync -vsync ++ ++# 1024x576 59.90 Hz (CVT 0.59M9) hsync: 35.88 kHz; pclk: 46.50 MHz ++Modeline "1024x576" 46.50 1024 1064 1160 1296 576 579 584 599 -hsync +vsync ++ ++# 1280x720 59.74 Hz (CVT 0.92M9-R) hsync: 44.27 kHz; pclk: 63.75 MHz ++Modeline "1280x720R" 63.75 1280 1328 1360 1440 720 723 728 741 +hsync -vsync ++ ++# 1280x720 59.86 Hz (CVT 0.92M9) hsync: 44.77 kHz; pclk: 74.50 MHz ++Modeline "1280x720" 74.50 1280 1344 1472 1664 720 723 728 748 -hsync +vsync ++ ++# 1368x768 59.85 Hz (CVT) hsync: 47.28 kHz; pclk: 72.25 MHz ++Modeline "1368x768R" 72.25 1368 1416 1448 1528 768 771 781 790 +hsync -vsync ++ ++# 1368x768 59.88 Hz (CVT) hsync: 47.79 kHz; pclk: 85.25 MHz ++Modeline "1368x768" 85.25 1368 1440 1576 1784 768 771 781 798 -hsync +vsync ++ ++# 1600x900 59.82 Hz (CVT 1.44M9-R) hsync: 55.40 kHz; pclk: 97.50 MHz ++Modeline "1600x900R" 97.50 1600 1648 1680 1760 900 903 908 926 +hsync -vsync ++ ++# 1600x900 59.95 Hz (CVT 1.44M9) hsync: 55.99 kHz; pclk: 118.25 MHz ++Modeline "1600x900" 118.25 1600 1696 1856 2112 900 903 908 934 -hsync +vsync ++ ++# 1920x1080 59.93 Hz (CVT 2.07M9-R) hsync: 66.59 kHz; pclk: 138.50 MHz ++Modeline "1920x1080R" 138.50 1920 1968 2000 2080 1080 1083 1088 1111 +hsync -vsync ++ ++# 1920x1080 59.96 Hz (CVT 2.07M9) hsync: 67.16 kHz; pclk: 173.00 MHz ++Modeline "1920x1080" 173.00 1920 2048 2248 2576 1080 1083 1088 1120 -hsync +vsync ++ ++# 2048x1152 59.91 Hz (CVT 2.36M9-R) hsync: 70.99 kHz; pclk: 156.75 MHz ++Modeline "2048x1152R" 156.75 2048 2096 2128 2208 1152 1155 1160 1185 +hsync -vsync ++ ++# 2048x1152 59.90 Hz (CVT 2.36M9) hsync: 71.58 kHz; pclk: 197.00 MHz ++Modeline "2048x1152" 197.00 2048 2184 2400 2752 1152 1155 1160 1195 -hsync +vsync ++ ++# 2560x1440 59.95 Hz (CVT 3.69M9-R) hsync: 88.79 kHz; pclk: 241.50 MHz ++Modeline "2560x1440R" 241.50 2560 2608 2640 2720 1440 1443 1448 1481 +hsync -vsync ++ ++# 2560x1440 59.96 Hz (CVT 3.69M9) hsync: 89.52 kHz; pclk: 312.25 MHz ++Modeline "2560x1440" 312.25 2560 2752 3024 3488 1440 1443 1448 1493 -hsync +vsync ++ ++# 2880x1620 59.97 Hz (CVT 4.67M9-R) hsync: 99.92 kHz; pclk: 303.75 MHz ++Modeline "2880x1620R" 303.75 2880 2928 2960 3040 1620 1623 1628 1666 +hsync -vsync ++ ++# 2880x1620 59.96 Hz (CVT 4.67M9) hsync: 100.67 kHz; pclk: 396.25 MHz ++Modeline "2880x1620" 396.25 2880 3096 3408 3936 1620 1623 1628 1679 -hsync +vsync ++ ++# 3200x1800 59.94 Hz (CVT 5.76M9-R) hsync: 111.01 kHz; pclk: 373.00 MHz ++Modeline "3200x1800R" 373.00 3200 3248 3280 3360 1800 1803 1808 1852 +hsync -vsync ++ ++# 3200x1800 59.96 Hz (CVT 5.76M9) hsync: 111.82 kHz; pclk: 492.00 MHz ++Modeline "3200x1800" 492.00 3200 3456 3800 4400 1800 1803 1808 1865 -hsync +vsync ++ ++# 3840x2160 59.97 Hz (CVT 8.29M9-R) hsync: 133.25 kHz; pclk: 533.00 MHz ++Modeline "3840x2160R" 533.00 3840 3888 3920 4000 2160 2163 2168 2222 +hsync -vsync ++ ++# 3840x2160 59.98 Hz (CVT 8.29M9) hsync: 134.18 kHz; pclk: 712.75 MHz ++Modeline "3840x2160" 712.75 3840 4160 4576 5312 2160 2163 2168 2237 -hsync +vsync ++ ++# 4096x2304 59.98 Hz (CVT 9.44M9-R) hsync: 142.15 kHz; pclk: 605.00 MHz ++Modeline "4096x2304R" 605.00 4096 4144 4176 4256 2304 2307 2312 2370 +hsync -vsync ++ ++# 4096x2304 59.99 Hz (CVT 9.44M9) hsync: 143.13 kHz; pclk: 813.00 MHz ++Modeline "4096x2304" 813.00 4096 4440 4888 5680 2304 2307 2312 2386 -hsync +vsync ++ ++# 5120x2880 59.99 Hz (CVT 14.75M9-R) hsync: 177.70 kHz; pclk: 938.25 MHz ++Modeline "5120x2880R" 938.25 5120 5168 5200 5280 2880 2883 2888 2962 +hsync -vsync ++ ++# 5120x2880 59.99 Hz (CVT 14.75M9) hsync: 178.88 kHz; pclk: 1276.50 MHz ++Modeline "5120x2880" 1276.50 5120 5560 6128 7136 2880 2883 2888 2982 -hsync +vsync ++ ++# 7680x4320 59.99 Hz (CVT 33.18M9-R) hsync: 266.55 kHz; pclk: 2089.75 MHz ++Modeline "7680x4320R" 2089.75 7680 7728 7760 7840 4320 4323 4328 4443 +hsync -vsync ++ ++# 7680x4320 59.99 Hz (CVT 33.18M9) hsync: 268.22 kHz; pclk: 2892.50 MHz ++Modeline "7680x4320" 2892.50 7680 8376 9232 10784 4320 4323 4328 4471 -hsync +vsync ++ ++# 15360x8640 59.99 Hz (CVT 132.71M9-R) hsync: 533.10 kHz; pclk: 8273.75 MHz ++Modeline "15360x8640R" 8273.75 15360 15408 15440 15520 8640 8643 8648 8886 +hsync -vsync ++ ++# 15360x8640 60.00 Hz (CVT 132.71M9) hsync: 536.27 kHz; pclk: 11669.25 MHz ++Modeline "15360x8640" 11669.25 15360 16824 18560 21760 8640 8643 8648 8938 -hsync +vsync ++ ++## 16:10 modelines generated by cvt ++ ++# 1280x800 59.91 Hz (CVT 1.02MA-R) hsync: 49.31 kHz; pclk: 71.00 MHz ++Modeline "1280x800R" 71.00 1280 1328 1360 1440 800 803 809 823 +hsync -vsync ++ ++# 1280x800 59.81 Hz (CVT 1.02MA) hsync: 49.70 kHz; pclk: 83.50 MHz ++Modeline "1280x800" 83.50 1280 1352 1480 1680 800 803 809 831 -hsync +vsync ++ ++# 1400x900 59.88 Hz (CVT) hsync: 55.45 kHz; pclk: 86.50 MHz ++Modeline "1400x900R" 86.50 1400 1448 1480 1560 900 903 913 926 +hsync -vsync ++ ++# 1400x900 59.96 Hz (CVT) hsync: 56.01 kHz; pclk: 103.50 MHz ++Modeline "1400x900" 103.50 1400 1480 1624 1848 900 903 913 934 -hsync +vsync ++ ++# 1680x1050 59.88 Hz (CVT 1.76MA-R) hsync: 64.67 kHz; pclk: 119.00 MHz ++Modeline "1680x1050R" 119.00 1680 1728 1760 1840 1050 1053 1059 1080 +hsync -vsync ++ ++# 1680x1050 59.95 Hz (CVT 1.76MA) hsync: 65.29 kHz; pclk: 146.25 MHz ++Modeline "1680x1050" 146.25 1680 1784 1960 2240 1050 1053 1059 1089 -hsync +vsync ++ ++# 1920x1200 59.95 Hz (CVT 2.30MA-R) hsync: 74.04 kHz; pclk: 154.00 MHz ++Modeline "1920x1200R" 154.00 1920 1968 2000 2080 1200 1203 1209 1235 +hsync -vsync ++ ++# 1920x1200 59.88 Hz (CVT 2.30MA) hsync: 74.56 kHz; pclk: 193.25 MHz ++Modeline "1920x1200" 193.25 1920 2056 2256 2592 1200 1203 1209 1245 -hsync +vsync ++ ++# 2560x1600 59.97 Hz (CVT 4.10MA-R) hsync: 98.71 kHz; pclk: 268.50 MHz ++Modeline "2560x1600R" 268.50 2560 2608 2640 2720 1600 1603 1609 1646 +hsync -vsync ++ ++# 2560x1600 59.99 Hz (CVT 4.10MA) hsync: 99.46 kHz; pclk: 348.50 MHz ++Modeline "2560x1600" 348.50 2560 2760 3032 3504 1600 1603 1609 1658 -hsync +vsync +-- +cgit v1.1 + diff --git a/0001-xfree86-use-modesetting-driver-by-default-on-GeForce.patch b/0001-xfree86-use-modesetting-driver-by-default-on-GeForce.patch index be83429..1b1306e 100644 --- a/0001-xfree86-use-modesetting-driver-by-default-on-GeForce.patch +++ b/0001-xfree86-use-modesetting-driver-by-default-on-GeForce.patch @@ -24,7 +24,7 @@ index 8158c2b62..78d1c947d 100644 @@ -1190,6 +1191,25 @@ xf86VideoPtrToDriverList(struct pci_device *dev, int idx = 0; - #if defined(__linux__) || defined(__NetBSD__) + #ifdef __linux__ + char busid[32]; + int fd; + diff --git a/0001-xwayland-Depend-on-wayland-protocols-to-build-tablet.patch b/0001-xwayland-Depend-on-wayland-protocols-to-build-tablet.patch new file mode 100644 index 0000000..e16b405 --- /dev/null +++ b/0001-xwayland-Depend-on-wayland-protocols-to-build-tablet.patch @@ -0,0 +1,73 @@ +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/0001-xwayland-Give-up-cleanly-on-Wayland-socket-errors.patch b/0001-xwayland-Give-up-cleanly-on-Wayland-socket-errors.patch new file mode 100644 index 0000000..5f2efe8 --- /dev/null +++ b/0001-xwayland-Give-up-cleanly-on-Wayland-socket-errors.patch @@ -0,0 +1,99 @@ +From fe46cbea0f19959d469ca4d1f09be379dc7b1e45 Mon Sep 17 00:00:00 2001 +From: Olivier Fourdan +Date: Tue, 21 Nov 2017 14:45:13 +0100 +Subject: [PATCH xserver] =?UTF-8?q?xwayland:=20Give=20up=20=E2=80=9Ccleanl?= + =?UTF-8?q?y=E2=80=9C=20on=20Wayland=20socket=20errors?= +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Xwayland is a pretty standard Wayland client, we want to be able to +capture core dumps on crashes. + +Yet using "-core" causes any FatalError() to generate a core dump, +meaning that we would get a core file for all Wayland server crashes, +which would generate a lot of false positives. + +Instead of using FatalError() on Wayland socket errors, give up cleanly +to avoid dumping core files when "-core" is used. + +See also: https://bugzilla.gnome.org/show_bug.cgi?id=790502 + and: https://bugzilla.gnome.org/show_bug.cgi?id=789086 + +Reviewed-by: Adam Jackson +Signed-off-by: Olivier Fourdan +--- + hw/xwayland/xwayland.c | 26 +++++++++++++++++++++----- + 1 file changed, 21 insertions(+), 5 deletions(-) + +diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c +index 638022180..c5a3ae7ae 100644 +--- a/hw/xwayland/xwayland.c ++++ b/hw/xwayland/xwayland.c +@@ -73,6 +73,22 @@ ddxBeforeReset(void) + } + #endif + ++ _X_NORETURN ++static void _X_ATTRIBUTE_PRINTF(1, 2) ++xwl_give_up(const char *f, ...) ++{ ++ va_list args; ++ ++ va_start(args, f); ++ VErrorFSigSafe(f, args); ++ va_end(args); ++ ++ CloseWellKnownConnections(); ++ OsCleanup(TRUE); ++ fflush(stderr); ++ exit(1); ++} ++ + void + ddxUseMsg(void) + { +@@ -719,13 +735,13 @@ xwl_read_events (struct xwl_screen *xwl_screen) + + ret = wl_display_read_events(xwl_screen->display); + if (ret == -1) +- FatalError("failed to read Wayland events: %s\n", strerror(errno)); ++ xwl_give_up("failed to read Wayland events: %s\n", strerror(errno)); + + xwl_screen->prepare_read = 0; + + ret = wl_display_dispatch_pending(xwl_screen->display); + if (ret == -1) +- FatalError("failed to dispatch Wayland events: %s\n", strerror(errno)); ++ xwl_give_up("failed to dispatch Wayland events: %s\n", strerror(errno)); + } + + static int +@@ -752,7 +768,7 @@ xwl_dispatch_events (struct xwl_screen *xwl_screen) + wl_display_prepare_read(xwl_screen->display) == -1) { + ret = wl_display_dispatch_pending(xwl_screen->display); + if (ret == -1) +- FatalError("failed to dispatch Wayland events: %s\n", ++ xwl_give_up("failed to dispatch Wayland events: %s\n", + strerror(errno)); + } + +@@ -761,13 +777,13 @@ xwl_dispatch_events (struct xwl_screen *xwl_screen) + pollout: + ready = xwl_display_pollout(xwl_screen, 5); + if (ready == -1 && errno != EINTR) +- FatalError("error polling on XWayland fd: %s\n", strerror(errno)); ++ xwl_give_up("error polling on XWayland fd: %s\n", strerror(errno)); + + if (ready > 0) + ret = wl_display_flush(xwl_screen->display); + + if (ret == -1 && errno != EAGAIN) +- FatalError("failed to write to XWayland fd: %s\n", strerror(errno)); ++ xwl_give_up("failed to write to XWayland fd: %s\n", strerror(errno)); + + xwl_screen->wait_flush = (ready == 0 || ready == -1 || ret == -1); + } +-- +2.14.3 + diff --git a/0001-xwayland-Keep-separate-variables-for-pointer-and-tab.patch b/0001-xwayland-Keep-separate-variables-for-pointer-and-tab.patch new file mode 100644 index 0000000..571fc93 --- /dev/null +++ b/0001-xwayland-Keep-separate-variables-for-pointer-and-tab.patch @@ -0,0 +1,135 @@ +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/0001-xwayland-avoid-race-condition-on-new-keymap.patch b/0001-xwayland-avoid-race-condition-on-new-keymap.patch new file mode 100644 index 0000000..3acf65c --- /dev/null +++ b/0001-xwayland-avoid-race-condition-on-new-keymap.patch @@ -0,0 +1,41 @@ +From 170c95978530f6373bdf4488116902b273f3abf4 Mon Sep 17 00:00:00 2001 +From: Olivier Fourdan +Date: Fri, 15 Dec 2017 16:43:47 +0100 +Subject: [PATCH xserver] xwayland: avoid race condition on new keymap +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +When the Wayland compositor notifies of a new keymap, for the first X11 +client using the keyboard, the last slave keyboard used might still not +be set (i.e. “lastSlave” is still NULL). + +As a result, the new keymap is not applied, and the first X11 window +will have the wrong keymap set initially. + +Apply the new keymap to the master keyboard as long as there's one. + +Bugzilla: https://bugzilla.gnome.org/show_bug.cgi?id=791383 +Signed-off-by: Olivier Fourdan +Reviewed-by: Peter Hutterer +Signed-off-by: Peter Hutterer +--- + hw/xwayland/xwayland-input.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/hw/xwayland/xwayland-input.c b/hw/xwayland/xwayland-input.c +index 439903032..c613690cd 100644 +--- a/hw/xwayland/xwayland-input.c ++++ b/hw/xwayland/xwayland-input.c +@@ -710,7 +710,7 @@ keyboard_handle_keymap(void *data, struct wl_keyboard *keyboard, + XkbDeviceApplyKeymap(xwl_seat->keyboard, xkb); + + master = GetMaster(xwl_seat->keyboard, MASTER_KEYBOARD); +- if (master && master->lastSlave == xwl_seat->keyboard) ++ if (master) + XkbDeviceApplyKeymap(master, xkb); + + XkbFreeKeyboard(xkb, XkbAllComponentsMask, TRUE); +-- +2.14.3 + diff --git a/0002-xfree86-Make-OutputClassMatches-take-a-xf86_platform.patch b/0002-xfree86-Make-OutputClassMatches-take-a-xf86_platform.patch new file mode 100644 index 0000000..89ce17c --- /dev/null +++ b/0002-xfree86-Make-OutputClassMatches-take-a-xf86_platform.patch @@ -0,0 +1,45 @@ +From 08b84d72878e43401e99059c3c926dfa42a360c3 Mon Sep 17 00:00:00 2001 +From: Hans De Goede +Date: Mon, 12 Dec 2016 17:03:13 +0100 +Subject: [PATCH xserver 2/6] xfree86: Make OutputClassMatches take a + xf86_platform_device + +Make OutputClassMatches directly take a xf86_platform_device as argument, +rather then an index into xf86_platform_devices. This makes things +easier for callers which already have a xf86_platform_device pointer. + +Reviewed-by: Adam Jackson +Signed-off-by: Hans de Goede +--- + hw/xfree86/common/xf86platformBus.c | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +diff --git a/hw/xfree86/common/xf86platformBus.c b/hw/xfree86/common/xf86platformBus.c +index 16d934f..25a9040 100644 +--- a/hw/xfree86/common/xf86platformBus.c ++++ b/hw/xfree86/common/xf86platformBus.c +@@ -214,9 +214,10 @@ MatchToken(const char *value, struct xorg_list *patterns, + } + + static Bool +-OutputClassMatches(const XF86ConfOutputClassPtr oclass, int index) ++OutputClassMatches(const XF86ConfOutputClassPtr oclass, ++ struct xf86_platform_device *dev) + { +- char *driver = xf86_platform_odev_attributes(index)->driver; ++ char *driver = dev->attribs->driver; + + if (!MatchToken(driver, &oclass->match_driver, strcmp)) + return FALSE; +@@ -234,7 +235,7 @@ xf86OutputClassDriverList(int index, char *matches[], int nmatches) + return 0; + + for (cl = xf86configptr->conf_outputclass_lst; cl; cl = cl->list.next) { +- if (OutputClassMatches(cl, index)) { ++ if (OutputClassMatches(cl, &xf86_platform_devices[index])) { + char *path = xf86_platform_odev_attributes(index)->path; + + xf86Msg(X_INFO, "Applying OutputClass \"%s\" to %s\n", +-- +2.9.3 + diff --git a/0002-xwayland-Bind-to-wp_tablet_manager-if-available-and-.patch b/0002-xwayland-Bind-to-wp_tablet_manager-if-available-and-.patch new file mode 100644 index 0000000..9e750cb --- /dev/null +++ b/0002-xwayland-Bind-to-wp_tablet_manager-if-available-and-.patch @@ -0,0 +1,166 @@ +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/0003-xfree86-Add-options-support-for-OutputClass-Options.patch b/0003-xfree86-Add-options-support-for-OutputClass-Options.patch new file mode 100644 index 0000000..b18f9b9 --- /dev/null +++ b/0003-xfree86-Add-options-support-for-OutputClass-Options.patch @@ -0,0 +1,190 @@ +From 9cd3cc75269d9196898487b5712ee47b8291e077 Mon Sep 17 00:00:00 2001 +From: Hans De Goede +Date: Mon, 12 Dec 2016 17:03:14 +0100 +Subject: [PATCH xserver 3/6] xfree86: Add options support for OutputClass + Options + +Add support for setting options in OutputClass Sections and having these +applied to any matching output devices. + +Reviewed-by: Adam Jackson +Signed-off-by: Hans de Goede +--- + hw/xfree86/common/xf86Option.c | 5 ++++- + hw/xfree86/common/xf86platformBus.c | 42 +++++++++++++++++++++++++++++++++++++ + hw/xfree86/common/xf86platformBus.h | 2 ++ + hw/xfree86/man/xorg.conf.man | 10 +++++++++ + hw/xfree86/parser/OutputClass.c | 6 ++++++ + hw/xfree86/parser/xf86Parser.h | 1 + + 6 files changed, 65 insertions(+), 1 deletion(-) + +diff --git a/hw/xfree86/common/xf86Option.c b/hw/xfree86/common/xf86Option.c +index 0e8bc1f..929724d 100644 +--- a/hw/xfree86/common/xf86Option.c ++++ b/hw/xfree86/common/xf86Option.c +@@ -44,6 +44,7 @@ + #include "xf86Xinput.h" + #include "xf86Optrec.h" + #include "xf86Parser.h" ++#include "xf86platformBus.h" /* For OutputClass functions */ + #include "optionstr.h" + + static Bool ParseOptionValue(int scrnIndex, XF86OptionPtr options, +@@ -64,7 +65,7 @@ static Bool ParseOptionValue(int scrnIndex, XF86OptionPtr options, + * + * The order of precedence for options is: + * +- * extraOpts, display, confScreen, monitor, device ++ * extraOpts, display, confScreen, monitor, device, outputClassOptions + */ + + void +@@ -79,6 +80,8 @@ xf86CollectOptions(ScrnInfoPtr pScrn, XF86OptionPtr extraOpts) + pScrn->options = NULL; + + for (i = pScrn->numEntities - 1; i >= 0; i--) { ++ xf86MergeOutputClassOptions(pScrn->entityList[i], &pScrn->options); ++ + device = xf86GetDevFromEntity(pScrn->entityList[i], + pScrn->entityInstanceList[i]); + if (device && device->options) { +diff --git a/hw/xfree86/common/xf86platformBus.c b/hw/xfree86/common/xf86platformBus.c +index 25a9040..a698c6c 100644 +--- a/hw/xfree86/common/xf86platformBus.c ++++ b/hw/xfree86/common/xf86platformBus.c +@@ -310,6 +310,48 @@ xf86platformProbe(void) + return 0; + } + ++void ++xf86MergeOutputClassOptions(int entityIndex, void **options) ++{ ++ const EntityPtr entity = xf86Entities[entityIndex]; ++ struct xf86_platform_device *dev = NULL; ++ XF86ConfOutputClassPtr cl; ++ XF86OptionPtr classopts; ++ int i = 0; ++ ++ switch (entity->bus.type) { ++ case BUS_PLATFORM: ++ dev = entity->bus.id.plat; ++ break; ++ case BUS_PCI: ++ for (i = 0; i < xf86_num_platform_devices; i++) { ++ if (MATCH_PCI_DEVICES(xf86_platform_devices[i].pdev, ++ entity->bus.id.pci)) { ++ dev = &xf86_platform_devices[i]; ++ break; ++ } ++ } ++ break; ++ default: ++ xf86Msg(X_DEBUG, "xf86MergeOutputClassOptions unsupported bus type %d\n", ++ entity->bus.type); ++ } ++ ++ if (!dev) ++ return; ++ ++ for (cl = xf86configptr->conf_outputclass_lst; cl; cl = cl->list.next) { ++ if (!OutputClassMatches(cl, dev) || !cl->option_lst) ++ continue; ++ ++ xf86Msg(X_INFO, "Applying OutputClass \"%s\" options to %s\n", ++ cl->identifier, dev->attribs->path); ++ ++ classopts = xf86optionListDup(cl->option_lst); ++ *options = xf86optionListMerge(*options, classopts); ++ } ++} ++ + static int + xf86ClaimPlatformSlot(struct xf86_platform_device * d, DriverPtr drvp, + int chipset, GDevPtr dev, Bool active) +diff --git a/hw/xfree86/common/xf86platformBus.h b/hw/xfree86/common/xf86platformBus.h +index 0f5c0ef..70d9ec8 100644 +--- a/hw/xfree86/common/xf86platformBus.h ++++ b/hw/xfree86/common/xf86platformBus.h +@@ -42,6 +42,7 @@ struct xf86_platform_device { + int xf86platformProbe(void); + int xf86platformProbeDev(DriverPtr drvp); + int xf86platformAddGPUDevices(DriverPtr drvp); ++void xf86MergeOutputClassOptions(int entityIndex, void **options); + + extern int xf86_num_platform_devices; + extern struct xf86_platform_device *xf86_platform_devices; +@@ -161,6 +162,7 @@ extern void xf86platformPrimary(void); + #else + + static inline int xf86platformAddGPUDevices(DriverPtr drvp) { return FALSE; } ++static inline void xf86MergeOutputClassOptions(int index, void **options) {} + + #endif + +diff --git a/hw/xfree86/man/xorg.conf.man b/hw/xfree86/man/xorg.conf.man +index 7d0c524..8928a53 100644 +--- a/hw/xfree86/man/xorg.conf.man ++++ b/hw/xfree86/man/xorg.conf.man +@@ -1280,6 +1280,16 @@ For example: + Check the case-sensitive string + .RI \*q matchdriver \*q + against the kernel driver of the device. ++.PP ++When an output device has been matched to the ++.B OutputClass ++section, any ++.B Option ++entries are applied to the device. See the ++.B Device ++section below for a description of the remaining ++.B Option ++entries. + .SH "DEVICE SECTION" + The config file may have multiple + .B Device +diff --git a/hw/xfree86/parser/OutputClass.c b/hw/xfree86/parser/OutputClass.c +index 8064e0c..f813ee6 100644 +--- a/hw/xfree86/parser/OutputClass.c ++++ b/hw/xfree86/parser/OutputClass.c +@@ -36,6 +36,7 @@ static const xf86ConfigSymTabRec OutputClassTab[] = { + {ENDSECTION, "endsection"}, + {IDENTIFIER, "identifier"}, + {DRIVER, "driver"}, ++ {OPTION, "option"}, + {MATCH_DRIVER, "matchdriver"}, + {-1, ""}, + }; +@@ -60,6 +61,8 @@ xf86freeOutputClassList(XF86ConfOutputClassPtr ptr) + free(group); + } + ++ xf86optionListFree(ptr->option_lst); ++ + prev = ptr; + ptr = ptr->list.next; + free(prev); +@@ -112,6 +115,9 @@ xf86parseOutputClassSection(void) + else + ptr->driver = xf86_lex_val.str; + break; ++ case OPTION: ++ ptr->option_lst = xf86parseOption(ptr->option_lst); ++ break; + case MATCH_DRIVER: + if (xf86getSubToken(&(ptr->comment)) != STRING) + Error(QUOTE_MSG, "MatchDriver"); +diff --git a/hw/xfree86/parser/xf86Parser.h b/hw/xfree86/parser/xf86Parser.h +index 9c4b403..897edab 100644 +--- a/hw/xfree86/parser/xf86Parser.h ++++ b/hw/xfree86/parser/xf86Parser.h +@@ -338,6 +338,7 @@ typedef struct { + char *identifier; + char *driver; + struct xorg_list match_driver; ++ XF86OptionPtr option_lst; + char *comment; + } XF86ConfOutputClassRec, *XF86ConfOutputClassPtr; + +-- +2.9.3 + diff --git a/0003-xwayland-Listen-for-wp_tablet_seat-events.patch b/0003-xwayland-Listen-for-wp_tablet_seat-events.patch new file mode 100644 index 0000000..308331f --- /dev/null +++ b/0003-xwayland-Listen-for-wp_tablet_seat-events.patch @@ -0,0 +1,173 @@ +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/0004-xfree86-xf86platformProbe-split-finding-pci-info-and.patch b/0004-xfree86-xf86platformProbe-split-finding-pci-info-and.patch new file mode 100644 index 0000000..03d404e --- /dev/null +++ b/0004-xfree86-xf86platformProbe-split-finding-pci-info-and.patch @@ -0,0 +1,61 @@ +From ab1a65b7755d081b41188104b21f4d21eaa3187b Mon Sep 17 00:00:00 2001 +From: Hans De Goede +Date: Mon, 12 Dec 2016 17:03:15 +0100 +Subject: [PATCH xserver 4/6] xfree86: xf86platformProbe: split finding + pci-info and setting primary GPU + +This is a preparation patch for allowing an OutputClass section to +override the default primary GPU device selection. + +Reviewed-by: Adam Jackson +Signed-off-by: Hans de Goede +--- + hw/xfree86/common/xf86platformBus.c | 23 +++++++++++++++-------- + 1 file changed, 15 insertions(+), 8 deletions(-) + +diff --git a/hw/xfree86/common/xf86platformBus.c b/hw/xfree86/common/xf86platformBus.c +index a698c6c..39b3248 100644 +--- a/hw/xfree86/common/xf86platformBus.c ++++ b/hw/xfree86/common/xf86platformBus.c +@@ -145,16 +145,9 @@ platform_find_pci_info(struct xf86_platform_device *pd, char *busid) + + iter = pci_slot_match_iterator_create(&devmatch); + info = pci_device_next(iter); +- if (info) { ++ if (info) + pd->pdev = info; +- pci_device_probe(info); +- if (pci_device_is_boot_vga(info)) { +- primaryBus.type = BUS_PLATFORM; +- primaryBus.id.plat = pd; +- } +- } + pci_iterator_destroy(iter); +- + } + + static Bool +@@ -307,6 +300,20 @@ xf86platformProbe(void) + platform_find_pci_info(&xf86_platform_devices[i], busid); + } + } ++ ++ for (i = 0; i < xf86_num_platform_devices; i++) { ++ struct xf86_platform_device *dev = &xf86_platform_devices[i]; ++ ++ if (!dev->pdev) ++ continue; ++ ++ pci_device_probe(dev->pdev); ++ if (pci_device_is_boot_vga(dev->pdev)) { ++ primaryBus.type = BUS_PLATFORM; ++ primaryBus.id.plat = dev; ++ } ++ } ++ + return 0; + } + +-- +2.9.3 + diff --git a/0004-xwayland-Handle-wp_tablet-events.patch b/0004-xwayland-Handle-wp_tablet-events.patch new file mode 100644 index 0000000..4fb4453 --- /dev/null +++ b/0004-xwayland-Handle-wp_tablet-events.patch @@ -0,0 +1,211 @@ +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/0005-xfree86-Allow-overriding-primary-GPU-detection-from-.patch b/0005-xfree86-Allow-overriding-primary-GPU-detection-from-.patch new file mode 100644 index 0000000..afa47e4 --- /dev/null +++ b/0005-xfree86-Allow-overriding-primary-GPU-detection-from-.patch @@ -0,0 +1,91 @@ +From d75ffcdbf8c1e3c8e0d46debcd533a9f2560f0a8 Mon Sep 17 00:00:00 2001 +From: Hans De Goede +Date: Mon, 12 Dec 2016 17:03:16 +0100 +Subject: [PATCH xserver 5/6] xfree86: Allow overriding primary GPU detection + from an OutputClass section + +Allow using: + +Option "PrimaryGPU" "yes" + +In an OutputClass section to override the default primary GPU device +selection which selects the GPU used as output by the firmware. + +If multiple output devices match an OutputClass section with +the PrimaryGPU option set, the first one enumerated becomes the +primary GPU. + +Reviewed-by: Adam Jackson +Signed-off-by: Hans de Goede +--- + hw/xfree86/common/xf86platformBus.c | 19 +++++++++++++++++++ + hw/xfree86/man/xorg.conf.man | 12 +++++++++++- + 2 files changed, 30 insertions(+), 1 deletion(-) + +diff --git a/hw/xfree86/common/xf86platformBus.c b/hw/xfree86/common/xf86platformBus.c +index 39b3248..fc17d15 100644 +--- a/hw/xfree86/common/xf86platformBus.c ++++ b/hw/xfree86/common/xf86platformBus.c +@@ -286,6 +286,7 @@ xf86platformProbe(void) + { + int i; + Bool pci = TRUE; ++ XF86ConfOutputClassPtr cl; + + config_odev_probe(xf86PlatformDeviceProbe); + +@@ -301,6 +302,24 @@ xf86platformProbe(void) + } + } + ++ /* First see if there is an OutputClass match marking a device as primary */ ++ for (i = 0; i < xf86_num_platform_devices; i++) { ++ struct xf86_platform_device *dev = &xf86_platform_devices[i]; ++ for (cl = xf86configptr->conf_outputclass_lst; cl; cl = cl->list.next) { ++ if (!OutputClassMatches(cl, dev)) ++ continue; ++ ++ if (xf86CheckBoolOption(cl->option_lst, "PrimaryGPU", FALSE)) { ++ xf86Msg(X_CONFIG, "OutputClass \"%s\" setting %s as PrimaryGPU\n", ++ cl->identifier, dev->attribs->path); ++ primaryBus.type = BUS_PLATFORM; ++ primaryBus.id.plat = dev; ++ return 0; ++ } ++ } ++ } ++ ++ /* Then check for pci_device_is_boot_vga() */ + for (i = 0; i < xf86_num_platform_devices; i++) { + struct xf86_platform_device *dev = &xf86_platform_devices[i]; + +diff --git a/hw/xfree86/man/xorg.conf.man b/hw/xfree86/man/xorg.conf.man +index 8928a53..79b71a8 100644 +--- a/hw/xfree86/man/xorg.conf.man ++++ b/hw/xfree86/man/xorg.conf.man +@@ -1285,11 +1285,21 @@ When an output device has been matched to the + .B OutputClass + section, any + .B Option +-entries are applied to the device. See the ++entries are applied to the device. One ++.B OutputClass ++specific ++.B Option ++is recognized. See the + .B Device + section below for a description of the remaining + .B Option + entries. ++.TP 7 ++.BI "Option \*qPrimaryGPU\*q \*q" boolean \*q ++This option specifies that the matched device should be treated as the ++primary GPU, replacing the selection of the GPU used as output by the ++firmware. If multiple output devices match an OutputClass section with ++the PrimaryGPU option set, the first one enumerated becomes the primary GPU. + .SH "DEVICE SECTION" + The config file may have multiple + .B Device +-- +2.9.3 + diff --git a/0005-xfree86-Remove-redundant-ServerIsNotSeat0-check-from.patch b/0005-xfree86-Remove-redundant-ServerIsNotSeat0-check-from.patch new file mode 100644 index 0000000..424e400 --- /dev/null +++ b/0005-xfree86-Remove-redundant-ServerIsNotSeat0-check-from.patch @@ -0,0 +1,31 @@ +From c17e544b271ced65483692103d39ed1188d4ca25 Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Tue, 27 Sep 2016 14:30:10 +0200 +Subject: [PATCH xserver v2 5/7] xfree86: Remove redundant ServerIsNotSeat0 + check from xf86CallDriverProbe + +If foundScreen is TRUE, then all the code below the removed if +will not execute until we reach the return foundScreen; at the +end, so this entire if block is redundant. + +Signed-off-by: Hans de Goede +--- + hw/xfree86/common/xf86Bus.c | 2 -- + 1 file changed, 2 deletions(-) + +diff --git a/hw/xfree86/common/xf86Bus.c b/hw/xfree86/common/xf86Bus.c +index 5b93940..27c6b1b 100644 +--- a/hw/xfree86/common/xf86Bus.c ++++ b/hw/xfree86/common/xf86Bus.c +@@ -82,8 +82,6 @@ xf86CallDriverProbe(DriverPtr drv, Bool detect_only) + if (!xf86DoConfigure && drv->platformProbe != NULL) { + foundScreen = xf86platformProbeDev(drv); + } +- if (ServerIsNotSeat0() && foundScreen) +- return foundScreen; + #endif + + #ifdef XSERVER_LIBPCIACCESS +-- +2.9.3 + diff --git a/0005-xwayland-Handle-tablet_tool-events.patch b/0005-xwayland-Handle-tablet_tool-events.patch new file mode 100644 index 0000000..5ebc618 --- /dev/null +++ b/0005-xwayland-Handle-tablet_tool-events.patch @@ -0,0 +1,374 @@ +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/0006-xfree86-Add-ModulePath-support-for-OutputClass-confi.patch b/0006-xfree86-Add-ModulePath-support-for-OutputClass-confi.patch new file mode 100644 index 0000000..6ba4018 --- /dev/null +++ b/0006-xfree86-Add-ModulePath-support-for-OutputClass-confi.patch @@ -0,0 +1,183 @@ +From b5dffbbac193aa640ffcfa0a431c21b862854e53 Mon Sep 17 00:00:00 2001 +From: Hans De Goede +Date: Mon, 12 Dec 2016 17:03:17 +0100 +Subject: [PATCH xserver 6/6] xfree86: Add ModulePath support for OutputClass + config Sections + +Allow OutputClass config snippets to modify the module-path. + +Note that any specified ModulePaths will be pre-pended to the normal +ModulePath. The idea behind this is that any output hardware specific +modules should have preference over the normal modules. + +One use-case for this is the nvidia binary driver, this allows a +config snippet like this: + +Section "OutputClass" + MatchDriver "nvidia" + Modulepath "/usr/lib64/nvidia/modules" +EndSection + +To get the nvidia glx specific glx module loaded, but only when the +nvidia kernel driver is loaded. + +Together with the glvnd work done recently, this allows the nouveau ++ mesa and nvidia-binary userspace stacks to co-exist on the same +system without any ldconfig / xorg.conf tweaking and the xserver will +automatically do the right thing depending on which kernel driver +(nouveau or nvidia) is loaded. + +Reviewed-by: Adam Jackson +Signed-off-by: Hans de Goede +--- + hw/xfree86/common/xf86platformBus.c | 23 +++++++++++++++++++++++ + hw/xfree86/loader/loadmod.c | 1 + + hw/xfree86/man/xorg.conf.man | 16 ++++++++++++++++ + hw/xfree86/parser/OutputClass.c | 15 +++++++++++++++ + hw/xfree86/parser/xf86Parser.h | 1 + + 5 files changed, 56 insertions(+) + +diff --git a/hw/xfree86/common/xf86platformBus.c b/hw/xfree86/common/xf86platformBus.c +index fc17d15..0b5795f 100644 +--- a/hw/xfree86/common/xf86platformBus.c ++++ b/hw/xfree86/common/xf86platformBus.c +@@ -40,6 +40,7 @@ + #include "hotplug.h" + #include "systemd-logind.h" + ++#include "loaderProcs.h" + #include "xf86.h" + #include "xf86_OSproc.h" + #include "xf86Priv.h" +@@ -287,6 +288,7 @@ xf86platformProbe(void) + int i; + Bool pci = TRUE; + XF86ConfOutputClassPtr cl; ++ char *old_path, *path = NULL; + + config_odev_probe(xf86PlatformDeviceProbe); + +@@ -300,8 +302,29 @@ xf86platformProbe(void) + if (pci && (strncmp(busid, "pci:", 4) == 0)) { + platform_find_pci_info(&xf86_platform_devices[i], busid); + } ++ ++ /* ++ * Deal with OutputClass ModulePath directives, these must be ++ * processed before we do any module loading. ++ */ ++ for (cl = xf86configptr->conf_outputclass_lst; cl; cl = cl->list.next) { ++ if (!OutputClassMatches(cl, &xf86_platform_devices[i])) ++ continue; ++ ++ if (cl->modulepath && xf86ModPathFrom != X_CMDLINE) { ++ old_path = path; ++ XNFasprintf(&path, "%s,%s", cl->modulepath, ++ path ? path : xf86ModulePath); ++ free(old_path); ++ xf86Msg(X_CONFIG, "OutputClass \"%s\" ModulePath extended to \"%s\"\n", ++ cl->identifier, path); ++ LoaderSetPath(path); ++ } ++ } + } + ++ free(path); ++ + /* First see if there is an OutputClass match marking a device as primary */ + for (i = 0; i < xf86_num_platform_devices; i++) { + struct xf86_platform_device *dev = &xf86_platform_devices[i]; +diff --git a/hw/xfree86/loader/loadmod.c b/hw/xfree86/loader/loadmod.c +index 8bf6836..940f5fc 100644 +--- a/hw/xfree86/loader/loadmod.c ++++ b/hw/xfree86/loader/loadmod.c +@@ -184,6 +184,7 @@ LoaderSetPath(const char *path) + if (!path) + return; + ++ FreeStringList(defaultPathList); + defaultPathList = InitPathList(path); + } + +diff --git a/hw/xfree86/man/xorg.conf.man b/hw/xfree86/man/xorg.conf.man +index 79b71a8..00ebf56 100644 +--- a/hw/xfree86/man/xorg.conf.man ++++ b/hw/xfree86/man/xorg.conf.man +@@ -1300,6 +1300,22 @@ This option specifies that the matched device should be treated as the + primary GPU, replacing the selection of the GPU used as output by the + firmware. If multiple output devices match an OutputClass section with + the PrimaryGPU option set, the first one enumerated becomes the primary GPU. ++.PP ++A ++.B OutputClass ++Section may contain ++.B ModulePath ++entries. When an output device matches an ++.B OutputClass ++section, any ++.B ModulePath ++entries in that ++.B OutputClass ++are pre-pended to the search path for loadable Xorg server modules. See ++.B ModulePath ++in the ++.B Files ++section for more info. + .SH "DEVICE SECTION" + The config file may have multiple + .B Device +diff --git a/hw/xfree86/parser/OutputClass.c b/hw/xfree86/parser/OutputClass.c +index f813ee6..01b348f 100644 +--- a/hw/xfree86/parser/OutputClass.c ++++ b/hw/xfree86/parser/OutputClass.c +@@ -36,6 +36,7 @@ static const xf86ConfigSymTabRec OutputClassTab[] = { + {ENDSECTION, "endsection"}, + {IDENTIFIER, "identifier"}, + {DRIVER, "driver"}, ++ {MODULEPATH, "modulepath"}, + {OPTION, "option"}, + {MATCH_DRIVER, "matchdriver"}, + {-1, ""}, +@@ -53,6 +54,7 @@ xf86freeOutputClassList(XF86ConfOutputClassPtr ptr) + TestFree(ptr->identifier); + TestFree(ptr->comment); + TestFree(ptr->driver); ++ TestFree(ptr->modulepath); + + xorg_list_for_each_entry_safe(group, next, &ptr->match_driver, entry) { + xorg_list_del(&group->entry); +@@ -115,6 +117,19 @@ xf86parseOutputClassSection(void) + else + ptr->driver = xf86_lex_val.str; + break; ++ case MODULEPATH: ++ if (xf86getSubToken(&(ptr->comment)) != STRING) ++ Error(QUOTE_MSG, "ModulePath"); ++ if (ptr->modulepath) { ++ char *path; ++ XNFasprintf(&path, "%s,%s", ptr->modulepath, xf86_lex_val.str); ++ free(xf86_lex_val.str); ++ free(ptr->modulepath); ++ ptr->modulepath = path; ++ } else { ++ ptr->modulepath = xf86_lex_val.str; ++ } ++ break; + case OPTION: + ptr->option_lst = xf86parseOption(ptr->option_lst); + break; +diff --git a/hw/xfree86/parser/xf86Parser.h b/hw/xfree86/parser/xf86Parser.h +index 897edab..e014048 100644 +--- a/hw/xfree86/parser/xf86Parser.h ++++ b/hw/xfree86/parser/xf86Parser.h +@@ -337,6 +337,7 @@ typedef struct { + GenericListRec list; + char *identifier; + char *driver; ++ char *modulepath; + struct xorg_list match_driver; + XF86OptionPtr option_lst; + char *comment; +-- +2.9.3 + diff --git a/0006-xfree86-Make-adding-unclaimed-devices-as-GPU-devices.patch b/0006-xfree86-Make-adding-unclaimed-devices-as-GPU-devices.patch new file mode 100644 index 0000000..c0af28d --- /dev/null +++ b/0006-xfree86-Make-adding-unclaimed-devices-as-GPU-devices.patch @@ -0,0 +1,89 @@ +From 74bc0fff3a6ca233e56b3fb2971bca97b5a4f8b5 Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Fri, 30 Sep 2016 11:59:04 +0200 +Subject: [PATCH xserver v2 6/7] xfree86: Make adding unclaimed devices as GPU + devices a separate step + +This is primarily a preparation patch for fixing the xserver exiting with +a "no screens found" error even though there are supported video cards, +due to the server not recognizing any card as the primary card. + +This also fixes the (mostly theoretical) case of a platformBus capable +driver adding a device as GPUscreen before a driver which only supports +the old PCI probe method gets a chance to claim it as a normal screen. + +Signed-off-by: Hans de Goede +--- + hw/xfree86/common/xf86Bus.c | 4 ++++ + hw/xfree86/common/xf86platformBus.c | 15 +++++++++++++++ + hw/xfree86/common/xf86platformBus.h | 6 ++++++ + 3 files changed, 25 insertions(+) + +diff --git a/hw/xfree86/common/xf86Bus.c b/hw/xfree86/common/xf86Bus.c +index 27c6b1b..a3a9898 100644 +--- a/hw/xfree86/common/xf86Bus.c ++++ b/hw/xfree86/common/xf86Bus.c +@@ -125,6 +125,10 @@ xf86BusConfig(void) + xf86CallDriverProbe(xf86DriverList[i], FALSE); + } + ++ for (i = 0; i < xf86NumDrivers; i++) { ++ xf86platformAddGPUDevices(xf86DriverList[i]); ++ } ++ + /* If nothing was detected, return now */ + if (xf86NumScreens == 0) { + xf86Msg(X_ERROR, "No devices detected.\n"); +diff --git a/hw/xfree86/common/xf86platformBus.c b/hw/xfree86/common/xf86platformBus.c +index 39fb1dd..8dd0d5d 100644 +--- a/hw/xfree86/common/xf86platformBus.c ++++ b/hw/xfree86/common/xf86platformBus.c +@@ -475,6 +475,21 @@ xf86platformProbeDev(DriverPtr drvp) + isGPUDevice(devList[i]) ? PLATFORM_PROBE_GPU_SCREEN : 0); + } + ++ return foundScreen; ++} ++ ++int ++xf86platformAddGPUDevices(DriverPtr drvp) ++{ ++ Bool foundScreen = FALSE; ++ GDevPtr *devList; ++ int j; ++ ++ if (!drvp->platformProbe) ++ return FALSE; ++ ++ xf86MatchDevice(drvp->driverName, &devList); ++ + /* if autoaddgpu devices is enabled then go find any unclaimed platform + * devices and add them as GPU screens */ + if (xf86Info.autoAddGPU) { +diff --git a/hw/xfree86/common/xf86platformBus.h b/hw/xfree86/common/xf86platformBus.h +index a7335b9..0f5c0ef 100644 +--- a/hw/xfree86/common/xf86platformBus.h ++++ b/hw/xfree86/common/xf86platformBus.h +@@ -41,6 +41,7 @@ struct xf86_platform_device { + #ifdef XSERVER_PLATFORM_BUS + int xf86platformProbe(void); + int xf86platformProbeDev(DriverPtr drvp); ++int xf86platformAddGPUDevices(DriverPtr drvp); + + extern int xf86_num_platform_devices; + extern struct xf86_platform_device *xf86_platform_devices; +@@ -156,6 +157,11 @@ xf86PlatformMatchDriver(char *matches[], int nmatches); + + extern void xf86platformVTProbe(void); + extern void xf86platformPrimary(void); ++ ++#else ++ ++static inline int xf86platformAddGPUDevices(DriverPtr drvp) { return FALSE; } ++ + #endif + + #endif +-- +2.9.3 + diff --git a/0006-xwayland-handle-button-events-after-motion-events.patch b/0006-xwayland-handle-button-events-after-motion-events.patch new file mode 100644 index 0000000..97b0c48 --- /dev/null +++ b/0006-xwayland-handle-button-events-after-motion-events.patch @@ -0,0 +1,121 @@ +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/0007-xfree86-Try-harder-to-find-atleast-1-non-GPU-Screen.patch b/0007-xfree86-Try-harder-to-find-atleast-1-non-GPU-Screen.patch new file mode 100644 index 0000000..75dda14 --- /dev/null +++ b/0007-xfree86-Try-harder-to-find-atleast-1-non-GPU-Screen.patch @@ -0,0 +1,122 @@ +From 02bcb6f189c4ad8b2e73ce99cfa3c10f0c244a88 Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Fri, 30 Sep 2016 12:29:09 +0200 +Subject: [PATCH xserver v2 7/7] xfree86: Try harder to find atleast 1 non GPU + Screen + +If we did not find any non GPU Screens, try again ignoring the notion +of any video devices being the primary device. This fixes Xorg exiting +with a "no screens found" error when using virtio-vga in a +virtual-machine and when using a device driven by simpledrm. + +This is a somewhat ugly solution, but it is the best I can come up with +without major surgery to the bus and probe code. + +Signed-off-by: Hans de Goede +--- + hw/xfree86/common/xf86.h | 1 + + hw/xfree86/common/xf86Bus.c | 26 +++++++++++++++++++++++--- + hw/xfree86/common/xf86Globals.c | 1 + + hw/xfree86/common/xf86pciBus.c | 4 ++++ + hw/xfree86/common/xf86platformBus.c | 4 ++++ + 5 files changed, 33 insertions(+), 3 deletions(-) + +diff --git a/hw/xfree86/common/xf86.h b/hw/xfree86/common/xf86.h +index e54c811..f724688 100644 +--- a/hw/xfree86/common/xf86.h ++++ b/hw/xfree86/common/xf86.h +@@ -55,6 +55,7 @@ + extern _X_EXPORT int xf86DoConfigure; + extern _X_EXPORT int xf86DoShowOptions; + extern _X_EXPORT Bool xf86DoConfigurePass1; ++extern _X_EXPORT Bool xf86ProbeIgnorePrimary; + extern _X_EXPORT Bool xorgHWAccess; + + extern _X_EXPORT DevPrivateKeyRec xf86ScreenKeyRec; +diff --git a/hw/xfree86/common/xf86Bus.c b/hw/xfree86/common/xf86Bus.c +index a3a9898..9836803 100644 +--- a/hw/xfree86/common/xf86Bus.c ++++ b/hw/xfree86/common/xf86Bus.c +@@ -117,14 +117,34 @@ xf86BusConfig(void) + int i, j; + + /* +- * Now call each of the Probe functions. Each successful probe will +- * result in an extra entry added to the xf86Screens[] list for each +- * instance of the hardware found. ++ * 3 step probe to (hopefully) ensure that we always find at least 1 ++ * (non GPU) screen: ++ * ++ * 1. Call each drivers probe function normally, ++ * Each successful probe will result in an extra entry added to the ++ * xf86Screens[] list for each instance of the hardware found. + */ + for (i = 0; i < xf86NumDrivers; i++) { + xf86CallDriverProbe(xf86DriverList[i], FALSE); + } + ++ /* ++ * 2. If no Screens were found, call each drivers probe function with ++ * ignorePrimary = TRUE, to ensure that we do actually get a ++ * Screen if there is atleast one supported video card. ++ */ ++ if (xf86NumScreens == 0) { ++ xf86ProbeIgnorePrimary = TRUE; ++ for (i = 0; i < xf86NumDrivers && xf86NumScreens == 0; i++) { ++ xf86CallDriverProbe(xf86DriverList[i], FALSE); ++ } ++ xf86ProbeIgnorePrimary = FALSE; ++ } ++ ++ /* ++ * 3. Call xf86platformAddGPUDevices() to add any additional video cards as ++ * GPUScreens (GPUScreens are only supported by platformBus drivers). ++ */ + for (i = 0; i < xf86NumDrivers; i++) { + xf86platformAddGPUDevices(xf86DriverList[i]); + } +diff --git a/hw/xfree86/common/xf86Globals.c b/hw/xfree86/common/xf86Globals.c +index 07cfabf..e962b75 100644 +--- a/hw/xfree86/common/xf86Globals.c ++++ b/hw/xfree86/common/xf86Globals.c +@@ -152,6 +152,7 @@ XF86ConfigPtr xf86configptr = NULL; + Bool xf86Resetting = FALSE; + Bool xf86Initialising = FALSE; + Bool xf86DoConfigure = FALSE; ++Bool xf86ProbeIgnorePrimary = FALSE; + Bool xf86DoShowOptions = FALSE; + DriverPtr *xf86DriverList = NULL; + int xf86NumDrivers = 0; +diff --git a/hw/xfree86/common/xf86pciBus.c b/hw/xfree86/common/xf86pciBus.c +index 8158c2b..9adfee5 100644 +--- a/hw/xfree86/common/xf86pciBus.c ++++ b/hw/xfree86/common/xf86pciBus.c +@@ -352,6 +352,10 @@ xf86ComparePciBusString(const char *busID, int bus, int device, int func) + Bool + xf86IsPrimaryPci(struct pci_device *pPci) + { ++ /* Add max. 1 screen for the IgnorePrimary fallback path */ ++ if (xf86ProbeIgnorePrimary && xf86NumScreens == 0) ++ return TRUE; ++ + if (primaryBus.type == BUS_PCI) + return pPci == primaryBus.id.pci; + #ifdef XSERVER_PLATFORM_BUS +diff --git a/hw/xfree86/common/xf86platformBus.c b/hw/xfree86/common/xf86platformBus.c +index 8dd0d5d..063e81c 100644 +--- a/hw/xfree86/common/xf86platformBus.c ++++ b/hw/xfree86/common/xf86platformBus.c +@@ -114,6 +114,10 @@ xf86_find_platform_device_by_devnum(int major, int minor) + static Bool + xf86IsPrimaryPlatform(struct xf86_platform_device *plat) + { ++ /* Add max. 1 screen for the IgnorePrimary fallback path */ ++ if (xf86ProbeIgnorePrimary && xf86NumScreens == 0) ++ return TRUE; ++ + if (primaryBus.type == BUS_PLATFORM) + return plat == primaryBus.id.plat; + #ifdef XSERVER_LIBPCIACCESS +-- +2.9.3 + diff --git a/0007-xwayland-Refactor-cursor-management-into-xwl_cursor.patch b/0007-xwayland-Refactor-cursor-management-into-xwl_cursor.patch new file mode 100644 index 0000000..c3bcd11 --- /dev/null +++ b/0007-xwayland-Refactor-cursor-management-into-xwl_cursor.patch @@ -0,0 +1,213 @@ +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/0008-xwayland-update-cursor-on-tablet-tools-in-proximity.patch b/0008-xwayland-update-cursor-on-tablet-tools-in-proximity.patch new file mode 100644 index 0000000..fa5472c --- /dev/null +++ b/0008-xwayland-update-cursor-on-tablet-tools-in-proximity.patch @@ -0,0 +1,208 @@ +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/0009-xwayland-add-tablet-pad-support.patch b/0009-xwayland-add-tablet-pad-support.patch new file mode 100644 index 0000000..8158d92 --- /dev/null +++ b/0009-xwayland-add-tablet-pad-support.patch @@ -0,0 +1,511 @@ +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/0010-xwayland-Unconditionally-initialize-lists-in-init_ta.patch b/0010-xwayland-Unconditionally-initialize-lists-in-init_ta.patch new file mode 100644 index 0000000..739b5a4 --- /dev/null +++ b/0010-xwayland-Unconditionally-initialize-lists-in-init_ta.patch @@ -0,0 +1,74 @@ +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/0011-xwayland-Correct-off-by-one-error-in-tablet-button-n.patch b/0011-xwayland-Correct-off-by-one-error-in-tablet-button-n.patch new file mode 100644 index 0000000..76e95ec --- /dev/null +++ b/0011-xwayland-Correct-off-by-one-error-in-tablet-button-n.patch @@ -0,0 +1,39 @@ +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/0012-xwayland-Implement-tablet_tool_wheel-for-scrolling.patch b/0012-xwayland-Implement-tablet_tool_wheel-for-scrolling.patch new file mode 100644 index 0000000..097bcb4 --- /dev/null +++ b/0012-xwayland-Implement-tablet_tool_wheel-for-scrolling.patch @@ -0,0 +1,78 @@ +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/10-quirks.conf b/10-quirks.conf new file mode 100644 index 0000000..47907d8 --- /dev/null +++ b/10-quirks.conf @@ -0,0 +1,38 @@ +# Collection of quirks and blacklist/whitelists for specific devices. + + +# Accelerometer device, posts data through ABS_X/ABS_Y, making X unusable +# http://bugs.freedesktop.org/show_bug.cgi?id=22442 +Section "InputClass" + Identifier "ThinkPad HDAPS accelerometer blacklist" + MatchProduct "ThinkPad HDAPS accelerometer data" + Option "Ignore" "on" +EndSection + +# https://bugzilla.redhat.com/show_bug.cgi?id=523914 +# Mouse does not move in PV Xen guest +# Explicitly tell evdev to not ignore the absolute axes. +Section "InputClass" + Identifier "Xen Virtual Pointer axis blacklist" + MatchProduct "Xen Virtual Pointer" + Option "IgnoreAbsoluteAxes" "off" + Option "IgnoreRelativeAxes" "off" +EndSection + +# https://bugs.freedesktop.org/show_bug.cgi?id=55867 +# Bug 55867 - Doesn't know how to tag XI_TRACKBALL +Section "InputClass" + Identifier "Tag trackballs as XI_TRACKBALL" + MatchProduct "trackball" + MatchDriver "evdev" + Option "TypeName" "TRACKBALL" +EndSection + +# https://bugs.freedesktop.org/show_bug.cgi?id=62831 +# Bug 62831 - Mionix Naos 5000 mouse detected incorrectly +Section "InputClass" + Identifier "Tag Mionix Naos 5000 mouse XI_MOUSE" + MatchProduct "La-VIEW Technology Naos 5000 Mouse" + MatchDriver "evdev" + Option "TypeName" "MOUSE" +EndSection diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..4041668 --- /dev/null +++ b/Makefile @@ -0,0 +1,30 @@ +# Makefile for source rpm: xorg-x11-server +# $Id$ +NAME := xorg-x11-server +SPECFILE = $(firstword $(wildcard *.spec)) + +define find-makefile-common +for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$d/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done +endef + +MAKEFILE_COMMON := $(shell $(find-makefile-common)) + +ifeq ($(MAKEFILE_COMMON),) +# attempt a checkout +define checkout-makefile-common +test -f CVS/Root && { cvs -Q -d $$(cat CVS/Root) checkout common && echo "common/Makefile.common" ; } || { echo "ERROR: I can't figure out how to checkout the 'common' module." ; exit -1 ; } >&2 +endef + +MAKEFILE_COMMON := $(shell $(checkout-makefile-common)) +endif + +include $(MAKEFILE_COMMON) + +ifeq ($(MAKECMDGOALS),me a sandwich) +.PHONY :: me a sandwich +me a: + @: + +sandwich: + @[ `id -u` -ne 0 ] && echo "What? Make it yourself." || echo Okay. +endif diff --git a/commitid b/commitid new file mode 100644 index 0000000..7420e41 --- /dev/null +++ b/commitid @@ -0,0 +1 @@ +d13cb974426f7f1110b0bdb08c4ebb46ff8975f7 diff --git a/gitignore b/gitignore new file mode 100644 index 0000000..524cfc6 --- /dev/null +++ b/gitignore @@ -0,0 +1,306 @@ +Makefile +Makefile.in +.deps +.libs +.msg +*.lo +*.la +*.a +*.o +*~ +.*sw? +*.pbxuser +*.mode1v3 +obj* +build* +local +aclocal.m4 +autom4te.cache +compile +config.guess +config.log +config.status +config.sub +configure +configure.lineno +depcomp +install-sh +libtool +ltmain.sh +missing +TAGS +tags +ylwrap +xorg-server.pc +stamp-h? +do-not-use-config.h +do-not-use-config.h.in +afb/afbbltC.c +afb/afbbltCI.c +afb/afbbltG.c +afb/afbbltO.c +afb/afbbltX.c +afb/afbseg.c +afb/afbtileC.c +afb/afbtileG.c +cfb/cfb8lineCO.c +cfb/cfb8lineCP.c +cfb/cfb8lineG.c +cfb/cfb8lineX.c +cfb/cfb8segC.c +cfb/cfb8segCS.c +cfb/cfb8segX.c +cfb/cfb8setG.c +cfb/cfbbltC.c +cfb/cfbbltG.c +cfb/cfbbltO.c +cfb/cfbbltX.c +cfb/cfbfillarcC.c +cfb/cfbfillarcG.c +cfb/cfbglrop8.c +cfb/cfbply1rctC.c +cfb/cfbply1rctG.c +cfb/cfbseg.c +cfb/cfbsolidC.c +cfb/cfbsolidG.c +cfb/cfbsolidX.c +cfb/cfbtile32C.c +cfb/cfbtile32G.c +cfb/cfbtileoddC.c +cfb/cfbtileoddG.c +cfb/cfbzerarcC.c +cfb/cfbzerarcG.c +cfb/cfbzerarcX.c +cfb32/cfb8lineCO.c +cfb32/cfb8lineCP.c +cfb32/cfb8lineG.c +cfb32/cfb8lineX.c +cfb32/cfb8segC.c +cfb32/cfb8segCS.c +cfb32/cfb8segX.c +cfb32/cfb8setG.c +cfb32/cfbbltC.c +cfb32/cfbbltG.c +cfb32/cfbbltO.c +cfb32/cfbbltX.c +cfb32/cfbfillarcC.c +cfb32/cfbfillarcG.c +cfb32/cfbply1rctC.c +cfb32/cfbply1rctG.c +cfb32/cfbseg.c +cfb32/cfbsolidC.c +cfb32/cfbsolidG.c +cfb32/cfbsolidX.c +cfb32/cfbtile32C.c +cfb32/cfbtile32G.c +cfb32/cfbtileoddC.c +cfb32/cfbtileoddG.c +cfb32/cfbzerarcC.c +cfb32/cfbzerarcG.c +cfb32/cfbzerarcX.c +doc/Xserver.1x +doc/Xserver.man +hw/dmx/Xdmx +hw/dmx/Xdmx.1x +hw/dmx/config/dmxtodmx +hw/dmx/config/dmxtodmx.1x +hw/dmx/config/parser.c +hw/dmx/config/parser.h +hw/dmx/config/scanner.c +hw/dmx/config/vdltodmx +hw/dmx/config/vdltodmx.1x +hw/dmx/config/xdmxconfig +hw/dmx/config/xdmxconfig.1x +hw/dmx/examples/dmxaddinput +hw/dmx/examples/dmxaddscreen +hw/dmx/examples/dmxreconfig +hw/dmx/examples/dmxresize +hw/dmx/examples/dmxrminput +hw/dmx/examples/dmxrmscreen +hw/dmx/examples/dmxwininfo +hw/dmx/examples/ev +hw/dmx/examples/evi +hw/dmx/examples/res +hw/dmx/examples/xbell +hw/dmx/examples/xdmx +hw/dmx/examples/xinput +hw/dmx/examples/xled +hw/dmx/examples/xtest +hw/kdrive/ati/Xati +hw/kdrive/chips/Xchips +hw/kdrive/ephyr/Xephyr +hw/kdrive/epson/Xepson +hw/kdrive/fake/Xfake +hw/kdrive/fbdev/Xfbdev +hw/kdrive/i810/Xi810 +hw/kdrive/mach64/Xmach64 +hw/kdrive/mga/Xmga +hw/kdrive/neomagic/Xneomagic +hw/kdrive/nvidia/Xnvidia +hw/kdrive/pm2/Xpm2 +hw/kdrive/r128/Xr128 +hw/kdrive/sdl/Xsdl +hw/kdrive/sis300/Xsis +hw/kdrive/smi/Xsmi +hw/kdrive/vesa/Xvesa +hw/kdrive/via/Xvia +hw/vfb/Xvfb +hw/vfb/Xvfb.1x +hw/vfb/Xvfb.man +hw/xfree86/Xorg +hw/xfree86/common/xf86Build.h +hw/xfree86/common/xf86DefModeSet.c +hw/xfree86/doc/man/Xorg.1x +hw/xfree86/doc/man/Xorg.man +hw/xfree86/doc/man/xorg.conf.5x +hw/xfree86/doc/man/xorg.conf.man +hw/xfree86/exa/exa.4 +hw/xfree86/exa/exa.4x +hw/xfree86/exa/exa.man +hw/xfree86/fbdevhw/fbdevhw.4x +hw/xfree86/fbdevhw/fbdevhw.man +hw/xfree86/getconfig/cfg.man +hw/xfree86/getconfig/getconfig.1x +hw/xfree86/getconfig/getconfig.5x +hw/xfree86/getconfig/getconfig.man +hw/xfree86/os-support/xorgos.c +hw/xfree86/osandcommon.c +hw/xfree86/ramdac/xf86BitOrder.c +hw/xfree86/scanpci/xf86PciData.c +hw/xfree86/scanpci/xf86PciIds.h +hw/xfree86/utils/cvt/cvt +hw/xfree86/utils/cvt/cvt.man +hw/xfree86/utils/gtf/gtf +hw/xfree86/utils/gtf/gtf.1x +hw/xfree86/utils/gtf/gtf.man +hw/xfree86/utils/ioport/inb +hw/xfree86/utils/ioport/inl +hw/xfree86/utils/ioport/inw +hw/xfree86/utils/ioport/ioport +hw/xfree86/utils/ioport/outb +hw/xfree86/utils/ioport/outl +hw/xfree86/utils/ioport/outw +hw/xfree86/utils/pcitweak/pcitweak +hw/xfree86/utils/pcitweak/pcitweak.1x +hw/xfree86/utils/pcitweak/pcitweak.man +hw/xfree86/utils/scanpci/scanpci +hw/xfree86/utils/scanpci/scanpci.1x +hw/xfree86/utils/scanpci/scanpci.man +hw/xfree86/utils/xorgcfg/XOrgCfg +hw/xfree86/utils/xorgcfg/xorgcfg +hw/xfree86/utils/xorgcfg/xorgcfg.1x +hw/xfree86/utils/xorgcfg/xorgcfg.man +hw/xfree86/utils/xorgconfig/xorgconfig +hw/xfree86/utils/xorgconfig/xorgconfig.1x +hw/xfree86/utils/xorgconfig/xorgconfig.man +hw/xfree86/xaa/l-xaaBitmap.c +hw/xfree86/xaa/l-xaaStipple.c +hw/xfree86/xaa/l-xaaTEGlyph.c +hw/xfree86/xaa/l3-xaaBitmap.c +hw/xfree86/xaa/l3-xaaStipple.c +hw/xfree86/xaa/lf-xaaBitmap.c +hw/xfree86/xaa/lf-xaaStipple.c +hw/xfree86/xaa/lf-xaaTEGlyph.c +hw/xfree86/xaa/lf3-xaaBitmap.c +hw/xfree86/xaa/lf3-xaaStipple.c +hw/xfree86/xaa/m-xaaBitmap.c +hw/xfree86/xaa/m-xaaStipple.c +hw/xfree86/xaa/m-xaaTEGlyph.c +hw/xfree86/xaa/m3-xaaBitmap.c +hw/xfree86/xaa/m3-xaaStipple.c +hw/xfree86/xaa/mf-xaaBitmap.c +hw/xfree86/xaa/mf-xaaStipple.c +hw/xfree86/xaa/mf-xaaTEGlyph.c +hw/xfree86/xaa/mf3-xaaBitmap.c +hw/xfree86/xaa/mf3-xaaStipple.c +hw/xfree86/xaa/s-xaaDashLine.c +hw/xfree86/xaa/s-xaaLine.c +hw/xfree86/xf1bpp/maskbits.c +hw/xfree86/xf1bpp/mfbbitblt.c +hw/xfree86/xf1bpp/mfbbltC.c +hw/xfree86/xf1bpp/mfbbltCI.c +hw/xfree86/xf1bpp/mfbbltG.c +hw/xfree86/xf1bpp/mfbbltO.c +hw/xfree86/xf1bpp/mfbbltX.c +hw/xfree86/xf1bpp/mfbbres.c +hw/xfree86/xf1bpp/mfbbresd.c +hw/xfree86/xf1bpp/mfbclip.c +hw/xfree86/xf1bpp/mfbcmap.c +hw/xfree86/xf1bpp/mfbfillarc.c +hw/xfree86/xf1bpp/mfbfillrct.c +hw/xfree86/xf1bpp/mfbfillsp.c +hw/xfree86/xf1bpp/mfbfont.c +hw/xfree86/xf1bpp/mfbgc.c +hw/xfree86/xf1bpp/mfbgetsp.c +hw/xfree86/xf1bpp/mfbigbblak.c +hw/xfree86/xf1bpp/mfbigbwht.c +hw/xfree86/xf1bpp/mfbhrzvert.c +hw/xfree86/xf1bpp/mfbimage.c +hw/xfree86/xf1bpp/mfbline.c +hw/xfree86/xf1bpp/mfbmisc.c +hw/xfree86/xf1bpp/mfbpablack.c +hw/xfree86/xf1bpp/mfbpainv.c +hw/xfree86/xf1bpp/mfbpawhite.c +hw/xfree86/xf1bpp/mfbpgbblak.c +hw/xfree86/xf1bpp/mfbpgbinv.c +hw/xfree86/xf1bpp/mfbpgbwht.c +hw/xfree86/xf1bpp/mfbpixmap.c +hw/xfree86/xf1bpp/mfbplyblack.c +hw/xfree86/xf1bpp/mfbplyinv.c +hw/xfree86/xf1bpp/mfbplywhite.c +hw/xfree86/xf1bpp/mfbpntwin.c +hw/xfree86/xf1bpp/mfbpolypnt.c +hw/xfree86/xf1bpp/mfbpushpxl.c +hw/xfree86/xf1bpp/mfbscrclse.c +hw/xfree86/xf1bpp/mfbscrinit.c +hw/xfree86/xf1bpp/mfbseg.c +hw/xfree86/xf1bpp/mfbsetsp.c +hw/xfree86/xf1bpp/mfbteblack.c +hw/xfree86/xf1bpp/mfbtewhite.c +hw/xfree86/xf1bpp/mfbtileC.c +hw/xfree86/xf1bpp/mfbtileG.c +hw/xfree86/xf1bpp/mfbwindow.c +hw/xfree86/xf1bpp/mfbzerarc.c +hw/xfree86/xf4bpp/mfbseg.c +hw/xfree86/xf8_32bpp/cfbgc32.c +hw/xfree86/xf8_32bpp/cfbgc8.c +hw/xfree86/xorg.c +hw/xfree86/xorg.conf.example +hw/xfree86/xorg.conf.example.pre +hw/xnest/Xnest +hw/xnest/Xnest.1x +hw/xnest/Xnest.man +hw/xprint/Xprt +hw/xprint/config/C/print/Xprinters.ghostscript +hw/xprint/doc/Xprt.1x +hw/xprint/doc/Xprt.man +hw/xprint/dpmsstubs-wrapper.c +hw/xprint/miinitext-wrapper.c +include/dix-config.h +include/kdrive-config.h +include/xgl-config.h +include/xkb-config.h +include/xorg-config.h +include/xorg-server.h +include/xwin-config.h +mfb/mfbbltC.c +mfb/mfbbltCI.c +mfb/mfbbltG.c +mfb/mfbbltO.c +mfb/mfbbltX.c +mfb/mfbigbblak.c +mfb/mfbigbwht.c +mfb/mfbpablack.c +mfb/mfbpainv.c +mfb/mfbpawhite.c +mfb/mfbpgbblak.c +mfb/mfbpgbinv.c +mfb/mfbpgbwht.c +mfb/mfbplyblack.c +mfb/mfbplyinv.c +mfb/mfbplywhite.c +mfb/mfbseg.c +mfb/mfbteblack.c +mfb/mfbtewhite.c +mfb/mfbtileC.c +mfb/mfbtileG.c diff --git a/import.log b/import.log new file mode 100644 index 0000000..782e371 --- /dev/null +++ b/import.log @@ -0,0 +1,6 @@ +xorg-x11-server-1_5_0-1_fc10:HEAD:xorg-x11-server-1.5.0-1.fc10.src.rpm:1220485219 +xorg-x11-server-1_5_1-1_fc10:HEAD:xorg-x11-server-1.5.1-1.fc10.src.rpm:1222198557 +xorg-x11-server-1_5_2-1_fc10:HEAD:xorg-x11-server-1.5.2-1.fc10.src.rpm:1223667007 +xorg-x11-server-1_5_3-1_fc10:HEAD:xorg-x11-server-1.5.3-1.fc10.src.rpm:1225918317 +xorg-x11-server-1_6_0-1_fc11:HEAD:xorg-x11-server-1.6.0-1.fc11.src.rpm:1235594175 +xorg-x11-server-1_6_1-1_fc11:HEAD:xorg-x11-server-1.6.1-1.fc11.src.rpm:1239742477 diff --git a/make-git-snapshot.sh b/make-git-snapshot.sh new file mode 100755 index 0000000..0d9b2ad --- /dev/null +++ b/make-git-snapshot.sh @@ -0,0 +1,17 @@ +#!/bin/sh + +DIRNAME=xorg-server-$( date +%Y%m%d ) + +rm -rf $DIRNAME +git clone git://git.freedesktop.org/git/xorg/xserver $DIRNAME +cd $DIRNAME +if [ -z "$1" ]; then + git log | head -1 +else + git checkout $1 +fi +git log | head -1 | awk '{ print $2 }' > ../commitid +git repack -a -d +cd .. +tar cf - $DIRNAME | xz -c9 > $DIRNAME.tar.xz +rm -rf $DIRNAME diff --git a/sources b/sources index 888c6f9..59caaa3 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (xorg-server-21.1.21.tar.xz) = bb2eb4e6756eb9e38b61bd47c017da44bcf5f45f2b7a906b4bb3a56b3d791cec64abb9bf37b224efe1e4fab9cc296f3672c9b2f8e00e1cdfc54337bef63cd16c +SHA512 (xorg-server-1.19.6.tar.bz2) = 38519a8d0af9dd034045fc346959496dd718fa59b6188307974797a1cd9c349deb54987f6232ea8396baf810dcc710c0ff191f76ed2186cae4d44921b3680412 diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index 788acf9..bca7fd3 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -1,230 +1,387 @@ +# This package is an experiment in active integration of upstream SCM with +# Fedora packaging. It works something like this: +# +# The "pristine" source is actually a git repo (with no working checkout). +# The first step of %%prep is to check it out and switch to a "fedora" branch. +# If you need to add a patch to the server, just do it like a normal git +# operation, dump it with git-format-patch to a file in the standard naming +# format, and add a PatchN: line. If you want to push something upstream, +# check out the master branch, pull, cherry-pick, and push. + # X.org requires lazy relocations to work. %undefine _hardened_build %undefine _strict_symbol_defs_build -# Released ABI versions: +#global gitdate 20161026 +%global stable_abi 1 + +%if !0%{?gitdate} || %{stable_abi} +# Released ABI versions. Have to keep these manually in sync with the +# source because rpm is a terrible language. %global ansic_major 0 %global ansic_minor 4 -%global videodrv_major 25 -%global videodrv_minor 2 +%global videodrv_major 23 +%global videodrv_minor 0 %global xinput_major 24 -%global xinput_minor 4 +%global xinput_minor 1 %global extension_major 10 %global extension_minor 0 +%endif + +%if 0%{?gitdate} +# For git snapshots, use date for major and a serial number for minor +%global minor_serial 0 +%global git_ansic_major %{gitdate} +%global git_ansic_minor %{minor_serial} +%global git_videodrv_major %{gitdate} +%global git_videodrv_minor %{minor_serial} +%global git_xinput_major %{gitdate} +%global git_xinput_minor %{minor_serial} +%global git_extension_major %{gitdate} +%global git_extension_minor %{minor_serial} +%endif %global pkgname xorg-server -Summary: X.Org X11 X server -Name: xorg-x11-server -Version: 21.1.21 -Release: 1%{?dist} -URL: http://www.x.org -# SPDX -License: Adobe-Display-PostScript AND BSD-3-Clause AND DEC-3-Clause AND HPND AND HPND-sell-MIT-disclaimer-xserver AND HPND-sell-variant AND ICU AND ISC AND MIT AND MIT-open-group AND NTP AND SGI-B-2.0 AND SMLNJ AND X11 AND X11-distribute-modifications-variant +Summary: X.Org X11 X server +Name: xorg-x11-server +Version: 1.19.6 +Release: 7%{?gitdate:.%{gitdate}}%{dist} +URL: http://www.x.org +License: MIT +Group: User Interface/X -Source0: https://www.x.org/pub/individual/xserver/%{pkgname}-%{version}.tar.xz +#VCS: git:git://git.freedesktop.org/git/xorg/xserver +%if 0%{?gitdate} +# git snapshot. to recreate, run: +# ./make-git-snapshot.sh `cat commitid` +Source0: xorg-server-%{gitdate}.tar.xz +#Source0: http://www.x.org/pub/individual/xserver/%{pkgname}-%{version}.tar.bz2 +Source1: make-git-snapshot.sh +Source2: commitid +%else +Source0: https://www.x.org/pub/individual/xserver/%{pkgname}-%{version}.tar.bz2 +Source1: gitignore +%endif + +Source4: 10-quirks.conf Source10: xserver.pamd + # "useful" xvfb-run script -Source20: http://svn.exactcode.de/t2/trunk/package/xorg/xorg-server/xvfb-run.sh +Source20: http://svn.exactcode.de/t2/trunk/package/xorg/xorg-server/xvfb-run.sh + # for requires generation in drivers -Source30: xserver-sdk-abi-requires +Source30: xserver-sdk-abi-requires.release +Source31: xserver-sdk-abi-requires.git + # maintainer convenience script -Source40: driver-abi-rebuild.sh +Source40: driver-abi-rebuild.sh + +# Various fixes pending upstream +Patch2: 0005-xfree86-Remove-redundant-ServerIsNotSeat0-check-from.patch +Patch3: 0006-xfree86-Make-adding-unclaimed-devices-as-GPU-devices.patch +Patch4: 0007-xfree86-Try-harder-to-find-atleast-1-non-GPU-Screen.patch + +# Patches for better integration with the nvidia driver, pending upstream +Patch11: 0001-xfree86-Free-devlist-returned-by-xf86MatchDevice.patch +Patch12: 0002-xfree86-Make-OutputClassMatches-take-a-xf86_platform.patch +Patch13: 0003-xfree86-Add-options-support-for-OutputClass-Options.patch +Patch14: 0004-xfree86-xf86platformProbe-split-finding-pci-info-and.patch +Patch15: 0005-xfree86-Allow-overriding-primary-GPU-detection-from-.patch +Patch16: 0006-xfree86-Add-ModulePath-support-for-OutputClass-confi.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 + +# Upstream commit fe46cbe for Xwayland - Not in server-1.19-branch +Patch9950: 0001-xwayland-Give-up-cleanly-on-Wayland-socket-errors.patch +# Upstream commit 60f4646a for Xwayland - Not in xorg-server-1.19.6 +Patch9951: 0001-xwayland-Keep-separate-variables-for-pointer-and-tab.patch +# Upstream commit 16fd1847 for Xwayland - Not in xorg-server-1.19.6 +Patch9952: 0001-xwayland-avoid-race-condition-on-new-keymap.patch # From Debian use intel ddx driver only for gen4 and older chipsets -Patch0: 06_use-intel-only-on-pre-gen4.diff -# Default to xf86-video-modesetting on GeForce 8 and newer -Patch1: 0001-xfree86-use-modesetting-driver-by-default-on-GeForce.patch -# Default to va_gl on intel i965 as we use the modesetting drv there -# va_gl should probably just be the default everywhere ? -Patch2: 0001-xf86-dri2-Use-va_gl-as-vdpau_driver-for-Intel-i965-G.patch -# because the display-managers are not ready yet, do not upstream -Patch3: 0001-Fedora-hack-Make-the-suid-root-wrapper-always-start-.patch +%if 0%{?fedora} > 25 || 0%{?rhel} > 7 +Patch20: 06_use-intel-only-on-pre-gen4.diff +%endif -BuildRequires: bison -BuildRequires: flex -BuildRequires: gawk -BuildRequires: gcc -BuildRequires: kernel-headers -BuildRequires: libXi-devel -BuildRequires: libXinerama-devel -BuildRequires: libXres-devel -BuildRequires: libXv-devel -BuildRequires: make -BuildRequires: mesa-libEGL-devel -BuildRequires: mesa-libGL-devel >= 9.2 -BuildRequires: meson -BuildRequires: pkgconfig -BuildRequires: pkgconfig(audit) -BuildRequires: pkgconfig(bigreqsproto) >= 1.1.0 -BuildRequires: pkgconfig(compositeproto) >= 0.4 -BuildRequires: pkgconfig(damageproto) >= 1.1 -BuildRequires: pkgconfig(dbus-1) >= 1.0 -BuildRequires: pkgconfig(dri2proto) >= 2.8 -BuildRequires: pkgconfig(dri3proto) >= 1.2 -BuildRequires: pkgconfig(epoxy) -BuildRequires: pkgconfig(epoxy) >= 1.5.4 -BuildRequires: pkgconfig(fixesproto) >= 6.0 -BuildRequires: pkgconfig(fontsproto) >= 2.1.3 -BuildRequires: pkgconfig(gbm) >= 10.2 -BuildRequires: pkgconfig(inputproto) >= 2.3.99.1 -BuildRequires: pkgconfig(kbproto) >= 1.0.3 -BuildRequires: pkgconfig(libdrm) >= 2.4.89 -BuildRequires: pkgconfig(libselinux) >= 2.0.86 -BuildRequires: pkgconfig(libsystemd) >= 209 -BuildRequires: pkgconfig(libudev) >= 143 -BuildRequires: pkgconfig(libunwind) -BuildRequires: pkgconfig(libxcvt) -BuildRequires: pkgconfig(openssl) -BuildRequires: pkgconfig(pciaccess) >= 0.12.901 -BuildRequires: pkgconfig(pixman-1) -BuildRequires: pkgconfig(randrproto) >= 1.6.0 -BuildRequires: pkgconfig(recordproto) >= 1.13.99.1 -BuildRequires: pkgconfig(renderproto) >= 0.11 -BuildRequires: pkgconfig(resourceproto) >= 1.2.0 -BuildRequires: pkgconfig(scrnsaverproto) >= 1.1 -BuildRequires: pkgconfig(videoproto) -BuildRequires: pkgconfig(x11) -BuildRequires: pkgconfig(x11-xcb) -BuildRequires: pkgconfig(xau) -BuildRequires: pkgconfig(xcb-aux) -BuildRequires: pkgconfig(xcb-icccm) -BuildRequires: pkgconfig(xcb-image) -BuildRequires: pkgconfig(xcb-keysyms) -BuildRequires: pkgconfig(xcb-renderutil) -BuildRequires: pkgconfig(xcmiscproto) >= 1.2.0 -BuildRequires: pkgconfig(xdmcp) -BuildRequires: pkgconfig(xext) >= 1.0.99.4 -BuildRequires: pkgconfig(xextproto) >= 7.2.99.901 -BuildRequires: pkgconfig(xf86bigfontproto) >= 1.2.0 -BuildRequires: pkgconfig(xf86vidmodeproto) >= 2.2.99.1 -BuildRequires: pkgconfig(xfont2) >= 2.0 -BuildRequires: pkgconfig(xineramaproto) -BuildRequires: pkgconfig(xkbfile) -BuildRequires: pkgconfig(xproto) >= 7.0.31 -BuildRequires: pkgconfig(xshmfence) >= 1.1 -BuildRequires: pkgconfig(xtrans) >= 1.3.5 -BuildRequires: pkgconfig(xtrans) >= 1.3.5 -BuildRequires: systemtap-sdt-devel -BuildRequires: xorg-x11-util-macros >= 1.17 -BuildRequires: xorg-x11-xtrans-devel >= 1.3.2 +# Submitted upstream +Patch21: 0001-xf86-dri2-Use-va_gl-as-vdpau_driver-for-Intel-i965-G.patch + +#Patch6044: xserver-1.6.99-hush-prerelease-warning.patch + +Patch7025: 0001-Always-install-vbe-and-int10-sdk-headers.patch + +# Submitted upstream, but not going anywhere +Patch7027: xserver-autobind-hotplug.patch + +# because the display-managers are not ready yet, do not upstream +Patch10000: 0001-Fedora-hack-Make-the-suid-root-wrapper-always-start-.patch + +# Default to xf86-video-modesetting on GeForce 8 and newer +Patch10001: 0001-xfree86-use-modesetting-driver-by-default-on-GeForce.patch + +# Upstream commit a309323328d9d6e0bf +Patch10002: 0001-config-fix-NULL-value-detection-for-ID_INPUT-being-u.patch + +# Upstream commit 8be1dbe - in 1.19 and master branches +Patch10010: 0001-xfree86-add-default-modes-for-16-9-and-16-10.patch + +%global moduledir %{_libdir}/xorg/modules +%global drimoduledir %{_libdir}/dri +%global sdkdir %{_includedir}/xorg + +#ifarch s390 s390x +#global with_hw_servers 0 +#else +%global with_hw_servers 1 +#endif + +%if %{with_hw_servers} +%global enable_xorg --enable-xorg +%else +%global enable_xorg --disable-xorg +%endif + +%ifnarch %{ix86} x86_64 +%global no_int10 --disable-vbe --disable-int10-module +%endif + +%global kdrive --enable-kdrive --enable-xephyr --disable-xfake --disable-xfbdev +%global xservers --enable-xvfb --enable-xnest %{kdrive} %{enable_xorg} + +BuildRequires: systemtap-sdt-devel +BuildRequires: git +BuildRequires: automake autoconf libtool pkgconfig +BuildRequires: xorg-x11-util-macros >= 1.17 + +BuildRequires: xorg-x11-proto-devel >= 7.7-10 +BuildRequires: xorg-x11-font-utils >= 7.2-11 + +BuildRequires: dbus-devel libepoxy-devel systemd-devel +BuildRequires: xorg-x11-xtrans-devel >= 1.3.2 +BuildRequires: libXfont2-devel libXau-devel libxkbfile-devel libXres-devel +BuildRequires: libfontenc-devel libXtst-devel libXdmcp-devel +BuildRequires: libX11-devel libXext-devel +BuildRequires: libXinerama-devel libXi-devel + +# DMX config utils buildreqs. +BuildRequires: libXt-devel libdmx-devel libXmu-devel libXrender-devel +BuildRequires: libXi-devel libXpm-devel libXaw-devel libXfixes-devel + +BuildRequires: wayland-devel +BuildRequires: wayland-protocols-devel +BuildRequires: pkgconfig(wayland-client) >= 1.3.0 +BuildRequires: pkgconfig(epoxy) +%if 0%{?fedora} > 24 || 0%{?rhel} > 7 +BuildRequires: pkgconfig(xshmfence) >= 1.1 +%endif +BuildRequires: libXv-devel +BuildRequires: pixman-devel >= 0.30.0 +BuildRequires: libpciaccess-devel >= 0.13.1 openssl-devel bison flex flex-devel +BuildRequires: mesa-libGL-devel >= 9.2 +BuildRequires: mesa-libEGL-devel +BuildRequires: mesa-libgbm-devel +# XXX silly... +BuildRequires: libdrm-devel >= 2.4.0 kernel-headers + +BuildRequires: audit-libs-devel libselinux-devel >= 2.0.86-1 +BuildRequires: libudev-devel +%if 0%{?fedora} > 24 || 0%{?rhel} > 7 +# libunwind is Exclusive for the following arches +%ifarch aarch64 %{arm} hppa ia64 mips ppc ppc64 %{ix86} x86_64 +BuildRequires: libunwind-devel +%endif +%endif + +BuildRequires: pkgconfig(xcb-aux) pkgconfig(xcb-image) pkgconfig(xcb-icccm) +BuildRequires: pkgconfig(xcb-keysyms) pkgconfig(xcb-renderutil) + +# All server subpackages have a virtual provide for the name of the server +# they deliver. The Xorg one is versioned, the others are intentionally +# unversioned. %description -X.Org X11 X server. +X.Org X11 X server -%package common -Summary: Xorg server common files -Requires: pixman -Requires: xkbcomp -Requires: xkeyboard-config +%package common +Summary: Xorg server common files +Group: User Interface/X +Requires: pixman >= 0.30.0 +Requires: xkeyboard-config xkbcomp -%description common +%description common Common files shared among all X servers. -%package Xorg -Summary: Xorg X server -Requires: libEGL -Requires: system-setup-keyboard -Requires: xorg-x11-drv-libinput -Requires: xorg-x11-server-common >= %{version}-%{release} -Provides: Xorg = %{version}-%{release} -Provides: Xserver +%if %{with_hw_servers} +%package Xorg +Summary: Xorg X server +Group: User Interface/X +Provides: Xorg = %{version}-%{release} +Provides: Xserver # HdG: This should be moved to the wrapper package once the wrapper gets # its own sub-package: -Provides: xorg-x11-server-wrapper = %{version}-%{release} -Provides: xserver-abi(ansic-%{ansic_major}) = %{ansic_minor} -Provides: xserver-abi(videodrv-%{videodrv_major}) = %{videodrv_minor} -Provides: xserver-abi(xinput-%{xinput_major}) = %{xinput_minor} -Provides: xserver-abi(extension-%{extension_major}) = %{extension_minor} -# Dropped from xorg-x11-server-21.1 -# https://gitlab.freedesktop.org/xorg/xserver/-/commit/b3b81c8c2090cd49410960a021baf0d27fdd2ab3 -Obsoletes: xorg-x11-server-Xdmx < 1.20.15 -# Legacy fbdev devices have been replaced with simpledrm: -# https://fedoraproject.org/wiki/Changes/ReplaceFbdevDrivers -Obsoletes: xorg-x11-drv-fbdev < 0.5.0-19 -Obsoletes: xorg-x11-drv-vesa < 2.6.0-3 -Obsoletes: xorg-x11-drv-armsoc < 1.4.1-10 +Provides: xorg-x11-server-wrapper = %{version}-%{release} +%if !0%{?gitdate} || %{stable_abi} +Provides: xserver-abi(ansic-%{ansic_major}) = %{ansic_minor} +Provides: xserver-abi(videodrv-%{videodrv_major}) = %{videodrv_minor} +Provides: xserver-abi(xinput-%{xinput_major}) = %{xinput_minor} +Provides: xserver-abi(extension-%{extension_major}) = %{extension_minor} +%endif +%if 0%{?gitdate} +Provides: xserver-abi(ansic-%{git_ansic_major}) = %{git_ansic_minor} +Provides: xserver-abi(videodrv-%{git_videodrv_major}) = %{git_videodrv_minor} +Provides: xserver-abi(xinput-%{git_xinput_major}) = %{git_xinput_minor} +Provides: xserver-abi(extension-%{git_extension_major}) = %{git_extension_minor} +%endif +Obsoletes: xorg-x11-glamor < %{version}-%{release} +Provides: xorg-x11-glamor = %{version}-%{release} +Obsoletes: xorg-x11-drv-modesetting < %{version}-%{release} +Provides: xorg-x11-drv-modesetting = %{version}-%{release} +%if 0%{?fedora} > 24 || 0%{?rhel} > 7 +# Dropped from F25 +Obsoletes: xorg-x11-drv-vmmouse < 13.1.0-4 +%endif -%description Xorg -X.org X11 is an open source implementation of the X Window System. It provides -the basic low level functionality which full fledged graphical user interfaces -(GUIs) such as GNOME and KDE are designed upon. +Requires: xorg-x11-server-common >= %{version}-%{release} +Requires: system-setup-keyboard + +%description Xorg +X.org X11 is an open source implementation of the X Window System. It +provides the basic low level functionality which full fledged +graphical user interfaces (GUIs) such as GNOME and KDE are designed +upon. +%endif -%package Xnest -Summary: A nested server -Requires: xorg-x11-server-common >= %{version}-%{release} -Provides: Xnest +%package Xnest +Summary: A nested server +Group: User Interface/X +Requires: xorg-x11-server-common >= %{version}-%{release} +Provides: Xnest -%description Xnest -Xnest is an X server which has been implemented as an ordinary X application. It -runs in a window just like other X applications, but it is an X server itself in -which you can run other software. It is a very useful tool for developers who -wish to test their applications without running them on their real X server. +%description Xnest +Xnest is an X server which has been implemented as an ordinary +X application. It runs in a window just like other X applications, +but it is an X server itself in which you can run other software. It +is a very useful tool for developers who wish to test their +applications without running them on their real X server. -%package Xvfb -Summary: A X Windows System virtual framebuffer X server +%package Xdmx +Summary: Distributed Multihead X Server and utilities +Group: User Interface/X +Requires: xorg-x11-server-common >= %{version}-%{release} +Provides: Xdmx + +%description Xdmx +Xdmx is proxy X server that provides multi-head support for multiple displays +attached to different machines (each of which is running a typical X server). +When Xinerama is used with Xdmx, the multiple displays on multiple machines +are presented to the user as a single unified screen. A simple application +for Xdmx would be to provide multi-head support using two desktop machines, +each of which has a single display device attached to it. A complex +application for Xdmx would be to unify a 4 by 4 grid of 1280x1024 displays +(each attached to one of 16 computers) into a unified 5120x4096 display. + + +%package Xvfb +Summary: A X Windows System virtual framebuffer X server +Group: User Interface/X # xvfb-run is GPLv2, rest is MIT -License: MIT and GPL-2.0-only -Requires: xorg-x11-server-common >= %{version}-%{release} +License: MIT and GPLv2 +Requires: xorg-x11-server-common >= %{version}-%{release} # required for xvfb-run -Requires: xorg-x11-xauth -Provides: Xvfb -Requires: util-linux +Requires: xorg-x11-xauth +Provides: Xvfb -%description Xvfb -Xvfb (X Virtual Frame Buffer) is an X server that is able to run on machines -with no display hardware and no physical input devices. Xvfb simulates a dumb -framebuffer using virtual memory. Xvfb does not open any devices, but behaves -otherwise as an X display. Xvfb is normally used for testing servers. +%description Xvfb +Xvfb (X Virtual Frame Buffer) is an X server that is able to run on +machines with no display hardware and no physical input devices. +Xvfb simulates a dumb framebuffer using virtual memory. Xvfb does +not open any devices, but behaves otherwise as an X display. Xvfb +is normally used for testing servers. -%package Xephyr -Summary: A nested server -Requires: xorg-x11-server-common >= %{version}-%{release} -Provides: Xephyr +%package Xephyr +Summary: A nested server +Group: User Interface/X +Requires: xorg-x11-server-common >= %{version}-%{release} +Provides: Xephyr -%description Xephyr -Xephyr is an X server which has been implemented as an ordinary X application. -It runs in a window just like other X applications, but it is an X server itself -in which you can run other software. It is a very useful tool for developers who -wish to test their applications without running them on their real X server. -Unlike Xnest, Xephyr renders to an X image rather than relaying the X protocol, -and therefore supports the newer X extensions like Render and Composite. +%description Xephyr +Xephyr is an X server which has been implemented as an ordinary +X application. It runs in a window just like other X applications, +but it is an X server itself in which you can run other software. It +is a very useful tool for developers who wish to test their +applications without running them on their real X server. Unlike +Xnest, Xephyr renders to an X image rather than relaying the +X protocol, and therefore supports the newer X extensions like +Render and Composite. -%package devel -Summary: SDK for X server driver module development -Requires: libpciaccess-devel -Requires: libXfont2-devel -Requires: xorg-x11-proto-devel -Requires: xorg-x11-util-macros -Requires: pixman-devel -Requires: pkgconfig -Provides: xorg-x11-server-static +%package Xwayland +Summary: Wayland X Server +Group: User Interface/X +Requires: xorg-x11-server-common >= %{version}-%{release} + +%description Xwayland +Xwayland is an X server for running X clients under Wayland. + + +%if %{with_hw_servers} +%package devel +Summary: SDK for X server driver module development +Group: User Interface/X +Requires: xorg-x11-util-macros +Requires: xorg-x11-proto-devel +Requires: libXfont2-devel +Requires: pkgconfig pixman-devel libpciaccess-devel +Provides: xorg-x11-server-static +Obsoletes: xorg-x11-glamor-devel < %{version}-%{release} +Provides: xorg-x11-glamor-devel = %{version}-%{release} %description devel The SDK package provides the developmental files which are necessary for -developing X server driver modules, and for compiling driver modules outside of -the standard X11 source code tree. Developers writing video drivers, input -drivers, or other X modules should install this package. +developing X server driver modules, and for compiling driver modules +outside of the standard X11 source code tree. Developers writing video +drivers, input drivers, or other X modules should install this package. +%endif -%package source -Summary: Xserver source code required to build VNC server (Xvnc) -BuildArch: noarch +%package source +Summary: Xserver source code required to build VNC server (Xvnc) +Group: Development/Libraries +BuildArch: noarch -%description source -Xserver source code needed to build VNC server (Xvnc). +%description source +Xserver source code needed to build VNC server (Xvnc) %prep -%autosetup -p1 -n %{pkgname}-%{version} +%autosetup -N -n %{pkgname}-%{?gitdate:%{gitdate}}%{!?gitdate:%{version}} +rm -rf .git +cp %{SOURCE1} .gitignore +# ick +%global __scm git +%{expand:%__scm_setup_git -q} +%autopatch +%if %{with_hw_servers} && 0%{?stable_abi} # check the ABI in the source against what we expect. getmajor() { grep -i ^#define.ABI.$1_VERSION hw/xfree86/common/xf86Module.h | @@ -245,102 +402,125 @@ test `getminor xinput` == %{xinput_minor} test `getmajor extension` == %{extension_major} test `getminor extension` == %{extension_minor} -%build -%meson \ - -D agp=auto \ - -D builder_string="Build ID: %{name} %{version}-%{release}" \ - -D default_font_path="catalogue:/etc/X11/fontpath.d,built-ins" \ - -D devel-docs=false \ - -D dga=true \ - -D docs-pdf=false \ - -D docs=false \ - -D dpms=true \ - -D dri1=false \ - -D dri2=true \ - -D dri3=true \ - -D drm=true \ - -D dtrace=false \ - -D fallback_input_driver=libinput \ - -D glamor=true \ - -D glx=true \ - -D hal=false \ - -D input_thread=true \ - -D int10=false \ - -D ipv6=true \ - -D libunwind=true \ - -D linux_acpi=false \ - -D linux_apm=false \ - -D listen_local=true \ - -D listen_tcp=false \ - -D listen_unix=true \ - -D log_dir="%{_localstatedir}/log" \ - -D mitshm=auto \ - -D module_dir="%{_libdir}/xorg/modules" \ - -D pciaccess=true \ - -D screensaver=true \ - -D secure-rpc=false \ - -D sha1=libcrypto \ - -D suid_wrapper=true \ - -D systemd_logind=true \ - -D udev_kms=true \ - -D udev=true \ - -D vgahw=true \ - -D xace=true \ - -D xcsecurity=true \ - -D xdm-auth-1=true \ - -D xdmcp=true \ - -D xephyr=true \ - -D xf86bigfont=false \ - -D xf86-input-inputtest=true \ - -D xinerama=true \ - -D xkb_output_dir="%{_localstatedir}/lib/xkb" \ - -D xnest=true \ - -D xorg=true \ - -D xpbproxy=false \ - -D xquartz=false \ - -D xres=true \ - -D xselinux=true \ - -D xvfb=true \ - -D xvmc=true \ - -D xv=true \ - -D xwin=false +%endif + +%build + +%global default_font_path "catalogue:/etc/X11/fontpath.d,built-ins" + +%if %{with_hw_servers} +%global dri_flags --enable-dri --enable-dri2 %{?!rhel:--enable-dri3} --enable-suid-wrapper --enable-glamor +%else +%global dri_flags --disable-dri --disable-dri2 +%endif + +%if 0%{?fedora} > 24 || 0%{?rhel} > 7 +%global bodhi_flags --with-vendor-name="Fedora Project" +%global wayland --enable-xwayland +%endif + +# ick +%if 0%{?fedora} < 20 || 0%{?rhel} <= 7 +sed -i 's/WAYLAND_SCANNER_RULES.*//g' configure.ac +%endif + +# --with-pie ? +autoreconf -f -v --install || exit 1 +# export CFLAGS="${RPM_OPT_FLAGS}" +# XXX without dtrace + +%configure %{xservers} \ + --enable-dependency-tracking \ + --disable-static \ + --with-pic \ + %{?no_int10} --with-int10=x86emu \ + --with-default-font-path=%{default_font_path} \ + --with-module-dir=%{moduledir} \ + --with-builderstring="Build ID: %{name} %{version}-%{release}" \ + --with-os-name="$(hostname -s) $(uname -r)" \ + --with-xkb-output=%{_localstatedir}/lib/xkb \ + --without-dtrace \ + --disable-linux-acpi --disable-linux-apm \ + --enable-xselinux --enable-record --enable-present \ + --enable-config-udev \ + --disable-unit-tests \ + --enable-dmx \ + %{?wayland} \ + %{dri_flags} %{?bodhi_flags} \ + ${CONFIGURE} + +make V=1 %{?_smp_mflags} -%meson_build %install -%meson_install +%make_install moduledir=%{moduledir} -install -D -m 0644 -p xkb/README.compiled %{buildroot}%{_localstatedir}/lib/xkb/README.compiled -install -D -m 0644 %{SOURCE10} %{buildroot}%{_sysconfdir}/pam.d/xserver +%if %{with_hw_servers} +rm -rf $RPM_BUILD_ROOT%{_libdir}/xorg/modules/multimedia/ +mkdir -p $RPM_BUILD_ROOT%{_libdir}/xorg/modules/{drivers,input} + +mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/pam.d +install -m 644 %{SOURCE10} $RPM_BUILD_ROOT%{_sysconfdir}/pam.d/xserver + +mkdir -p $RPM_BUILD_ROOT%{_datadir}/X11/xorg.conf.d +install -m 644 %{SOURCE4} $RPM_BUILD_ROOT%{_datadir}/X11/xorg.conf.d # make sure the (empty) /etc/X11/xorg.conf.d is there, system-setup-keyboard # relies on it more or less. -mkdir -p %{buildroot}%{_sysconfdir}/X11/xorg.conf.d +mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/X11/xorg.conf.d -install -D -m 0755 %{SOURCE30} %{buildroot}%{_bindir}/xserver-sdk-abi-requires -install -D -m 0755 %{SOURCE20} %{buildroot}%{_bindir}/xvfb-run +mkdir -p $RPM_BUILD_ROOT%{_bindir} + +%if %{stable_abi} +install -m 755 %{SOURCE30} $RPM_BUILD_ROOT%{_bindir}/xserver-sdk-abi-requires +%else +sed -e s/@MAJOR@/%{gitdate}/g -e s/@MINOR@/%{minor_serial}/g %{SOURCE31} > \ + $RPM_BUILD_ROOT%{_bindir}/xserver-sdk-abi-requires +chmod 755 $RPM_BUILD_ROOT%{_bindir}/xserver-sdk-abi-requires +%endif + +%endif # Make the source package %global xserver_source_dir %{_datadir}/xorg-x11-server-source %global inst_srcdir %{buildroot}/%{xserver_source_dir} - mkdir -p %{inst_srcdir}/{Xext,xkb,GL,hw/{xquartz/bundle,xfree86/common}} mkdir -p %{inst_srcdir}/{hw/dmx/doc,man,doc,hw/dmx/doxygen} cp {,%{inst_srcdir}/}hw/xquartz/bundle/cpprules.in cp {,%{inst_srcdir}/}man/Xserver.man cp {,%{inst_srcdir}/}doc/smartsched -#cp {,%{inst_srcdir}/}hw/dmx/doxygen/doxygen.conf.in +cp {,%{inst_srcdir}/}hw/dmx/doxygen/doxygen.conf.in cp {,%{inst_srcdir}/}xserver.ent.in cp {,%{inst_srcdir}/}hw/xfree86/Xorg.sh.in cp xkb/README.compiled %{inst_srcdir}/xkb cp hw/xfree86/xorgconf.cpp %{inst_srcdir}/hw/xfree86 -find . -type f -not -path "./%{_vpath_builddir}/*" | egrep '.*\.(c|h|am|ac|inc|m4|h.in|pc.in|man.pre|pl|txt)$' | +install -m 0755 %{SOURCE20} $RPM_BUILD_ROOT%{_bindir}/xvfb-run + +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 # Remove unwanted files/dirs -find %{buildroot} -type f -name '*.la' -delete +{ + rm -f $RPM_BUILD_ROOT%{_libdir}/X11/Options + rm -f $RPM_BUILD_ROOT%{_bindir}/in? + rm -f $RPM_BUILD_ROOT%{_bindir}/ioport + rm -f $RPM_BUILD_ROOT%{_bindir}/out? + rm -f $RPM_BUILD_ROOT%{_bindir}/pcitweak + rm -f $RPM_BUILD_ROOT%{_mandir}/man1/pcitweak.1* + find $RPM_BUILD_ROOT -type f -name '*.la' | xargs rm -f -- || : +%if !%{with_hw_servers} + rm -f $RPM_BUILD_ROOT%{_libdir}/pkgconfig/xorg-server.pc + rm -f $RPM_BUILD_ROOT%{_datadir}/aclocal/xorg-server.m4 + rm -rf $RPM_BUILD_ROOT%{_defaultdocdir}/xorg-server +%endif +# wtf +%ifnarch %{ix86} x86_64 + rm -f $RPM_BUILD_ROOT%{_libdir}/xorg/modules/lib{int10,vbe}.so +%endif +} %files common @@ -350,15 +530,22 @@ find %{buildroot} -type f -name '*.la' -delete %dir %{_localstatedir}/lib/xkb %{_localstatedir}/lib/xkb/README.compiled +%if 1 +%global Xorgperms %attr(4755, root, root) +%else +# disable until module loading is audited +%global Xorgperms %attr(0711,root,root) %caps(cap_sys_admin,cap_sys_rawio,cap_dac_override=pe) +%endif + +%if %{with_hw_servers} %files Xorg %config %attr(0644,root,root) %{_sysconfdir}/pam.d/xserver -%{_bindir}/gtf %{_bindir}/X %{_bindir}/Xorg %{_libexecdir}/Xorg -# Disable until module loading is audited -# %attr(0711,root,root) %caps(cap_sys_admin,cap_sys_rawio,cap_dac_override=pe) -%attr(4755, root, root) %{_libexecdir}/Xorg.wrap +%{Xorgperms} %{_libexecdir}/Xorg.wrap +%{_bindir}/cvt +%{_bindir}/gtf %dir %{_libdir}/xorg %dir %{_libdir}/xorg/modules %dir %{_libdir}/xorg/modules/drivers @@ -366,33 +553,56 @@ find %{buildroot} -type f -name '*.la' -delete %dir %{_libdir}/xorg/modules/extensions %{_libdir}/xorg/modules/extensions/libglx.so %dir %{_libdir}/xorg/modules/input -%{_libdir}/xorg/modules/input/inputtest_drv.so -%{_libdir}/xorg/modules/libexa.so %{_libdir}/xorg/modules/libfbdevhw.so -#%%{_libdir}/xorg/modules/libfb.so +%{_libdir}/xorg/modules/libexa.so +%{_libdir}/xorg/modules/libfb.so %{_libdir}/xorg/modules/libglamoregl.so %{_libdir}/xorg/modules/libshadow.so %{_libdir}/xorg/modules/libshadowfb.so %{_libdir}/xorg/modules/libvgahw.so %{_libdir}/xorg/modules/libwfb.so +%ifarch %{ix86} x86_64 +%{_libdir}/xorg/modules/libint10.so +%{_libdir}/xorg/modules/libvbe.so +%endif %{_mandir}/man1/gtf.1* %{_mandir}/man1/Xorg.1* %{_mandir}/man1/Xorg.wrap.1* -%{_mandir}/man4/exa.4* +%{_mandir}/man1/cvt.1* %{_mandir}/man4/fbdevhw.4* -%{_mandir}/man4/inputtestdrv.4* +%{_mandir}/man4/exa.4* %{_mandir}/man4/modesetting.4* +%{_mandir}/man5/Xwrapper.config.5* %{_mandir}/man5/xorg.conf.5* %{_mandir}/man5/xorg.conf.d.5* -%{_mandir}/man5/Xwrapper.config.5* %dir %{_sysconfdir}/X11/xorg.conf.d %dir %{_datadir}/X11/xorg.conf.d %{_datadir}/X11/xorg.conf.d/10-quirks.conf +%endif + %files Xnest %{_bindir}/Xnest %{_mandir}/man1/Xnest.1* +%files Xdmx +%{_bindir}/Xdmx +%{_bindir}/dmxaddinput +%{_bindir}/dmxaddscreen +%{_bindir}/dmxreconfig +%{_bindir}/dmxresize +%{_bindir}/dmxrminput +%{_bindir}/dmxrmscreen +%{_bindir}/dmxtodmx +%{_bindir}/dmxwininfo +%{_bindir}/vdltodmx +%{_bindir}/dmxinfo +%{_bindir}/xdmxconfig +%{_mandir}/man1/Xdmx.1* +%{_mandir}/man1/dmxtodmx.1* +%{_mandir}/man1/vdltodmx.1* +%{_mandir}/man1/xdmxconfig.1* + %files Xvfb %{_bindir}/Xvfb %{_bindir}/xvfb-run @@ -402,211 +612,534 @@ find %{buildroot} -type f -name '*.la' -delete %{_bindir}/Xephyr %{_mandir}/man1/Xephyr.1* +%files Xwayland +%{_bindir}/Xwayland + +%if %{with_hw_servers} %files devel %doc COPYING +#{_docdir}/xorg-server %{_bindir}/xserver-sdk-abi-requires %{_libdir}/pkgconfig/xorg-server.pc %dir %{_includedir}/xorg -%{_includedir}/xorg/*.h +%{sdkdir}/*.h %{_datadir}/aclocal/xorg-server.m4 +%endif %files source %{xserver_source_dir} %changelog -* Tue Nov 25 2025 Olivier Fourdan - 21.1.21-1 -- Update to xserver 21.1.21 (#2417000) +* Thu Apr 12 2018 Olivier Fourdan - 1.19.6-7 +- Re-fix "use type instead of which in xvfb-run (rhbz#1443357)" which + was overridden inadvertently -* Tue Oct 28 2025 Olivier Fourdan - 21.1.20-1 -- Update to xserver 21.1.20 (#2406803) -- CVE fix for: CVE-2025-62229, CVE-2025-62230, CVE-2025-62231 +* Thu Apr 05 2018 Michael Cronenworth - 1.19.6-6 +- Patch for adding default modes for 16:9 and 16:10 resolutions (rhbz#1339930) -* Fri Jul 25 2025 Fedora Release Engineering - 21.1.18-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild +* Tue Feb 13 2018 Olivier Fourdan 1.19.6-5 +- xwayland: avoid race condition on new keymap +- xwayland: Keep separate variables for pointer and tablet foci (rhbz#1519961) +- xvfb-run now support command line option “--auto-display” -* Wed Jul 09 2025 Peter Hutterer -- Update Xvfb SPDX license identifier +* Fri Feb 09 2018 Fedora Release Engineering - 1.19.6-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild -* Wed Jun 18 2025 Olivier Fourdan - 21.1.18-1 -- Update to xserver 21.1.18 -- Contains an additional fix for CVE-2025-49176 +* Tue Jan 30 2018 Olivier Fourdan 1.19.6-3 +- Avoid generating a core file when the Wayland compositor is gone. -* Tue Jun 17 2025 Olivier Fourdan - 21.1.17-1 -- Update to xserver 21.1.17 -- CVE fix for: CVE-2025-49175, CVE-2025-49176, CVE-2025-49177 - CVE-2025-49178, CVE-2025-49179, CVE-2025-49180 +* Thu Jan 11 2018 Peter Hutterer 1.19.6-2 +- Fix handling of devices with ID_INPUT=null -* Wed Feb 26 2025 Olivier Fourdan - 21.1.16-1 -- Update to xserver 21.1.16 (#2347558) -- CVE fix for: CVE-2025-26594, CVE-2025-26595, CVE-2025-26596, CVE-2025-26597, - CVE-2025-26598, CVE-2025-26599, CVE-2025-26600, CVE-2025-26601 +* Wed Dec 20 2017 Adam Jackson - 1.19.6-1 +- xserver 1.19.6 -* Tue Feb 25 2025 Olivier Fourdan - 21.1.15-3 -- Fix DRI2 failure (#2347345) +* Thu Oct 12 2017 Adam Jackson - 1.19.5-1 +- xserver 1.19.5 -* Sun Jan 19 2025 Fedora Release Engineering - 21.1.15-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild +* Thu Oct 05 2017 Olivier Fourdan - 1.19.4-1 +- xserver-1.19.4 +- Backport tablet support for Xwayland -* Fri Dec 20 2024 José Expósito - 21.1.15-1 -- Update to v21.1.15 +* Fri Sep 08 2017 Troy Dawson - 1.19.3-9 +- Cleanup spec file conditionals -* Fri Nov 29 2024 Sérgio Basto - 21.1.14-3 -- Revert commit "Fix error copying Xorg.wrap", debugedit-5.1-2 have the real fix +* Thu Aug 03 2017 Fedora Release Engineering - 1.19.3-8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild -* Mon Nov 18 2024 José Expósito - 21.1.14-2 -- Fix build issues caused by Xorg.wrap -- Restore quirks for Apple silicon - Fixes: 422064e45a42 ("Update X11-server to 21.1.13 and ABI numbers of videodrv and xinput") - Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2326701 +* Thu Jul 27 2017 Fedora Release Engineering - 1.19.3-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild -* Tue Oct 29 2024 José Expósito - 21.1.14-1 -- Update to v21.1.14 +* Sun Jul 2 2017 Ville Skyttä - 1.19.3-6 +- Use type instead of which in xvfb-run (rhbz#1443357) -* Wed Oct 16 2024 Peter Robinson -- Obsolete xorg-x11-drv-armsoc +* Thu May 04 2017 Orion Poplawski - 1.19.3-5 +- Enable full build for s390/x -* Mon Sep 30 2024 Simone Caronni - 21.1.13-5 -- After removal of int10/vbe, obsolete vesa and fbdev X drivers: - https://fedoraproject.org/wiki/Changes/ReplaceFbdevDrivers +* Mon Apr 24 2017 Ben Skeggs - 1.19.3-4 +- Default to xf86-video-modesetting on GeForce 8 and newer -* Sat Sep 28 2024 Simone Caronni - 21.1.13-4 -- Remove all conditionals. Drop int10 everywhere and enable libunwind/dri3 on - ELN. +* Fri Apr 07 2017 Adam Jackson - 1.19.3-3 +- Inoculate against a versioning bug with libdrm 2.4.78 -* Fri Sep 27 2024 Simone Caronni - 21.1.13-3 -- Switch to meson, drop no longer required patch. -- Drop Obsoletes/Provides that have been removed in ~2014. -- Add build depdendencies as they are searched by meson. -- Format SPEC file. +* Thu Mar 23 2017 Hans de Goede - 1.19.3-2 +- Use va_gl as vdpau driver on i965 GPUs (rhbz#1413733) -* Thu Sep 26 2024 Simone Caronni - 21.1.13-2 -- Drop support for building snapshots. If they need to be built, there are - anyway more simpler ways. -- Trim changelog. -- Drop custom compileri/linker flags that are part of the standard already. +* Wed Mar 15 2017 Adam Jackson - 1.19.3-1 +- xserver 1.19.3 -* Mon Sep 02 2024 Sérgio Basto - 21.1.13-1 -- Update X11-server to 21.1.13 and ABI numbers of videodrv and xinput -- DMX DDX was dropped -- 0001-Disallow-byte-swapped-clients-by-default.patch is upstreamed -- 0001-autobind-GPUs-to-the-screen.patch is upstreamed -- 0001-xf86-dri2-Use-va_gl-as-vdpau_driver-for-Intel-i965-G.patch updated +* Thu Mar 02 2017 Adam Jackson - 1.19.2-1 +- xserver 1.19.2 -* Sat Jul 20 2024 Fedora Release Engineering - 1.20.14-37 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild +* Sat Feb 11 2017 Fedora Release Engineering - 1.19.1-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild -* Wed Apr 10 2024 José Expósito - 1.20.14-35 -- Backport fix for invalid Unicode sequence +* Wed Feb 01 2017 Peter Hutterer 1.19.1-3 +- Fix a few input thread lock issues causing intel crashes (#1384486) -* Wed Apr 10 2024 José Expósito - 1.20.14-35 -- Fix regression caused by the fix for CVE-2024-31083 +* Mon Jan 16 2017 Adam Jackson - 1.19.1-2 +- Limit the intel driver only on F26 and up -* Wed Apr 03 2024 José Expósito - 1.20.14-34 -- CVE fix for: CVE-2024-31080, CVE-2024-31081, CVE-2024-31082 and - CVE-2024-31083 +* Wed Jan 11 2017 Adam Jackson - 1.19.1-1 +- xserver 1.19.1 -* Mon Mar 04 2024 José Expósito - 1.20.14-33 -- Add util-linux as a dependency of Xvfb +* Tue Jan 10 2017 Hans de Goede - 1.19.0-4 +- Follow Debian and only default to the intel ddx on gen4 or older intel GPUs -* Sat Jan 27 2024 Fedora Release Engineering - 1.20.14-32 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild +* Tue Dec 20 2016 Hans de Goede - 1.19.0-3 +- Add one more patch for better integration with the nvidia binary driver -* Fri Jan 19 2024 José Expósito - 1.20.14-31 -- Fix compilation error on i686 +* Thu Dec 15 2016 Hans de Goede - 1.19.0-2 +- Add some patches for better integration with the nvidia binary driver +- Add a patch from upstream fixing a crash (rhbz#1389886) -* Fri Jan 19 2024 José Expósito - 1.20.14-30 -- Fix use after free related to CVE-2024-21886 +* Wed Nov 23 2016 Olivier Fourdan 1.19.0-1 +- xserver 1.19.0 +- Fix use after free of cursors in Xwayland (rhbz#1385258) +- Fix an issue where some monitors would show only black, or + partially black when secondary GPU outputs are used -* Tue Jan 16 2024 José Expósito - 1.20.14-29 -- CVE fix for: CVE-2023-6816, CVE-2024-0229, CVE-2024-21885, CVE-2024-21886, - CVE-2024-0408 and CVE-2024-0409 +* Tue Nov 15 2016 Peter Hutterer 1.19.0-0.8.rc2 +- Update device barriers for new master devices (#1384432) -* Wed Dec 13 2023 Peter Hutterer - 1.20.14-28 -- CVE fix for: CVE-2023-6377, CVE-2023-6478 +* Thu Nov 3 2016 Hans de Goede - 1.19.0-0.7.rc2 +- Update to 1.19.0-rc2 +- Fix (hopefully) various crashes in FlushAllOutput() (rhbz#1382444) +- Fix Xwayland crashing in glamor on non glamor capable hw (rhbz#1390018) -* Fri Nov 10 2023 Peter Hutterer - 1.20.14-27 -- Update with full SPDX license list +* Tue Nov 1 2016 Ben Crocker - 1.19.0-0.6.20161028 +- Fix Config record allocation during startup: if xorg.conf.d directory +- was absent, a segfault resulted. -* Wed Oct 25 2023 Peter Hutterer - 1.20.14-26 -- CVE fix for: CVE-2023-5367, CVE-2023-5380 +* Mon Oct 31 2016 Adam Jackson - 1.19.0-0.5.20161026 +- Use %%autopatch instead of doing our own custom git-am trick -* Fri Oct 20 2023 José Expósito -- SPDX migration: license is already SPDX compatible +* Fri Oct 28 2016 Hans de Goede - 1.19.0-0.4.20161026 +- Add missing Requires: libXfont2-devel to -devel sub-package (rhbz#1389711) -* Fri Sep 29 2023 Orion Poplawski - 1.20.14-25 -- Fix xvfb-run --error-file / auth-file options +* Wed Oct 26 2016 Hans de Goede - 1.19.0-0.3.20161026 +- Sync with upstream git, bringing in a bunch if bug-fixes +- Add some extra fixes which are pending upstream +- This also adds PointerWarping emulation to Xwayland, which should improve + compatiblity with many games -* Sat Jul 22 2023 Fedora Release Engineering - 1.20.14-24 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild +* Wed Oct 5 2016 Hans de Goede - 1.19.0-0.2.20160929 +- Add a fix from upstream to fix xterm crash under Xwayland (fdo#97974) +- Add a fix from upstream to fix glamor / xwayland not working with glvnd +- Add a fix from upstream to fix input devices no longer working + after a vt-switch -* Tue Apr 25 2023 Olivier Fourdan - 1.20.14-23 -- Backport fix for a deadlock with DRI3 (#2189434) +* Thu Sep 29 2016 Hans de Goede - 1.19.0-0.1.20160929 +- Rebase to current git master (1.19-rc1+) +- Drop Obsoletes for the driver packages removed from F21 (its been 2 + years since they have been removed now) -* Thu Apr 13 2023 Florian Weimer - 1.20.14-22 -- Make more functions available in fb.h with !FB_ACCESS_WRAPPER +* Thu Sep 08 2016 Adam Jackson 1.18.4-6 +- Backport GLX_EXT_libglvnd support from 1.19 -* Wed Mar 29 2023 Olivier Fourdan - 1.20.14-21 -- CVE fix for: CVE-2023-1393 +* Thu Sep 01 2016 Peter Hutterer 1.18.4-5 +- Fall back to libinput if the module is missing -* Thu Feb 23 2023 Olivier Fourdan - 1.20.14-20 -- Fix xvfb-run script with --listen-tcp +* Thu Aug 25 2016 Hans de Goede - 1.18.4-4 +- Fix (undo) server ABI breakage from 1.18.4-3 -* Thu Feb 09 2023 Iker Pedrosa - 1.20.14-19 -- Remove pam_console from service file (#1822209) +* Thu Aug 25 2016 Hans de Goede - 1.18.4-3 +- Various switchable-graphics / prime fixes from upstream, mostly + related to using the modesetting driver in prime setups +- Fix Xorg -configure not working (rhbz#1368502) -* Thu Feb 02 2023 Peter Hutterer - 1.20.14-18 -- CVE-2023-0494: potential use-after-free +* Fri Aug 19 2016 Kalev Lember - 1.18.4-2 +- Backport a number of XWayland fixes from master -* Wed Feb 01 2023 Peter Hutterer - 1.20.14-17 -- Updated conditional fedora statement +* Tue Jul 19 2016 Adam Jackson - 1.18.4-1 +- xserver 1.18.4 -* Tue Jan 17 2023 Olivier Fourdan - 1.20.14-16 -- Use the recommended way to apply conditional patches without - conditionalizing the sources (for byte-swapped clients). +* Mon Jul 04 2016 Olivier Fourdan 1.18.3-8 +- Fix segfault in Xwayland due to cursor update after unrealize (#1338979) -* Fri Jan 13 2023 Leif Liddy 1.20.14-15 -- Xorg server does not correctly select the DCP for the display - without a quirk on Apple silicon machines (#2152414) +* Tue Jun 28 2016 Peter Hutterer 1.18.3-7 +- Fix segfault caused by forced indicator update (#1335439) -* Fri Jan 13 2023 Peter Hutterer - 1.20.14-14 -- Disallow byte-swapped clients (#2159489) +* Fri Jun 17 2016 Hans de Goede - 1.18.3-6 +- Add switchable-graphics / prime fixes from f24 branch +- Add some more switchable-graphics / prime fixes from upstream -* Wed Jan 11 2023 Olivier Fourdan - 1.20.14-13 -- Rename boolean config value field from bool to boolean to fix drivers - build failures due to a conflict with C++ and stdbool.h +* Mon Jun 13 2016 Adam Jackson - 1.18.3-5 +- Restore DRI1 for now -* Mon Dec 19 2022 Peter Hutterer - 1.20.14-12 -- Fix buggy patch to CVE-2022-46340 +* Mon May 09 2016 Adam Jackson - 1.18.3-4 +- Move a symbol from DRI1 to DRI2 code to fix ati/openchrome -* Wed Dec 14 2022 Peter Hutterer 1.20.14-11 -- CVE fix for: CVE-2022-4283, CVE-2022-46340, CVE-2022-46341, - CVE-2022-46342, CVE-2022-46343, CVE-2022-46344 +* Thu May 05 2016 Peter Hutterer 1.18.3-3 +- Fix NumLock indicator light turning off after layout change (#1047151) -* Wed Nov 23 2022 Peter Hutterer - 1.20.14-10 -- Drop dependency on xorg-x11-font-utils, it was only there for on - build-time variable that's always the same value anyway (#2145088) +* Thu Apr 14 2016 Adam Jackson - 1.18.3-2 +- Stop building DRI1 support +- Don't build DRI2 on s390{,x} -* Tue Nov 8 2022 Olivier Fourdan - 1.20.14-9 -- Fix CVE-2022-3550, CVE-2022-3551 +* Mon Apr 04 2016 Adam Jackson 1.18.3-1 +- xserver 1.18.3 -* Sat Jul 23 2022 Fedora Release Engineering - 1.20.14-8 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild +* Thu Mar 17 2016 Adam Jackson 1.18.2-2 +- Fix red tint artifacts in glamor +- Fix a performance cliff in present triggered by plasma +- Silence some xf86vidmode log spam -* Tue Jul 12 2022 Olivier Fourdan - 1.20.14-7 -- Fix CVE-2022-2319/ZDI-CAN-16062, CVE-2022-2320/ZDI-CAN-16070 +* Fri Mar 11 2016 Adam Jackson 1.18.2-1 +- xserver 1.18.2 -* Wed Apr 13 2022 Dominik Mierzejewski - 1.20.14-6 -- Don't hardcode fps for fake screen (#2054188) +* Wed Mar 09 2016 Peter Hutterer 1.18.1-3 +- Stop bug warnings on three-finger pinch gestures (#1282252) -* Fri Apr 8 2022 Jocelyn Falempe - 1.20.14-5 -- Fix basic graphic mode not working with simpledrm (#2067151) +* Mon Feb 15 2016 Dave Airlie 1.18.1-2 +- fix issues with reverse prime and present. -* Fri Jan 28 2022 Olivier Fourdan - 1.20.14-4 -- Fix build with GCC 12 (#2047134) +* Mon Feb 08 2016 Adam Jackson 1.18.1-1 +- xserver 1.18.1 -* Tue Jan 25 2022 Olivier Fourdan - 1.20.14-3 -- Fix crash with NVIDIA proprietary driver with Present (#2046147) +* Fri Feb 05 2016 Fedora Release Engineering - 1.18.0-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild -* Sat Jan 22 2022 Fedora Release Engineering - 1.20.14-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild +* Mon Nov 16 2015 Hans de Goede - 1.18.0-2 +- Fix Xorg.wrap kms detection to so that the server does not always run + as root + +* Mon Nov 09 2015 Adam Jackson 1.18.0-1 +- xserver 1.18.0 + +* Tue Oct 27 2015 Dave Airlie 1.18.0-0.6 +- update to git snapshot of 1.7.99.902 (1.18.0 rc2) + +* Wed Oct 14 2015 Hans de Goede - 1.18.0-0.5 +- Fix xorg sometimes crashing on machine poweroff/shutdown (#1269210) + +* Thu Sep 24 2015 Rex Dieter 1.18.0-0.4 +- pull in candidate fix for clients getting stuck waiting indefinitely + for an idle event when a CRTC is turned off (#1256082,#1258084) + +* Tue Sep 22 2015 Dave Airlie 1.18.0-0.3 +- hack to fix GLX_MESA_copy_sub_buffer regression (#1265395) + +* Mon Sep 07 2015 Dave Airlie 1.18.0-0.2 +- update to git snapshot of 1.7.99 (1.18.0 rc1) + +* Wed Jul 29 2015 Dave Airlie 1.18.0-0.1 +- git snapshot of what will be 1.18.0 (should be ABI stable) + +* Wed Jul 15 2015 Dave Airlie 1.17.2-2 +- fix bug with glamor and PRIME where server would crash + +* Tue Jun 16 2015 Adam Jackson 1.17.2-1 +- xserver 1.17.2 + +* Tue Jun 16 2015 Dave Airlie 1.17.1-16 +- fix bug with glamor and overlapping copies + +* Wed Jun 10 2015 Ray Strode 1.17.1-15 +- CVE-2015-3164 + +* Tue May 26 2015 Peter Hutterer 1.17.1-14 +- Add the unaccelerated valuator masks, fixes nonmoving mouse in SDL + (#1208992) + +* Wed May 20 2015 Kalev Lember - 1.17.1-13 +- Obsolete xorg-x11-drv-void + +* Tue May 19 2015 Hans de Goede - 1.17.1-12 +- Fix "start -- vt7" not working fix breaking headless setups (#1203780) + +* Sat May 02 2015 Adel Gadllah - 1.17.1-11 +- modesetting: Fix software cursor fallback (#1205725) + +* Thu Apr 30 2015 Hans de Goede - 1.17.1-10 +- Fix "start -- vt7" not working (#1203780) + +* Sat Apr 11 2015 Ray Strode 1.17.1-9 +- Handle logind timeouts more gracefuly. +- Bump timeouts so they don't happen in practice + Fixes X on some old optimus and other hybrid hardware + Related: #1209347 + +* Thu Apr 09 2015 Adam Jackson 1.17.1-8 +- Fix endian detection code (#1206060) + +* Wed Mar 18 2015 Hans de Goede - 1.17.1-7 +- Modify the server wrapper to not always start the server as root. + Callers of the server which start it in a way which is compatible with the + server running without root rights can now set a XORG_RUN_AS_USER_OK env + variable and then the wrapper will behave as if needs_root_rights = auto + is specified, unless overriden from Xwrapper.config + +* Wed Mar 04 2015 Adam Jackson 1.17.1-6 +- Fix int10 interrupt vector setup + +* Mon Mar 02 2015 Dave Airlie 1.17.1-5 +- omg, define something to 0 makes it work, security. + +* Mon Mar 02 2015 Dave Airlie 1.17.1-4 +- require lazy relocations to work, remove cement + +* Sat Feb 21 2015 Till Maas - 1.17.1-3 +- Rebuilt for Fedora 23 Change + https://fedoraproject.org/wiki/Changes/Harden_all_packages_with_position-independent_code + +* Tue Feb 17 2015 Dave Airlie 1.17.1-2 +- fix regression in SI:localuser handling + +* Wed Feb 11 2015 Hans de Goede - 1.17.1-1 +- New upstream release 1.17.1 (rhbz#1144404) +- xorg-x11-drv-modesetting is now included in xorg-x11-server-Xorg, + obsolete it +- Fix xorg-x11-drv-r128 obsoletes (rhbz#1176791) + +* Fri Feb 06 2015 Peter Hutterer 1.16.2.901-3 +- CVE-2015-0255: unchecked XKB string lengths + +* Thu Feb 05 2015 Ray Strode 1.16.2.901-2 +- Add patch from ickle to fix flicker on login / durin vt switch + see https://bugzilla.gnome.org/show_bug.cgi?id=737226 + +* Wed Dec 10 2014 Dave Airlie 1.16.2.901-1 +- upstream security release. 1.16.2.901 + +* Fri Nov 21 2014 Dave Airlie 1.16.2-1 +- New upstream bugfix release 1.16.2 + +* Fri Nov 21 2014 Dave Airlie 1.16.1-2 +- backport glamor DRI3 sync integration from upstream + +* Fri Oct 3 2014 Hans de Goede - 1.16.1-1 +- New upstream bugfix release 1.16.1 (rhbz#1144404) + +* Thu Sep 11 2014 Adam Jackson 1.16.0-10 +- Only send GLX_BufferSwapComplete for PresentCompleteKindPixmap + +* Wed Sep 10 2014 Hans de Goede - 1.16.0-9 +- Fixup Xwayland summary, remove . at end of summaries (rhbz#1140225) + +* Tue Sep 09 2014 Kalev Lember - 1.16.0-8 +- Update the versions of obsoletes for dropped drivers + +* Tue Sep 2 2014 Hans de Goede - 1.16.0-7 +- Drop Fedora specific xorg-non-pci.patch, replace with solution from + upstream + +* Thu Aug 28 2014 Hans de Goede - 1.16.0-6 +- drop no longer valid configure arguments (rhbz#1133350) + +* Mon Aug 25 2014 Peter Robinson 1.16.0-5 +- re-add support for non pci platform devices + +* Mon Aug 18 2014 Fedora Release Engineering - 1.16.0-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild + +* Fri Aug 8 2014 Hans de Goede - 1.16.0-3 +- Really fix conditionals to allow building on F-20 (rhbz#1127351) + +* Thu Aug 7 2014 Hans de Goede - 1.16.0-2 +- Fix xwayland conditionals to allow building on F-20 (rhbz#1127351) + +* Mon Jul 28 2014 Hans de Goede - 1.16.0-1 +- Update to 1.16.0 + +* Thu Jul 17 2014 Adam Jackson 1.15.99.904-4 +- Add Obsoletes for video drivers dropped in F21+ + +* Fri Jul 11 2014 Hans de Goede - 1.15.99.904-3 +- Fix startx crash introduced by 1.15.99.904 (rhbz#1118540) + +* Fri Jul 11 2014 Peter Hutterer 1.15.99.904-2 +- Don't force the screensaver off on DPMS unblank + +* Tue Jul 8 2014 Hans de Goede - 1.15.99.904-1 +- Update to 1.15.99.904 + +* Wed Jul 2 2014 Hans de Goede - 1.15.99.903-5 +- Fix code including glamor.h not compiling due to strndup re-definition + +* Wed Jul 02 2014 Adam Jackson 1.15.99.903-4 +- Snap xwayland damage reports to the bounding box + +* Wed Jul 2 2014 Hans de Goede - 1.15.99.903-3 +- Fix xvfb crash on client disconnect (rhbz#1113128) + +* Thu Jun 19 2014 Dennis Gilmore - 1.15.99.903-2 +- add support for non pci platform devices + +* Wed Jun 11 2014 Hans de Goede - 1.15.99.903-1 +- Update to 1.15.99.903 +- This bumps the videodrv ABI once more, so all drivers must be rebuild + +* Sun Jun 08 2014 Fedora Release Engineering - 1.15.99.902-8.20140428 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild + +* Wed May 21 2014 Adam Jackson 1.15.99.902-7 +- Don't try to build Xwayland in F20 +- Fix shadowfb initialization to, er, work + +* Wed May 14 2014 Peter Hutterer - 1.15.99.902-6.20140428 +- Revert button mapping for Evoluent Vertical mouse, the default mapping + matches the manufacturer's documentation (#612140) + +* Mon Apr 28 2014 Hans de Goede - 1.15.99.902-5.20140428 +- Add hw/xfree86/Xorg.sh.in to xorg-x11-server-source + +* Mon Apr 28 2014 Hans de Goede - 1.15.99.902-4.20140428 +- Git snapshot 20140428 +- This fixes the silent hardware cursor API break in 1.15.99.902 (#1090897) + +* Fri Apr 25 2014 Hans de Goede - 1.15.99.902-3 +- Add missing BuildRequires for dbus-devel, libepoxy-devel, mesa-libEGL-devel, + mesa-libgbm-devel and systemd-devel +- Fix compilation of int10 module on arm + +* Wed Apr 23 2014 Hans de Goede - 1.15.99.902-2 +- Add --enable-glamor to configure flags + +* Thu Apr 17 2014 Hans de Goede - 1.15.99.902-1 +- Update to 1.15.99.902 +- Drop the Xwayland as extension patch-set +- Add a new xorg-x11-server-Xwayland package with the new standalone Xwayland + server + +* Fri Feb 28 2014 Peter Hutterer 1.15.0-5 +- Search all parent devices for a PnPID. + +* Mon Feb 17 2014 Adam Williamson - 1.15.0-4 +- fix xwayland crash under mutter (RH #1065109 , BGO #724443) + +* Wed Feb 05 2014 Peter Hutterer 1.15.0-3 +- Prevent out-of-bounds access in check_butmap_change (#1061466) + +* Tue Jan 14 2014 Adam Jackson 1.15.0-2 +- exa-only-draw-valid-trapezoids.patch: Fix crash in exa. + +* Mon Jan 13 2014 Adam Jackson 1.15.0-1 +- xserver 1.15.0 + +* Tue Dec 17 2013 Adam Jackson 1.14.99.904-1 +- 1.15RC4 +- Re-disable int10 on arm + +* Mon Dec 2 2013 Peter Robinson 1.14.99.902-2 +- Add aarch64 to platforms that have libunwind + +* Wed Nov 20 2013 Adam Jackson 1.14.99.902-1 +- 1.15RC2 + +* Mon Nov 18 2013 Adam Jackson 1.14.99.901-6 +- Prefer fbdev to vesa, fixes fallback path on UEFI + +* Fri Nov 08 2013 Adam Jackson 1.14.99.901-5 +- Restore XkbCopyDeviceKeymap for (older) tigervnc + +* Fri Nov 08 2013 Adam Jackson 1.14.99.901-4 +- Explicitly enable DRI2 + +* Thu Nov 07 2013 Adam Jackson 1.14.99.901-3 +- Merge Xinerama+{Damage,Render,Composite} fix series + +* Thu Nov 07 2013 Adam Jackson 1.14.99.901-2 +- Fix build with --disable-present + +* Thu Nov 07 2013 Adam Jackson 1.14.99.901-1 +- 1.15RC1 + +* Mon Oct 28 2013 Adam Jackson 1.14.99.3-2 +- Don't build xwayland in RHEL + +* Fri Oct 25 2013 Adam Jackson 1.14.99.3-1 +- xserver 1.14.99.3 +- xwayland branch refresh +- Drop some F17-era Obsoletes +- Update BuildReqs to match reality + +* Wed Oct 23 2013 Peter Hutterer 1.14.3-6 +- Fix Xdmx cursor jumps (#1019821) + +* Tue Oct 08 2013 Adam Jackson 1.14.3-5 +- Snap wayland damage reports to the bounding box + +* Thu Oct 03 2013 Adam Jackson 1.14.3-4 +- Fix up fixing up the driver list after filtering out non-wayland + +* Wed Oct 02 2013 Adam Jackson 1.14.3-3 +- Only look at wayland-capable drivers when run with -wayland + +* Mon Sep 23 2013 Adam Jackson 1.14.3-2 +- xwayland support + +* Mon Sep 16 2013 Peter Hutterer 1.14.3-1 +- xserver 1.14.3 + +* Tue Jul 30 2013 Peter Hutterer 1.14.2-9 +- Fix active touch grabs, second touchpoint didn't get sent to client +- Fix version mismatch for XI 2.2+ clients (where a library supports > 2.2 + but another version than the originally requested one). + +* Tue Jul 30 2013 Dave Airlie 1.14.2-8 +- fixes for multi-monitor reverse optimus + +* Mon Jul 22 2013 Peter Hutterer 1.14.2-7 +- Fix erroneous valuator 1 coordinate when an absolute device in relative + mode doesn't send y coordinates. + +* Fri Jul 19 2013 Peter Hutterer 1.14.2-6 +- Add new version of the resolution-based scaling patch - scale y down + instead of x up. That gives almost the same behaviour as current + synaptics. Drop the synaptics quirk, this needs to be now removed from the + driver. + +* Mon Jul 15 2013 Peter Hutterer 1.14.2-5 +- Fix logspam when trying to free a non-existant grab. +- Update touch patch to upstream version (from fdo #66720) +- re-add xephyr resizable patch, got lost in rebase (#976995) + +* Fri Jul 12 2013 Dave Airlie 1.14.2-4 +- reapply dropped patch to fix regression (#981953) + +* Tue Jul 09 2013 Peter Hutterer 1.14.2-3 +- Fix crash on 32-bit with virtual box guest additions (#972095) + +* Tue Jul 09 2013 Peter Hutterer 1.14.2-2 +- Fix crash in gnome-shell when tapping a menu twice (fdo #66720) + +* Thu Jul 04 2013 Peter Hutterer 1.14.2-1 +- xorg-server 1.4.2 +- drop merged patches +- Add a quirk to set the synaptics resolution to 0 by default. The pre-scale + patch in the server clashes with synaptics inaccurate resolution numbers, + causing the touchpad movement to be stunted. + +* Thu Jun 06 2013 Peter Hutterer 1.14.1.901-2 +- Backport the touch grab race condition patches from fdo #56578 + +* Thu Jun 06 2013 Peter Hutterer 1.14.1.901-1 +- xserver 1.14.2RC1 + +* Tue Jun 04 2013 Peter Hutterer 1.14.1-4 +- Update quirks for trackballs and the La-VIEW Technology Naos 5000 mouse diff --git a/xserver-autobind-hotplug.patch b/xserver-autobind-hotplug.patch new file mode 100644 index 0000000..8025cbd --- /dev/null +++ b/xserver-autobind-hotplug.patch @@ -0,0 +1,302 @@ +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/xserver-sdk-abi-requires.git b/xserver-sdk-abi-requires.git new file mode 100755 index 0000000..c033061 --- /dev/null +++ b/xserver-sdk-abi-requires.git @@ -0,0 +1,14 @@ +#!/bin/sh +# +# The X server provides capabilities of the form: +# +# Provides: xserver-abi(ansic-0) = 4 +# +# for an ABI version of 0.4. The major number is encoded into the name so +# that major number changes force upgrades. If we didn't, then +# +# Requires: xserver-abi(ansic) >= 0.4 +# +# would also match 1.0, which is wrong since major numbers mean an ABI break. + +echo "xserver-abi($1-@MAJOR@) >= @MINOR@" diff --git a/xserver-sdk-abi-requires.release b/xserver-sdk-abi-requires.release new file mode 100755 index 0000000..30d77bf --- /dev/null +++ b/xserver-sdk-abi-requires.release @@ -0,0 +1,19 @@ +#!/bin/sh +# +# The X server provides capabilities of the form: +# +# Provides: xserver-abi(ansic-0) = 4 +# +# for an ABI version of 0.4. The major number is encoded into the name so +# that major number changes force upgrades. If we didn't, then +# +# Requires: xserver-abi(ansic) >= 0.4 +# +# would also match 1.0, which is wrong since major numbers mean an ABI break. + +ver=$(pkg-config --variable abi_$1 xorg-server) + +major=$(echo $ver | cut -f 1 -d .) +minor=$(echo $ver | cut -f 2 -d .) + +echo "xserver-abi($1-$major) >= $minor" diff --git a/xserver.pamd b/xserver.pamd index 9374ff6..bf79930 100644 --- a/xserver.pamd +++ b/xserver.pamd @@ -1,4 +1,5 @@ #%PAM-1.0 auth sufficient pam_rootok.so +auth required pam_console.so account required pam_permit.so session optional pam_keyinit.so force revoke diff --git a/xvfb-run.sh b/xvfb-run.sh index dec7dfc..b5cb02c 100644 --- a/xvfb-run.sh +++ b/xvfb-run.sh @@ -31,7 +31,7 @@ SERVERNUM=99 AUTHFILE= ERRORFILE=/dev/null STARTWAIT=3 -XVFBARGS="-screen 0 640x480x24" +XVFBARGS="-screen 0 640x480x8" LISTENTCP="-nolisten tcp" XAUTHPROTO=. @@ -101,7 +101,7 @@ find_free_servernum() { # Parse the command line. ARGS=$(getopt --options +ade:f:hn:lp:s:w: \ - --long auto-servernum,error-file:,auth-file:,help,server-num:,listen-tcp,xauth-protocol:,server-args:,wait: \ + --long auto-servernum,error-file:auth-file:,help,server-num:,listen-tcp,xauth-protocol:,server-args:,wait: \ --name "$PROGNAME" -- "$@") GETOPT_STATUS=$? @@ -120,7 +120,7 @@ while :; do -f|--auth-file) AUTHFILE="$2"; shift ;; -h|--help) SHOWHELP="yes" ;; -n|--server-num) SERVERNUM="$2"; shift ;; - -l|--listen-tcp) LISTENTCP="-listen tcp" ;; + -l|--listen-tcp) LISTENTCP="" ;; -p|--xauth-protocol) XAUTHPROTO="$2"; shift ;; -s|--server-args) XVFBARGS="$2"; shift ;; -w|--wait) STARTWAIT="$2"; shift ;;