Skip to content
This repository was archived by the owner on Apr 8, 2024. It is now read-only.

Commit f629305

Browse files
Roman Kiryanovdyang23
authored andcommitted
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 Signed-off-by: Yang, Dong <dong.yang@intel.com>
1 parent 035b237 commit f629305

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

drivers/virtio/virtio_input.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#include <linux/virtio.h>
44
#include <linux/virtio_config.h>
55
#include <linux/input.h>
6+
#include <linux/input/mt.h>
67

78
#include <uapi/linux/virtio_ids.h>
89
#include <uapi/linux/virtio_input.h>
@@ -164,6 +165,12 @@ static void virtinput_cfg_abs(struct virtio_input *vi, int abs)
164165
virtio_cread(vi->vdev, struct virtio_input_config, u.abs.flat, &fl);
165166
input_set_abs_params(vi->idev, abs, mi, ma, fu, fl);
166167
input_abs_set_res(vi->idev, abs, re);
168+
if (abs == ABS_MT_TRACKING_ID)
169+
input_mt_init_slots(vi->idev,
170+
ma, /* input max finger */
171+
INPUT_MT_DIRECT
172+
| INPUT_MT_DROP_UNUSED
173+
| INPUT_MT_TRACK);
167174
}
168175

169176
static int virtinput_init_vqs(struct virtio_input *vi)

0 commit comments

Comments
 (0)