Commit Graph

1243 Commits

Author SHA1 Message Date
Chase Douglas
7bcbf8eb11 Allocate SynapticsPrivate.comm->hwState
This is needed for when SynapticsHwState can't be allocated on the stack.

Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-02-10 13:20:48 -08:00
Chase Douglas
a78d55d021 Allocate SynapticsHwStruct for local function use
SynapticsHwStruct (SHS) will soon include ValuatorMasks, which can only
be allocated on the heap. The input driver callbacks are called in
signal context, so we can't instantiate a new SHS when that occurs.
Since we only ever need one SHS, allocate one at device init time and
use it in place of local SHS instances.

Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-02-10 13:20:48 -08:00
Chase Douglas
e5cd694ed1 Transition eventcomm-test to new SynapticsHwState instantiation scheme
Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-02-10 13:20:48 -08:00
Chase Douglas
c34cf307f9 Introduce SynapticsHwStateAlloc() and SynapticsHwStateFree()
Put them in a new file so eventcomm-test can access them.

Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-02-10 13:20:48 -08:00
Chase Douglas
146edc2baa Allocate proto data in eventcomm-test
Provide a helper function for allocating proto data and use it in
eventcomm-test. This ensures a null pointer for priv->proto_data is not
dereferenced.

Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-02-10 13:20:48 -08:00
Chase Douglas
49f6109032 Revert "Replace the motion estimator"
The algorithm is completely wrong because it uses subtraction of
unsigned variables. The negative effects of this commit manifest in
cursor warps to edges or corners of the screen.

Since the algorithm has never worked right, previous testing must be
disregarded. Revert it until we have a tested algorithm.

This reverts commit b26125e412.

Conflicts:

	src/synaptics.c

Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-02-09 00:38:13 +10:00
Peter Hutterer
141d9120b1 Submit the right number of MT axes
For devices with only x/y, num_mt_axes is 0, since x/y are already counted
elsewhere. The server will then fail to init the TouchClassRec since it
expects at least 2 touch axes. Fix this, assume we always have at least two
touch axes if we have any touch axes at all.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2012-02-07 06:14:13 +10:00
Peter Hutterer
e4ee51e771 Merge branch 'fixes' of git://people.freedesktop.org/~cndougla/xf86-input-synaptics 2012-02-07 02:51:08 +10:00
Chase Douglas
6b808dc766 Don't initialize semi-multitouch devices for touch device class
Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
2012-02-06 08:37:00 -08:00
Chase Douglas
a8b065eeb8 Don't initialize touch state if device does is not multitouch
And don't attempt to use it either.

Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
2012-02-06 08:35:16 -08:00
Chase Douglas
4824f67e7b Don't emit touch sequences if only one touch is active
When a second touch begins, emit a touch begin for the first touch with
the current valuator values. When a touch ends and we are going from two
touches down to one touch, end both touches. This ensures we don't send
a touch sequence at the same time we are moving the pointer.

Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
2012-02-06 08:33:16 -08:00
Benjamin Otte
da0d20d0fd eventcomm: Fix initialization code
num_mt_axes contains the number of non-x/y multitouch axes, and the valuator
mask needs to contains x, y, followed by two empy values for the scroll
valuators, followed by the remaining MT axes.

https://bugs.freedesktop.org/show_bug.cgi?id=45663

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-02-07 00:10:25 +10:00
Chase Douglas
3822705204 Only move the cursor when one touch is on a touchpad
Otherwise, we might post motion events and touch events for the same
physical interaction.

Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-02-06 23:51:54 +10:00
Chase Douglas
dfdcf8b343 Ensure delta computation does not go crazy
I have seen this a couple times, but I haven't been able to catch it
when it starts. It's a feedback loop, so once you miss the entrance of
the loop, you can't see what really went wrong.

This patch papers over the issue for now.

Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
Acked-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-02-06 23:51:54 +10:00
Peter Hutterer
782c7fb6fe Remove compiler warning: unused variable "atom"
synaptics.c: In function 'DeviceInit':
synaptics.c:1161:18: warning: unused variable 'atom' [-Wunused-variable]

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-02-06 23:51:54 +10:00
Peter Hutterer
53adb8399d synclient: fix indentation of "format mismatch" parameters
Prefix is 4 spaces, not three.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-02-04 23:44:09 +10:00
Chase Douglas
d15c391544 eventcomm: Add touch event handling
Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-01-26 15:54:29 +10:00
Chase Douglas
efdc34859b eventcomm: Read evdev events from mtdev where multitouch is available
Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-01-26 15:53:18 +10:00
Chase Douglas
b1b9745979 eventcomm: Initialize touch device and axes
Use mtdev to ensure touches are tracked and of evdev MT protocol type
B.

Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-01-26 15:51:24 +10:00
Chase Douglas
56d32619b9 Add touch device class support
Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-01-26 15:48:37 +10:00
Chase Douglas
7ef9150d83 Allocate axis labels array dynamically
Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-01-26 15:47:19 +10:00
Daniel Stone
3804a0ee0b Constify priv->device
Fixes a compiler warning due to discarding the const qualifier as it
comes back from the option code.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-01-06 12:13:18 +10:00
Peter Hutterer
c861d4568c test: fix build error introduced in 9f9b55ab55
Bad search/replace, ended up in two xf86SetStrOption declarations which
differed on ABIs < 14.

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=44335

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2012-01-04 08:04:24 +10:00
Peter Hutterer
f5c60a6d1e Remove unused variable 'thr'
synaptics.c: In function 'SynapticsAccelerationProfile':
synaptics.c:619:12: warning: unused variable 'thr' [-Wunused-variable]

On input ABIs < 14.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2012-01-04 08:04:24 +10:00
JJ Ding
3ec93218d2 fix wrong finger width range
Signed-off-by: JJ Ding <dgdunix@gmail.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-01-03 09:00:14 +10:00
Peter Hutterer
9f9b55ab55 test: fix build errors introduced by upstream server change
Introduced by upstream change xorg-server-1.11.99.1-33-g09e4b78,
    Fix gcc -Wwrite-strings warnings in xf86 ddx

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-12-12 11:35:37 +10:00
Cyril Brulebois
b7e65f04f5 Revert: "eventcomm: replace synaptics-custom TEST_BIT with server's BitIsOn."
This commit reverts 13543b156d

As seen in Debian's #648488, this switch causes a regression on
PowerPC, especially seen on iBook G4 with appletouch. Take a defensive
stance and revert back to a working state until things have been figured
out and fixed properly.

Since things have evolved and since that revert triggers a lot of
conflicts, the following method was applied:
 - manual reintroduction of the 3 removed macros: OFF, LONG, TEST_BIT
 - coccinelle semantic patch to revert from BitIsOn to TEST_BIT

Coccinelle semantic patch:
  @@
  expression a,b;
  @@
  -BitIsOn(a,b)
  +TEST_BIT(b,a)

Bugzilla: http://bugs.debian.org/648488
Signed-off-by: Cyril Brulebois <kibi@debian.org>
2011-12-12 11:16:14 +10:00
Peter Hutterer
0cd5a77c3a If protocol is auto-dev and the device path is set, unset the protocol
The remainder of the handling code will take try through all protocols,
taking the device into account (as of
xf86-input-synaptics-1.4.0-34-g241254e)

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-12-01 07:36:27 +10:00
Peter Hutterer
d1301412d7 Return true/false from SetDeviceAndProtocol
Instead of requiring the caller to know which private field indicates
failure, just return true on success or false on failure.

No functional change.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-12-01 07:36:22 +10:00
Peter Hutterer
2603ad69b9 Use the scroll distances as increment for scrolling valuator axes
XI2.1 allows an 'increment' for each scrolling variable. Use that instead of
hiding it away inside the driver.

For circular scrolling, the increment is the one of the respective scrolling
axis.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-10-24 16:01:30 +10:00
Daniel Stone
4f46057a33 Scroll: Initial smooth scrolling support
Post smooth-scrolling events through the new X server API when
available, rather than legacy jerky button events.

[Amended to use the final smooth scrolling API]

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Amendments-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-10-24 16:01:30 +10:00
Peter Hutterer
15bef1f709 eventcomm: print strerror(errno), not of rc
Found by coverity.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Dirk Wallenstein <halsmit@t-online.de>
2011-10-24 16:01:30 +10:00
Peter Hutterer
cefc85ad44 Fix compiler warning - unused variable 'para'
synaptics.c: In function 'post_scroll_events':
synaptics.c:2426:26: warning: unused variable 'para' [-Wunused-variable]

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-10-18 16:13:24 +10:00
Daniel Stone
26831a6eea Scroll: Prepare ScrollData for smooth scrolling
Convert ScrollData from up/down/left/right members for button presses,
to more fine-grained delta_x and delta_y members, and move these to
priv->scroll.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-10-18 16:07:33 +10:00
Daniel Stone
7c0361d4ec Adjust acceleration scheme for input ABI v14
v14 wants doubles, rather than floats, from acceleration schemes.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-10-18 16:07:28 +10:00
Peter Hutterer
a15af62815 test: wrap ABI 14 xf86OptionRec type changes
ABI 13 still uses pointer as type for most option calls, ABI 14 uses the
proper type now. Wrap this so we can build against both versions.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-10-12 11:22:48 +10:00
Casper Dik
ba981e223a Extra buttons on Acer Ferrari 4000 laptop touchpad are not recognized
The code was checking for a value of exactly 1, while the Synaptics
docs at http://www.synaptics.com/sites/default/files/511-000275-01rA.pdf
say:

    Extended Model ID. This query returns the product ID, additional
    capability bits, and additional bits to widen the infoSensor
    field. infoSensor is a part of the Model ID query (query $03).
    The Extended Model ID query is only present if nExtendedQueries
    is *greater than* or equal to 1.

