* [PATCH] input: uinput: Setup MT usage during device creation
@ 2010-09-19 11:54 Henrik Rydberg
2010-09-19 23:32 ` Dmitry Torokhov
0 siblings, 1 reply; 2+ messages in thread
From: Henrik Rydberg @ 2010-09-19 11:54 UTC (permalink / raw)
To: Dmitry Torokhov; +Cc: linux-input, linux-kernel, Henrik Rydberg
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 <rydberg@euromail.se>
---
drivers/input/misc/uinput.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/drivers/input/misc/uinput.c b/drivers/input/misc/uinput.c
index 0d4266a..3606985 100644
--- a/drivers/input/misc/uinput.c
+++ b/drivers/input/misc/uinput.c
@@ -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;
--
1.7.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] input: uinput: Setup MT usage during device creation
2010-09-19 11:54 [PATCH] input: uinput: Setup MT usage during device creation Henrik Rydberg
@ 2010-09-19 23:32 ` Dmitry Torokhov
0 siblings, 0 replies; 2+ messages in thread
From: Dmitry Torokhov @ 2010-09-19 23:32 UTC (permalink / raw)
To: Henrik Rydberg; +Cc: linux-input, linux-kernel
On Sun, Sep 19, 2010 at 01:54:13PM +0200, Henrik Rydberg wrote:
> 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 <rydberg@euromail.se>
Applied to 'for-linus', thank you Henrik.
--
Dmitry
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-09-19 23:32 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-19 11:54 [PATCH] input: uinput: Setup MT usage during device creation Henrik Rydberg
2010-09-19 23:32 ` Dmitry Torokhov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).