xserver-multidpi/dix
Peter Korsgaard 6cccf0131c dix: add 3x3 transformation matrix xinput property for multi-head handling
For absolute input devices (E.G. touchscreens) in multi-head setups,
we need a way to bind the device to an randr output. This adds the
infrastructure to the server to allow us to do so.

positionSprite() scales input coordinates to the dimensions of the shared
(total) screen frame buffer, so to restrict motion to an output we need to
scale/rotate/translate device coordinates to a subset of the frame buffer
before passing them on to positionSprite.

This is done here using a 3x3 transformation matrix, which is applied to
the device coordinates using homogeneous coordinates, E.G.:

[ c0 c1 c2 ]   [ x ]
[ c3 c4 c5 ] * [ y ]
[ c6 c7 c8 ]   [ 1 ]

Notice: As input devices have varying input ranges, the coordinates are
first scaled to the [0..1] range for generality, and afterwards scaled
back up.

E.G. for a dual head setup (using same resolution) next to each other, you
would want to scale the X coordinates of the touchscreen connected to the
both heads by 50%, and translate (offset) the coordinates of the rightmost
head by 50%, or in matrix form:

   left:            right:
[ 0.5 0 0 ]     [ 0.5 0 0.5 ]
[ 0   1 0 ]     [ 0   1 0   ]
[ 0   0 1 ]     [ 0   0 0   ]

Which can be done using xinput:

xinput set-prop <left> --type=float "Coordinate Transformation Matrix" \
       0.5 0 0 0 1 0 0 0 1

xinput set-prop <right> --type=float "Coordinate Transformation Matrix" \
       0.5 0 0.5 0 1 0 0 0 1

Likewise more complication setups involving more heads, rotation or
different resolution can be handled.

Signed-off-by: Peter Korsgaard <peter.korsgaard@barco.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-05-28 16:49:30 +10:00
..
.gitignore .gitignore: use common defaults with custom section #24239 2009-11-11 21:40:20 -08:00
atom.c Misc coding style cleanup 2010-05-13 06:16:48 +07:00
buildatoms XFree86 4.3.0.1 2003-11-14 16:49:22 +00:00
BuiltInAtoms R6.6 is the Xorg base-line 2003-11-14 15:54:54 +00:00
colormap.c Fix build without XACE 2010-05-17 13:03:12 -07:00
cursor.c Return an appropriately-typed error from dixLookupResourceByType. 2010-05-19 12:32:48 -07:00
deprecated.c dix: remove dixLookupResource - we don't have any users left. 2009-09-07 10:51:16 +10:00
devices.c dix: add 3x3 transformation matrix xinput property for multi-head handling 2010-05-28 16:49:30 +10:00
dispatch.c Replace screen->rgf scratch GC flags with a bit in each GC. 2010-05-20 14:36:29 -07:00
dispatch.h Remove RCS tags. Fix Xprint makefile braindamage. 2006-07-21 17:56:00 -04:00
dixfonts.c doPolyText: forget about FontChange's XID after looking up pFont. 2010-05-21 12:48:16 -07:00
dixutils.c Return an appropriately-typed error from dixLookupResourceByType. 2010-05-19 12:32:48 -07:00
enterleave.c dix: call SetFocusOut and LeaveWindow when disabling a device. 2009-08-03 10:11:48 +10:00
enterleave.h dix: call SetFocusOut and LeaveWindow when disabling a device. 2009-08-03 10:11:48 +10:00
eventconvert.c Replace X-allocation functions with their C89 counterparts 2010-05-13 00:22:37 +07:00
events.c Return an appropriately-typed error from dixLookupResourceByType. 2010-05-19 12:32:48 -07:00
extension.c Eliminate boilerplate around client->noClientException. 2010-05-13 17:14:07 -07:00
ffs.c Rework symbol visibility for easier maintenance 2008-12-03 05:43:34 -02:00
gc.c Replace screen->rgf scratch GC flags with a bit in each GC. 2010-05-20 14:36:29 -07:00
getevents.c dix: add 3x3 transformation matrix xinput property for multi-head handling 2010-05-28 16:49:30 +10:00
globals.c DPMS: Remove the defaultDPMS* variables 2009-04-03 18:22:20 -04:00
glyphcurs.c Replace dixChangeGC with calls directly to the right variant. 2010-05-13 17:14:07 -07:00
grabs.c Replace X-allocation functions with their C89 counterparts 2010-05-13 00:22:37 +07:00
initatoms.c Rework symbol visibility for easier maintenance 2008-12-03 05:43:34 -02:00
inpututils.c dix: add helper functions to duplicate and free InputAttributes. 2010-05-25 10:06:11 -07:00
main.c Replace X-allocation functions with their C89 counterparts 2010-05-13 00:22:37 +07:00
Makefile.am dtrace: Add Xserver-dtrace.h to CLEANFILES 2009-12-15 16:51:48 -08:00
pixmap.c Replace X-allocation functions with their C89 counterparts 2010-05-13 00:22:37 +07:00
privates.c Remove devPrivates init and delete callback lists. 2010-05-13 14:16:32 -07:00
property.c Eliminate boilerplate around client->noClientException. 2010-05-13 17:14:07 -07:00
protocol.txt Add DRI2 requests to protocol.txt 2009-08-28 23:29:05 -04:00
ptrveloc.c Replace X-allocation functions with their C89 counterparts 2010-05-13 00:22:37 +07:00
registry.c Replace X-allocation functions with their C89 counterparts 2010-05-13 00:22:37 +07:00
resource.c Add typed resource-lookup errors for non-core resource types. 2010-05-19 12:32:48 -07:00
selection.c Use WriteEventsToClient rather than TryClientEvents where possible. 2010-05-19 12:32:34 -07:00
swaprep.c Replace X-allocation functions with their C89 counterparts 2010-05-13 00:22:37 +07:00
swapreq.c Remove #define NEED_EVENTS and NEED_REPLIES 2008-12-12 11:43:32 +10:00
tables.c Remove #define NEED_EVENTS and NEED_REPLIES 2008-12-12 11:43:32 +10:00
window.c Return an appropriately-typed error from dixLookupResourceByType. 2010-05-19 12:32:48 -07:00
Xserver-dtrace.h.in Update Sun license notices to current X.Org standard form 2009-12-16 17:11:35 -08:00
Xserver.d Update Sun license notices to current X.Org standard form 2009-12-16 17:11:35 -08:00