linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/3] Balanced slots, attempt #2
@ 2015-03-31 15:07 Benjamin Tissoires
  2015-03-31 15:07 ` [PATCH v2 1/3] Input: MT - make slot assignment work for overcovered solutions Benjamin Tissoires
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Benjamin Tissoires @ 2015-03-31 15:07 UTC (permalink / raw)
  To: Dmitry Torokhov, Henrik Rydberg, Hans de Goede, Peter Hutterer
  Cc: linux-input, linux-kernel

Hi,

so this is the v2 with Hans' ack and Henrik's respin of the first patch.

Cheers,
Benjamin


Benjamin Tissoires (3):
  Input: MT - make slot assignment work for overcovered solutions
  Revert "Revert "Input: synaptics - use dmax in input_mt_assign_slots""
  Input: synaptics - allocate 3 slots to keep stability in image sensors

 drivers/input/input-mt.c        | 21 ++++++++++++---------
 drivers/input/mouse/synaptics.c |  7 +++++--
 2 files changed, 17 insertions(+), 11 deletions(-)

-- 
2.3.4


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

* [PATCH v2 1/3] Input: MT - make slot assignment work for overcovered solutions
  2015-03-31 15:07 [PATCH v2 0/3] Balanced slots, attempt #2 Benjamin Tissoires
@ 2015-03-31 15:07 ` Benjamin Tissoires
  2015-03-31 15:07 ` [PATCH v2 2/3] Revert "Revert "Input: synaptics - use dmax in input_mt_assign_slots"" Benjamin Tissoires
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Benjamin Tissoires @ 2015-03-31 15:07 UTC (permalink / raw)
  To: Dmitry Torokhov, Henrik Rydberg, Hans de Goede, Peter Hutterer
  Cc: linux-input, linux-kernel

The recent inclusion of a deassignment cost in the slot assignment
algorithm did not properly account for the corner cases where the
solutions are overcovered. This patch makes sure the resulting assignment
is unique, allocating new slots when necessary.

Signed-off-by: Henrik Rydberg <rydberg@bitmath.org>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Acked-by: Hans de Goede <hdegoede@redhat.com>
---

changes in v2:
- used Henrik's version, took authorship and added s-o-b
- acked by Hans

 drivers/input/input-mt.c | 21 ++++++++++++---------
 1 file changed, 12 insertions(+), 9 deletions(-)

diff --git a/drivers/input/input-mt.c b/drivers/input/input-mt.c
index cb150a1..f4de3ee 100644
--- a/drivers/input/input-mt.c
+++ b/drivers/input/input-mt.c
@@ -365,25 +365,28 @@ static void input_mt_set_slots(struct input_mt *mt,
 			       int *slots, int num_pos)
 {
 	struct input_mt_slot *s;
-	int *w = mt->red, *p;
+	int *w = mt->red, j;
 
-	for (p = slots; p != slots + num_pos; p++)
-		*p = -1;
+	for (j = 0; j != num_pos; j++)
+		slots[j] = -1;
 
 	for (s = mt->slots; s != mt->slots + mt->num_slots; s++) {
 		if (!input_mt_is_active(s))
 			continue;
-		for (p = slots; p != slots + num_pos; p++)
-			if (*w++ < 0)
-				*p = s - mt->slots;
+		for (j = 0; j != num_pos; j++)
+			if (w[j] < 0) {
+				slots[j] = s - mt->slots;
+				break;
+			}
+		w += num_pos;
 	}
 
 	for (s = mt->slots; s != mt->slots + mt->num_slots; s++) {
 		if (input_mt_is_active(s))
 			continue;
-		for (p = slots; p != slots + num_pos; p++)
-			if (*p < 0) {
-				*p = s - mt->slots;
+		for (j = 0; j != num_pos; j++)
+			if (slots[j] < 0) {
+				slots[j] = s - mt->slots;
 				break;
 			}
 	}
-- 
2.3.4


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

* [PATCH v2 2/3] Revert "Revert "Input: synaptics - use dmax in input_mt_assign_slots""
  2015-03-31 15:07 [PATCH v2 0/3] Balanced slots, attempt #2 Benjamin Tissoires
  2015-03-31 15:07 ` [PATCH v2 1/3] Input: MT - make slot assignment work for overcovered solutions Benjamin Tissoires
