Re: [PATCH] input: mt: introduce MT event slots

From: Dmitry Torokhov
Date: Thu Apr 15 2010 - 19:25:44 EST


Hi Henrik,

On Thu, Apr 08, 2010 at 02:13:10AM +0200, Henrik Rydberg wrote:
> With the rapidly increasing number of intelligent multi-contact and
> multi-user devices, the need to send digested, filtered information
> from a set of different sources within the same device is imminent.
> This patch adds the concept of slots to the MT protocol. The slots
> enumerate a set of identified sources, such that all MT events
> can be passed independently and selectively per identified source.
>
> The protocol works like this: Instead of sending a SYN_MT_REPORT
> event immediately after the contact data, one sends a SYN_MT_SLOT
> event immediately before the contact data. The input core will only
> emit events for the slots corresponding to the contacts that have
> changed. It is assumed that the same slot is used for the duration
> of an initiated contact.
>

I see the reason for doing this however I would like to hold off
applying it till we get a couple of users and prove that the scheme
works well for them.

> Signed-off-by: Henrik Rydberg <rydberg@xxxxxxxxxxx>
> ---
> drivers/input/input.c | 62 +++++++++++++++++++++++++++++++++++++++++++++++++
> include/linux/input.h | 26 ++++++++++++++++++++
> 2 files changed, 88 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/input/input.c b/drivers/input/input.c
> index afd4e2b..217e976 100644
> --- a/drivers/input/input.c
> +++ b/drivers/input/input.c
> @@ -181,6 +181,22 @@ static void input_stop_autorepeat(struct input_dev *dev)
> #define INPUT_PASS_TO_DEVICE 2
> #define INPUT_PASS_TO_ALL (INPUT_PASS_TO_HANDLERS | INPUT_PASS_TO_DEVICE)
>
> +static void input_handle_mt_event(struct input_dev *dev,
> + unsigned int code, int value)
> +{
> + int oldval = dev->mt[dev->slot].abs[code];

A temp for dev->mt[dev->slot] might be nice.

>
> +/**
> + * struct input_mt_slot - represents the state of an MT input slot
> + * @abs: current values from absolute axes for this slot
> + */
> +struct input_mt_slot {
> + int abs[ABS_MAX + 1];
> +};

It would be nice to use abs[ABS_MT_MAX - ABS_MT_TOUCH_MAJOR] to save
some memory.

--
Dmitry
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/