Commit Graph

26 Commits

Author SHA1 Message Date
Simon Thum 693a31e704 dix: indentation fixes for pointer acceleration
Signed-off-by: Simon Thum <simon.thum@gmx.de>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-05-16 10:59:35 +10:00
Keith Packard 9838b7032e Introduce a consistent coding style
This is strictly the application of the script 'x-indent-all.sh'
from util/modular. Compared to the patch that Daniel posted in
January, I've added a few indent flags:

	-bap
	-psl
	-T PrivatePtr
	-T pmWait
	-T _XFUNCPROTOBEGIN
	-T _XFUNCPROTOEND
	-T _X_EXPORT

The typedefs were needed to make the output of sdksyms.sh match the
previous output, otherwise, the code is formatted badly enough that
sdksyms.sh generates incorrect output.

The generated code was compared with the previous version and found to
be essentially identical -- "assert" line numbers and BUILD_TIME were
the only differences found.

The comparison was done with this script:

dir1=$1
dir2=$2

for dir in $dir1 $dir2; do
	(cd $dir && find . -name '*.o' | while read file; do
		dir=`dirname $file`
		base=`basename $file .o`
		dump=$dir/$base.dump
		objdump -d $file > $dump
	done)
done

find $dir1 -name '*.dump' | while read dump; do
	otherdump=`echo $dump | sed "s;$dir1;$dir2;"`
	diff -u $dump $otherdump
done

Signed-off-by: Keith Packard <keithp@keithp.com>
Acked-by: Daniel Stone <daniel@fooishbar.org>
Acked-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2012-03-21 13:54:42 -07:00
Daniel Stone 2b8f1d07bd Input: Widen pointer acceleration types to double
This widens almost all of the float-using code in ptrveloc.[ch] to
doubles, other than values coming from properties which are specified to
be floats by the property API.

Bumps input API to v14 as this changes the AccelScheme signature, as
used by xf86-input-synaptics.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2011-09-29 12:24:33 +10:00
Peter Hutterer 1c162ebcab dix: change ProcessVelocityData2D to BOOL.
Don't confuse users with a return type of short, that's even less indicative
that it returns 0/non-0 than "int".

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
2011-04-21 14:17:55 +10:00
Simon Thum 1c008e7e78 dix: change all timestamps in pointer acceleration to CARD32
CARD32 is being returned by GetTimeInMilis(), so use it consistently.

Signed-off-by: Simon Thum <simon.thum@gmx.de>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-03-02 15:00:08 +10:00
Simon Thum a4b8526185 dix: update pointer acceleration code to use ValuatorMask
Signed-off-by: Simon Thum <simon.thum@gmx.de>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-03-02 14:54:03 +10:00
Simon Thum 8128846e16 dix: refactor predictable scheme initialization
This intends to clean up the predictable accel struct
from purely scheme-related things like input properties,
as they would be useless in other use cases such
as wheel acceleration.

Signed-off-by: Simon Thum <simon.thum@gmx.de>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-03-02 14:47:58 +10:00
Simon Thum 006157f203 dix: refactor scheme init
This makes it possible to init a scheme in one init call, so we
get rid of the tightly coupled two-phase init used before.

Signed-off-by: Simon Thum <simon.thum@gmx.de>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-02-17 10:23:01 +10:00
Keith Packard 65e961fcc1 Replace some input devPrivates with regular struct fields
In the process, fixes a memory leak in CloseDevice, and an unchecked
memory allocation in InitializePredictableAccelerationProperties.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
2010-04-30 13:05:11 -07:00
Simon Thum 1763550d01 dix: add smooth limited pointer acceleration profile
This profile is inspired by the accel code removed from the wacom driver.
It ascends from zero to acceleration, maxing out at threshold. This means you
can control the slope using threshold, which wasn't possible in wacom.
For sanity's sake, threshold should grow with acceleration.

Works best with adaptive deceleration, since otherwise it only generates
acceleration above 1, causing seldom pixel skips.

Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-01-01 11:22:42 -08:00
Peter Hutterer 0e6cee853d dix: clean up accel old scheme data when switching schemes.
InitValuatorClassDeviceStruct always initializes with the default profile.
The default profile allocs data and adds a few properties which become
obsolete if the profile is changed lateron by the driver.

