diff mbox

input-mt: Allow -1 for tracking id

Message ID BANLkTimcCh7MbmxtuzTCEFyT28FHZU+ijw@mail.gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Sadrul Chowdhury April 14, 2011, 10:13 p.m. UTC
In protocol B, the tracking ID can be set to -1. But since the min
value is set to 0, the clients don't receive a -1 when a contact is
lifted. The attached patch sets the min to -1 to fix this issue.

Cheers.
Sadrul

Comments

Henrik Rydberg April 15, 2011, 7 a.m. UTC | #1
Hi Sadrul,

On Thu, Apr 14, 2011 at 06:13:17PM -0400, Sadrul Chowdhury wrote:
> In protocol B, the tracking ID can be set to -1. But since the min
> value is set to 0, the clients don't receive a -1 when a contact is
> lifted. The attached patch sets the min to -1 to fix this issue.

All ABS_MT_TRACKING_ID values outside the valid value range denote an
invalid touch. To simplify implementation in userland, where the valid
range may not always be known, the documentation was changed to say
"-1" instead. Apparently the original explanation was unintentionally
dropped with it.

Because the change goes against the semantics of the tracking id, this
patch constitues an interface breakage, with malfunctions in userspace
as a result. Therefore, this patch will not be applied.

Thanks,
Henrik
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Sadrul Chowdhury April 15, 2011, 1:09 p.m. UTC | #2
On Fri, Apr 15, 2011 at 3:00 AM, Henrik Rydberg <rydberg@euromail.se> wrote:
> Hi Sadrul,
>
> On Thu, Apr 14, 2011 at 06:13:17PM -0400, Sadrul Chowdhury wrote:
>> In protocol B, the tracking ID can be set to -1. But since the min
>> value is set to 0, the clients don't receive a -1 when a contact is
>> lifted. The attached patch sets the min to -1 to fix this issue.
>
> All ABS_MT_TRACKING_ID values outside the valid value range denote an
> invalid touch. To simplify implementation in userland, where the valid
> range may not always be known, the documentation was changed to say
> "-1" instead. Apparently the original explanation was unintentionally
> dropped with it.
>
> Because the change goes against the semantics of the tracking id, this
> patch constitues an interface breakage, with malfunctions in userspace
> as a result. Therefore, this patch will not be applied.

Ah, that makes sense. Thanks for the explanation. I will fix things on
the client end.

Thanks.
Sadrul
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

From dc5f39811bfd21409853fb4f5047f2ac47618c76 Mon Sep 17 00:00:00 2001
From: Sadrul Habib Chowdhury <sadrul@chromium.org>
Date: Thu, 14 Apr 2011 17:42:27 -0400
Subject: [PATCH] input-mt: Allow -1 for tracking id.

The tracking id set to -1 when a slot is released. So allow the minimum
value to reach -1.

Change-Id: I8ffeaed70fd4824d5778ad2f2d7bc467157887fc

Signed-off-by: Sadrul Habib Chowdhury <sadrul@chromium.org>
---
 drivers/input/input-mt.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/input/input-mt.c b/drivers/input/input-mt.c
index c48c81f..5fb11e4 100644
--- a/drivers/input/input-mt.c
+++ b/drivers/input/input-mt.c
@@ -39,7 +39,7 @@  int input_mt_init_slots(struct input_dev *dev, unsigned int num_slots)
 
 	dev->mtsize = num_slots;
 	input_set_abs_params(dev, ABS_MT_SLOT, 0, num_slots - 1, 0, 0);
-	input_set_abs_params(dev, ABS_MT_TRACKING_ID, 0, TRKID_MAX, 0, 0);
+	input_set_abs_params(dev, ABS_MT_TRACKING_ID, -1, TRKID_MAX, 0, 0);
 	input_set_events_per_packet(dev, 6 * num_slots);
 
 	/* Mark slots as 'unused' */
-- 
1.7.2.3