@ 2015-03-31 15:07 ` Benjamin Tissoires
  2015-03-31 15:07 ` [PATCH v2 3/3] Input: synaptics - allocate 3 slots to keep stability in image sensors Benjamin Tissoires
  2015-03-31 15:26 ` [PATCH v2 0/3] Balanced slots, attempt #2 Henrik Rydberg
  3 siblings, 0 replies; 6+ messages in thread
From: Benjamin Tissoires @ 2015-03-31 15:07 UTC (permalink / raw)
  To: Dmitry Torokhov, Henrik Rydberg, Hans de Goede, Peter Hutterer
  Cc: linux-input, linux-kernel

This reverts commit 09d042a2eb90 ("Revert "Input: synaptics - use dmax in input_mt_assign_slots"")

Now that balanced slots assignments seem to be fixed, let's
reenable the use in synaptics.c and wait for users to complain
if there are still problems.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Acked-by: Hans de Goede <hdegoede@redhat.com>
---

changes in v2:
- acked by Hans

 drivers/input/mouse/synaptics.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c
index 1d3d11d..02a12b694 100644
--- a/drivers/input/mouse/synaptics.c
+++ b/drivers/input/mouse/synaptics.c
@@ -67,6 +67,9 @@
 #define X_MAX_POSITIVE 8176
 #define Y_MAX_POSITIVE 8176
 
+/* maximum ABS_MT_POSITION displacement (in mm) */
+#define DMAX 10
+
 /*****************************************************************************
  *	Stuff we need even when we do not want native Synaptics support
  ****************************************************************************/
@@ -922,7 +925,7 @@ static void synaptics_report_mt_data(struct psmouse *psmouse,
 		pos[i].y = synaptics_invert_y(hw[i]->y);
 	}
 
-	input_mt_assign_slots(dev, slot, pos, nsemi, 0);
+	input_mt_assign_slots(dev, slot, pos, nsemi, DMAX * priv->x_res);
 
 	for (i = 0; i < nsemi; i++) {
 		input_mt_slot(dev, slot[i]);
-- 
2.3.4

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

* [PATCH v2 3/3] Input: synaptics - allocate 3 slots to keep stability in image sensors
  2015-03-31 15:07 [PATCH v2 0/3] Balanced slots, attempt #2 Benjamin Tissoires
  2015-03-31 15:07 ` [PATCH v2 1/3] Input: MT - make slot assignment work for overcovered solutions Benjamin Tissoires
  2015-03-31 15:07 ` [PATCH v2 2/3] Revert "Revert "Input: synaptics - use dmax in input_mt_assign_slots"" Benjamin Tissoires
@ 2015-03-31 15:07 ` Benjamin Tissoires
  2015-03-31 15:26 ` [PATCH v2 0/3] Balanced slots, attempt #2 Henrik Rydberg
  3 siblings, 0 replies; 6+ messages in thread
From: Benjamin Tissoires @ 2015-03-31 15:07 UTC (permalink / raw)
  To: Dmitry Torokhov, Henrik Rydberg, Hans de Goede, Peter Hutterer
  Cc: linux-input, linux-kernel

When slowly dropping 1, 2 and then 3 fingers on an image sensor touchpad,
we can see that the first finger gets reassigned a new slot while it did
not move. This is due to the kernel tracking algorithm which can not
assign correctly the 3 touches, being out of slots.

Declaring that we support 3 slots allows to actually forward:
slot 0 -> down, slot 1 -> up, slot 2 -> down

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Acked-by: Hans de Goede <hdegoede@redhat.com>
---

changes in v2:
- acked by Hans

 drivers/input/mouse/synaptics.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c
index 02a12b694..b4c6717 100644
--- a/drivers/input/mouse/synaptics.c
+++ b/drivers/input/mouse/synaptics.c
@@ -1194,7 +1194,7 @@ static void set_input_params(struct psmouse *psmouse,
 					ABS_MT_POSITION_Y);
 		/* Image sensors can report per-contact pressure */
 		input_set_abs_params(dev, ABS_MT_PRESSURE, 0, 255, 0, 0);
-		input_mt_init_slots(dev, 2, INPUT_MT_POINTER | INPUT_MT_TRACK);
+		input_mt_init_slots(dev, 3, INPUT_MT_POINTER | INPUT_MT_TRACK);
 
 		/* Image sensors can signal 4 and 5 finger clicks */
 		__set_bit(BTN_TOOL_QUADTAP, dev->keybit);
-- 
2.3.4

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

* Re: [PATCH v2 0/3] Balanced slots, attempt #2
  2015-03-31 15:07 [PATCH v2 0/3] Balanced slots, attempt #2 Benjamin Tissoires
                   ` (2 preceding siblings ...)
  2015-03-31 15:07 ` [PATCH v2 3/3] Input: synaptics - allocate 3 slots to keep stability in image sensors Benjamin Tissoires
@ 2015-03-31 15:26 ` Henrik Rydberg
  2015-04-05 20:46   ` Dmitry Torokhov
  3 siblings, 1 reply; 6+ messages in thread
From: Henrik Rydberg @ 2015-03-31 15:26 UTC (permalink / raw)
  To: Benjamin Tissoires, Dmitry Torokhov, Hans de Goede,
	Peter Hutterer
  Cc: linux-input, linux-kernel

On 03/31/2015 05:07 PM, Benjamin Tissoires wrote:
> Hi,
> 
> so this is the v2 with Hans' ack and Henrik's respin of the first patch.

The whole series looks good, thank you Benjamin.

Acked-by: Henrik Rydberg <rydberg@bitmath.org>

Henrik

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

* Re: [PATCH v2 0/3] Balanced slots, attempt #2
  2015-03-31 15:26 ` [PATCH v2 0/3] Balanced slots, attempt #2 Henrik Rydberg
