compositor-drm: Load calibration values from udev

This allows the values to be associated with an specific input device using
udev rules.
Rob Bradford 12 years ago committed by Kristian Høgsberg
parent ea23b28642
commit f4f58be8df
  1. 23
      src/compositor-drm.c

@ -1737,6 +1737,7 @@ device_added(struct udev_device *udev_device, struct drm_seat *master)
struct evdev_device *device;
const char *devnode;
const char *device_seat;
const char *calibration_values;
int fd;
device_seat = udev_device_get_property_value(udev_device, "ID_SEAT");
@ -1765,6 +1766,28 @@ device_added(struct udev_device *udev_device, struct drm_seat *master)
return;
}
calibration_values =
udev_device_get_property_value(udev_device,
"WL_CALIBRATION");
if (calibration_values && sscanf(calibration_values,
"%f %f %f %f %f %f",
&device->abs.calibration[0],
&device->abs.calibration[1],
&device->abs.calibration[2],
&device->abs.calibration[3],
&device->abs.calibration[4],
&device->abs.calibration[5]) == 6) {
device->abs.apply_calibration = 1;
weston_log ("Applying calibration: %f %f %f %f %f %f\n",
device->abs.calibration[0],
device->abs.calibration[1],
device->abs.calibration[2],
device->abs.calibration[3],
device->abs.calibration[4],
device->abs.calibration[5]);
}
wl_list_insert(master->devices_list.prev, &device->link);
}

Loading…
Cancel
Save