All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] input-mt: Allow -1 for tracking id
@ 2011-04-14 22:13 Sadrul Chowdhury
  2011-04-15  7:00 ` Henrik Rydberg
  0 siblings, 1 reply; 3+ messages in thread
From: Sadrul Chowdhury @ 2011-04-14 22:13 UTC (permalink / raw)
  To: linux-input

[-- Attachment #1: Type: text/plain, Size: 216 bytes --]

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

[-- Attachment #2: 0001-mt-Allow-1-for-tracking-id.patch --]
[-- Type: text/x-patch, Size: 1088 bytes --]

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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] input-mt: Allow -1 for tracking id
  2011-04-14 22:13 [PATCH] input-mt: Allow -1 for tracking id Sadrul Chowdhury
@ 2011-04-15  7:00 ` Henrik Rydberg
  2011-04-15 13:09   ` Sadrul Chowdhury
  0 siblings, 1 reply; 3+ messages in thread
From: Henrik Rydberg @ 2011-04-15  7:00 UTC (permalink / raw)
  To: Sadrul Chowdhury; +Cc: linux-input

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] input-mt: Allow -1 for tracking id
  2011-04-15  7:00 ` Henrik Rydberg
@ 2011-04-15 13:09   ` Sadrul Chowdhury
  0 siblings, 0 replies; 3+ messages in thread
From: Sadrul Chowdhury @ 2011-04-15 13:09 UTC (permalink / raw)
  To: Henrik Rydberg; +Cc: linux-input

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-04-15 13:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-04-14 22:13 [PATCH] input-mt: Allow -1 for tracking id Sadrul Chowdhury
2011-04-15  7:00 ` Henrik Rydberg
2011-04-15 13:09   ` Sadrul Chowdhury

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.