@ 2015-04-05 20:46   ` Dmitry Torokhov
  0 siblings, 0 replies; 6+ messages in thread
From: Dmitry Torokhov @ 2015-04-05 20:46 UTC (permalink / raw)
  To: Henrik Rydberg
  Cc: Benjamin Tissoires, Hans de Goede, Peter Hutterer, linux-input,
	linux-kernel

On Tue, Mar 31, 2015 at 05:26:31PM +0200, Henrik Rydberg wrote:
> On 03/31/2015 05:07 PM, Benjamin Tissoires wrote:
> > Hi,
> > 
> > so this is the v2 with Hans' ack and Henrik's respin of the first patch.
> 
> The whole series looks good, thank you Benjamin.
> 
> Acked-by: Henrik Rydberg <rydberg@bitmath.org>

Queued for 4.1, thank you.

-- 
Dmitry

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

end of thread, other threads:[~2015-04-05 20:46 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-31 15:07 [PATCH v2 0/3] Balanced slots, attempt #2 Benjamin Tissoires
2015-03-31 15:07 ` [PATCH v2 1/3] Input: MT - make slot assignment work for overcovered solutions Benjamin Tissoires
2015-03-31 15:07 ` [PATCH v2 2/3] Revert "Revert "Input: synaptics - use dmax in input_mt_assign_slots"" Benjamin Tissoires
2015-03-31 15:07 ` [PATCH v2 3/3] Input: synaptics - allocate 3 slots to keep stability in image sensors Benjamin Tissoires
2015-03-31 15:26 ` [PATCH v2 0/3] Balanced slots, attempt #2 Henrik Rydberg
2015-04-05 20:46   ` 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).