Signed-off-by: Casper Dik <casper.dik@oracle.com>
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-09-21 16:07:32 +10:00
Peter Hutterer
bc789cc7a0 man: note that a PS/2 device is not supported
If all we see is a PS/2 Mouse or similar, then the kernel doesn't give us
the required bits to provide all the functionality we want. Note that in the
man-page.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Cyril Brulebois <kibi@debian.org>
2011-09-06 08:06:36 +10:00
Alexandr Shadchin
7a72af1ce1 The correct maximum values for pressure and finger width
Signed-off-by: Alexandr Shadchin <Alexandr.Shadchin@gmail.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-08-29 13:48:23 +10:00
Alexandr Shadchin
45d4a6bec0 On/Off hooks to return boolean so we can bail out of the caller
Signed-off-by: Alexandr Shadchin <Alexandr.Shadchin@gmail.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-08-29 13:48:20 +10:00
Peter Hutterer
2034e1e264 Fix compiler warning: unused variable "wakupTime"
Introduced in 458c725129

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-08-25 10:58:43 +10:00
Daniel Stone
4fe1b58c2c Scroll: Modify ScrollData in repeat_scrollbuttons
repeat_scrollbuttons used to read the scroll repeat values and then post
button events directly.  Instead, make it modify ScrollData and let
post_scroll_events take care of sending the scroll events, which
requires moving the repeat_scrollbuttons call upwards.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-08-25 09:50:34 +10:00
Daniel Stone
df68486254 Scroll: Move coasting variables to priv->scroll
Also rename (e.g. autoscroll_x -> coast_delta_x, and
autoscroll_xspd -> coast_speed_x) variables to clarify things a bit.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-08-25 09:50:34 +10:00
Derek Foreman
aae994cc0c Scroll: Add last_millis to track scroll event timing
Stopping a little short of having a full scroll history, adding
last_millis lets us track when the last scroll event we sent was,
for more accurate timing of coasting in particular.

Signed-off-by: Derek Foreman <derek.foreman@collabora.co.uk>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-08-25 09:50:34 +10:00
Daniel Stone
fb7c0c5965 Scroll: Move scroll_[xya] into new priv->scroll struct
And rename them to last_x, last_y and last_a respectively, as they're
used to store the values as of the last scroll event sent.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-08-25 09:50:34 +10:00
Daniel Stone
81a8ddb4a7 Scroll: Clarify rep_buttons assignment
Instead of a combined variable declaration with two ternary expressions
using raw hex values, expand it to have two genuine if statements,
setting with a more clear bitshift.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-08-25 09:50:34 +10:00
Derek Foreman
f40bbf7494 Revise palm check logic
Make the palm-check logic more stable and reliable, and make sure that
any palms are blocked for the duration of their presses.

Signed-off-by: Derek Foreman <derek.foreman@collabora.co.uk>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-08-25 09:50:34 +10:00
Derek Foreman
86dfe5086f More accurate extrapolated fake motion events
Use better time estimates so we can provide better fake motion events.
This reduces the difference between motion with one and two fingers down
to be almost imperceptible, despite the reporting rate being halved on
PS/2 devices.

Signed-off-by: Derek Foreman <derek.foreman@collabora.co.uk>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-08-25 09:50:34 +10:00
Derek Foreman
b26125e412 Replace the motion estimator
Use a smarter motion estimator that attempts to draw a best-fit line
through the history where possible, including taking acceleration into
account.

Signed-off-by: Derek Foreman <derek.foreman@collabora.co.uk>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Simon Thum <simon.thum@gmx.de>
2011-08-25 09:50:33 +10:00
Daniel Stone
ffed18dfff Update count_packet_finger in store_history, not get_delta
Seems more sensible to update the count of packets in the history when
we update the history, rather than somewhere else entirely.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-08-25 09:50:33 +10:00