1
0
forked from rpms/plymouth

New upstream release 22.02.122 (#2039427)

Add patches from upstream to fix some issues with the kernel switch
  to simpledrm
This commit is contained in:
Hans de Goede 2022-03-07 15:29:05 +01:00
parent 4849ce1d28
commit 096eceb37e
9 changed files with 340 additions and 44 deletions

1
.gitignore vendored
View File

@ -18,3 +18,4 @@ plymouth-0.8.4.tar.bz2
/plymouth-8a3c9bb.tar.gz
/plymouth-372b5f8.tar.gz
/plymouth-1ea1020.tar.gz
/plymouth-22.02.122.tar.bz2

View File

@ -1,26 +0,0 @@
From 696f93e5996634473fb554e07ba2d0775be2a814 Mon Sep 17 00:00:00 2001
From: Hans de Goede <hdegoede@redhat.com>
Date: Tue, 1 Oct 2019 12:11:09 +0200
Subject: [PATCH] Revert "configure: bump so name"
This reverts commit be27b260042e76aba988b88a4f26983247e02bde.
---
configure.ac | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/configure.ac b/configure.ac
index 2257374..507145e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -26,7 +26,7 @@ PKG_PROG_PKG_CONFIG
LT_INIT([dlopen disable-static pic-only])
## increment if the interface has additions, changes, removals.
-LT_CURRENT=5
+LT_CURRENT=4
## increment any time the source changes; set to
## 0 if you increment CURRENT
--
2.23.0

View File

@ -0,0 +1,34 @@
From 5d758194621ae40ef2b2613fd86101652114cbd3 Mon Sep 17 00:00:00 2001
From: Oleg Solovyov <mcpain@altlinux.org>
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

View File

@ -0,0 +1,142 @@
From b41e40e065c60e76b9721747492875c3454440dc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Mateusz=20Pi=C3=B3rkowski?= <mati7337@protonmail.ch>
Date: Tue, 22 Feb 2022 15:41:49 +0000
Subject: [PATCH] Add support for CSI sequences
---
src/libply-splash-core/ply-keyboard.c | 52 +++++++++++++++++++++++++--
src/main.c | 2 ++
src/plugins/renderers/x11/plugin.c | 19 ++++++++++
3 files changed, 71 insertions(+), 2 deletions(-)
diff --git a/src/libply-splash-core/ply-keyboard.c b/src/libply-splash-core/ply-keyboard.c
index b174261..b40e961 100644
--- a/src/libply-splash-core/ply-keyboard.c
+++ b/src/libply-splash-core/ply-keyboard.c
@@ -48,6 +48,12 @@
#define KEY_RETURN '\n'
#define KEY_BACKSPACE '\177'
+#define CSI_SEQUENCE_PREFIX "\033["
+#define CSI_SEQUENCE_MINIMUM_LENGTH (strlen (CSI_SEQUENCE_PREFIX) + 1)
+
+#define FUNCTION_KEY_SEQUENCE_PREFIX (CSI_SEQUENCE_PREFIX "[")
+#define FUNCTION_KEY_SEQUENCE_MINIMUM_LENGTH (strlen (FUNCTION_KEY_SEQUENCE_PREFIX) + 1)
+
typedef void (*ply_keyboard_handler_t) (void *);
typedef struct
@@ -195,7 +201,11 @@ process_keyboard_input (ply_keyboard_t *keyboard,
wchar_t key;
ply_list_node_t *node;
- if ((ssize_t) mbrtowc (&key, keyboard_input, character_size, NULL) > 0) {
+ if (keyboard_input[0] == KEY_ESCAPE && character_size >= 2){
+ /* Escape sequence */
+ ply_buffer_append_bytes (keyboard->line_buffer,
+ keyboard_input, character_size);
+ } else if ((ssize_t) mbrtowc (&key, keyboard_input, character_size, NULL) > 0) {
switch (key) {
case KEY_CTRL_U:
case KEY_CTRL_W:
@@ -270,8 +280,46 @@ on_key_event (ply_keyboard_t *keyboard,
while (i < size) {
ssize_t character_size;
char *keyboard_input;
+ size_t bytes_left = size - i;
+
+ /* Control Sequence Introducer sequences
+ */
+ if(bytes_left >= FUNCTION_KEY_SEQUENCE_MINIMUM_LENGTH &&
+ strncmp (bytes + i, FUNCTION_KEY_SEQUENCE_PREFIX,
+ strlen (FUNCTION_KEY_SEQUENCE_PREFIX)) == 0) {
+ /* Special case - CSI [ after which the next character
+ * is a function key
+ */
+ process_keyboard_input (keyboard, bytes + i, 4);
+ i += 4;
+ continue;
+ } else if(bytes_left >= CSI_SEQUENCE_MINIMUM_LENGTH && /* At least CSI + final byte */
+ strncmp (bytes + i, CSI_SEQUENCE_PREFIX,
+ strlen (CSI_SEQUENCE_PREFIX)) == 0) {
+ ssize_t csi_seq_size;
+ csi_seq_size = 0;
+ for (size_t j = strlen (CSI_SEQUENCE_PREFIX); j < bytes_left; j++) {
+ if ((bytes[i + j] >= 0x40) &&
+ (bytes[i + j] <= 0x7E)) {
+ /* Final byte found */
+ csi_seq_size = j + 1;
+ break;
+ }
+ /* We presume if we aren't at the final byte, the intermediate
+ * bytes will be in the range 0x20-0x2F, but we don't validate
+ * that, since it's not really clear how invalid sequences should
+ * be handled, and letting them through to the keyboard input
+ * handlers seems just as reasonable as alternatives.
+ */
+ }
+ if (csi_seq_size == 0) /* No final byte found */
+ continue;
+ process_keyboard_input (keyboard, bytes + i, csi_seq_size);
+ i += csi_seq_size;
+ continue;
+ }
- character_size = (ssize_t) ply_utf8_character_get_size (bytes + i, size - i);
+ character_size = (ssize_t) ply_utf8_character_get_size (bytes + i, bytes_left);
if (character_size < 0)
break;
diff --git a/src/main.c b/src/main.c
index 1cb8f6c..bedab7d 100644
--- a/src/main.c
+++ b/src/main.c
@@ -1516,6 +1516,8 @@ on_keyboard_input (state_t *state,
ply_buffer_clear (state->entry_buffer);
ply_list_remove_node (state->entry_triggers, node);
free (entry_trigger);
+ } else if (character_size >= 2 && keyboard_input[0] == '\033') {
+ /* Ignore escape sequences */
} else {
ply_buffer_append_bytes (state->entry_buffer, keyboard_input, character_size);
}
diff --git a/src/plugins/renderers/x11/plugin.c b/src/plugins/renderers/x11/plugin.c
index bfb039a..e7169f3 100644
--- a/src/plugins/renderers/x11/plugin.c
+++ b/src/plugins/renderers/x11/plugin.c
@@ -61,6 +61,21 @@
#include "ply-renderer.h"
#include "ply-renderer-plugin.h"
+static const char *function_key_escape_sequence[] = {
+ "\033[[A", /* F1 */
+ "\033[[B", /* F2 */
+ "\033[[C", /* F3 */
+ "\033[[D", /* F4 */
+ "\033[[E", /* F5 */
+ "\033[17~", /* F6 */
+ "\033[18~", /* F7 */
+ "\033[19~", /* F8 */
+ "\033[20~", /* F9 */
+ "\033[21~", /* F10 */
+ "\033[22~", /* F11 */
+ "\033[23~", /* F12 */
+};
+
struct _ply_renderer_head
{
ply_renderer_backend_t *backend;
@@ -482,6 +497,10 @@ on_key_event (GtkWidget *widget,
ply_buffer_append_bytes (input_source->key_buffer, "\033", 1);
} else if (event->keyval == GDK_KEY_BackSpace) { /* Backspace */
ply_buffer_append_bytes (input_source->key_buffer, "\177", 1);
+ } else if (GDK_KEY_F1 <= event->keyval &&
+ GDK_KEY_F12 >= event->keyval) { /* F1-F12 */
+ const char *key = function_key_escape_sequence[event->keyval - GDK_KEY_F1];
+ ply_buffer_append_bytes (input_source->key_buffer, key, strlen(key));
} else {
gchar bytes[7];
int byte_count;
--
2.35.1

View File

@ -0,0 +1,50 @@
From ab4238d54813561d3ad0e50684504d67e4c5ba96 Mon Sep 17 00:00:00 2001
From: Hans de Goede <hdegoede@redhat.com>
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 <hdegoede@redhat.com>
---
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

View File

@ -0,0 +1,94 @@
From 83b385061ccbf5a46ea77f7f12c1c7bfc72a09f2 Mon Sep 17 00:00:00 2001
From: Hans de Goede <hdegoede@redhat.com>
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 <hdegoede@redhat.com>
---
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

View File

@ -9,4 +9,6 @@ addFilter("non-readable")
# rather then after the package-name
addFilter("incoherent-logrotate-file")
# No provides, the throbgress plugin has been removed upstream
addFilter("W: obsolete-not-provided plymouth-plugin-throbgress")
addFilter("obsolete-not-provided plymouth-plugin-throbgress")
# Some files are shared between themes
addFilter("files-duplicate")

View File

@ -1,24 +1,18 @@
%global commit 1ea1020dd18c99ef7547acc85d1cfbf88af626bb
%global commitdate 20210331
%global shortcommit %(c=%{commit}; echo ${c:0:7})
Summary: Graphical Boot Animation and Logger
Name: plymouth
Version: 0.9.5
Release: 5.%{commitdate}git%{shortcommit}%{?dist}
Version: 22.02.122
Release: 1%{?dist}
License: GPLv2+
URL: http://www.freedesktop.org/wiki/Software/Plymouth
# Pending upstream: https://gitlab.freedesktop.org/plymouth/plymouth/-/merge_requests/138/
Source0: https://gitlab.freedesktop.org/jwrdegoede/plymouth/-/archive/%{commit}/%{name}-%{shortcommit}.tar.gz
#Source0: https://gitlab.freedesktop.org/plymouth/plymouth/-/archive/%%{commit}/%%{name}-%%{shortcommit}.tar.gz
Source0: https://gitlab.freedesktop.org/plymouth/plymouth/-/archive/%{version}/%{name}-%{version}.tar.bz2
Source2: charge.plymouth
# Upstream has bumped the soname because some obscure symbols were dropped,
# but we really do not want to change soname in Fedora during a cycle.
# The only libply* user in Fedora outside this pkg is plymouth-theme-breeze
# and that does not need the removed symbols.
Patch0: 0001-Revert-configure-bump-so-name.patch
# Patches cherry-picked from upstream git
Patch1: 0001-drm-Retry-setting-scanout-buffer-on-failure.patch
Patch2: 0002-Add-support-for-CSI-sequences.patch
Patch3: 0003-ply-utils-Reintroduce-ply_string_has_prefix-helper.patch
Patch4: 0004-ply-device-manager-Treat-SimpleDRM-drm-devices-as-fb.patch
BuildRequires: make
BuildRequires: gcc libtool git
@ -216,7 +210,7 @@ Plymouth. It features a small spinner on a dark background.
%prep
%autosetup -p1 -n %{name}-%{commit}
%autosetup -p1
autoreconf --install --symlink -Wno-portability
# Change the default theme
sed -i -e 's/spinner/bgrt/g' src/plymouthd.defaults
@ -321,7 +315,7 @@ fi
%config(noreplace) %{_sysconfdir}/plymouth/plymouthd.conf
%config(noreplace) %{_sysconfdir}/logrotate.d/bootlog
%{_sbindir}/plymouthd
%{_libexecdir}/plymouth/plymouthd-drm-escrow
%{_libexecdir}/plymouth/plymouthd-fd-escrow
%{_bindir}/plymouth
%{_libdir}/plymouth/details.so
%{_libdir}/plymouth/text.so
@ -402,6 +396,11 @@ fi
%changelog
* Mon Mar 7 2022 Hans de Goede <hdegoede@redhat.com> - 22.02.122-1
- New upstream release 22.02.122 (#2039427)
- Add patches from upstream to fix some issues with the kernel switch
to simpledrm
* Fri Jan 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.5-5.20210331git1ea1020
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild

View File

@ -1 +1 @@
SHA512 (plymouth-1ea1020.tar.gz) = fb72557408b7c8a2f5e0c1cdaf77a415c3887a0c30463a03885cbe6bce29a097c0dc3f745628f832a0a095722909a48fc98e44079e760b5d4c07a712f91ba700
SHA512 (plymouth-22.02.122.tar.bz2) = 84dc4cc199c43ab56838f55e4f28564d1bcedcbca4feae91497f186ce2004e6efd098a6fcfc655cbc05ecd593c21a7ec5b1e96848469a3747a7eb79d4776fb8a