| From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 |
| From: Roman Kiryanov <rkir@google.com> |
| Date: Mon, 28 Oct 2019 14:34:48 -0700 |
| Subject: ANDROID: virtio: virtio_input: Set the amount of multitouch slots in |
| virtio input |
| |
| Virtio input was missing the the amount of multitouch |
| slots and kernel was filtering out ABS_MT_SLOT events |
| for a screen is touched in more than one place. |
| |
| Bug: 143488374 |
| Signed-off-by: Roman Kiryanov <rkir@google.com> |
| Change-Id: I617099435af311e6b0ee127b76eafe13834ea8f8 |
| --- |
| drivers/virtio/virtio_input.c | 7 +++++++ |
| 1 file changed, 7 insertions(+) |
| |
| diff --git a/drivers/virtio/virtio_input.c b/drivers/virtio/virtio_input.c |
| index 5ae529671b3d..c68134c5a2e6 100644 |
| --- a/drivers/virtio/virtio_input.c |
| +++ b/drivers/virtio/virtio_input.c |
| @@ -3,6 +3,7 @@ |
| #include <linux/virtio.h> |
| #include <linux/virtio_config.h> |
| #include <linux/input.h> |
| +#include <linux/input/mt.h> |
| |
| #include <uapi/linux/virtio_ids.h> |
| #include <uapi/linux/virtio_input.h> |
| @@ -164,6 +165,12 @@ static void virtinput_cfg_abs(struct virtio_input *vi, int abs) |
| virtio_cread(vi->vdev, struct virtio_input_config, u.abs.flat, &fl); |
| input_set_abs_params(vi->idev, abs, mi, ma, fu, fl); |
| input_abs_set_res(vi->idev, abs, re); |
| + if (abs == ABS_MT_TRACKING_ID) |
| + input_mt_init_slots(vi->idev, |
| + ma, /* input max finger */ |
| + INPUT_MT_DIRECT |
| + | INPUT_MT_DROP_UNUSED |
| + | INPUT_MT_TRACK); |
| } |
| |
| static int virtinput_init_vqs(struct virtio_input *vi) |