<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/libevdev.git/libevdev, branch libevdev-1.2</title>
<subtitle>gitlab.freedesktop.org: libevdev/libevdev.git
</subtitle>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libevdev.git/'/>
<entry>
<title>Drain all events before synchronizing after SYN_DROPPED</title>
<updated>2014-04-23T22:17:01+00:00</updated>
<author>
<name>Peter Hutterer</name>
<email>peter.hutterer@who-t.net</email>
</author>
<published>2014-04-07T05:16:28+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libevdev.git/commit/?id=050bca91a1e8dd2e46c219c0b282092cb053166c'/>
<id>050bca91a1e8dd2e46c219c0b282092cb053166c</id>
<content type='text'>
The kernel ring buffer drops all events on SYN_DROPPED, but then continues to
fill up again. So by the time we read the events, the kernel's client buffer is
essentially like this:
  SYN_DROPPED, ev1, ev2, ev3, ...., evN

The kernel's device state represents the device after evN, and that is what
the ioctls return. For EV_KEY, EV_SND, EV_LED and EV_SW the kernel removes
potential duplicates from the client buffer [1], it doesn't do so for EV_ABS.

So we can't actually sync while there are events on the wire because the
events represent an earlier state. So simply discard all events in the kernel
buffer, synchronize, and then start processing again. We lose some granularity
but at least the events are correct.

[1] http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/drivers/input/evdev.c?id=483180281f0ac60d1138710eb21f4b9961901294

Signed-off-by: Peter Hutterer &lt;peter.hutterer@who-t.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The kernel ring buffer drops all events on SYN_DROPPED, but then continues to
fill up again. So by the time we read the events, the kernel's client buffer is
essentially like this:
  SYN_DROPPED, ev1, ev2, ev3, ...., evN

The kernel's device state represents the device after evN, and that is what
the ioctls return. For EV_KEY, EV_SND, EV_LED and EV_SW the kernel removes
potential duplicates from the client buffer [1], it doesn't do so for EV_ABS.

So we can't actually sync while there are events on the wire because the
events represent an earlier state. So simply discard all events in the kernel
buffer, synchronize, and then start processing again. We lose some granularity
but at least the events are correct.

[1] http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/drivers/input/evdev.c?id=483180281f0ac60d1138710eb21f4b9961901294

Signed-off-by: Peter Hutterer &lt;peter.hutterer@who-t.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Move read_more_events() up in the file</title>
<updated>2014-04-23T22:17:01+00:00</updated>
<author>
<name>Peter Hutterer</name>
<email>peter.hutterer@who-t.net</email>
</author>
<published>2014-04-07T05:01:44+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libevdev.git/commit/?id=8b01184404dafb0dc121a1cdef066ea78ba6d21c'/>
<id>8b01184404dafb0dc121a1cdef066ea78ba6d21c</id>
<content type='text'>
No functional change

Signed-off-by: Peter Hutterer &lt;peter.hutterer@who-t.net&gt;
Reviewed-by: Benjamin Tissoires &lt;benjamin.tissoires@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
No functional change

Signed-off-by: Peter Hutterer &lt;peter.hutterer@who-t.net&gt;
Reviewed-by: Benjamin Tissoires &lt;benjamin.tissoires@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Actually make the min queue size a minimum</title>
<updated>2014-04-10T01:00:56+00:00</updated>
<author>
<name>Peter Hutterer</name>
<email>peter.hutterer@who-t.net</email>
</author>
<published>2014-04-07T05:00:24+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libevdev.git/commit/?id=1c425e9837b9e9b5e1f5ebdad5393418a2473840'/>
<id>1c425e9837b9e9b5e1f5ebdad5393418a2473840</id>
<content type='text'>
Signed-off-by: Peter Hutterer &lt;peter.hutterer@who-t.net&gt;
Reviewed-by: Benjamin Tissoires &lt;benjamin.tissoires@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Peter Hutterer &lt;peter.hutterer@who-t.net&gt;
Reviewed-by: Benjamin Tissoires &lt;benjamin.tissoires@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Clarify what signal-safe means</title>
<updated>2014-04-10T01:00:56+00:00</updated>
<author>
<name>Peter Hutterer</name>
<email>peter.hutterer@who-t.net</email>
</author>
<published>2014-04-10T01:00:24+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libevdev.git/commit/?id=779654839a5fbcb3618493be71ff9191e0a0af88'/>
<id>779654839a5fbcb3618493be71ff9191e0a0af88</id>
<content type='text'>
Just in case...

