diff --git a/backport-drm-Retry-setting-scanout-buffer-on-failure.patch b/backport-drm-Retry-setting-scanout-buffer-on-failure.patch new file mode 100644 index 0000000..e639ca7 --- /dev/null +++ b/backport-drm-Retry-setting-scanout-buffer-on-failure.patch @@ -0,0 +1,33 @@ +From 5d758194621ae40ef2b2613fd86101652114cbd3 Mon Sep 17 00:00:00 2001 +From: Oleg Solovyov +Date: Wed, 8 Dec 2021 19:15:47 +0300 +Subject: [PATCH] drm: Retry setting scanout buffer on failure + +Plymouth currently assumes that setting the scanout buffer will succeed. +if it fails because of a driver bug or transient failure it should try +again next frame. + +This commit adds that error handling code. +--- + src/plugins/renderers/drm/plugin.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/src/plugins/renderers/drm/plugin.c b/src/plugins/renderers/drm/plugin.c +index 02e9413..10711c6 100644 +--- a/src/plugins/renderers/drm/plugin.c ++++ b/src/plugins/renderers/drm/plugin.c +@@ -1628,9 +1628,9 @@ reset_scan_out_buffer_if_needed (ply_renderer_backend_t *backend, + return false; + + if (head->scan_out_buffer_needs_reset) { +- ply_renderer_head_set_scan_out_buffer (backend, head, +- head->scan_out_buffer_id); +- head->scan_out_buffer_needs_reset = false; ++ did_reset = ply_renderer_head_set_scan_out_buffer (backend, head, ++ head->scan_out_buffer_id); ++ head->scan_out_buffer_needs_reset = !did_reset; + return true; + } + +-- +2.35.1 diff --git a/backport-ply-device-manager-Also-ignore-SimpleDRM-devs-in-col.patch b/backport-ply-device-manager-Also-ignore-SimpleDRM-devs-in-col.patch new file mode 100644 index 0000000..96f785b --- /dev/null +++ b/backport-ply-device-manager-Also-ignore-SimpleDRM-devs-in-col.patch @@ -0,0 +1,84 @@ +From d32a748fe5c24d5cc3b3dd671a045102373dd392 Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Wed, 28 Sep 2022 15:16:15 +0200 +Subject: [PATCH 6/6] ply-device-manager: Also ignore SimpleDRM devs in + coldplug enumeration path + +Plymouth has 2 hw discovery paths: +1. Enumerating devices already known by udev at plymouth startup +2. Devices which are hotplugged after startup + +At boot we have udevd which is enumerating hw and plymouthd racing +with each other, which means that plymouthd may discover the new +SimpleDRM device through either 1. or 2. + +Before this patch a check for SimpleDRM was missing from path 1, causing +it to be treated as a normal device instead of being ignored as intended: + +plymouth-debug.log for the simpledrm being enumerated in path 1: + +ply-device-manager.c:344: create_devices_for_subsystem: + found device /sys/devices/platform/simple-framebuffer.0/drm/card0 +ply-device-manager.c:351: create_devices_for_subsystem: + device is initialized +ply-device-manager.c:360: create_devices_for_subsystem: + found node /dev/dri/card0 +ply-device-manager.c:283: create_devices_for_udev_device: + found DRM device /dev/dri/card0 +ply-device-manager.c:885: create_devices_for_terminal_and_rende: + creating devices for /dev/dri/card0 (renderer type: 1) + +plymouth-debug.log for the simpledrm *not* being enumerated in path 1: + +ply-device-manager.c:344: create_devices_for_subsystem: + found device /sys/devices/platform/simple-framebuffer.0/drm/card0 +ply-device-manager.c:367: create_devices_for_subsystem: + it's not initialized + +followed by path 2 enumerating the device very shortly after this: + +ply-device-manager.c:532: on_udev_event: + got add event for device /dev/dri/card0 +ply-device-manager.c:462: verify_add_or_change: + ignoring since we only handle SimpleDRM devices after timeout + +Note how path 2 does correctly ignore SimpleDRM devices, where as +path 1 does not. This commit fixes this by moving the verify_drm_device() +check in to create_devices_for_udev_device() which runs in both paths. + +Link: https://bugzilla.redhat.com/show_bug.cgi?id=2127663 +Reported-by: Michael Catanzaro +Signed-off-by: Hans de Goede +--- + src/libply-splash-core/ply-device-manager.c | 11 +++++------ + 1 file changed, 5 insertions(+), 6 deletions(-) + +diff --git a/src/libply-splash-core/ply-device-manager.c b/src/libply-splash-core/ply-device-manager.c +index 23b8b37..820a282 100644 +--- a/src/libply-splash-core/ply-device-manager.c ++++ b/src/libply-splash-core/ply-device-manager.c +@@ -314,6 +314,10 @@ create_devices_for_udev_device (ply_devi + ply_trace ("device subsystem is %s", subsystem); + + if (subsystem != NULL && strcmp (subsystem, SUBSYSTEM_DRM) == 0) { ++ if (!manager->device_timeout_elapsed && !verify_drm_device (device)) { ++ ply_trace ("ignoring since we only handle SimpleDRM devices after timeout"); ++ return false; ++ } + ply_trace ("found DRM device %s", device_path); + renderer_type = PLY_RENDERER_TYPE_DRM; + } else if (strcmp (subsystem, SUBSYSTEM_FRAME_BUFFER) == 0) { +@@ -457,11 +461,6 @@ verify_add_or_change (ply_device_manager + ply_trace ("ignoring since we're already using text splash for local console"); + return false; + } +- +- if (!verify_drm_device (device)) { +- ply_trace ("ignoring since we only handle SimpleDRM devices after timeout"); +- return false; +- } + } else { + ply_trace ("ignoring since we only handle subsystem %s devices after timeout", subsystem); + return false; +-- +2.37.3 \ No newline at end of file diff --git a/backport-ply-device-manager-Move-verify_drm_device-higher-up-.patch b/backport-ply-device-manager-Move-verify_drm_device-higher-up-.patch new file mode 100644 index 0000000..137d6fd --- /dev/null +++ b/backport-ply-device-manager-Move-verify_drm_device-higher-up-.patch @@ -0,0 +1,104 @@ +From f775a38aefa3797d3697330aea78b341914e59f5 Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Wed, 28 Sep 2022 15:14:00 +0200 +Subject: [PATCH 5/6] ply-device-manager: Move verify_drm_device() higher up in + the file + +Move verify_drm_device() higher up in ply-device-manager.c, this is +a preparation patch for the next patch in this series. + +This is a pure move without any changes to the moved block. + +Signed-off-by: Hans de Goede +--- + src/libply-splash-core/ply-device-manager.c | 68 ++++++++++----------- + 1 file changed, 34 insertions(+), 34 deletions(-) + +diff --git a/src/libply-splash-core/ply-device-manager.c b/src/libply-splash-core/ply-device-manager.c +index cba2425..23b8b37 100644 +--- a/src/libply-splash-core/ply-device-manager.c ++++ b/src/libply-splash-core/ply-device-manager.c +@@ -262,6 +262,40 @@ fb_device_has_drm_device (ply_device_manager_t *manager, + return has_drm_device; + } + ++static bool ++verify_drm_device (struct udev_device *device) ++{ ++ const char *id_path; ++ ++ /* ++ * Simple-framebuffer devices driven by simpledrm lack information ++ * like panel-rotation info and physical size, causing the splash ++ * to briefly render on its side / without HiDPI scaling, switching ++ * to the correct rendering when the native driver loads. ++ * To avoid this treat simpledrm devices as fbdev devices and only ++ * use them after the timeout. ++ */ ++ id_path = udev_device_get_property_value (device, "ID_PATH"); ++ if (!ply_string_has_prefix (id_path, "platform-simple-framebuffer")) ++ return true; /* Not a SimpleDRM device */ ++ ++ /* ++ * With nomodeset, no native drivers will load, so SimpleDRM devices ++ * should be used immediately. ++ */ ++ if (ply_kernel_command_line_has_argument ("nomodeset")) ++ return true; ++ ++ /* ++ * Some firmwares leave the panel black at boot. Allow enabling SimpleDRM ++ * use from the cmdline to show something to the user ASAP. ++ */ ++ if (ply_kernel_command_line_has_argument ("plymouth.use-simpledrm")) ++ return true; ++ ++ return false; ++} ++ + static bool + create_devices_for_udev_device (ply_device_manager_t *manager, + struct udev_device *device) +@@ -404,40 +438,6 @@ on_drm_udev_add_or_change (ply_device_manager_t *manager, + } + } + +-static bool +-verify_drm_device (struct udev_device *device) +-{ +- const char *id_path; +- +- /* +- * Simple-framebuffer devices driven by simpledrm lack information +- * like panel-rotation info and physical size, causing the splash +- * to briefly render on its side / without HiDPI scaling, switching +- * to the correct rendering when the native driver loads. +- * To avoid this treat simpledrm devices as fbdev devices and only +- * use them after the timeout. +- */ +- id_path = udev_device_get_property_value (device, "ID_PATH"); +- if (!ply_string_has_prefix (id_path, "platform-simple-framebuffer")) +- return true; /* Not a SimpleDRM device */ +- +- /* +- * With nomodeset, no native drivers will load, so SimpleDRM devices +- * should be used immediately. +- */ +- if (ply_kernel_command_line_has_argument ("nomodeset")) +- return true; +- +- /* +- * Some firmwares leave the panel black at boot. Allow enabling SimpleDRM +- * use from the cmdline to show something to the user ASAP. +- */ +- if (ply_kernel_command_line_has_argument ("plymouth.use-simpledrm")) +- return true; +- +- return false; +-} +- + static bool + verify_add_or_change (ply_device_manager_t *manager, + const char *action, +-- +2.37.3 diff --git a/backport-ply-device-manager-Treat-SimpleDRM-drm-devices-as-fb.patch b/backport-ply-device-manager-Treat-SimpleDRM-drm-devices-as-fb.patch new file mode 100644 index 0000000..7839e0a --- /dev/null +++ b/backport-ply-device-manager-Treat-SimpleDRM-drm-devices-as-fb.patch @@ -0,0 +1,93 @@ +From 83b385061ccbf5a46ea77f7f12c1c7bfc72a09f2 Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Mon, 28 Feb 2022 16:07:11 +0100 +Subject: [PATCH 4/4] ply-device-manager: Treat SimpleDRM drm devices as fbdev + devices + +Simple-framebuffer devices driven by simpledrm lack information +like panel-rotation info and physical size, causing the splash +to briefly render on its side / without HiDPI scaling, switching +to the correct rendering when the native driver loads. + +To avoid this treat simpledrm devices as fbdev devices and only +use them after the timeout. + +Also adds 2 exceptions to this: + +1. If nomodeset is passed on the kernel commandline then no native +drivers will load, so in this case it is best to immediately use +SimpleDRM devices when they are detected. + +2. On some devics the firmware leave the panel black at boot. In this +case it is desirable to show the splash to the user ASAP so that there +is some visual feedback that the device is booting. Add a support for a +"plymouth.use-simpledrm" kernel cmdline option to show the splash +immediately on SimpleDRM devices rather then waiting for the native +driver to load. + +Closes #167 + +Signed-off-by: Hans de Goede +--- + src/libply-splash-core/ply-device-manager.c | 39 +++++++++++++++++++++ + 1 file changed, 39 insertions(+) + +diff --git a/src/libply-splash-core/ply-device-manager.c b/src/libply-splash-core/ply-device-manager.c +index bb548ef..82b89f3 100644 +--- a/src/libply-splash-core/ply-device-manager.c ++++ b/src/libply-splash-core/ply-device-manager.c +@@ -405,6 +405,40 @@ on_drm_udev_add_or_change (ply_device_manager_t *manager, + } + } + ++static bool ++verify_drm_device (struct udev_device *device) ++{ ++ const char *id_path; ++ ++ /* ++ * Simple-framebuffer devices driven by simpledrm lack information ++ * like panel-rotation info and physical size, causing the splash ++ * to briefly render on its side / without HiDPI scaling, switching ++ * to the correct rendering when the native driver loads. ++ * To avoid this treat simpledrm devices as fbdev devices and only ++ * use them after the timeout. ++ */ ++ id_path = udev_device_get_property_value (device, "ID_PATH"); ++ if (!ply_string_has_prefix (id_path, "platform-simple-framebuffer")) ++ return true; /* Not a SimpleDRM device */ ++ ++ /* ++ * With nomodeset, no native drivers will load, so SimpleDRM devices ++ * should be used immediately. ++ */ ++ if (ply_kernel_command_line_has_argument ("nomodeset")) ++ return true; ++ ++ /* ++ * Some firmwares leave the panel black at boot. Allow enabling SimpleDRM ++ * use from the cmdline to show something to the user ASAP. ++ */ ++ if (ply_kernel_command_line_has_argument ("plymouth.use-simpledrm")) ++ return true; ++ ++ return false; ++} ++ + static bool + verify_add_or_change (ply_device_manager_t *manager, + const char *action, +@@ -423,6 +457,11 @@ verify_add_or_change (ply_device_manager_t *manager, + ply_trace ("ignoring since we're already using text splash for local console"); + return false; + } ++ ++ if (!verify_drm_device (device)) { ++ ply_trace ("ignoring since we only handle SimpleDRM devices after timeout"); ++ return false; ++ } + } else { + ply_trace ("ignoring since we only handle subsystem %s devices after timeout", subsystem); + return false; +-- +2.35.1 diff --git a/backport-ply-utils-Reintroduce-ply_string_has_prefix-helper.patch b/backport-ply-utils-Reintroduce-ply_string_has_prefix-helper.patch new file mode 100644 index 0000000..f88446c --- /dev/null +++ b/backport-ply-utils-Reintroduce-ply_string_has_prefix-helper.patch @@ -0,0 +1,49 @@ +From ab4238d54813561d3ad0e50684504d67e4c5ba96 Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Mon, 7 Mar 2022 12:25:56 +0100 +Subject: [PATCH 3/4] ply-utils: Reintroduce ply_string_has_prefix helper + +ply_string_has_prefix was dropped in commit c7965ea19abf ("ply-utils: +Drop unused ply_string_has_prefix helper"). We have a need for this +helper again, so reintroduce it. + +Signed-off-by: Hans de Goede +--- + src/libply/ply-utils.c | 9 +++++++++ + src/libply/ply-utils.h | 1 + + 2 files changed, 10 insertions(+) + +diff --git a/src/libply/ply-utils.c b/src/libply/ply-utils.c +index f90ac40..f457579 100644 +--- a/src/libply/ply-utils.c ++++ b/src/libply/ply-utils.c +@@ -459,6 +459,15 @@ ply_free_string_array (char **array) + free (array); + } + ++bool ++ply_string_has_prefix (const char *str, const char *prefix) ++{ ++ if (str == NULL || prefix == NULL) ++ return false; ++ ++ return strncmp (str, prefix, strlen (prefix)) == 0; ++} ++ + double + ply_get_timestamp (void) + { +diff --git a/src/libply/ply-utils.h b/src/libply/ply-utils.h +index 47bb3f2..7572cca 100644 +--- a/src/libply/ply-utils.h ++++ b/src/libply/ply-utils.h +@@ -85,6 +85,7 @@ bool ply_fd_has_data (int fd); + bool ply_set_fd_as_blocking (int fd); + char **ply_copy_string_array (const char *const *array); + void ply_free_string_array (char **array); ++bool ply_string_has_prefix (const char *str, const char *prefix); + double ply_get_timestamp (void); + + void ply_save_errno (void); +-- +2.35.1 diff --git a/plymouth-0.9.5.tar.gz b/plymouth-0.9.5.tar.gz deleted file mode 100644 index e3b4897..0000000 Binary files a/plymouth-0.9.5.tar.gz and /dev/null differ diff --git a/plymouth-22.02.122.tar.gz b/plymouth-22.02.122.tar.gz new file mode 100644 index 0000000..d9c8e22 Binary files /dev/null and b/plymouth-22.02.122.tar.gz differ diff --git a/plymouth.spec b/plymouth.spec index d20290a..148b45c 100644 --- a/plymouth.spec +++ b/plymouth.spec @@ -1,5 +1,3 @@ -# commit date: 20191013 - %if %{?openEuler:1}0 %bcond_without graphics %else @@ -7,12 +5,18 @@ %endif Name: plymouth -Version: 0.9.5 -Release: 4 +Version: 22.02.122 +Release: 1 License: GPLv2+ Summary: Graphical Boot Animation and Logger URL: https://www.freedesktop.org/wiki/Software/Plymouth -Source0: https://gitlab.freedesktop.org/plymouth/plymouth/-/archive/0.9.5/plymouth-0.9.5.tar.gz +Source0: https://gitlab.freedesktop.org/plymouth/plymouth/-/archive/%{version}/plymouth-%{version}.tar.gz + +Patch0: backport-drm-Retry-setting-scanout-buffer-on-failure.patch +Patch1: backport-ply-utils-Reintroduce-ply_string_has_prefix-helper.patch +Patch2: backport-ply-device-manager-Treat-SimpleDRM-drm-devices-as-fb.patch +Patch3: backport-ply-device-manager-Move-verify_drm_device-higher-up-.patch +Patch4: backport-ply-device-manager-Also-ignore-SimpleDRM-devs-in-col.patch Patch9000: carry-xattr-when-copying-files-to-initramfs.patch @@ -199,6 +203,7 @@ fi %{_libexecdir}/plymouth/plymouth-update-initrd %{_libexecdir}/plymouth/plymouth-generate-initrd %{_libexecdir}/plymouth/plymouth-populate-initrd +%{_libexecdir}/plymouth/plymouthd-fd-escrow %dir %{_datadir}/plymouth %{_datadir}/plymouth/plymouthd.defaults @@ -241,6 +246,12 @@ fi %{_mandir}/man?/* %changelog +* Tue Nov 02 2022 yanglu - 22.02.122-1 +- Type:requirement +- CVE:NA +- SUG:NA +- DESC:update plymouth version to 22.02.122 + * Fri Jun 17 2022 gaihuiying - 0.9.5-4 - Type:bugfix - CVE:NA