Compare commits
125 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e356a592b7 | ||
|
|
115bb19734 | ||
|
|
ab69deda47 | ||
|
|
96c4fa6fb3 | ||
|
|
5d7ed4931e | ||
|
|
5b50181e4f | ||
|
|
dd5395436b | ||
|
|
572824c028 | ||
|
|
3e4c792ded | ||
|
|
928204fc39 | ||
|
|
e3a0a54473 | ||
|
|
cb5f4ca65c | ||
|
|
6b1c1806e3 | ||
|
|
28edf326d9 | ||
|
|
d53e48508b | ||
|
|
db932d9182 | ||
|
|
083eae6061 | ||
|
|
51ae8aa675 | ||
|
|
0bb198b86b | ||
|
|
b8c1f8e99c | ||
|
|
ddd6374980 | ||
|
|
73f289de65 | ||
|
|
00592f1f26 | ||
|
|
2cdddcc3e1 | ||
|
|
fefea377b3 | ||
|
|
72accf2c5a | ||
|
|
422064e45a | ||
|
|
aa17c8dba1 | ||
|
|
ef7d64c39f | ||
|
|
47092bca4f | ||
|
|
0ad871b912 | ||
|
|
43f6ceeda4 | ||
|
|
c88593e07d | ||
|
|
3982aab455 | ||
|
|
af32bd411c | ||
|
|
9df532a027 | ||
|
|
57dbbbe6c2 | ||
|
|
d887a5b989 | ||
|
|
d8ec1545f3 | ||
|
|
54e15127ae | ||
|
|
28a268e0aa | ||
|
|
fdd7c4bbd1 | ||
|
|
78721b7ea4 | ||
|
|
a3932dc93a | ||
|
|
c2b6cc043d | ||
|
|
21269fd4b7 | ||
|
|
31ea8b9649 | ||
|
|
7c9187a093 | ||
|
|
996eaa843f | ||
|
|
50af4f1fc6 | ||
|
|
743d53fc69 | ||
|
|
6c12217df8 |
||
|
|
e6bf129b81 | ||
|
|
140953a817 | ||
|
|
fc0c7be4e3 | ||
|
|
75e6f92d0f | ||
|
|
4e595ce4fd | ||
|
|
9fc1d98575 | ||
|
|
88dcddb59c | ||
|
|
98518b3d7a | ||
|
|
ba5ead2efb | ||
|
|
672ae9a577 | ||
|
|
4f6b52c6ec | ||
|
|
befd31b800 | ||
|
|
5125f50551 | ||
|
|
f08aeec29a | ||
|
|
a6fbe2c194 | ||
|
|
4818e48baf | ||
|
|
03bc044aa3 | ||
|
|
5f0a71dde2 | ||
|
|
b1458e4567 | ||
|
|
11999b2307 | ||
|
|
29f0985634 | ||
|
|
38a777ceb5 | ||
|
|
283d9cdb07 | ||
|
|
16f4e7facb | ||
|
|
79af8e61d7 | ||
|
|
eaf4422969 | ||
|
|
eb8a79641e | ||
|
|
e6480d9628 | ||
|
|
9d32eb45b5 | ||
|
|
efa2d863b7 | ||
|
|
97b803e415 | ||
|
|
1e468bc44a | ||
|
|
dafffedcc8 | ||
|
|
622718ea83 | ||
|
|
76e2fe61fd | ||
|
|
f1f3380dc7 | ||
|
|
3ae2631a52 | ||
|
|
7730e12c9e | ||
|
|
cf7f90e3c6 | ||
|
|
945c62ac33 | ||
|
|
5160bab94c | ||
|
|
84ed0d0988 | ||
|
|
9f7e9a83a5 | ||
|
|
9b1cb6ee15 | ||
|
|
c0df45f1ac | ||
|
|
324f637f1e | ||
|
|
d3c0c12b95 | ||
|
|
cac57f572a | ||
|
|
2a3298614e | ||
|
|
ad1a5b36a8 | ||
|
|
00ee1ad93f | ||
|
|
914938e968 | ||
|
|
e625aaaade | ||
|
|
d9ffe4889f | ||
|
|
71d71362b9 | ||
|
|
e38c5484bc | ||
|
|
60bd7d1fb5 | ||
|
|
f57420c8b5 | ||
|
|
72455413e3 | ||
|
|
b25ac7f75c | ||
|
|
a237e8dbd7 | ||
|
|
63ad72a19e | ||
|
|
228641ed26 | ||
|
|
a24c5faafd | ||
|
|
00b4ee574b | ||
|
|
8833777f42 | ||
|
|
f0e985518a | ||
|
|
117a24dd8f | ||
|
|
01bf953d1d | ||
|
|
58b85adf7f | ||
|
|
17fe3265bd | ||
|
|
3e9561ab1d | ||
|
|
120f876308 |
42 changed files with 445 additions and 5177 deletions
35
.gitignore
vendored
35
.gitignore
vendored
|
|
@ -1,36 +1,3 @@
|
|||
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
|
||||
/xorg-x11-server-1.15.0-1.fc21.src.rpm
|
||||
*.gz
|
||||
|
|
|
|||
|
|
@ -1,37 +0,0 @@
|
|||
From e96a83d9b1b5a52a41213c7a4840dc96b4f5b06f Mon Sep 17 00:00:00 2001
|
||||
From: Adam Jackson <ajax@redhat.com>
|
||||
Date: Wed, 15 Aug 2012 12:35:21 -0400
|
||||
Subject: [PATCH] Always install vbe and int10 sdk headers
|
||||
|
||||
Signed-off-by: Adam Jackson <ajax@redhat.com>
|
||||
---
|
||||
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
|
||||
|
||||
|
|
@ -1,33 +0,0 @@
|
|||
From a309323328d9d6e0bf5d9ea1d75920e53b9beef3 Mon Sep 17 00:00:00 2001
|
||||
From: Peter Hutterer <peter.hutterer@who-t.net>
|
||||
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 <ajax@redhat.com>
|
||||
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
||||
---
|
||||
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
|
||||
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
From 27043630ebb54fd1915c5d1814ab62079ca3eca9 Mon Sep 17 00:00:00 2001
|
||||
From acf5a0100c98a040e5e07a79ecf4a83627da770e Mon Sep 17 00:00:00 2001
|
||||
From: Hans de Goede <hdegoede@redhat.com>
|
||||
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 <hdegoede@redhat.com>
|
||||
---
|
||||
hw/xfree86/dri2/dri2.c | 36 +++++++++++++++++++----------
|
||||
hw/xfree86/dri2/pci_ids/pci_id_driver_map.h | 21 +++++++++--------
|
||||
2 files changed, 35 insertions(+), 22 deletions(-)
|
||||
hw/xfree86/dri2/dri2.c | 31 +++++++++++++--------
|
||||
hw/xfree86/dri2/pci_ids/pci_id_driver_map.h | 21 +++++++-------
|
||||
2 files changed, 31 insertions(+), 21 deletions(-)
|
||||
|
||||
diff --git a/hw/xfree86/dri2/dri2.c b/hw/xfree86/dri2/dri2.c
|
||||
index 2165603..d0366746 100644
|
||||
index 6619e3aa7..1f8ad14bc 100644
|
||||
--- a/hw/xfree86/dri2/dri2.c
|
||||
+++ b/hw/xfree86/dri2/dri2.c
|
||||
@@ -1437,14 +1437,19 @@ get_prime_id(void)
|
||||
@@ -1437,14 +1437,18 @@ get_prime_id(void)
|
||||
|
||||
#include "pci_ids/pci_id_driver_map.h"
|
||||
|
||||
|
|
@ -41,24 +41,18 @@ index 2165603..d0366746 100644
|
|||
+ const char **dri_driver_ret,
|
||||
+ const char **vdpau_driver_ret)
|
||||
{
|
||||
ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
|
||||
EntityInfoPtr pEnt = xf86GetEntityInfo(pScrn->entityList[0]);
|
||||
struct pci_device *pdev = NULL;
|
||||
#ifdef WITH_LIBDRM
|
||||
int i, j;
|
||||
- char *driver = NULL;
|
||||
drmDevicePtr dev;
|
||||
|
||||
+ *dri_driver_ret = NULL;
|
||||
+ *vdpau_driver_ret = NULL;
|
||||
+
|
||||
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) {
|
||||
/* 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)
|
||||
xf86DrvMsg(pScreen->myNum, X_ERROR,
|
||||
"[DRI2] Couldn't drmGetVersion() on non-PCI device, "
|
||||
"no driver name found.\n");
|
||||
|
|
@ -66,61 +60,61 @@ index 2165603..d0366746 100644
|
|||
+ return;
|
||||
}
|
||||
|
||||
- kernel_driver = strndup(version->name, version->name_len);
|
||||
- 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 kernel_driver;
|
||||
- return driver;
|
||||
+ return;
|
||||
}
|
||||
|
||||
for (i = 0; driver_map[i].driver; i++) {
|
||||
if (pdev->vendor_id != driver_map[i].vendor_id)
|
||||
@@ -1467,13 +1473,15 @@ dri2_probe_driver_name(ScreenPtr pScreen, DRI2InfoPtr info)
|
||||
continue;
|
||||
|
||||
- if (driver_map[i].num_chips_ids == -1)
|
||||
- return strdup(driver_map[i].driver);
|
||||
+ if (driver_map[i].num_chips_ids == -1) {
|
||||
if (driver_map[i].num_chips_ids == -1) {
|
||||
- driver = strdup(driver_map[i].driver);
|
||||
+ *dri_driver_ret = driver_map[i].driver;
|
||||
+ *vdpau_driver_ret = driver_map[i].vdpau_driver;
|
||||
+ return;
|
||||
+ }
|
||||
goto out;
|
||||
}
|
||||
|
||||
for (j = 0; j < driver_map[i].num_chips_ids; j++) {
|
||||
- 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) {
|
||||
if (driver_map[i].chip_ids[j] == dev->deviceinfo.pci->device_id) {
|
||||
- driver = strdup(driver_map[i].driver);
|
||||
+ *dri_driver_ret = driver_map[i].driver;
|
||||
+ *vdpau_driver_ret = driver_map[i].vdpau_driver;
|
||||
+ return;
|
||||
+ }
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
@@ -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
|
||||
- return NULL;
|
||||
+ *dri_driver_ret = NULL;
|
||||
+ *vdpau_driver_ret = NULL;
|
||||
#endif
|
||||
}
|
||||
|
||||
Bool
|
||||
@@ -1606,7 +1617,8 @@ DRI2ScreenInit(ScreenPtr pScreen, DRI2InfoPtr info)
|
||||
if (info->driverName) {
|
||||
ds->driverNames[0] = info->driverName;
|
||||
@@ -1604,7 +1612,8 @@ DRI2ScreenInit(ScreenPtr pScreen, DRI2InfoPtr info)
|
||||
} 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 da7ea1c..7036d10 100644
|
||||
index da7ea1c1e..7036d1003 100644
|
||||
--- a/hw/xfree86/dri2/pci_ids/pci_id_driver_map.h
|
||||
+++ b/hw/xfree86/dri2/pci_ids/pci_id_driver_map.h
|
||||
@@ -66,21 +66,22 @@ static const int vmwgfx_chip_ids[] = {
|
||||
@@ -60,23 +60,24 @@ static const int vmwgfx_chip_ids[] = {
|
||||
static const struct {
|
||||
int vendor_id;
|
||||
const char *driver;
|
||||
|
|
@ -130,8 +124,10 @@ index da7ea1c..7036d10 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) },
|
||||
|
|
@ -140,19 +136,18 @@ index da7ea1c..7036d10 100644
|
|||
#endif
|
||||
- { 0x1002, "r300", r300_chip_ids, ARRAY_SIZE(r300_chip_ids) },
|
||||
- { 0x1002, "r600", r600_chip_ids, ARRAY_SIZE(r600_chip_ids) },
|
||||
- { 0x1002, "radeonsi", radeonsi_chip_ids, ARRAY_SIZE(radeonsi_chip_ids) },
|
||||
- { 0x1002, "radeonsi", NULL, -1 },
|
||||
- { 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", radeonsi_chip_ids, ARRAY_SIZE(radeonsi_chip_ids) },
|
||||
+ { 0x1002, "r600", "r600", r600_chip_ids, ARRAY_SIZE(r600_chip_ids) },
|
||||
+ { 0x1002, "radeonsi", "radeonsi", NULL, -1 },
|
||||
+ { 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, 0 },
|
||||
+ { 0x0000, NULL, NULL, NULL, 0 },
|
||||
};
|
||||
|
||||
--
|
||||
2.9.3
|
||||
|
||||
#endif /* _PCI_ID_DRIVER_MAP_H_ */
|
||||
|
|
|
|||
|
|
@ -1,39 +0,0 @@
|
|||
From c57c1e53ea3d76ebba5b2a23b7260817d3e6b921 Mon Sep 17 00:00:00 2001
|
||||
From: Hans De Goede <hdegoede@redhat.com>
|
||||
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 <ajax@redhat.com>
|
||||
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
||||
---
|
||||
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
|
||||
|
||||
|
|
@ -24,7 +24,7 @@ index 8158c2b62..78d1c947d 100644
|
|||
@@ -1190,6 +1191,25 @@ xf86VideoPtrToDriverList(struct pci_device *dev,
|
||||
int idx = 0;
|
||||
|
||||
#ifdef __linux__
|
||||
#if defined(__linux__) || defined(__NetBSD__)
|
||||
+ char busid[32];
|
||||
+ int fd;
|
||||
+
|
||||
|
|
|
|||
|
|
@ -1,73 +0,0 @@
|
|||
From 7f22271ca7ace43f6fa1168a2acea9af6f2d5896 Mon Sep 17 00:00:00 2001
|
||||
From: Jason Gerecke <killertofu@gmail.com>
|
||||
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 <jason.gerecke@wacom.com>
|
||||
Signed-off-by: Carlos Garnacho <carlosg@gnome.org>
|
||||
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
|
||||
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
||||
Acked-by: Ping Cheng <ping.cheng@wacom.com>
|
||||
(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 <inpututils.h>
|
||||
#include <mipointer.h>
|
||||
#include <mipointrst.h>
|
||||
+#include "tablet-unstable-v2-client-protocol.h"
|
||||
|
||||
/* Copied from mipointer.c */
|
||||
#define MIPOINTER(dev) \
|
||||
--
|
||||
2.13.5
|
||||
|
||||
|
|
@ -1,99 +0,0 @@
|
|||
From fe46cbea0f19959d469ca4d1f09be379dc7b1e45 Mon Sep 17 00:00:00 2001
|
||||
From: Olivier Fourdan <ofourdan@redhat.com>
|
||||
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 <ajax@redhat.com>
|
||||
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
|
||||
---
|
||||
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
|
||||
|
||||
|
|
@ -1,135 +0,0 @@
|
|||
From 60f4646ae10f0b57790fce46682baa531512b53e Mon Sep 17 00:00:00 2001
|
||||
From: Carlos Garnacho <carlosg@gnome.org>
|
||||
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 <carlosg@gnome.org>
|
||||
Acked-by: Jason Gerecke <jason.gerecke@wacom.com>
|
||||
Tested-by: Olivier Fourdan <ofourdan@redhat.com>
|
||||
---
|
||||
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
|
||||
|
||||
|
|
@ -1,41 +0,0 @@
|
|||
From 170c95978530f6373bdf4488116902b273f3abf4 Mon Sep 17 00:00:00 2001
|
||||
From: Olivier Fourdan <ofourdan@redhat.com>
|
||||
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 <ofourdan@redhat.com>
|
||||
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
|
||||
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
||||
---
|
||||
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
|
||||
|
||||
|
|
@ -1,45 +0,0 @@
|
|||
From 08b84d72878e43401e99059c3c926dfa42a360c3 Mon Sep 17 00:00:00 2001
|
||||
From: Hans De Goede <hdegoede@redhat.com>
|
||||
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 <ajax@redhat.com>
|
||||
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
||||
---
|
||||
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
|
||||
|
||||
|
|
@ -1,166 +0,0 @@
|
|||
From 8dcc03fb4a5db18fb52377ee578a2a673d691a1e Mon Sep 17 00:00:00 2001
|
||||
From: Jason Gerecke <killertofu@gmail.com>
|
||||
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 <jason.gerecke@wacom.com>
|
||||
Signed-off-by: Carlos Garnacho <carlosg@gnome.org>
|
||||
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
|
||||
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
||||
Acked-by: Ping Cheng <ping.cheng@wacom.com>
|
||||
(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
|
||||
|
||||
|
|
@ -1,190 +0,0 @@
|
|||
From 9cd3cc75269d9196898487b5712ee47b8291e077 Mon Sep 17 00:00:00 2001
|
||||
From: Hans De Goede <hdegoede@redhat.com>
|
||||
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 <ajax@redhat.com>
|
||||
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
||||
---
|
||||
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
|
||||
|
||||
|
|
@ -1,173 +0,0 @@
|
|||
From 243eadc7979e35756a4f0e349ee97bbbd3a268c3 Mon Sep 17 00:00:00 2001
|
||||
From: Jason Gerecke <killertofu@gmail.com>
|
||||
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 <jason.gerecke@wacom.com>
|
||||
Signed-off-by: Carlos Garnacho <carlosg@gnome.org>
|
||||
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
|
||||
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
||||
Acked-by: Ping Cheng <ping.cheng@wacom.com>
|
||||
(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
|
||||
|
||||
|
|
@ -1,61 +0,0 @@
|
|||
From ab1a65b7755d081b41188104b21f4d21eaa3187b Mon Sep 17 00:00:00 2001
|
||||
From: Hans De Goede <hdegoede@redhat.com>
|
||||
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 <ajax@redhat.com>
|
||||
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
||||
---
|
||||
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
|
||||
|
||||
|
|
@ -1,211 +0,0 @@
|
|||
From 591b08b3311c5217969a8ceb3ed58b58fabc4891 Mon Sep 17 00:00:00 2001
|
||||
From: Jason Gerecke <killertofu@gmail.com>
|
||||
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 <jason.gerecke@wacom.com>
|
||||
Signed-off-by: Carlos Garnacho <carlosg@gnome.org>
|
||||
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
|
||||
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
||||
Acked-by: Ping Cheng <ping.cheng@wacom.com>
|
||||
(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
|
||||
|
||||
|
|
@ -1,91 +0,0 @@
|
|||
From d75ffcdbf8c1e3c8e0d46debcd533a9f2560f0a8 Mon Sep 17 00:00:00 2001
|
||||
From: Hans De Goede <hdegoede@redhat.com>
|
||||
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 <ajax@redhat.com>
|
||||
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
||||
---
|
||||
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
|
||||
|
||||
|
|
@ -1,31 +0,0 @@
|
|||
From c17e544b271ced65483692103d39ed1188d4ca25 Mon Sep 17 00:00:00 2001
|
||||
From: Hans de Goede <hdegoede@redhat.com>
|
||||
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 <hdegoede@redhat.com>
|
||||
---
|
||||
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
|
||||
|
||||
|
|
@ -1,374 +0,0 @@
|
|||
From 4354336014ca0c29270a6cdf83e9f9e5fe16080e Mon Sep 17 00:00:00 2001
|
||||
From: Jason Gerecke <killertofu@gmail.com>
|
||||
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 <jason.gerecke@wacom.com>
|
||||
Signed-off-by: Carlos Garnacho <carlosg@gnome.org>
|
||||
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
|
||||
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
||||
Acked-by: Ping Cheng <ping.cheng@wacom.com>
|
||||
(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
|
||||
|
||||
|
|
@ -1,183 +0,0 @@
|
|||
From b5dffbbac193aa640ffcfa0a431c21b862854e53 Mon Sep 17 00:00:00 2001
|
||||
From: Hans De Goede <hdegoede@redhat.com>
|
||||
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 <ajax@redhat.com>
|
||||
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
||||
---
|
||||
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
|
||||
|
||||
|
|
@ -1,89 +0,0 @@
|
|||
From 74bc0fff3a6ca233e56b3fb2971bca97b5a4f8b5 Mon Sep 17 00:00:00 2001
|
||||
From: Hans de Goede <hdegoede@redhat.com>
|
||||
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 <hdegoede@redhat.com>
|
||||
---
|
||||
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
|
||||
|
||||
|
|
@ -1,121 +0,0 @@
|
|||
From 317ce1201a2ec848f9066294ea544b756f735385 Mon Sep 17 00:00:00 2001
|
||||
From: Peter Hutterer <peter.hutterer@who-t.net>
|
||||
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 <peter.hutterer@who-t.net>
|
||||
Acked-by: Ping Cheng <ping.cheng@wacom.com>
|
||||
(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 <inpututils.h>
|
||||
#include <mipointer.h>
|
||||
#include <mipointrst.h>
|
||||
+#include <misc.h>
|
||||
#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
|
||||
|
||||
|
|
@ -1,122 +0,0 @@
|
|||
From 02bcb6f189c4ad8b2e73ce99cfa3c10f0c244a88 Mon Sep 17 00:00:00 2001
|
||||
From: Hans de Goede <hdegoede@redhat.com>
|
||||
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 <hdegoede@redhat.com>
|
||||
---
|
||||
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
|
||||
|
||||
|
|
@ -1,213 +0,0 @@
|
|||
From 94a88b752a9373656bb0f62897513c8f5e552127 Mon Sep 17 00:00:00 2001
|
||||
From: Carlos Garnacho <carlosg@gnome.org>
|
||||
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 <carlosg@gnome.org>
|
||||
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
|
||||
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
||||
Acked-by: Ping Cheng <ping.cheng@wacom.com>
|
||||
(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
|
||||
|
||||
|
|
@ -1,208 +0,0 @@
|
|||
From 78a4493bc8e60da7b97342660dd1ff6de844e951 Mon Sep 17 00:00:00 2001
|
||||
From: Carlos Garnacho <carlosg@gnome.org>
|
||||
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 <carlosg@gnome.org>
|
||||
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
|
||||
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
||||
Acked-by: Ping Cheng <ping.cheng@wacom.com>
|
||||
(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
|
||||
|
||||
|
|
@ -1,511 +0,0 @@
|
|||
From 6f79f4993d351a891a715e994ab9574542e64b35 Mon Sep 17 00:00:00 2001
|
||||
From: Peter Hutterer <peter.hutterer@who-t.net>
|
||||
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 <peter.hutterer@who-t.net>
|
||||
Acked-by: Ping Cheng <ping.cheng@wacom.com>
|
||||
(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
|
||||
|
||||
|
|
@ -1,74 +0,0 @@
|
|||
From 81d85fb95d71c0d781328506f1417e7b92c68b97 Mon Sep 17 00:00:00 2001
|
||||
From: Lyude <lyude@redhat.com>
|
||||
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 <lyude@redhat.com>
|
||||
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
|
||||
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
||||
(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
|
||||
|
||||
|
|
@ -1,39 +0,0 @@
|
|||
From edcc95e914079485b7d693cecbfc436d084ad47d Mon Sep 17 00:00:00 2001
|
||||
From: Jason Gerecke <killertofu@gmail.com>
|
||||
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 <jason.gerecke@wacom.com>
|
||||
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
|
||||
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
||||
(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
|
||||
|
||||
|
|
@ -1,78 +0,0 @@
|
|||
From d03bf0d1759d7d113216a0311e794b5adb0845de Mon Sep 17 00:00:00 2001
|
||||
From: Jason Gerecke <killertofu@gmail.com>
|
||||
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 <jason.gerecke@wacom.com>
|
||||
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
|
||||
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
||||
(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
|
||||
|
||||
|
|
@ -1,38 +0,0 @@
|
|||
# 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
|
||||
30
Makefile
30
Makefile
|
|
@ -1,30 +0,0 @@
|
|||
# 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
|
||||
1
commitid
1
commitid
|
|
@ -1 +0,0 @@
|
|||
d13cb974426f7f1110b0bdb08c4ebb46ff8975f7
|
||||
306
gitignore
306
gitignore
|
|
@ -1,306 +0,0 @@
|
|||
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
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
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
|
||||
|
|
@ -1,17 +0,0 @@
|
|||
#!/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
|
||||
2
sources
2
sources
|
|
@ -1 +1 @@
|
|||
SHA512 (xorg-server-1.19.6.tar.bz2) = 38519a8d0af9dd034045fc346959496dd718fa59b6188307974797a1cd9c349deb54987f6232ea8396baf810dcc710c0ff191f76ed2186cae4d44921b3680412
|
||||
SHA512 (xorg-server-21.1.21.tar.xz) = bb2eb4e6756eb9e38b61bd47c017da44bcf5f45f2b7a906b4bb3a56b3d791cec64abb9bf37b224efe1e4fab9cc296f3672c9b2f8e00e1cdfc54337bef63cd16c
|
||||
|
|
|
|||
1305
xorg-x11-server.spec
1305
xorg-x11-server.spec
File diff suppressed because it is too large
Load diff
|
|
@ -1,302 +0,0 @@
|
|||
From 4471df41ea6e94834a2b10643ca7fcd69682d276 Mon Sep 17 00:00:00 2001
|
||||
From: Dave Airlie <airlied@redhat.com>
|
||||
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 <airlied@gmail.com>
|
||||
[hdegoede@redhat.com: Make configurable, fix with nvidia, submit upstream]
|
||||
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
||||
---
|
||||
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
|
||||
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
#!/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@"
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
#!/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"
|
||||
|
|
@ -1,5 +1,4 @@
|
|||
#%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
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ SERVERNUM=99
|
|||
AUTHFILE=
|
||||
ERRORFILE=/dev/null
|
||||
STARTWAIT=3
|
||||
XVFBARGS="-screen 0 640x480x8"
|
||||
XVFBARGS="-screen 0 640x480x24"
|
||||
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="" ;;
|
||||
-l|--listen-tcp) LISTENTCP="-listen tcp" ;;
|
||||
-p|--xauth-protocol) XAUTHPROTO="$2"; shift ;;
|
||||
-s|--server-args) XVFBARGS="$2"; shift ;;
|
||||
-w|--wait) STARTWAIT="$2"; shift ;;
|
||||
|
|
@ -142,7 +142,7 @@ if [ -z "$*" ]; then
|
|||
exit 2
|
||||
fi
|
||||
|
||||
if ! which xauth >/dev/null; then
|
||||
if ! type xauth >/dev/null; then
|
||||
error "xauth command not found"
|
||||
exit 3
|
||||
fi
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue