chromiumos/platform/libevdev.git
15 months agolibevdev: enforce state resync if SYN_DROPPED happens 09/60209/3 factory-4455.B factory-pit-4390.B factory-pit-4471.B firmware-falco_peppy-4389.B firmware-leon-4389.26.B firmware-pit-4482.B firmware-wolf-4389.24.B master release-R30-4537.B stabilize-4443.B stabilize-4512.B
Chung-yih Wang [Thu, 27 Jun 2013 10:13:37 +0000 (18:13 +0800)]
libevdev: enforce state resync if SYN_DROPPED happens

BUG=chrome-os-partner:20471
TEST=none; don't know how to trigger it yet

Change-Id: Icfdafb64ceb7e7ac27ad80b16570a9f3c4d503e2
Reviewed-on: https://gerrit.chromium.org/gerrit/60209
Reviewed-by: Andrew de los Reyes <adlr@chromium.org>
Commit-Queue: Chung-yih Wang <cywang@chromium.org>
Tested-by: Chung-yih Wang <cywang@chromium.org>
16 months agoReadInfo: fail silently if file does not contain device info 12/57012/2 factory-4290.B factory-pit-4280.B factory-spring-4262.B stabilize-4255.B stabilize-4287.B
Dennis Kempin [Wed, 29 May 2013 18:45:32 +0000 (11:45 -0700)]
ReadInfo: fail silently if file does not contain device info

Printing error messages is useful in case the header is corrupted,
however ReadInfo is also used to read an optional header and will print
error messages in case there is no header present.
This error message has been removed.

BUG=chromium:244969
TEST=run touchtests. No more error messages.

Change-Id: Ibf1fd35630acb14f5a74872bb03eed513eca39a2
Reviewed-on: https://gerrit.chromium.org/gerrit/57012
Reviewed-by: Andrew de los Reyes <adlr@chromium.org>
Tested-by: Dennis Kempin <denniskempin@chromium.org>
Commit-Queue: Dennis Kempin <denniskempin@chromium.org>

17 months agolibevdev: Better error handling, better handling of bitmask reads. 68/50468/2 factory-4128.B factory-spring-4131.B
Andrew de los Reyes [Wed, 8 May 2013 16:30:50 +0000 (09:30 -0700)]
libevdev: Better error handling, better handling of bitmask reads.

Since bitmasks are stored as arrays of longs, and sizeof(long) depends
on the platform you're on (32 or 64 bit), reading in bitmasks was
always done in sizeof(long) increments. If a device is 32 bits, it
would generate 4 bytes for the 'bit' bitmask, but then when reading,
we would expect 8, and overrun the log. With this CL, we look for
end-of-line and stop.

BUG=chromium:239070
TEST=Able to make and replay new Spring regression test

Change-Id: I286f2ed36df7d7c9c5b0588941c8a386466d0d40
Reviewed-on: https://gerrit.chromium.org/gerrit/50468
Reviewed-by: Dennis Kempin <denniskempin@chromium.org>
Commit-Queue: Andrew de los Reyes <adlr@chromium.org>
Tested-by: Andrew de los Reyes <adlr@chromium.org>
17 months agoFix events log parsing on ARM platform 58/49458/5 release-R28-4100.B stabilize-4100.38.B stabilize-spring-4100.53.B toolchainB
Chung-yih Wang [Mon, 29 Apr 2013 04:50:46 +0000 (12:50 +0800)]
Fix events log parsing on ARM platform

The patch mainly fixes the bug of parsing the additional evdev info
(bitmasks) in the event log file on ARM platform where the size of
long is 4 bytes instead of 8 bytes on x86_64 machines. Therefore,
extra remaining bytes in the line should be read and skipped.

BUG=chromium:236282
TEST=run_remote_test --remote daisy_ip platform_GesturesRegressionTest

Change-Id: I5f5a239da209b172b6d0768c279311977479bc9f
Reviewed-on: https://gerrit.chromium.org/gerrit/49458
Reviewed-by: Andrew de los Reyes <adlr@chromium.org>
Commit-Queue: Chung-yih Wang <cywang@chromium.org>
Tested-by: Chung-yih Wang <cywang@chromium.org>
18 months agoRemove redundant definition of EvdevPtr 21/47421/3 stabilize-4008.0.B stabilize-4035.0.B stabilize-4068.0.B
Yunlian Jiang [Fri, 5 Apr 2013 17:32:55 +0000 (10:32 -0700)]
Remove redundant definition of EvdevPtr

BUG=chromium:218912
TEST=emerge-lumpy libevdev, no clang warning

Change-Id: I6a63fdde6719a93e5f9ccc5ec34f390222fa4d7d
Reviewed-on: https://gerrit.chromium.org/gerrit/47421
Reviewed-by: Dennis Kempin <denniskempin@chromium.org>
Tested-by: Yunlian Jiang <yunlian@chromium.org>
Commit-Queue: Yunlian Jiang <yunlian@chromium.org>

18 months agoReadInfo: Fill missing bitmask fields with zero 55/46955/3
Dennis Kempin [Fri, 29 Mar 2013 23:58:08 +0000 (16:58 -0700)]
ReadInfo: Fill missing bitmask fields with zero

Sometimes logs come with shorter bitmasks than expected. Make sure the
header parsing does not fail and fill the remaining fields with zero.

BUG=chromium:220977
TEST=load feedback log from mario

Change-Id: I3ff6fd05c7c30d8327a48b52e3b7d7a11e59c144
Reviewed-on: https://gerrit.chromium.org/gerrit/46955
Reviewed-by: Andrew de los Reyes <adlr@chromium.org>
Commit-Queue: Dennis Kempin <denniskempin@chromium.org>
Tested-by: Dennis Kempin <denniskempin@chromium.org>
18 months agoReadInfoFromFile: Read full name, don't stop at whitespaces 84/46784/2
Dennis Kempin [Thu, 28 Mar 2013 19:02:54 +0000 (12:02 -0700)]
ReadInfoFromFile: Read full name, don't stop at whitespaces

Some devices have whitespaces in their names. Read the whole line not
just the first word.

BUG=chromium:220977
TEST=touchtests -c from a feedback report from link

Change-Id: I6d52ab7df047a35541bb949ef45f96745dde3099
Reviewed-on: https://gerrit.chromium.org/gerrit/46784
Reviewed-by: Andrew de los Reyes <adlr@chromium.org>
Commit-Queue: Dennis Kempin <denniskempin@chromium.org>
Tested-by: Dennis Kempin <denniskempin@chromium.org>
19 months agocast (more) time_t values 04/44404/2 factory-spring-3842.B firmware-spring-3824.4.B firmware-spring-3824.55.B firmware-spring-3824.84.B firmware-spring-3824.B firmware-spring-3833.B release-R27-3912.B stabilize-3881.0.B stabilize-3912.79.B toolchainA
Mike Frysinger [Sun, 23 Dec 2012 18:00:24 +0000 (13:00 -0500)]
cast (more) time_t values

On x32, the time fields are uint64_t, but long types are 32bit.
So using %ld to show times results in warnings.  Cast it long to
avoid those warnings.

Just like commit da3e473ac3289b6782d45c02e749900594c6e96d, but for
some code that has been added since.

BUG=chromium-os:36866
TEST=`emerge-x32-generic libevdev` now works
TEST=`emerge-x86-alex libevdev` still works

Change-Id: I288f31eedfcf0763aef5ba838c73ca0e0fffa9e2
Reviewed-on: https://gerrit.chromium.org/gerrit/44404
Reviewed-by: Che-Liang Chiou <clchiou@chromium.org>
Commit-Queue: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
19 months agoinstall libevdev_hollow.so for replay utility 33/44033/3
Chung-yih Wang [Tue, 26 Feb 2013 11:30:38 +0000 (19:30 +0800)]
install libevdev_hollow.so for replay utility

BUG=chromium-os:37644
TEST=in chroot, build on a target board,
      try the following steps:
        1. setup_board --board=lumpy
        2. cros_workon --board=lumpy start libevdev
        3. emerge-lumpy libevdev
      And check if libevdev_hollow.so is installed
    under
        /build/lumpy/usr/lib64/libevdev_hollow.so

Change-Id: I08f6fa593483e944bcf075698d87a213f820a2a2
Reviewed-on: https://gerrit.chromium.org/gerrit/44033
Commit-Queue: Chung-yih Wang <cywang@chromium.org>
Tested-by: Chung-yih Wang <cywang@chromium.org>
Reviewed-by: Chung-yih Wang <cywang@chromium.org>
19 months agoMakefile: make in-place now installs into local in-place folder 69/44069/2
Dennis Kempin [Tue, 26 Feb 2013 19:19:14 +0000 (11:19 -0800)]
Makefile: make in-place now installs into local in-place folder