Signed-off-by: Peter Hutterer &lt;peter.hutterer@who-t.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Just in case...

Signed-off-by: Peter Hutterer &lt;peter.hutterer@who-t.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Calling libevdev_enable_event_code() overwrites EV_ABS/EV_REP values</title>
<updated>2014-04-07T23:01:56+00:00</updated>
<author>
<name>Peter Hutterer</name>
<email>peter.hutterer@who-t.net</email>
</author>
<published>2014-04-04T04:11:47+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libevdev.git/commit/?id=d55056c468360cbe2ecbe90fde60ba176c5429ce'/>
<id>d55056c468360cbe2ecbe90fde60ba176c5429ce</id>
<content type='text'>
Document this behaviour

Signed-off-by: Peter Hutterer &lt;peter.hutterer@who-t.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Document this behaviour

Signed-off-by: Peter Hutterer &lt;peter.hutterer@who-t.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Split the SYN_DROPPED page into a few sections</title>
<updated>2014-04-07T04:26:31+00:00</updated>
<author>
<name>Peter Hutterer</name>
<email>peter.hutterer@who-t.net</email>
</author>
<published>2014-04-07T04:26:31+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libevdev.git/commit/?id=c44e510acd3fa1ba02f39e4130761fbfc06e0755'/>
<id>c44e510acd3fa1ba02f39e4130761fbfc06e0755</id>
<content type='text'>
Signed-off-by: Peter Hutterer &lt;peter.hutterer@who-t.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Peter Hutterer &lt;peter.hutterer@who-t.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix a typo, add a @ref in the documentation</title>
<updated>2014-04-07T04:23:21+00:00</updated>
<author>
<name>Peter Hutterer</name>
<email>peter.hutterer@who-t.net</email>
</author>
<published>2014-04-07T04:21:27+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libevdev.git/commit/?id=be87068a9bbcfefef822a06640f4a931389057d6'/>
<id>be87068a9bbcfefef822a06640f4a931389057d6</id>
<content type='text'>
Signed-off-by: Peter Hutterer &lt;peter.hutterer@who-t.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Peter Hutterer &lt;peter.hutterer@who-t.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Drop invalid ABS_MT_TRACKING_ID changes</title>
<updated>2014-04-03T03:31:40+00:00</updated>
<author>
<name>Peter Hutterer</name>
<email>peter.hutterer@who-t.net</email>
</author>
<published>2014-04-01T07:01:39+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libevdev.git/commit/?id=6cbf971b3969de37a2a8e5c6cb02a0648210a6af'/>
<id>6cbf971b3969de37a2a8e5c6cb02a0648210a6af</id>
<content type='text'>
Follow-up to
commit 41334b5b40cd5456f5f584b55d8888aaafa1f26e
Author: Peter Hutterer &lt;peter.hutterer@who-t.net&gt;
Date:   Thu Mar 6 11:54:00 2014 +1000

    If the tracking ID changes during SYN_DROPPED, terminate the touch first

In normal mode, we may get double tracking ID events in the same slot, but
only if we either have a user-generated event sequence (uinput) or a malicious
device that tries to send data on a slot &gt; dev-&gt;num_slots.
Since the client is unlikely to be able to handle these events, discard the
ABS_MT_TRACKING_ID completely. This is a bug somewhere in the stack, so
complain and hobble on along.

Note: the kernel doesn't allow that, but we cap to num_slots anyway, see
66fee1bec4c4b021e1b54adcd775cf6e2aa84869.

Signed-off-by: Peter Hutterer &lt;peter.hutterer@who-t.net&gt;
Reviewed-by: Benjamin Tissoires &lt;benjamin.tissoires@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Follow-up to
commit 41334b5b40cd5456f5f584b55d8888aaafa1f26e
Author: Peter Hutterer &lt;peter.hutterer@who-t.net&gt;
Date:   Thu Mar 6 11:54:00 2014 +1000

    If the tracking ID changes during SYN_DROPPED, terminate the touch first

