aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Woodhouse <dwmw2@infradead.org>2009-12-01 00:14:54 +0000
committerPeter Hutterer <peter.hutterer@who-t.net>2009-12-03 09:27:28 +1000
commitb6b377fe9afa51ee8cbef8e9830537806e94a3ac (patch)
tree966c18e6dc6d31b83ccf2342a7ba47f0b4024ed1
parentSwap axes before applying touch screen calibration. (diff)
downloadxf86-input-evdev-b6b377fe9afa51ee8cbef8e9830537806e94a3ac.tar.gz
xf86-input-evdev-b6b377fe9afa51ee8cbef8e9830537806e94a3ac.tar.bz2
xf86-input-evdev-b6b377fe9afa51ee8cbef8e9830537806e94a3ac.zip
Report initial calibration parameters.
Where an initial calibration is provided through the Calibration option to the driver, it wasn't being exposed in the 'Evdev Axis Calibration' property. Remedy that... Signed-off-by: David Woodhouse <David.Woodhouse@intel.com> Acked-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> (cherry picked from commit 7b285a802b8ccddd1edcf40ab345c4a96bcdf43c)
-rw-r--r--src/evdev.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/evdev.c b/src/evdev.c
index bf0e760..d37889d 100644
--- a/src/evdev.c
+++ b/src/evdev.c
@@ -2511,8 +2511,22 @@ EvdevInitProperty(DeviceIntPtr dev)
prop_calibration = MakeAtom(EVDEV_PROP_CALIBRATION,
strlen(EVDEV_PROP_CALIBRATION), TRUE);
- rc = XIChangeDeviceProperty(dev, prop_calibration, XA_INTEGER, 32,
- PropModeReplace, 0, NULL, FALSE);
+ if (pEvdev->flags & EVDEV_CALIBRATED) {
+ int calibration[4];
+
+ calibration[0] = pEvdev->calibration.min_x;
+ calibration[1] = pEvdev->calibration.max_x;
+ calibration[2] = pEvdev->calibration.min_y;
+ calibration[3] = pEvdev->calibration.max_y;
+
+ rc = XIChangeDeviceProperty(dev, prop_calibration, XA_INTEGER,
+ 32, PropModeReplace, 4, calibration,
+ FALSE);
+ } else {
+ rc = XIChangeDeviceProperty(dev, prop_calibration, XA_INTEGER,
+ 32, PropModeReplace, 0, NULL,
+ FALSE);
+ }
if (rc != Success)
return;