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

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