The replay tool has been updated to link against this folder. Keeps the
chroot environment cleaner.

BUG=chromium-os:39158
TEST=remake touchtests

Change-Id: I22f58c2bcabd185377688c5625a1304381885bcc
Reviewed-on: https://gerrit.chromium.org/gerrit/44069
Reviewed-by: Andrew de los Reyes <adlr@chromium.org>
Commit-Queue: Dennis Kempin <denniskempin@chromium.org>
Tested-by: Dennis Kempin <denniskempin@chromium.org>
19 months agoAdd in-place make targets 17/43817/2
Dennis Kempin [Fri, 22 Feb 2013 20:59:03 +0000 (12:59 -0800)]
Add in-place make targets

This CL adds in-place make targets for libevdev. It will only build
libevdev-hollow, as libevdev itself is not required.
This change brought an error in libevdev.c to light which has been
fixed. Compiling with LIBEVDEV_HOLLOW resulted in unused functions
errors, these functions have been added to the ifndef block.

BUG=chromium-os:38304
TEST=see touchpad-tests

Change-Id: I1da1c51db895f31f569d8608022a4992c0230a54
Reviewed-on: https://gerrit.chromium.org/gerrit/43817
Reviewed-by: Andrew de los Reyes <adlr@chromium.org>
Commit-Queue: Dennis Kempin <denniskempin@chromium.org>
Tested-by: Dennis Kempin <denniskempin@chromium.org>
19 months agoRead methods for new log format 42/43542/3
Dennis Kempin [Tue, 19 Feb 2013 22:28:48 +0000 (14:28 -0800)]
Read methods for new log format

Added read methods for the new log format, removing the dependency
on utouch-evemu for reading logs.
The log format has been changed to list bitmasks before absinfo to allow
checking the abs_bitmask for which absinfo's to read. Also this CL
introduces the LIBEVDEV_HOLLOW flag, which is used to strip libevdev
from methods that are to be reimplemented for replaying. Before the
whole libevdev.c file was skipped, but now it includes methods we do not
want to strip.

BUG=chromium-os:38304
TEST=reading the format is tested in platform/mttools/mtlib/replay.

Change-Id: I4602c9c1253b409a28bec6853481189fa409ee6c
Reviewed-on: https://gerrit.chromium.org/gerrit/43542
Commit-Queue: Dennis Kempin <denniskempin@chromium.org>
Reviewed-by: Dennis Kempin <denniskempin@chromium.org>
Tested-by: Dennis Kempin <denniskempin@chromium.org>
19 months agoNew API: Write device info and events to file 36/43136/4
Dennis Kempin [Tue, 12 Feb 2013 22:53:10 +0000 (14:53 -0800)]
New API: Write device info and events to file

This CL adds two new functions that allow writing of the
device info and input_events to a log file. The
Event_Dump_Debug_Log method has been adjusted to use these
methods.
In contrast to the previous behavior the debug log will now
contain the device information at the top of the log.
The API will be extended in a follow up CL by methods to read
this format for use in replaying of log files.

BUG=chromium-os:38859
TEST=gmerge libevdev && restart ui && tpcontrol log
Look at cmt_input_events.dat.

Change-Id: Icf0f26ab555704c63d90279e93d84a1973ed0f53
Reviewed-on: https://gerrit.chromium.org/gerrit/43136
Reviewed-by: Andrew de los Reyes <adlr@chromium.org>
Commit-Queue: Dennis Kempin <denniskempin@chromium.org>
Tested-by: Dennis Kempin <denniskempin@chromium.org>
20 months agolibevdev: Updating common.mk to ToT to enable profiling 84/42784/3 release-R26-3701.B stabilize-3701.30.0 stabilize-3701.30.0b stabilize-3701.46.B stabilize-3701.81.B stabilize-bluetooth-smart toolchain-3701.42.B
Ryan Harrison [Wed, 6 Feb 2013 21:39:30 +0000 (16:39 -0500)]
libevdev: Updating common.mk to ToT to enable profiling

This update replaces the current common.mk used in this project with the newest
version. This will allow all of the common.mk based projects to be on the same
version for debugging and enables profiling support.

BUG=chromium-os:37854
TEST=Exectuted the following commands to confirm the build works:
     MODE=profiling cros_workon_make --board=link
     MODE=profiling cros_workon_make --board=link --test
     cros_workon_make --board=link
     cros_workon_make --board=link --test
     Repeated these with emerge-link, USE=profiling, and
     FEATURES=test as need.
     For the emerge command with profiling and testing enable, confirmed the
     appropriate coverage files were created in /usr/share/profiling/...

Change-Id: If91b3447d009a8ab20d217fea4789d5677443687
Reviewed-on: https://gerrit.chromium.org/gerrit/42784
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Tested-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>

21 months agoAdd device class for multi-touch mice 20/41320/2 stabilize-3658.0.0
Che-Liang Chiou [Tue, 15 Jan 2013 22:57:13 +0000 (14:57 -0800)]
Add device class for multi-touch mice

BUG=chromium-os:36322
TEST=On Snow, Magic Mouse works (though its gestures are interpreted as
     a touchpad)

Change-Id: Ide9becba558e101cf2a43dffad746ac183ad9559
Reviewed-on: https://gerrit.chromium.org/gerrit/41320
Tested-by: Che-Liang Chiou <clchiou@chromium.org>
Reviewed-by: Andrew de los Reyes <adlr@chromium.org>
Commit-Queue: Che-Liang Chiou <clchiou@chromium.org>

21 months agoCorrect member type for struct MTSlotInfo 41/40641/3 factory-3536.B
Yufeng Shen [Tue, 8 Jan 2013 22:51:26 +0000 (17:51 -0500)]
Correct member type for struct MTSlotInfo

As pointed out by djkurtz@ in a related code review here
https://gerrit.chromium.org/gerrit/#/c/37987/2/x11-drivers/xf86-input-evdev/files/evdev-2.7.3-Add-SYN_DROPPED-handling.patch

EVIOCGMTSLOTS() takes a struct defined as
struct input_mt_request_layout {
      __u32 code;
      __s32 values[num_slots];
};

MTSlotInfo needs to explicitly make code unsigned 32bit and values array
of signed 32bit.

BUG=chromium-os:37778
TEST=compile.

Change-Id: If32ffcc7efea5e79062465967c40bd04456b4538
Reviewed-on: https://gerrit.chromium.org/gerrit/40641
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Commit-Queue: Yufeng Shen <miletus@chromium.org>
Tested-by: Yufeng Shen <miletus@chromium.org>
21 months agoSuppress out of range warning messages 27/40427/3
Chung-yih Wang [Fri, 4 Jan 2013 06:29:02 +0000 (14:29 +0800)]
Suppress out of range warning messages

If touchpad firmware does not report correct boundaries of touchpad
surface, the library keeps printing out warning messages in Xorg.0.log
once a finger is on the 'out of range' position. The patch tries to
suppress this kind of messages by updating effective boundary of X/Y
axis once the reported event is out of current range.

BUG=chromium-os:16477
TEST=on device; move a finger around the boundaries of the touchpad
  and see if the warning messages should be suppressed by updating
  X and Y ranges

Change-Id: I90e94fbf51c22f3e918aa29c3170b6481cf46d15
Reviewed-on: https://gerrit.chromium.org/gerrit/40427
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Reviewed-by: Chung-yih Wang <cywang@chromium.org>
Commit-Queue: Chung-yih Wang <cywang@chromium.org>
Tested-by: Chung-yih Wang <cywang@chromium.org>
21 months agocast time_t values 85/40185/2
Mike Frysinger [Sun, 23 Dec 2012 18:00:24 +0000 (13:00 -0500)]
cast time_t values

On x32, the time fields are uint64_t, but long types are 32bit.
So using %ld to show times results in warnings.  Cast it long to
avoid those warnings.

BUG=chromium-os:36866
TEST=`emerge-x32-generic libevdev` now works
TEST=`emerge-x86-alex libevdev` still works

Change-Id: Ieeabe6bb34cd59f537ae58ae0a6ac6f3fa522754
Reviewed-on: https://gerrit.chromium.org/gerrit/40185
Reviewed-by: Chung-yih Wang <cywang@chromium.org>
Reviewed-by: Che-Liang Chiou <clchiou@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
Commit-Queue: Mike Frysinger <vapier@chromium.org>

22 months agoAdd heuristics for determining evdev device class 95/38695/3 stabilize2
Che-Liang Chiou [Mon, 26 Nov 2012 23:49:02 +0000 (15:49 -0800)]
Add heuristics for determining evdev device class

These heuristics are similar to those of xf86-input-cmt.

BUG=chromium-os:36634
TEST=see it probes device class correctly from debug output

Change-Id: I9e8a2225ff439608621d3760adde7690ded4b61e
Reviewed-on: https://gerrit.chromium.org/gerrit/38695
Commit-Ready: Che-Liang Chiou <clchiou@chromium.org>
Reviewed-by: Che-Liang Chiou <clchiou@chromium.org>
Tested-by: Che-Liang Chiou <clchiou@chromium.org>
22 months agoAdd Evdev_Get_Version() 46/38446/3
Chung-yih Wang [Wed, 21 Nov 2012 03:25:33 +0000 (11:25 +0800)]
Add Evdev_Get_Version()

BUG=chromium-os:36545
TEST=in chroot; follow the steps to see if the version number could be
  found in the library libevdev.so

  $ version=`git rev-parse HEAD`
  $ sudo emerge libevdev
  $ grep $version /usr/lib64/libevdev.so

  Binary file /usr/lib64/libevdev.so matches

Change-Id: I744a6704bcbd7d89c3b19e99d8bc0264379a9d7e
Reviewed-on: https://gerrit.chromium.org/gerrit/38446
Reviewed-by: Joseph Shyh-In Hwang <josephsih@chromium.org>
Commit-Ready: Chung-yih Wang <cywang@chromium.org>
Tested-by: Chung-yih Wang <cywang@chromium.org>
23 months agoPropagate EV_REL events up in input stack
Che-Liang Chiou [Thu, 25 Oct 2012 00:08:51 +0000 (17:08 -0700)]
Propagate EV_REL events up in input stack

As we want xf86-input-cmt to drive mice in addition to touchpads, EV_REL
events have to be propagated up.

BUG=chromium-os:29435
TEST=add debug output in gestures, and see it receives EV_REL events

Change-Id: I0d134077882725ba6399ea47743bdb8ea2d5a051
Reviewed-on: https://gerrit.chromium.org/gerrit/36514
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Commit-Ready: Che-Liang Chiou <clchiou@chromium.org>
Tested-by: Che-Liang Chiou <clchiou@chromium.org>
2 years agoPropagate orientation min/max up to next level of input stack
Che-Liang Chiou [Thu, 11 Oct 2012 18:41:06 +0000 (11:41 -0700)]
Propagate orientation min/max up to next level of input stack

This information is important to gestures library when scaling touch
major and minor input, which may adjust their values according to
orientation of fingers.  So send it up.

BUG=chromium-os:29435
TEST=connect Apple Magic Trackpad, and observe gestures library has
     received orientation min/max [-31, 32]

Change-Id: Idf48f320026d9e34339d7231765e9d6440ee5739
Reviewed-on: https://gerrit.chromium.org/gerrit/35294
Commit-Ready: Che-Liang Chiou <clchiou@chromium.org>
Reviewed-by: Che-Liang Chiou <clchiou@chromium.org>
Tested-by: Che-Liang Chiou <clchiou@chromium.org>
2 years agofix out-of-tree installing factory-2985.B factory-2993.B factory-3004.B
Mike Frysinger [Wed, 8 Aug 2012 19:01:43 +0000 (15:01 -0400)]
fix out-of-tree installing

The current install rules assume that we are installing out of the source
dir, but this fails when building out-of-tree.  Tweak the install rule so
it works regardless.

BUG=chromium-os:33327
TEST=`emerge-x86-alex libevdev` still works

Change-Id: I4197b89dabfe2aa67dd2f6f85927e56c94a69404
Reviewed-on: https://gerrit.chromium.org/gerrit/29629
Reviewed-by: Dennis Kempin <denniskempin@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Chung-yih Wang <cywang@chromium.org>
Commit-Ready: Mike Frysinger <vapier@chromium.org>

2 years agoRemove "race condition TODO" comments
Daniel Kurtz [Mon, 17 Sep 2012 07:49:26 +0000 (15:49 +0800)]
Remove "race condition TODO" comments

This race was already solved when we added event synchronization
using Event_Sync_State() to EvdevRead().

Event_Read() will force a resynchronization if it detects any input
events arrived during a previous call to Event_Sync_State().

BUG=chrome-os-partner:13951
TEST=none (no functional change)

Change-Id: I85e47b92a90ffcbce85dfe84a39dac8ea6c55cc9
Reviewed-on: https://gerrit.chromium.org/gerrit/33414
Reviewed-by: Chung-yih Wang <cywang@chromium.org>
Commit-Ready: Daniel Kurtz <djkurtz@chromium.org>
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Tested-by: Daniel Kurtz <djkurtz@chromium.org>
2 years agoCall Event_Sync_State in Event_Open not Event_Init
Daniel Kurtz [Mon, 17 Sep 2012 07:45:29 +0000 (15:45 +0800)]
Call Event_Sync_State in Event_Open not Event_Init

Evdev is a 100% stateful protocol, meaning individual input_event's are
"deltas" between a shared input_event state shared by kernel driver and
userspace client.
Whenever the userspace client opens the kernel device, it must completely
resynchronize its state with the kernel (at least for those AXIS that are
stateful, such as KEYs and ABSs).

Previously, we were only doing this synchronization, but only once,
during driver PreInit().
However, the X input driver actually closes the device file during PreInit
and reopens it in the DeviceOn handler.  So, there is a small window
during which the kernel & X input driver state could get out of sync.
To make matters worse, during VT-Switch (e.g., during Suspend/Resume),
the X server issues DEVICE_OFF/_ON events, which also causes the X input
driver to close and then reopen the device file.  This means, on resume X
input driver state will not have been updated for any events during the
time when the device file was closed.

The solution is simple, always re-sync when opening the file for the
purpose of listening for input events.

BUG=chrome-os-partner:13951
TEST=On device using a touchpad supported by xf86-input-cmt:
 1) Place one finger on TP (finger A), move around to confirm pointer motion
 2) Place second finger on TP (finger B), move both to confirm 2-finger scroll
 3) Remove finger A so that on finger B is on pad, move around to confirm pointer motion
 4) Enter VT-2 (Ctrl-Alt-F2, F2 aka "->")
 5) While in VT-2, remove finger from touchpad
 6) Switch back to VT-1 (Ctrl-Alt-F1, F1 aka "<-")
 7) Try moving cursor, cursor responsive and smooth
 => w/out fix: no motion or choppy motion due to Ghost finger)

Change-Id: Ibd53b7767651a4387f624ac2a8cded6997909b70
Reviewed-on: https://gerrit.chromium.org/gerrit/33408
Reviewed-by: Chung-yih Wang <cywang@chromium.org>
Commit-Ready: Daniel Kurtz <djkurtz@chromium.org>
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Tested-by: Daniel Kurtz <djkurtz@chromium.org>
2 years agoassign printf format attribute to log_callback factory-2914.B
Daniel Kurtz [Fri, 7 Sep 2012 14:29:32 +0000 (22:29 +0800)]
assign printf format attribute to log_callback

Let the compiler detect and flag improper log messages at compile time.

BUG=chromium-os:34226
TEST=libevdev and cmt build clean

Change-Id: Ic339374361ab8bac7badc272e5dd33f9c8904ba6
Reviewed-on: https://gerrit.chromium.org/gerrit/32546
Reviewed-by: Andrew de los Reyes <adlr@chromium.org>
Commit-Ready: Daniel Kurtz <djkurtz@chromium.org>
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Tested-by: Daniel Kurtz <djkurtz@chromium.org>
2 years agouse %zu for printf'ing size_t
Daniel Kurtz [Fri, 7 Sep 2012 14:27:51 +0000 (22:27 +0800)]
use %zu for printf'ing size_t

This will be flagged as an warning once log_callback is given the
printf format __attribute__.

BUG=chromium-os:34226
TEST=builds clean when log_callback has __attribute__((format(printf,3,4)))

Change-Id: Iafe4da56c3637ee0b2b94c3652066a8ae8d6079e
Reviewed-on: https://gerrit.chromium.org/gerrit/32545
Reviewed-by: Andrew de los Reyes <adlr@chromium.org>
Commit-Ready: Daniel Kurtz <djkurtz@chromium.org>
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Tested-by: Daniel Kurtz <djkurtz@chromium.org>
2 years agoFix the wrong bitmask used in detecting single-pressure device factory-2846.B factory-2848.B
Chung-yih Wang [Tue, 28 Aug 2012 09:31:57 +0000 (17:31 +0800)]
Fix the wrong bitmask used in detecting single-pressure device

BUG=chromium-os:33949
TEST=on a multi-touch device(not semi-mt like Cr48), follow the steps:

1. have two finger touched on the touchpad with different pressures.
2. press alt-shift-i to generate a user feedback, don't send it out.
3. examine the touchpad_activity_log.txt under /var/log and see if two
   finger pressures are different in the log.

Change-Id: I52ac2f1f2d00eb9e57e5c4ce726953d46456d413
Reviewed-on: https://gerrit.chromium.org/gerrit/31578
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Commit-Ready: Chung-yih Wang <cywang@chromium.org>
Reviewed-by: Chung-yih Wang <cywang@chromium.org>
Tested-by: Chung-yih Wang <cywang@chromium.org>
2 years agolibevdev: move input event logging very close to read(). firmware-butterfly-2788.B firmware-stout-2817.B
Andrew de los Reyes [Fri, 17 Aug 2012 01:08:12 +0000 (18:08 -0700)]
libevdev: move input event logging very close to read().

We want to be sure we aren't missing any input events, even if they
come in with odd timestamps.

BUG=chromium-os:33601
TEST=tested on device; dumped log looked correct

Change-Id: I9c6e99b7bed6580b84f50cfa80766a8eb08489d4
Reviewed-on: https://gerrit.chromium.org/gerrit/30637
Commit-Ready: Andrew de los Reyes <adlr@chromium.org>
Reviewed-by: Andrew de los Reyes <adlr@chromium.org>
Tested-by: Andrew de los Reyes <adlr@chromium.org>
2 years agoRename the semi-mt specific handling with the single-pressure factory-2717.B factory-2723.14.B firmware-link-2695.2.B firmware-link-2695.B firmware-parrot-2685.B firmware-snow-2695.90.B firmware-snow-2695.B
Chung-yih Wang [Mon, 23 Jul 2012 08:49:10 +0000 (16:49 +0800)]
Rename the semi-mt specific handling with the single-pressure

Since the new kernel driver reports the data with MT-B format on Cr48, we don't
need the extra manipulations for semi-mt properties such as ABS_PRESSURE.
However, we still keep the single-pressure handling for other semi-mt devices
if it applies.

BUG=chromium-os:32681
TEST=on device, the touchpad still works correctly.

Change-Id: I9db4b4427c84de3e87717eb9c498eacdac4cd42d
Reviewed-on: https://gerrit.chromium.org/gerrit/28162
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Commit-Ready: Chung-yih Wang <cywang@chromium.org>
Reviewed-by: Chung-yih Wang <cywang@chromium.org>
Tested-by: Chung-yih Wang <cywang@chromium.org>
2 years agoChange log level of Event_Sync_State 90/27990/1
Chung-yih Wang [Fri, 20 Jul 2012 08:26:15 +0000 (16:26 +0800)]
Change log level of Event_Sync_State

We need the log information of Event_Sync_State to test if the SYN_DROPPED
event is handled correctly.

BUG=chromium-os:28997
TEST=there should be lines containing 'Event_Sync_State' in /var/log/Xorg.0.log

Change-Id: I95225a6fe8a87641480595231df44b2eaaf0788a

2 years agoQuery ABS_MT_POSITION_X/Y for trackpad area 20/26820/1 factory-2569.B
Yufeng Shen [Thu, 5 Jul 2012 15:44:36 +0000 (11:44 -0400)]
Query ABS_MT_POSITION_X/Y for trackpad area

Currently we are querying ABS_X/Y for trackpad area, which might
be missing from some device driver (like Apple Magic Mouse). So
we change to query ABS_MT_POSITION_X/Y instead for trackpad area.

BUG=chromium-os:29435
TEST=Checked that CMT works with Apple Magic Mouse, and still
     works with Alex and Lumpy.

Change-Id: Ic52967762c5846f22ca7cd7b7c524b3453b6b3a7

2 years agoPorted change I6e56456e2f47af79b94932498d1abb1b42cf8584 36/26036/1
Dennis Kempin [Mon, 25 Jun 2012 18:52:24 +0000 (11:52 -0700)]
Ported change I6e56456e2f47af79b94932498d1abb1b42cf8584

libevdev: fix EvdevProbeMTSlot()

MTSlotInfoPtr is already a pointer, get the size of what it points to,
and pass its value, not its address, to the ioctl.

BUG=chromium-os:31878
TEST=boot chromebook;  inspect /var/log/Xorg.0.log
    => No (EE) error messages related to EVIOCGMTSLOTS

