]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
device-manager: defer /dev/fb compat processing until after coldplug
authorRay Strode <rstrode@redhat.com>
Mon, 3 Mar 2014 22:25:44 +0000 (17:25 -0500)
committerRay Strode <rstrode@redhat.com>
Mon, 3 Mar 2014 22:31:27 +0000 (17:31 -0500)
We never want to use a /dev/fb device if a DRM device will work instead
(since it supports multi-monitor, isn't a legacy interface, etc)

Unfortunately, right now plymouthd notices efifb at early start up,
see's there is no DRM device associated with it and chooses it for
the main display, which causes all sort of problems.

This commit defers using /dev/fb devices until after udev settles.

src/libply-splash-core/ply-device-manager.c

index 25f7d54675fe94d50be4087910ebc0761071bfdf..d06e1b5da96991132bd6eee67e472eb1cdeab2d4 100644 (file)
@@ -188,8 +188,9 @@ create_seat_for_udev_device (ply_device_manager_t *manager,
       ply_renderer_type_t renderer_type = PLY_RENDERER_TYPE_NONE;
 
       subsystem = udev_device_get_subsystem (device);
+      ply_trace ("device subsystem is %s", subsystem);
 
-      if (strcmp (subsystem, SUBSYSTEM_DRM) == 0)
+      if (subsystem != NULL && strcmp (subsystem, SUBSYSTEM_DRM) == 0)
         {
           ply_trace ("found DRM device %s", device_path);
           renderer_type = PLY_RENDERER_TYPE_DRM;
@@ -359,9 +360,26 @@ on_udev_event (ply_device_manager_t *manager)
     return;
 
   if (strcmp (action, "add") == 0)
-    create_seat_for_udev_device (manager, device);
+    {
+      const char *subsystem;
+      bool coldplug_complete = manager->udev_queue_fd_watch == NULL;
+
+      subsystem = udev_device_get_subsystem (device);
+
+      if (strcmp (subsystem, SUBSYSTEM_DRM) == 0 ||
+          coldplug_complete)
+        {
+          create_seat_for_udev_device (manager, device);
+        }
+      else
+        {
+          ply_trace ("ignoring since we only handle subsystem %s devices after coldplug completes", subsystem);
+        }
+    }
   else if (strcmp (action, "remove") == 0)
-    free_seat_for_udev_device (manager, device);
+    {
+      free_seat_for_udev_device (manager, device);
+    }
 
   udev_device_unref (device);
 }