mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 19:21:31 -04:00
Input: uinput - setup MT usage during device creation
The input devices created by uinput do not currently handle multitouch properly. All events will appear as if they came from slot zero, and the input event buffers are not adjusted. This patch creates the MT slots during setup, and sets the number of events per packet based on the MT usage. Signed-off-by: Henrik Rydberg <[email protected]> Signed-off-by: Dmitry Torokhov <[email protected]>
This commit is contained in:
parent
af045b8666
commit
38e7afe96c
1 changed files with 7 additions and 0 deletions
|
|
@ -404,6 +404,13 @@ static int uinput_setup_device(struct uinput_device *udev, const char __user *bu
|
|||
retval = uinput_validate_absbits(dev);
|
||||
if (retval < 0)
|
||||
goto exit;
|
||||
if (test_bit(ABS_MT_SLOT, dev->absbit)) {
|
||||
int nslot = input_abs_get_max(dev, ABS_MT_SLOT) + 1;
|
||||
input_mt_create_slots(dev, nslot);
|
||||
input_set_events_per_packet(dev, 6 * nslot);
|
||||
} else if (test_bit(ABS_MT_POSITION_X, dev->absbit)) {
|
||||
input_set_events_per_packet(dev, 60);
|
||||
}
|
||||
}
|
||||
|
||||
udev->state = UIST_SETUP_COMPLETE;
|
||||
|
|
|
|||
Loading…
Reference in a new issue