aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVasyl Vavrychuk <vasyl.vavrychuk@opensynergy.com>2020-12-16 20:03:37 +0200
committerJan-Simon Moeller <jsmoeller@linuxfoundation.org>2021-04-30 16:58:41 +0000
commit201834107c10c283787d0a0dd008340215e27ecd (patch)
treedd18a6a25211ca0f60d3da72cdc474ef1153edf0
parent751cc789d9052d4b9ad586191ca4c2f50ad97476 (diff)
virtualization/linux-yocto: Fix multitouch with virtio-input.
Multitouch support with virtio-input was broken which can be observed: * by running weston-simple-touch with weston compositor ( weston-simple-touch does not work with AGL compositor due to XDG shell issues) * by doing pinch to zoom in/out on navigation app map Change-Id: I3ec2a989a4217ebe22cee9cf1640190ca8e2bb81 Bug-AGL: SPEC-3893 Signed-off-by: Vasyl Vavrychuk <vasyl.vavrychuk@opensynergy.com> Reviewed-on: https://gerrit.automotivelinux.org/gerrit/c/AGL/meta-agl/+/26289 Reviewed-by: Jan-Simon Moeller <jsmoeller@linuxfoundation.org> Tested-by: Jan-Simon Moeller <jsmoeller@linuxfoundation.org>
-rw-r--r--meta-agl-bsp/virtualization-layer/recipes-kernel/linux/linux-yocto/virtio-kmeta/bsp/virtio/virtio-input-add-multi-touch-support.patch66
-rw-r--r--meta-agl-bsp/virtualization-layer/recipes-kernel/linux/linux-yocto/virtio-kmeta/bsp/virtio/virtio.scc1
2 files changed, 67 insertions, 0 deletions
diff --git a/meta-agl-bsp/virtualization-layer/recipes-kernel/linux/linux-yocto/virtio-kmeta/bsp/virtio/virtio-input-add-multi-touch-support.patch b/meta-agl-bsp/virtualization-layer/recipes-kernel/linux/linux-yocto/virtio-kmeta/bsp/virtio/virtio-input-add-multi-touch-support.patch
new file mode 100644
index 000000000..59a9f9b5d
--- /dev/null
+++ b/meta-agl-bsp/virtualization-layer/recipes-kernel/linux/linux-yocto/virtio-kmeta/bsp/virtio/virtio-input-add-multi-touch-support.patch
@@ -0,0 +1,66 @@
+From 16c10bede8b3d8594279752bf53153491f3f944f Mon Sep 17 00:00:00 2001
+From: Mathias Crombez <mathias.crombez@faurecia.com>
+Date: Fri, 15 Jan 2021 02:26:23 +0200
+Subject: [PATCH] virtio-input: add multi-touch support
+
+Without multi-touch slots allocated, ABS_MT_SLOT events will be lost by
+input_handle_abs_event.
+
+Implementation is based on uinput_create_device.
+
+Signed-off-by: Mathias Crombez <mathias.crombez@faurecia.com>
+Co-developed-by: Vasyl Vavrychuk <vasyl.vavrychuk@opensynergy.com>
+Signed-off-by: Vasyl Vavrychuk <vasyl.vavrychuk@opensynergy.com>
+Link: https://lore.kernel.org/r/20210115002623.8576-1-vasyl.vavrychuk@opensynergy.com
+Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
+Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
+---
+ drivers/virtio/virtio_input.c | 11 ++++++++++-
+ 1 file changed, 10 insertions(+), 1 deletion(-)
+
+diff --git a/drivers/virtio/virtio_input.c b/drivers/virtio/virtio_input.c
+index 244965c20d9b..ce51ae165943 100644
+--- a/drivers/virtio/virtio_input.c
++++ b/drivers/virtio/virtio_input.c
+@@ -7,6 +7,7 @@
+
+ #include <uapi/linux/virtio_ids.h>
+ #include <uapi/linux/virtio_input.h>
++#include <linux/input/mt.h>
+
+ struct virtio_input {
+ struct virtio_device *vdev;
+@@ -219,7 +220,7 @@ static int virtinput_probe(struct virtio_device *vdev)
+ struct virtio_input *vi;
+ unsigned long flags;
+ size_t size;
+- int abs, err;
++ int abs, err, nslots;
+
+ if (!virtio_has_feature(vdev, VIRTIO_F_VERSION_1))
+ return -ENODEV;
+@@ -304,6 +305,13 @@ static int virtinput_probe(struct virtio_device *vdev)
+ continue;
+ virtinput_cfg_abs(vi, abs);
+ }
++
++ if (test_bit(ABS_MT_SLOT, vi->idev->absbit)) {
++ nslots = input_abs_get_max(vi->idev, ABS_MT_SLOT) + 1;
++ err = input_mt_init_slots(vi->idev, nslots, 0);
++ if (err)
++ goto err_mt_init_slots;
++ }
+ }
+
+ virtio_device_ready(vdev);
+@@ -319,6 +327,7 @@ static int virtinput_probe(struct virtio_device *vdev)
+ spin_lock_irqsave(&vi->lock, flags);
+ vi->ready = false;
+ spin_unlock_irqrestore(&vi->lock, flags);
++err_mt_init_slots:
+ input_free_device(vi->idev);
+ err_input_alloc:
+ vdev->config->del_vqs(vdev);
+--
+2.31.1
+
diff --git a/meta-agl-bsp/virtualization-layer/recipes-kernel/linux/linux-yocto/virtio-kmeta/bsp/virtio/virtio.scc b/meta-agl-bsp/virtualization-layer/recipes-kernel/linux/linux-yocto/virtio-kmeta/bsp/virtio/virtio.scc
index 333ac42b8..9dfca5c94 100644
--- a/meta-agl-bsp/virtualization-layer/recipes-kernel/linux/linux-yocto/virtio-kmeta/bsp/virtio/virtio.scc
+++ b/meta-agl-bsp/virtualization-layer/recipes-kernel/linux/linux-yocto/virtio-kmeta/bsp/virtio/virtio.scc
@@ -1,2 +1,3 @@
# SPDX-License-Identifier: MIT
kconf hardware virtio.cfg
+patch virtio-input-add-multi-touch-support.patch