Hi,

On 21-01-15 18:21, Jonathan Dieter wrote:
See https://bugzilla.redhat.com/show_bug.cgi?id=1183654

Signed-off-by: Jonathan Dieter <jdie...@lesbg.com>

Thanks looks good now:

Reviewed-by: Hans de Goede <hdego...@redhat.com>

Keith can you pick this up, or do you want me to prepare a tree and send
a pull-req for this ?

Regards,

Hans

---
  hw/xfree86/os-support/linux/lnx_platform.c | 39 ++++++++++++++++++++++++++++++
  1 file changed, 39 insertions(+)

diff --git a/hw/xfree86/os-support/linux/lnx_platform.c 
b/hw/xfree86/os-support/linux/lnx_platform.c
index 1d145b3..59f1083 100644
--- a/hw/xfree86/os-support/linux/lnx_platform.c
+++ b/hw/xfree86/os-support/linux/lnx_platform.c
@@ -20,6 +20,10 @@
  #include "hotplug.h"
  #include "systemd-logind.h"

+#ifdef CONFIG_UDEV_KMS
+#include <libudev.h>
+#endif
+
  static Bool
  get_drm_info(struct OdevAttributes *attribs, char *path, int delayed_index)
  {
@@ -161,6 +165,41 @@ xf86PlatformDeviceProbe(struct OdevAttributes *attribs)
      if (i != xf86_num_platform_devices)
          goto out_free;

+    #ifdef CONFIG_UDEV_KMS
+    {
+        struct udev_device *udev_device;
+        const char *dev_seat;
+        char *syspath = NULL;
+        struct udev *udev;
+
+        udev = udev_new();
+        if (!udev)
+            goto out_free;
+
+        syspath = config_odev_get_attribute(attribs, ODEV_ATTRIB_SYSPATH);
+
+        udev_device = udev_device_new_from_syspath(udev, syspath);
+        if (!udev_device) {
+            udev_unref(udev);
+            goto out_free;
+        }
+
+        dev_seat = udev_device_get_property_value(udev_device, "ID_SEAT");
+        if (!dev_seat)
+            dev_seat = "seat0";
+
+        if ((SeatId && strcmp(dev_seat, SeatId)) ||
+            (!SeatId && strcmp(dev_seat, "seat0"))) {
+            LogMessage(X_INFO, "xfree86: Not adding drm device (%s) as it's 
assigned to seat: %s\n", path, dev_seat);
+            udev_unref(udev);
+            udev_device_unref(udev_device);
+            goto out_free;
+        }
+
+        udev_unref(udev);
+        udev_device_unref(udev_device);
+    }
+    #endif
      LogMessage(X_INFO, "xfree86: Adding drm device (%s)\n", path);

      if (!xf86VTOwner()) {

_______________________________________________
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to