Blame SOURCES/0001-device-manager-skip-graphical-renderer-setup-when-de.patch

a802d9
From 014c2158898067176738ec36c9c90cc266a7e35b Mon Sep 17 00:00:00 2001
a802d9
From: Adam Williamson <awilliam@redhat.com>
a802d9
Date: Wed, 6 Jun 2018 17:06:14 -0700
a802d9
Subject: [PATCH] device-manager: skip graphical renderer setup when details
a802d9
 forced
a802d9
a802d9
If neither "rhgb" nor "splash" is on the kernel cmdline, then
a802d9
plymouth forces the "details" splash. This splash is merely
a802d9
a passthrough plugin, where it makes boot looks like plymouth
a802d9
isn't even running.
a802d9
a802d9
In this case, the code sets PLY_DEVICE_MANAGER_FLAGS_IGNORE_UDEV.
a802d9
The idea is to not bother waiting for udev events notifying
a802d9
plymouth when graphics devices show up, since it doesn't need
a802d9
to use the grpahics devices directly anyway.
a802d9
a802d9
Unfortunately, it does still erroneously try to setup graphical
a802d9
renderers in this case, including the /dev/fb renderer.
a802d9
a802d9
Before commit e4f86e3c, these graphical renderers failed because
a802d9
they were given the wrong device name, but since that fix, they're
a802d9
suceeding.  We definitely don't want the /dev/fb renderer to
a802d9
load if we're ignoring udev on efi systems, since during very
a802d9
early boot /dev/fb is backed by efifb, something we never want to
a802d9
use.  efifb is supposed to get replaced during the boot process
a802d9
by other fb implementations like say radeondrmfb, virtiodrmfb or
a802d9
bochsdrmfb, and some of those implementations can't handle the
a802d9
transition if /dev/fb is open at switchover time.
a802d9
a802d9
This commit adds a new flag to tell the device manager to
a802d9
not bother trying to setup graphical renderers when details are
a802d9
forced.
a802d9
a802d9
http://bugzilla.redhat.com/1518464
a802d9
---
a802d9
 src/libply-splash-core/ply-device-manager.c | 20 ++++++++++++++++----
a802d9
 src/libply-splash-core/ply-device-manager.h |  3 ++-
a802d9
 src/main.c                                  |  4 +++-
a802d9
 3 files changed, 21 insertions(+), 6 deletions(-)
a802d9
a802d9
diff --git a/src/libply-splash-core/ply-device-manager.c b/src/libply-splash-core/ply-device-manager.c
a802d9
index fbf4723..b637fb8 100644
a802d9
--- a/src/libply-splash-core/ply-device-manager.c
a802d9
+++ b/src/libply-splash-core/ply-device-manager.c
a802d9
@@ -786,6 +786,15 @@ create_devices_from_terminals (ply_device_manager_t *manager)
a802d9
         return false;
a802d9
 }
a802d9
 
a802d9
+static void
a802d9
+create_non_graphical_devices (ply_device_manager_t *manager)
a802d9
+{
a802d9
+        create_devices_for_terminal_and_renderer_type (manager,
a802d9
+                                                       NULL,
a802d9
+                                                       manager->local_console_terminal,
a802d9
+                                                       PLY_RENDERER_TYPE_NONE);
a802d9
+}
a802d9
+
a802d9
 #ifdef HAVE_UDEV
a802d9
 static void
a802d9
 create_devices_from_udev (ply_device_manager_t *manager)
a802d9
@@ -801,10 +810,7 @@ create_devices_from_udev (ply_device_manager_t *manager)
a802d9
                 return;
a802d9
 
a802d9
         ply_trace ("Creating non-graphical devices, since there's no suitable graphics hardware");
a802d9
-        create_devices_for_terminal_and_renderer_type (manager,
a802d9
-                                                       NULL,
a802d9
-                                                       manager->local_console_terminal,
a802d9
-                                                       PLY_RENDERER_TYPE_NONE);
a802d9
+        create_non_graphical_devices (manager);
a802d9
 }
a802d9
 #endif
a802d9
 
a802d9
@@ -845,6 +851,12 @@ ply_device_manager_watch_devices (ply_device_manager_t                *manager,
a802d9
         if (done_with_initial_devices_setup)
a802d9
                 return;
a802d9
 
a802d9
+        if ((manager->flags & PLY_DEVICE_MANAGER_FLAGS_SKIP_RENDERERS)) {
a802d9
+                ply_trace ("Creating non-graphical devices, since renderers are being explicitly skipped");
a802d9
+                create_non_graphical_devices (manager);
a802d9
+                return;
a802d9
+        }
a802d9
+
a802d9
         if ((manager->flags & PLY_DEVICE_MANAGER_FLAGS_IGNORE_UDEV)) {
a802d9
                 ply_trace ("udev support disabled, creating fallback devices");
a802d9
                 create_fallback_devices (manager);
a802d9
diff --git a/src/libply-splash-core/ply-device-manager.h b/src/libply-splash-core/ply-device-manager.h
a802d9
index 058f6e8..ad05897 100644
a802d9
--- a/src/libply-splash-core/ply-device-manager.h
a802d9
+++ b/src/libply-splash-core/ply-device-manager.h
a802d9
@@ -31,7 +31,8 @@ typedef enum
a802d9
 {
a802d9
         PLY_DEVICE_MANAGER_FLAGS_NONE = 0,
a802d9
         PLY_DEVICE_MANAGER_FLAGS_IGNORE_SERIAL_CONSOLES = 1 << 0,
a802d9
-                PLY_DEVICE_MANAGER_FLAGS_IGNORE_UDEV = 1 << 1
a802d9
+        PLY_DEVICE_MANAGER_FLAGS_IGNORE_UDEV = 1 << 1,
a802d9
+        PLY_DEVICE_MANAGER_FLAGS_SKIP_RENDERERS = 1 << 2
a802d9
 } ply_device_manager_flags_t;
a802d9
 
a802d9
 typedef struct _ply_device_manager ply_device_manager_t;
a802d9
diff --git a/src/main.c b/src/main.c
a802d9
index f1e0fa7..841fe6b 100644
a802d9
--- a/src/main.c
a802d9
+++ b/src/main.c
a802d9
@@ -2358,7 +2358,9 @@ main (int    argc,
a802d9
                 device_manager_flags |= PLY_DEVICE_MANAGER_FLAGS_IGNORE_UDEV;
a802d9
 
a802d9
         if (!plymouth_should_show_default_splash (&state)) {
a802d9
-                /* don't bother listening for udev events if we're forcing details */
a802d9
+                /* don't bother listening for udev events or setting up a graphical renderer
a802d9
+                 * if we're forcing details */
a802d9
+                device_manager_flags |= PLY_DEVICE_MANAGER_FLAGS_SKIP_RENDERERS;
a802d9
                 device_manager_flags |= PLY_DEVICE_MANAGER_FLAGS_IGNORE_UDEV;
a802d9
 
a802d9
                 /* don't ever delay showing the detailed splash */
a802d9
-- 
a802d9
2.17.1
a802d9