compositor-drm: Add quirk loading from udev
authorRob Bradford <rob@linux.intel.com>
Mon, 17 Sep 2012 17:07:00 +0000 (18:07 +0100)
committerRob Bradford <rob@linux.intel.com>
Thu, 6 Dec 2012 18:57:44 +0000 (18:57 +0000)
Look at udev properties and then set the quirk flags based on the udev
properties that are set on the device node.

src/compositor-drm.c

index 4c56454..fcc5170 100644 (file)
@@ -1834,6 +1834,14 @@ drm_restore(struct weston_compositor *ec)
        tty_reset(d->tty);
 }
 
+static void
+device_parse_quirks(struct evdev_device *evdev_device,
+                   struct udev_device *udev_device)
+{
+       if (udev_device_get_property_value(udev_device, "WL_QUIRK_SWAP_AXES"))
+               evdev_device->quirks |= EVDEV_QUIRK_SWAP_AXES;
+}
+
 static const char default_seat[] = "seat0";
 
 static void
@@ -1871,6 +1879,9 @@ device_added(struct udev_device *udev_device, struct drm_seat *master)
                return;
        }
 
+
+       device_parse_quirks(device, udev_device);
+
        wl_list_insert(master->devices_list.prev, &device->link);
 }