Change-Id: I283d5ab3e3115c937b9888147c698eb26479ee06

2 years agoPorted change I080542f3211c786c92bc495cc9c72576147fe6a6 35/26035/1
Dennis Kempin [Mon, 25 Jun 2012 18:24:59 +0000 (11:24 -0700)]
Ported change I080542f3211c786c92bc495cc9c72576147fe6a6

A recent refactor is filling /var/log/Xorg.0.log with debug messages on
every input sample, and labeling them as errors.  Reduce these messages
to LOG_DEBUG.
Note: "SYN_DROPPED" and "SYN_UNKNOWN" are anomalous conditions that we do
want to report as a WARNING.

Also reduce a few other recoverable error conditions to WARNING.

BUG=chromium-os:31880
TEST=tail -F /var/log/Xorg.0.log, no more Event_Print() message

Change-Id: Ia33aa6dc7c5fdbc558f5efa0d15049ff222df4c6

2 years agoadded build target for hollow libevdev 39/25439/2 factory-2475.B release-R21-2465.B
Dennis Kempin [Fri, 15 Jun 2012 23:27:12 +0000 (16:27 -0700)]
added build target for hollow libevdev

libevdev_hollow is build without the file libevdev.c. It's purpose
is to provide all code of libevdev without the device interfacing methods.
This allows the regression test system to test the libevdev library
by mocking these methods.

BUG=chromium-os:31732
TEST=make install. see that libevdev_hollow has been installed in lib64.

Change-Id: Ic5cf0bac4a7a3053b5ea394b8b7be0668aa2f8fd

2 years agoTransition to common.mk 58/25358/5 factory-2460.B
Dennis Kempin [Fri, 15 Jun 2012 01:44:07 +0000 (18:44 -0700)]
Transition to common.mk

updated makefiles to use common.mk
BUG=None
TEST=make all and emerge libevdev

Change-Id: Iabd618e6582b276410eed290720947fd4a888cbd

2 years agoupdated mod of include files as suggested by vapier 49/25349/2
Dennis Kempin [Fri, 15 Jun 2012 00:16:23 +0000 (17:16 -0700)]
updated mod of include files as suggested by vapier

BUG=None
TEST=None

Change-Id: Id1fee6f19f1cb3e7b7b31745f6837af4e68d0a74

2 years agoRefactoring: Moved include files 47/25047/2
Dennis Kempin [Mon, 11 Jun 2012 22:26:52 +0000 (15:26 -0700)]
Refactoring: Moved include files

Moved include files from include/ to include/libevdev to mirror include
structure in target folder.

BUG=chromium-os:31022
TEST=emerge -av1 libevdev; emerge -av1 xf86-input-cmt;

Change-Id: Iee58f4e8080bbf7e99bd67d9e5fc09e72e9e32ff

2 years agoFixed: Log verbosity of status messages 46/25046/2
Dennis Kempin [Mon, 11 Jun 2012 22:13:50 +0000 (15:13 -0700)]
Fixed: Log verbosity of status messages

normal usage without errors should not create log messages.
This fix turns status logs back to DEBUG verbosity.

BUG=chromium-os:31714
TEST=gmerge libevdev; restart ui; check log file after movement.

Change-Id: I5310c569f14beb6855ab75e04e04cfdc04b34db5

2 years agoMakefile: fixed install command 10/25010/2
Dennis Kempin [Mon, 11 Jun 2012 18:06:17 +0000 (11:06 -0700)]
Makefile: fixed install command

the install command used in the initial commit threw an error.
install does not take multiple files as parameters, use one
install command per file.
Also: added libevdev_log.h to installed files.

BUG=chromium-os:31022
TEST=emerge libevdev;
everything installs into the right folders

Change-Id: I4e8f31d39fc535360e111868da1561f01f79382c

2 years agoMoved files from xf86-input-cmt to libevdev 81/24881/1
Dennis Kempin [Fri, 8 Jun 2012 17:32:23 +0000 (10:32 -0700)]
Moved files from xf86-input-cmt to libevdev

xf86-input-cmt has been refactored to allow the kernel interfacing code to be
extracted into this library. This commit consists of the libevdev files from
xf86-input-cmt as of commit 6d19835796cfd950334d9ace309f133bdf08505c. No changes
to the source files have been made.
It also includes a Makefile to build the library.

BUG=chromium-os:31022
TEST=compiles