In normal mode, we may get double tracking ID events in the same slot, but
only if we either have a user-generated event sequence (uinput) or a malicious
device that tries to send data on a slot &gt; dev-&gt;num_slots.
Since the client is unlikely to be able to handle these events, discard the
ABS_MT_TRACKING_ID completely. This is a bug somewhere in the stack, so
complain and hobble on along.

Note: the kernel doesn't allow that, but we cap to num_slots anyway, see
66fee1bec4c4b021e1b54adcd775cf6e2aa84869.

Signed-off-by: Peter Hutterer &lt;peter.hutterer@who-t.net&gt;
Reviewed-by: Benjamin Tissoires &lt;benjamin.tissoires@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Move slot-related initialization down</title>
<updated>2014-04-03T03:31:39+00:00</updated>
<author>
<name>Peter Hutterer</name>
<email>peter.hutterer@who-t.net</email>
</author>
<published>2014-04-01T05:40:09+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libevdev.git/commit/?id=27df93737ee4a7d20d913e408d5f9f8d2bb33bad'/>
<id>27df93737ee4a7d20d913e408d5f9f8d2bb33bad</id>
<content type='text'>
No real effects, but improves readability

Signed-off-by: Peter Hutterer &lt;peter.hutterer@who-t.net&gt;
Reviewed-by: Benjamin Tissoires &lt;benjamin.tissoires@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
No real effects, but improves readability

Signed-off-by: Peter Hutterer &lt;peter.hutterer@who-t.net&gt;
Reviewed-by: Benjamin Tissoires &lt;benjamin.tissoires@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Drop hardcoded MAX_SLOTS in favour of pre-allocated memory</title>
<updated>2014-04-03T03:30:49+00:00</updated>
<author>
<name>Peter Hutterer</name>
<email>peter.hutterer@who-t.net</email>
</author>
<published>2014-04-01T05:32:46+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libevdev.git/commit/?id=f8fba5b5884bfb62225b9bde991dfdbec92ad751'/>
<id>f8fba5b5884bfb62225b9bde991dfdbec92ad751</id>
<content type='text'>
We can't allocate in sync_mt_state since it may be called in the signal
handler. So pre-allocate based on the device's number of slots, store that in
the libevdev struct and use it for the sync process.

This fixes a remaining bug with the handling of ABS_MT_TRACKING_ID. If a
device had &gt; MAX_SLOTS and a slot above that limit would start or stop during
a SYN_DROPPED event, the slot would not be synced, and a subsequent touch in
that slot may double-terminate or double-open a touchpoint in the client.
For the effects of that see

commit 41334b5b40cd5456f5f584b55d8888aaafa1f26e
Author: Peter Hutterer &lt;peter.hutterer@who-t.net&gt;
Date:   Thu Mar 6 11:54:00 2014 +1000

    If the tracking ID changes during SYN_DROPPED, terminate the touch first

Signed-off-by: Peter Hutterer &lt;peter.hutterer@who-t.net&gt;
Reviewed-by: Benjamin Tissoires &lt;benjamin.tissoires@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We can't allocate in sync_mt_state since it may be called in the signal
handler. So pre-allocate based on the device's number of slots, store that in
the libevdev struct and use it for the sync process.

This fixes a remaining bug with the handling of ABS_MT_TRACKING_ID. If a
device had &gt; MAX_SLOTS and a slot above that limit would start or stop during
a SYN_DROPPED event, the slot would not be synced, and a subsequent touch in
that slot may double-terminate or double-open a touchpoint in the client.
For the effects of that see

commit 41334b5b40cd5456f5f584b55d8888aaafa1f26e
Author: Peter Hutterer &lt;peter.hutterer@who-t.net&gt;
Date:   Thu Mar 6 11:54:00 2014 +1000

    If the tracking ID changes during SYN_DROPPED, terminate the touch first

Signed-off-by: Peter Hutterer &lt;peter.hutterer@who-t.net&gt;
Reviewed-by: Benjamin Tissoires &lt;benjamin.tissoires@gmail.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
