Before this commit we were trying to add most drm devices twice, once
from xf86platformProbe() and once from config_udev_init().

This results in somewhat confusing messages in Xorg.log, ie:

(II) xfree86: Adding drm device (/dev/dri/card0)
Later followed by:
(II) config/udev: Adding drm device (/dev/dri/card0)

With systemd-logind integration active this becomes worse, the second line
becomes 2 lines:

(II) config/udev: Adding drm device (/dev/dri/card0)
(EE) systemd-logind: failed to take device: Device or resource busy

By filtering out duplicate drm devices we avoid these confusing messages.

Signed-off-by: Hans de Goede <hdego...@redhat.com>
---
 config/udev.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/config/udev.c b/config/udev.c
index c1a5c91..9579bf2 100644
--- a/config/udev.c
+++ b/config/udev.c
@@ -113,6 +113,10 @@ device_added(struct udev_device *udev_device)
         if (strncmp(sysname, "card", 4) != 0)
             return;
 
+        /* Check for devices already added through xf86platformProbe() */
+        if (xf86_find_platform_device_by_devnum(major(devnum), minor(devnum)))
+            return;
+
         LogMessage(X_INFO, "config/udev: Adding drm device (%s)\n", path);
 
         config_udev_odev_setup_attribs(path, syspath, devnum, 
NewGPUDeviceRequest);
-- 
1.8.4.2

_______________________________________________
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