Commit Graph

86 Commits

Author SHA1 Message Date
Oliver McFadden
7333dc2969 Coverity Prevent: RESOURCE_LEAK in AccelSetProfileProperty:
Event alloc_arg: Called allocation function "XIPropToInt" on "ptr" [details]
167  	    rc = XIPropToInt(val, &nelem, &ptr);

Event leaked_storage: Variable "ptr" goes out of scope
2009-07-16 19:03:14 +03: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
Peter Hutterer
d7aef3f663 Merge branch 'master' into xi2
Conflicts:
	Xext/geext.c
	Xi/chdevcur.c
	Xi/extgrbdev.c
	Xi/xiproperty.c
	configure.ac
	dix/ptrveloc.c
	hw/xfree86/common/xf86Config.c
	mi/mipointer.h
	test/input.c
	xkb/xkb.c
2009-05-28 17:20:58 +10:00
Simon Thum
9457ce4489 dix: remove superfluous includes from ptrveloc.c
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-05-08 14:33:22 +10:00
Simon Thum
ee30e1b102 dix: fix warning in pointer acceleration
newer gcc's warn against how this cast is done (though it eludes me why),
and lrintf() is also faster especially on insane processors like the P4
(http://www.mega-nerd.com/FPcast).

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-05-08 14:33:22 +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
9d1597cbef dix: remove superfluous includes from ptrveloc.c
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-05-07 16:49:04 +10:00
Simon Thum
35fce4e5c7 dix: fix warning in pointer acceleration
newer gcc's warn against how this cast is done (though it eludes me why),
and lrintf() is also faster especially on insane processors like the P4
(http://www.mega-nerd.com/FPcast).

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-05-07 16:49:02 +10:00
Simon Thum
cbbc7fed99 dix: correctly utilize tracker buffer and protect from timer overruns
two small related fixes hard to split up

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-04-19 22:19:00 +10:00
Simon Thum
73b01a9aac dix: fix pointer accelerations remainder handling
This didn't really work as intended, but did amazingly well thanks
to roundf() hiding the defect. Cheers!

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-04-19 22:17:48 +10:00
Simon Thum
9212948461 dix: allow relative motion buffer to accumulate in a natural way
Since with XI2 we pass sub-pixel motion, anything else is broken.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-04-19 22:16:49 +10:00
Simon Thum
ff7f019bbc dix: correctly utilize tracker buffer and protect from timer overruns
two small related fixes hard to split up

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-04-10 13:49:51 +10:00
Simon Thum
06aebecb19 dix: fix pointer accelerations remainder handling
This didn't really work as intended, but did amazingly well thanks
to roundf() hiding the defect. Cheers!

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-04-10 13:49:51 +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
Simon Thum
fbb57a2c54 dix: ptraccel - Add GetAccelerationProfile()
Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com>
2008-12-12 11:43:31 +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
Paulo Cesar Pereira de Andrade
d6cbd4511e Export symbols defined in the sdk.
This is the biggest "visibility" patch. Instead of doing a "export"
symbol on demand, export everything in the sdk, so that if some module
fails due to an unresolved symbol, it is because it is using a symbol
not in the sdk.

  Most exported symbols shouldn't really be made visible, neither
advertised in the sdk, as they are only used by a single shared object.

  Symbols in the sdk (or referenced in sdk macros), but not defined
anywhere include:
XkbBuildCoreState()
XkbInitialMap
XkbXIUnsupported
XkbCheckActionVMods()
XkbSendCompatNotify()
XkbDDXFakePointerButton()
XkbDDXApplyConfig()
_XkbStrCaseCmp()
_XkbErrMessages[]
_XkbErrCode
_XkbErrLocation
_XkbErrData
XkbAccessXDetailText()
XkbNKNDetailMaskText()
XkbLookupGroupAndLevel()
XkbInitAtoms()
XkbGetOrderedDrawables()
XkbFreeOrderedDrawables()
XkbConvertXkbComponents()
XkbWriteXKBSemantics()
XkbWriteXKBLayout()
XkbWriteXKBKeymap()
XkbWriteXKBFile()
XkbWriteCFile()
XkbWriteXKMFile()
XkbWriteToServer()
XkbMergeFile()
XkmFindTOCEntry()
XkmReadFileSection()
XkmReadFileSectionName()
InitExtInput()
xf86CheckButton()
xf86SwitchCoreDevice()
RamDacSetGamma()
RamDacRestoreDACValues()
xf86Bpp
xf86ConfigPix24
xf86MouseCflags[]
xf86SupportedMouseTypes[]
xf86NumMouseTypes
xf86ChangeBusIndex()
xf86EntityEnter()
xf86EntityLeave()
xf86WrapperInit()
xf86RingBell()
xf86findOptionBoolean()
xf86debugListOptions()
LoadSubModuleLocal()
LoaderSymbolLocal()
getInt10Rec()
xf86CurrentScreen
xf86ReallocatePciResources()
xf86NewSerialNumber()
xf86RandRSetInitialMode()
fbCompositeSolidMask_nx1xn
fbCompositeSolidMask_nx8888x0565C
fbCompositeSolidMask_nx8888x8888C
fbCompositeSolidMask_nx8x0565
fbCompositeSolidMask_nx8x0888
fbCompositeSolidMask_nx8x8888
fbCompositeSrc_0565x0565
fbCompositeSrc_8888x0565
fbCompositeSrc_8888x0888
fbCompositeSrc_8888x8888
fbCompositeSrcAdd_1000x1000
fbCompositeSrcAdd_8000x8000
fbCompositeSrcAdd_8888x8888
fbGeneration
fbIn
fbOver
fbOver24
fbOverlayGeneration
fbRasterizeEdges
fbRestoreAreas
fbSaveAreas
composeFunctions
VBEBuildVbeModeList()
VBECalcVbeModeIndex()
TIramdac3030CalculateMNPForClock()
shadowBufPtr
shadowFindBuf()
miRRGetScreenInfo()
RRSetScreenConfig()
RRModePruneUnused()
PixmanImageFromPicture()
extern int miPointerGetMotionEvents()
miClipPicture()
miRasterizeTriangle()
fbPush1toN()
fbInitializeBackingStore()
ddxBeforeReset()
SetupSprite()
InitSprite()
DGADeliverEvent()

  SPECIAL CASES
o defined as _X_INTERNAL
	xf86NewInputDevice()
o defined as static
	fbGCPrivateKey
	fbOverlayScreenPrivateKey
	fbScreenPrivateKey
	fbWinPrivateKey
o defined in libXfont.so, but declared in xorg/dixfont.h
	GetGlyphs()
	QueryGlyphExtents()
	QueryTextExtents()
	ParseGlyphCachingMode()
	InitGlyphCaching()
	SetGlyphCachingMode()
2008-11-29 23:56:06 -02:00
Peter Hutterer
f4e725f248 dix: memset DeviceVelocityPtr to zero.
Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2008-11-21 09:04:51 +10:00
Simon Thum
7f818776b7 dix: fix typos in comments, one formatting fix.
Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com>
2008-11-21 09:04:17 +10:00
Simon Thum
e00cd54c1a dix: remove misleading comment in ptrvelo.c
Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com>
2008-08-08 16:19:20 +09:30
Simon Thum
e1b286d495 dix: simplified debugging helper for pointer acceleration
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2008-08-08 16:19:20 +09:30
Simon Thum
4f333d5351 dix: simplify velocity tracking filters
prefer fp-mul over fp-div and remove rather pointless check

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2008-08-08 16:19:20 +09:30
Simon Thum
d762c08aeb dix: export driver-side functions for acceleration
also add additional safety for accel driver api

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2008-08-04 15:13:37 +09:30
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
805f28e96c some trivial changes regarding C compat, indentation, etc.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2008-07-28 18:13:19 +09:30
Simon Thum
a17cb29f5a dix: preparation change: make runtime exchange of filter chain safe
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2008-07-28 18:13:19 +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
Daniel Stone
55644d2f1c Make --enable-debug usable again
Enable region debugging causes assertion failures (should really look
into that, though), and I don't need four messages every time I move my
pointer.
2008-07-16 14:23:34 +03:00
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