diff --git a/0001-renderer-support-reactivating-renderer-without-closi.patch b/0001-renderer-support-reactivating-renderer-without-closi.patch index 0583a9a..715ed08 100644 --- a/0001-renderer-support-reactivating-renderer-without-closi.patch +++ b/0001-renderer-support-reactivating-renderer-without-closi.patch @@ -1,7 +1,7 @@ From eb147e52b123070ab8839c3f59aaecc43fcc8652 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Mon, 25 Jun 2018 22:02:07 +0200 -Subject: [PATCH 1/3] renderer: support reactivating renderer without closing +Subject: [PATCH 1/9] renderer: support reactivating renderer without closing it first At the moment, ply_renderer_activate() doesn't work immediately following @@ -32,5 +32,5 @@ index b9059ef..ecf7082 100644 bool -- -2.17.1 +2.18.0 diff --git a/0002-main-move-ply_device_manager_deactivate_renderers-in.patch b/0002-main-move-ply_device_manager_deactivate_renderers-in.patch index 46368a6..336b6c6 100644 --- a/0002-main-move-ply_device_manager_deactivate_renderers-in.patch +++ b/0002-main-move-ply_device_manager_deactivate_renderers-in.patch @@ -1,7 +1,7 @@ From 778e0fb77a9dfb85270242f1238eba237488eb48 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Mon, 25 Jun 2018 16:55:39 +0200 -Subject: [PATCH 2/3] main: move ply_device_manager_deactivate_renderers() into +Subject: [PATCH 2/9] main: move ply_device_manager_deactivate_renderers() into hide_splash() hide_splash() should be the counter-part of show_splash(). show_splash() @@ -57,5 +57,5 @@ index 841fe6b..ff02ea6 100644 } -- -2.17.1 +2.18.0 diff --git a/0003-main-Only-activate-renderers-if-the-splash-uses-pixe.patch b/0003-main-Only-activate-renderers-if-the-splash-uses-pixe.patch new file mode 100644 index 0000000..ff9f018 --- /dev/null +++ b/0003-main-Only-activate-renderers-if-the-splash-uses-pixe.patch @@ -0,0 +1,98 @@ +From 447c783046a0e6bd0486e780f6a94396637a5bd4 Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Mon, 2 Jul 2018 09:39:12 +0200 +Subject: [PATCH 3/9] main: Only activate renderers if the splash uses + pixel-displays + +Since commit eb147e52b123 ("renderer: support reactivating renderer without +closing it first"), the show_theme() call done by +toggle_between_splash_and_details() will reactivate the renderers after +switching to details mode, causing the drm renderer to switch the screen +from text to graphics mode hiding the details being logged on the console. + +This commit fixes this by only calling ply_device_manager_activate_renderers() +and ply_device_manager_deactivate_renderers if the splash uses pixel-displays. + +Signed-off-by: Hans de Goede + +https://bugs.freedesktop.org/show_bug.cgi?id=107047 +--- + src/libply-splash-core/ply-boot-splash.c | 6 ++++++ + src/libply-splash-core/ply-boot-splash.h | 1 + + src/main.c | 12 ++++++++---- + 3 files changed, 15 insertions(+), 4 deletions(-) + +diff --git a/src/libply-splash-core/ply-boot-splash.c b/src/libply-splash-core/ply-boot-splash.c +index 87a7a0c..2e295f4 100644 +--- a/src/libply-splash-core/ply-boot-splash.c ++++ b/src/libply-splash-core/ply-boot-splash.c +@@ -695,4 +695,10 @@ ply_boot_splash_become_idle (ply_boot_splash_t *splash, + splash->plugin_interface->become_idle (splash->plugin, splash->idle_trigger); + } + ++bool ++ply_boot_splash_uses_pixel_displays (ply_boot_splash_t *splash) ++{ ++ return splash->plugin_interface->add_pixel_display != NULL; ++} ++ + /* vim: set ts=4 sw=4 expandtab autoindent cindent cino={.5s,(0: */ +diff --git a/src/libply-splash-core/ply-boot-splash.h b/src/libply-splash-core/ply-boot-splash.h +index b66ca47..0bdbe96 100644 +--- a/src/libply-splash-core/ply-boot-splash.h ++++ b/src/libply-splash-core/ply-boot-splash.h +@@ -89,6 +89,7 @@ void ply_boot_splash_attach_progress (ply_boot_splash_t *splash, + void ply_boot_splash_become_idle (ply_boot_splash_t *splash, + ply_boot_splash_on_idle_handler_t idle_handler, + void *user_data); ++bool ply_boot_splash_uses_pixel_displays (ply_boot_splash_t *splash); + + + #endif +diff --git a/src/main.c b/src/main.c +index ff02ea6..ed23968 100644 +--- a/src/main.c ++++ b/src/main.c +@@ -1174,7 +1174,8 @@ quit_splash (state_t *state) + static void + hide_splash (state_t *state) + { +- ply_device_manager_deactivate_renderers (state->device_manager); ++ if (state->boot_splash && ply_boot_splash_uses_pixel_displays (state->boot_splash)) ++ ply_device_manager_deactivate_renderers (state->device_manager); + + state->is_shown = false; + +@@ -1260,7 +1261,8 @@ deactivate_splash (state_t *state) + { + assert (!state->is_inactive); + +- ply_device_manager_deactivate_renderers (state->device_manager); ++ if (state->boot_splash && ply_boot_splash_uses_pixel_displays (state->boot_splash)) ++ ply_device_manager_deactivate_renderers (state->device_manager); + + detach_from_running_session (state); + +@@ -1359,7 +1361,8 @@ on_reactivate (state_t *state) + } + + ply_device_manager_activate_keyboards (state->device_manager); +- ply_device_manager_activate_renderers (state->device_manager); ++ if (state->boot_splash && ply_boot_splash_uses_pixel_displays (state->boot_splash)) ++ ply_device_manager_activate_renderers (state->device_manager); + + state->is_inactive = false; + +@@ -1763,7 +1766,8 @@ show_theme (state_t *state, + return NULL; + + attach_splash_to_devices (state, splash); +- ply_device_manager_activate_renderers (state->device_manager); ++ if (ply_boot_splash_uses_pixel_displays (splash)) ++ ply_device_manager_activate_renderers (state->device_manager); + + splash_mode = get_splash_mode_from_mode (state->mode); + +-- +2.18.0 + diff --git a/0003-show_theme-Only-activate-renderers-if-the-splash-use.patch b/0003-show_theme-Only-activate-renderers-if-the-splash-use.patch deleted file mode 100644 index bb9795d..0000000 --- a/0003-show_theme-Only-activate-renderers-if-the-splash-use.patch +++ /dev/null @@ -1,66 +0,0 @@ -From 353d12806adf6be4d051d491a2af28e3b24b3063 Mon Sep 17 00:00:00 2001 -From: Hans de Goede -Date: Mon, 2 Jul 2018 09:39:12 +0200 -Subject: [PATCH 3/3] show_theme: Only activate renderers if the splash uses - pixel-displays - -Since commit eb147e52b123 ("renderer: support reactivating renderer without -closing it first"), the show_theme() call done by -toggle_between_splash_and_details() will reactivate the renderers after -switching to details mode, causing the drm renderer to switch the screen -from text to graphics mode hiding the details being logged on the console. - -This commit fixes this by making show_theme() not call -ply_device_manager_activate_renderers() if the splash does not uses -pixel-displays. - -Signed-off-by: Hans de Goede ---- - src/libply-splash-core/ply-boot-splash.c | 5 +++++ - src/libply-splash-core/ply-boot-splash.h | 1 + - src/main.c | 3 ++- - 3 files changed, 8 insertions(+), 1 deletion(-) - -diff --git a/src/libply-splash-core/ply-boot-splash.c b/src/libply-splash-core/ply-boot-splash.c -index 87a7a0c..7888785 100644 ---- a/src/libply-splash-core/ply-boot-splash.c -+++ b/src/libply-splash-core/ply-boot-splash.c -@@ -695,4 +695,9 @@ ply_boot_splash_become_idle (ply_boot_splash_t *splash, - splash->plugin_interface->become_idle (splash->plugin, splash->idle_trigger); - } - -+bool ply_boot_splash_uses_pixel_displays (ply_boot_splash_t *splash) -+{ -+ return splash->plugin_interface->add_pixel_display != NULL; -+} -+ - /* vim: set ts=4 sw=4 expandtab autoindent cindent cino={.5s,(0: */ -diff --git a/src/libply-splash-core/ply-boot-splash.h b/src/libply-splash-core/ply-boot-splash.h -index b66ca47..0bdbe96 100644 ---- a/src/libply-splash-core/ply-boot-splash.h -+++ b/src/libply-splash-core/ply-boot-splash.h -@@ -89,6 +89,7 @@ void ply_boot_splash_attach_progress (ply_boot_splash_t *splash, - void ply_boot_splash_become_idle (ply_boot_splash_t *splash, - ply_boot_splash_on_idle_handler_t idle_handler, - void *user_data); -+bool ply_boot_splash_uses_pixel_displays (ply_boot_splash_t *splash); - - - #endif -diff --git a/src/main.c b/src/main.c -index ff02ea6..13848c1 100644 ---- a/src/main.c -+++ b/src/main.c -@@ -1763,7 +1763,8 @@ show_theme (state_t *state, - return NULL; - - attach_splash_to_devices (state, splash); -- ply_device_manager_activate_renderers (state->device_manager); -+ if (ply_boot_splash_uses_pixel_displays (splash)) -+ ply_device_manager_activate_renderers (state->device_manager); - - splash_mode = get_splash_mode_from_mode (state->mode); - --- -2.17.1 - diff --git a/0004-drm-Remove-unnecessary-reset_scan_out_buffer_if_need.patch b/0004-drm-Remove-unnecessary-reset_scan_out_buffer_if_need.patch new file mode 100644 index 0000000..ce6aea6 --- /dev/null +++ b/0004-drm-Remove-unnecessary-reset_scan_out_buffer_if_need.patch @@ -0,0 +1,85 @@ +From b527834c8821362da6d01ee15ecab589a43abfcb Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Mon, 2 Jul 2018 23:46:59 +0200 +Subject: [PATCH 4/9] drm: Remove unnecessary reset_scan_out_buffer_if_needed() + call from ply_renderer_head_map() + +ply_renderer_head_map() gets only called from map_to_device() which +calls activate() directly afterwards which calls +ply_renderer_head_set_scan_out_buffer(), so there is no need for the +reset_scan_out_buffer_if_needed() call. + +Not only is it not needed, but it is actually harmful, there are 2 problems +woth it: + +1) Normally the drm plugin gets instantiated by ply-renderer.c with + rendered->is_active=true, backend->is_active=false. The + rendered->is_active=true causes the first ply_renderer_activate call + to be a no-op without calling backend->activate(). So when the first + map_to_device() calls happen activate() has not been called yet and we've + not yet claimed master rights, so ply_renderer_head_set_scan_out_buffer() + calls will always fail, resulting in this in a ply-trace: + + Mapping buffer for 1920x1080 renderer head + Redrawing 1920x1080 renderer head + Setting scan out buffer of 1920x1080 head to our buffer + Couldn't set scan out buffer for head with controller id 41 + + This is harmless, but also shows that the reset_scan_out_buffer_if_needed() + is really not needed. + +2. If deactivate_renderer() gets called before the first show-splash then + rendered->is_active will become false, so renderer_activate() done before + map_to_device() will now actually call backend->activate() claiming + drm master rights and setting backend->is_active=true. + + The map_to_device() -> ply_renderer_head_map() call done after this, calls + ply_renderer_head_redraw() -> flush_head() which under 1. was a no-op + as it exits directly when backend->is_active=false. But now it actually + flushes the buffers by calling reset_scan_out_buffer_if_needed(). This + itself is fine. + + But since reset_scan_out_buffer_if_needed() has already happened in + ply_renderer_head_redraw() the reset_scan_out_buffer_if_needed() call this + commit removes would always return false (no reset necessary) causing + ply_renderer_head_map() to destroy the buffer and return an error. + + This results in the splash briefly showing, followed by the core soon after + trying another map_to_device(), which again briefly shows the splash, etc. + With the end result being a badly flickering display. + +Signed-off-by: Hans de Goede +--- + src/plugins/renderers/drm/plugin.c | 9 --------- + 1 file changed, 9 deletions(-) + +diff --git a/src/plugins/renderers/drm/plugin.c b/src/plugins/renderers/drm/plugin.c +index fb79aa6..1080590 100644 +--- a/src/plugins/renderers/drm/plugin.c ++++ b/src/plugins/renderers/drm/plugin.c +@@ -618,8 +618,6 @@ static bool + ply_renderer_head_map (ply_renderer_backend_t *backend, + ply_renderer_head_t *head) + { +- bool scan_out_set; +- + assert (backend != NULL); + assert (backend->device_fd >= 0); + assert (backend != NULL); +@@ -646,13 +644,6 @@ ply_renderer_head_map (ply_renderer_backend_t *backend, + */ + ply_renderer_head_redraw (backend, head); + +- scan_out_set = reset_scan_out_buffer_if_needed (backend, head); +- if (!scan_out_set && backend->is_active) { +- destroy_output_buffer (backend, head->scan_out_buffer_id); +- head->scan_out_buffer_id = 0; +- return false; +- } +- + return true; + } + +-- +2.18.0 + diff --git a/0005-main-Show-details-when-ESC-is-pressed-during-splash_.patch b/0005-main-Show-details-when-ESC-is-pressed-during-splash_.patch new file mode 100644 index 0000000..81ba4af --- /dev/null +++ b/0005-main-Show-details-when-ESC-is-pressed-during-splash_.patch @@ -0,0 +1,40 @@ +From 129b4a5004d771e83de37fc6f0d74615119ec102 Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Tue, 3 Jul 2018 08:44:33 +0200 +Subject: [PATCH 5/9] main: Show details when ESC is pressed during + splash_delay + +Start listening for keypresses on the first show_splash() call, so that +pressing ESC while we're delaying show the non-details splash will show +the details splash. + +Signed-off-by: Hans de Goede +--- + src/main.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/src/main.c b/src/main.c +index ed23968..d7f192f 100644 +--- a/src/main.c ++++ b/src/main.c +@@ -361,6 +361,8 @@ show_detailed_splash (state_t *state) + { + ply_boot_splash_t *splash; + ++ cancel_pending_delayed_show (state); ++ + if (state->boot_splash != NULL) + return; + +@@ -1001,6 +1003,8 @@ show_splash (state_t *state) + (ply_event_loop_timeout_handler_t) + show_splash, + state); ++ /* Listen for ESC to show details */ ++ ply_device_manager_activate_keyboards (state->device_manager); + return; + } + } +-- +2.18.0 + diff --git a/0006-main-Fix-getting-detailed-logs-from-systemd.patch b/0006-main-Fix-getting-detailed-logs-from-systemd.patch new file mode 100644 index 0000000..ea124d4 --- /dev/null +++ b/0006-main-Fix-getting-detailed-logs-from-systemd.patch @@ -0,0 +1,96 @@ +From 6a1fdabf344bdc15956e69d6dee78752680369a5 Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Tue, 26 Jun 2018 09:15:25 +0200 +Subject: [PATCH 6/9] main: Fix getting detailed logs from systemd + +This are 3 issues with the detailed logs handling: + +1) plymouth attaches to the session directly on a show-splash command +(in on_show_splash()), but it does not tell systemd to start printing +details until the splash is actually shown after the splash_delay. + +2) If the splash is actually shown during the initrd (e.g. a diskcript +password is necessary) then we tell the initrd systemd instance to +print details, but we don't tell the regular initrd instance which takes +over as pid 1 after the switch-root to print details. + +This leads to rather inconsistent logging/printing behavior, e.g.: + +* If a diskcrypt password is asked for, we only log details from +the initrd phase. + +* If the boot is shorter then splash_delay no details are logged + +* If the user presses ESC during boot during the initrd, only initrd + messages are printed + +* If the user presses ESC during boot after the initrd, only normal + messages are printed + +This commit fixes both these issues by: + +1) Telling systemd to print details as soon as we have attached to the session; + and to stop printing details when we detach from the session (*) +2) Telling systemd to print details after the rootfs has been remounted rw + +*) This is necessary to have a smooth transition to e.g. gdm if the splash +has not shown because the boot is shorter then splash_delay + +Signed-off-by: Hans de Goede +--- + src/main.c | 18 +++++++++++++----- + 1 file changed, 13 insertions(+), 5 deletions(-) + +diff --git a/src/main.c b/src/main.c +index d7f192f..634a38e 100644 +--- a/src/main.c ++++ b/src/main.c +@@ -853,6 +853,11 @@ on_system_initialized (state_t *state) + ply_trace ("system now initialized, opening log"); + state->system_initialized = true; + ++#ifdef PLY_ENABLE_SYSTEMD_INTEGRATION ++ if (state->is_attached) ++ tell_systemd_to_print_details (state); ++#endif ++ + prepare_logging (state); + } + +@@ -1782,11 +1787,6 @@ show_theme (state_t *state, + return NULL; + } + +-#ifdef PLY_ENABLE_SYSTEMD_INTEGRATION +- if (state->is_attached) +- tell_systemd_to_print_details (state); +-#endif +- + ply_device_manager_activate_keyboards (state->device_manager); + + return splash; +@@ -1833,6 +1833,10 @@ attach_to_running_session (state_t *state) + return false; + } + ++#ifdef PLY_ENABLE_SYSTEMD_INTEGRATION ++ tell_systemd_to_print_details (state); ++#endif ++ + state->is_redirected = should_be_redirected; + state->is_attached = true; + state->session = session; +@@ -1849,6 +1853,10 @@ detach_from_running_session (state_t *state) + if (!state->is_attached) + return; + ++#ifdef PLY_ENABLE_SYSTEMD_INTEGRATION ++ tell_systemd_to_stop_printing_details (state); ++#endif ++ + ply_trace ("detaching from terminal session"); + ply_terminal_session_detach (state->session); + state->is_redirected = false; +-- +2.18.0 + diff --git a/0007-main-fix-build.patch b/0007-main-fix-build.patch new file mode 100644 index 0000000..618de38 --- /dev/null +++ b/0007-main-fix-build.patch @@ -0,0 +1,28 @@ +From 75ef8ee24bf5875875af44a91cd24975a4d92664 Mon Sep 17 00:00:00 2001 +From: Ray Strode +Date: Tue, 10 Jul 2018 15:58:04 -0400 +Subject: [PATCH 7/7] main: fix build + +I slightly modified Hans patch in commit 129b4a50 before pushing it +and broke the build. + +This fixes the build by adding a forward declaration. +--- + src/main.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/src/main.c b/src/main.c +index 5555f0b..7e58fff 100644 +--- a/src/main.c ++++ b/src/main.c +@@ -168,6 +168,7 @@ static void on_quit (state_t *state, + bool retain_splash, + ply_trigger_t *quit_trigger); + static bool sh_is_init (state_t *state); ++static void cancel_pending_delayed_show (state_t *state); + + static ply_boot_splash_mode_t + get_splash_mode_from_mode (ply_mode_t mode) +-- +2.18.0 + diff --git a/boot-duration b/boot-duration deleted file mode 100644 index 7fe728c..0000000 --- a/boot-duration +++ /dev/null @@ -1,39 +0,0 @@ -0.222:RCkernelparam -0.223:RChostname -0.238:RCmountfs -0.275:RCswap -0.330:microcode_ctl -0.357:cpuspeed -0.365:ip6tables -0.380:iptables -0.385:isdn -0.504:auditd -0.508:restorecond -0.523:rsyslog -0.530:irqbalance -0.533:rpcbind -0.549:nfslock -0.561:mdmonitor -0.563:rpcidmapd -0.578:rpcgssd -0.579:messagebus -0.580:fuse -0.594:netfs -0.600:acpid -0.611:haldaemon -0.660:pcscd -0.691:udev-post -0.703:portreserve -0.712:setroubleshoot -0.749:bluetooth -0.738:sshd -0.763:ntpd -0.807:sendmail -0.876:crond -0.902:kerneloops -0.907:smolt -0.915:atd -0.927:avahi-daemon -0.941:cups -0.983:anacron -0.992:local diff --git a/plymouth.spec b/plymouth.spec index 8478238..5cf2258 100644 --- a/plymouth.spec +++ b/plymouth.spec @@ -16,12 +16,11 @@ Summary: Graphical Boot Animation and Logger Name: plymouth Version: 0.9.3 -Release: 12%{?snapshot_rel}%{?dist} +Release: 13%{?snapshot_rel}%{?dist} License: GPLv2+ URL: http://www.freedesktop.org/wiki/Software/Plymouth Source0: http://freedesktop.org/software/plymouth/releases/%{name}-%{version}.tar.xz -Source1: boot-duration Source2: charge.plymouth Source3: plymouth-update-initrd @@ -46,7 +45,11 @@ Patch9: 0001-device-manager-fall-back-to-text-mode-if-graphical-d.patch # CONFIG_FRAMEBUFFER_CONSOLE_DEFERRED_TAKEOVER Patch10: 0001-renderer-support-reactivating-renderer-without-closi.patch Patch11: 0002-main-move-ply_device_manager_deactivate_renderers-in.patch -Patch12: 0003-show_theme-Only-activate-renderers-if-the-splash-use.patch +Patch12: 0003-main-Only-activate-renderers-if-the-splash-uses-pixe.patch +Patch13: 0004-drm-Remove-unnecessary-reset_scan_out_buffer_if_need.patch +Patch14: 0005-main-Show-details-when-ESC-is-pressed-during-splash_.patch +Patch15: 0006-main-Fix-getting-detailed-logs-from-systemd.patch +Patch16: 0007-main-fix-build.patch BuildRequires: gcc BuildRequires: pkgconfig(libdrm) @@ -262,7 +265,6 @@ find $RPM_BUILD_ROOT -name '*.a' -delete find $RPM_BUILD_ROOT -name '*.la' -delete mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/lib/plymouth -cp $RPM_SOURCE_DIR/boot-duration $RPM_BUILD_ROOT%{_datadir}/plymouth/default-boot-duration cp -f $RPM_SOURCE_DIR/plymouth-update-initrd $RPM_BUILD_ROOT%{_libexecdir}/plymouth # Add charge, our new default @@ -353,7 +355,6 @@ fi %{_libdir}/plymouth/details.so %{_libdir}/plymouth/text.so %{_libdir}/plymouth/tribar.so -%{_datadir}/plymouth/default-boot-duration %{_datadir}/plymouth/themes/details/details.plymouth %{_datadir}/plymouth/themes/text/text.plymouth %{_datadir}/plymouth/themes/tribar/tribar.plymouth @@ -452,6 +453,12 @@ fi %files system-theme %changelog +* Mon Aug 06 2018 Hans de Goede - 0.9.3-13 +- Update patches for CONFIG_FRAMEBUFFER_CONSOLE_DEFERRED_TAKEOVER interaction + to the latest patches from master, this fixes the transition from plymouth + to gdm being non smooth +- Drop unused default-boot-duration file (rhbz#1456010) + * Thu Aug 2 2018 Peter Robinson 0.9.3-12 - Drop groups in spec - Drop requires on initscripts (rhbz 1592383)