The property handlers are stored in the device's devPrivates and cleaned up.
Ideally, the property handler ID's could be stored somewhere more obvious,
but that seems to require breaking the ABI.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Simon Thum <simon.thum@gmx.de>
2009-11-25 10:57:07 +10:00
Simon Thum 069b4c5f0a dix: make part of ptrveloc.h internal
Though this is a SDK header, some functions are intended solely
for the server.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-06-29 12:20:49 +10:00
Simon Thum 2830e84937 dix: rename pDev->dev, pVel->vel for consistency
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-06-29 12:20:49 +10:00
Simon Thum 373e8c960d dix: improve pointer acceleration API
This makes the ptr accel api actually sensible from a driver
perspective, since it avoids superfluous device lookups.
Also, makes independent accel contexts possible.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-06-29 12:20:48 +10:00
Simon Thum 3fc6fcfb26 dix: add 'none' pointer acceleration profile with number -1
This is a shorthand for disabling acceleration, while retaining the
possiblity to use constant deceleration. If constant deceleration is
also unused, it will optimize motion processing.

Other possiblities to deactivate acceleration were quite hidden,
and didn't always work as expected. E.g. xset m 1 1 would retain
adaptive deceleration, while xset m 1 0 would not (in the default
profile).

Also removes the 'reserved' profile; it was unused and it's trivial
to add new ones anyway.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-05-07 16:49:06 +10:00
Simon Thum 1a71862d33 dix/xfree86: simplified velocity approximation algorithm
Replace multi-stage filtering with simple linear velocity,
tracked several instances backwards. A heuristic ensures
only approximately linear motion is considered, so velocity
remains valid in any case. Numerical stability is much
better, and nothing changes to people who didn't tune the
advanced features of the previous algorithm.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-03-20 14:48:57 +10:00
Simon Thum ed9d58c3c2 dix: refactor pointer acceleration
The algorithm is split in a 2D-specific and a general part.
This potentially allows to accelerate more than just screen motion.
A state machine is intoduced to make code more explicit and readable.
It also improves handling of 'phase 1' mickeys when axial correction
kicks in (corner case).

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-02-13 14:41:57 +10:00
Simon Thum 19275ea8e9 dix: add property support for pointer acceleration.
Note: properties don't need to be cleaned up, the DIX does it for us anyway.
Data that is stored in properties is cleaned up by the property system.
Handlers, etc. don't need to be unregistered while cleaning up, as they get
deleted when the device is removed anyway.

Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com>
Signed-off-by: Simon Thum <simon.thum@gmx.de>
2009-01-15 09:28:55 +10:00
Paulo Cesar Pereira de Andrade 49f77fff14 Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.

  This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)

  LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.

  xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 05:43:34 -02:00
Simon Thum 18e9fd69fe dix: use average of pointer accel profile
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2008-08-04 15:13:30 +09:30
Simon Thum 1a9f9ac50f dix: optimize precision in device velocity estimation
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2008-07-28 18:13:19 +09:30
Simon Thum c184b91d9a dix: improve the driver interface to predictable pointer acceleration
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2008-07-28 18:13:18 +09:30
Simon Thum 87aa529857 dix: introduce defines for accel profile numbers
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2008-07-28 18:13:18 +09:30
Simon Thum 4e32e6fb38 dix: rename classic accel _scheme_ to lightweight to avoid confusion with
classic accel _profile_

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2008-07-28 18:13:18 +09:30
Simon Thum d40183c665 dix: add legal statements to ptrvelo.{c|h}
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2008-07-28 18:13:18 +09:30
Simon Thum c9eb0e870c Add support for multiple pointer acceleration schemes. #8583
Available acceleration schemes:
 - xorg classic scheme.
 - the new "Predictable" polynomial accel scheme.

X.Org Bug 8583 <http://bugs.freedesktop.org/show_bug.cgi?id=8583>

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2008-07-13 20:54:33 +09:30