linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Input: Do not add SYN_REPORT in between a single packet data
@ 2016-03-07 17:44 Aniroop Mathur
  2016-03-09 18:53 ` Aniroop Mathur
  2016-03-09 19:07 ` Dmitry Torokhov
  0 siblings, 2 replies; 17+ messages in thread
From: Aniroop Mathur @ 2016-03-07 17:44 UTC (permalink / raw)
  To: dmitry.torokhov; +Cc: linux-input, linux-kernel, aniroop.mathur, Aniroop Mathur

As mentioned in documentation, SYN_REPORT should be used to separate two packets
and should not be inserted in between a single packet as otherwise with multiple
SYN_REPORT in a single packet, input reader would not be able to know when the
packet ended really.

Documentation snippet:
* SYN_REPORT:
  - Used to synchronize and separate events into packets of input data changes
    occurring at the same moment in time. For example, motion of a mouse may set
    the REL_X and REL_Y values for one motion, then emit a SYN_REPORT. The next
    motion will emit more REL_X and REL_Y values and send another SYN_REPORT.

Signed-off-by: Aniroop Mathur <a.mathur@samsung.com>
---
 drivers/input/input.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/input/input.c b/drivers/input/input.c
index 8806059..262ef77 100644
--- a/drivers/input/input.c
+++ b/drivers/input/input.c
@@ -401,8 +401,7 @@ static void input_handle_event(struct input_dev *dev,
 		if (dev->num_vals >= 2)
 			input_pass_values(dev, dev->vals, dev->num_vals);
 		dev->num_vals = 0;
-	} else if (dev->num_vals >= dev->max_vals - 2) {
-		dev->vals[dev->num_vals++] = input_value_sync;
+	} else if (dev->num_vals >= dev->max_vals - 1) {
 		input_pass_values(dev, dev->vals, dev->num_vals);
 		dev->num_vals = 0;
 	}
-- 
2.6.2

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

end of thread, other threads:[~2016-04-27 14:59 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-07 17:44 [PATCH] Input: Do not add SYN_REPORT in between a single packet data Aniroop Mathur
2016-03-09 18:53 ` Aniroop Mathur
2016-03-09 19:07 ` Dmitry Torokhov
2016-03-10 13:45   ` Henrik Rydberg
2016-03-10 18:56     ` Aniroop Mathur
2016-03-16 18:24       ` Aniroop Mathur
2016-03-23 19:35         ` Aniroop Mathur
2016-03-30 17:16           ` Aniroop Mathur
2016-04-01 21:51       ` Dmitry Torokhov
2016-04-02 17:01         ` Aniroop Mathur
2016-04-04 17:29           ` Aniroop Mathur
2016-04-06 14:56           ` Aniroop Mathur
2016-04-06 17:38             ` Dmitry Torokhov
2016-04-06 19:09               ` Aniroop Mathur
2016-04-06 19:51                 ` Henrik Rydberg
2016-04-06 20:43                   ` Aniroop Mathur
2016-04-27 14:59                     ` Aniroop Mathur

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).