Commit graph

2921 commits

Author SHA1 Message Date
Hans de Goede
2f8b64ea4c ply-device-manager: Create renderer for simpledrm devices right away
Often when plymouth starts and enumerates udev devices which are already
present at start (coldplug detection), udev is still initializing all
the devices and it reports 0 for udev_device_get_is_initialized ().

It may take a long time for the state of the simpledrm udev device
to change to initialized and for a udev add event to be send.

Especially when the amdgpu kernel module is involved which is very
large for a kernel module and can take op to 7 seconds to load.

In this case it is even possible for plymouth's default DeviceTimeout
of 8 seconds to trigger before the simpledrm device is considered
initialized. See for example these lines extracted from the plymouth-debug
log attached to: https://bugzilla.redhat.com/show_bug.cgi?id=2183743

  00:00:02.909 ../src/libply-splash-core/ply-device-manager.c:498:create_devi: found device /sys/devices/pci0000:00/0000:00:01.0/simple-framebuffer.0/drm/card0
  00:00:02.910 ../src/libply-splash-core/ply-device-manager.c:513:create_devi: it's not initialized
  00:00:10.917 ../src/libply-splash-core/ply-device-manager.c:1237:create_dev: Timeout elapsed, looking for devices from udev
  00:00:10.918 ../src/libply-splash-core/ply-device-manager.c:498:create_devi: found device /sys/devices/pci0000:00/0000:00:01.0/simple-framebuffer.0/drm/card0
  00:00:10.918 ../src/libply-splash-core/ply-device-manager.c:513:create_devi: it's not initialized

This leads to plymouth falling back to the text splash even when
plymouth.use-simpledrm is passed on the kernel commandline.

Add a special case for simpledrm devices and add these during coldboot
even if they are not initialized yet.
2024-06-07 17:21:00 +02:00
Hans de Goede
8c0d596503 ply-device-manager: Remove simpledrm renderers before adding normal drm renderers
udev remove events for simpledrm udev devices may arrive after the udev add
event for a normal drm udev device which is replacing the simpledrm device.

When the local_console is managed by a simpledrm renderer and the remove
event for the simpledrm renderer is received after the add event of
the normal drm device, the local_console is left unmanaged breaking legacy
input support.

When this scenario gets hit it breaks entering disk unlock passwords.

Add code to remove simpledrm renderers before adding normal drm renderers
to avoid this.
2024-06-07 17:21:00 +02:00
Hans de Goede
eb5abda0c2 ply-device-manager: Move local_console_terminal handling for DRM/FB renderers
create_devices_for_terminal_and_renderer_type () only ever gets called with
a NULL terminal parameter when create_devices_for_udev_device () is calling
it to create a DRM or FB renderer.

Move the use of local_console_terminal as terminal for the first DRM / FB
renderer created from create_devices_for_udev_device () to
create_devices_for_terminal_and_renderer_type () with an extra !terminal
check.

This is a preparation patch for fixing an issue where the local_console
is managed by a simpledrm renderer and the remove event for that gets
processed after the add event of the normal drm device which leaves
the local_console unmanaged breaking legacy input support.
2024-06-07 17:21:00 +02:00
Hans de Goede
9096b304f6 ply-device-manager: Skip /dev/dri/render nodes
DRM render nodes do not support KMS and trying to probe them just
slows things down, so skip them.
2024-06-07 17:21:00 +02:00
Hans de Goede
188a4393b1 ply-renderer: Add ply_renderer_get_type ()
Add a ply_renderer_get_type () helper function to get the type of
a renderer.
2024-06-07 17:21:00 +02:00
Hans de Goede
19d49a42fc ply-renderer: Add new PLY_RENDERER_TYPE_SIMPLEDRM renderer-type
Add a new PLY_RENDERER_TYPE_SIMPLEDRM renderer-type to help differentiate
the simpledrm case from the regular drm device case.

simpledrm devices require some special handling in the device-manager,
this is a preparation patch for improving the simpledrm handling
in ply-device-manager.
2024-06-07 17:21:00 +02:00
Hans de Goede
1c3ff0338c ply-device-manager: Add syspath_is_simpledrm () helper
Add a helper to determine if a udev syspath is a simpledrm device.
This is a preparation patch to for making simpledrm devices their
own renderer-type.
2024-06-07 17:21:00 +02:00
Hans de Goede
64379c1100 ply-utils: Add ply_string_has_suffix () helper function
Add a ply_string_has_suffix () helper function to match the existing
ply_string_has_prefix () helper function.
2024-06-07 17:21:00 +02:00
Hans de Goede
65724bc46a Merge branch 'revert-fallback-to-text-if-no-renderers' into 'main'
ply-device-manager: Revert "Fall back to text plugin if no renderers installed"

See merge request plymouth/plymouth!319
2024-06-05 13:00:20 +00:00
Hans de Goede
c06ee92baf ply-device-manager: Revert "Fall back to text plugin if no renderers installed"
The drm renderer may fail to open /dev/dri/card# with -ENOENT when trying
to open/probe a simpledrm registered drm device and the open races with
that drm device being removed to be replaced by a new drm device registered
by the native GPU driver (e.g. i915 / amdgpu).

Switching to text mode immediately when this race gets hit is undesirable,
as it causes text mode on systems where plymouth would run in graphics
mode before. Remove the immediate switch to text mode on -ENOENT.
Delaying the switch to textmode until the timeout as before.

This reverts commit 03842d5201.

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=2270030
2024-06-05 14:49:57 +02:00
Ray Strode
238d2fc2a2 Merge branch 'mr256' into 'main'
Issue #256

See merge request plymouth/plymouth!322
2024-06-04 15:06:13 +00:00
emperor06
f9f90fc3de ply-utils: Ensure random ints are big enough
Using Math.Random() in a theme script practically always returns zero.
This is because ply_get_random_number uses mrand48 which, while
returning a 64-bit long, restricts the range of its return value
to be no more than 32-bit, and so gets improperly normalized.

This commit addresses the problem by calling mrand48() twice, once for
each 32-bits of the returned value.

https://gitlab.freedesktop.org/plymouth/plymouth/-/issues/256
2024-06-04 11:05:05 -04:00
Ray Strode
edc7c3ea10 Merge branch 'fixmeson' into 'main'
Bump required Meson version

See merge request plymouth/plymouth!314
2024-04-30 01:19:15 +00:00
nerdopolis
8f0584f753 Bump required Meson version 2024-04-30 01:18:56 +00:00
Ray Strode
5fbb7bdb74 Merge branch 'xkbcommon-dep' into 'main'
ply-splash-core: Add xkbcommon dep to pkgconfig file

See merge request plymouth/plymouth!316
2024-04-24 18:47:30 +00:00
Ray Strode
c936adb567 ply-splash-core: Add xkbcommon dep to pkgconfig file
This addresses a build blip.

https://gitlab.freedesktop.org/plymouth/plymouth/-/issues/251
2024-04-24 14:44:07 -04:00
Ray Strode
6935236fb6 Merge branch 'weblate-plymouth-master' into 'main'
Translations update from Fedora Weblate

See merge request plymouth/plymouth!312
2024-03-17 18:45:12 +00:00
Baurzhan Muftakhidinov
f2e02061a9 Translated using Weblate (Kazakh)
Currently translated at 100.0% (7 of 7 strings)

Added translation using Weblate (Kazakh)

Co-authored-by: Baurzhan Muftakhidinov <baurthefirst@gmail.com>
Translate-URL: https://translate.fedoraproject.org/projects/plymouth/master/kk/
Translation: plymouth/main
2024-03-10 10:36:09 +01:00
ButterflyOfFire
fbb3f0b360 Translated using Weblate (Kabyle)
Currently translated at 57.1% (4 of 7 strings)

Added translation using Weblate (Kabyle)

Co-authored-by: ButterflyOfFire <butterflyoffire@protonmail.com>
Translate-URL: https://translate.fedoraproject.org/projects/plymouth/master/kab/
Translation: plymouth/main
2024-03-10 10:36:08 +01:00
Ray Strode
050418a789 Merge branch 'scriptparsekmsg' into 'main'
script: Get the messages from the console and ply-kmsg-reader, and use...

See merge request plymouth/plymouth!277
2024-03-08 16:31:25 +00:00
nerdopolis
58a25cc403 script: Get the messages from the console and ply-kmsg-reader, and use ply-terminal-emulator and ply-console-viewer to the display messages 2024-03-08 13:23:02 +00:00
Ray Strode
f23233d446 Merge branch 'fix-no-unused-warning' into 'main'
ply-buffer: Fix unused-value warning

Closes #246

See merge request plymouth/plymouth!309
2024-03-07 20:22:29 +00:00
Ray Strode
c65d37e4ac ply-buffer: Fix unused-value warning
We currently get warnings during the build like

```
../src/libply/ply-buffer.h:60:20: warning: value computed is not
used [-Wunused-value]
60 |              !_ran && (*bytes = (char *) ply_buffer_get_bytes(buffer),
   |                    ^~
```

This commit changes the macro to use a GCC statement expression with
an if statement to work around the warning.

Closes: https://gitlab.freedesktop.org/plymouth/plymouth/-/issues/246
2024-03-07 15:14:34 -05:00
Ray Strode
18691572ee Merge branch 'bias-scale-downward' into 'main'
ply-utils: Only choose scale 2 when the perfect scale would be >= 1.75

See merge request plymouth/plymouth!308
2024-03-06 14:33:11 +00:00
Daniel van Vugt
3b8e918479 ply-utils: Only choose scale 2 when the perfect scale would be >= 1.75
This is the intended design documented in:
https://gitlab.gnome.org/GNOME/mutter/-/commit/d03dce43786d

And discussed in:
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3616
2024-03-05 17:51:11 +08:00
Ray Strode
4dc3a5ba0c Merge branch 'match-mutter-default-scale' into 'main'
ply-utils: Match mutter's default device scale choice

See merge request plymouth/plymouth!307
2024-02-27 08:07:23 +00:00
Daniel van Vugt
acf97c7367 ply-utils: Match mutter's default device scale choice
Until now, laptops with a DPI between 192 and 202 would be given a
default scale of 2 by Plymouth, and 1 by Mutter for the login screen.
That made the visual transition a bit ugly so let's match Mutter's
default scale selection. This means the threshold for laptops is now
1.5 x 135 = 202 DPI instead of 192 DPI. And for desktop monitors it's
now 1.5 x 110 = 165 DPI instead of 192 DPI.

Closes: https://bugs.launchpad.net/bugs/2054769
2024-02-27 14:56:41 +08:00
Ray Strode
954abd07db Merge branch 'weblate-plymouth-master' into 'main'
Translations update from Fedora Weblate

See merge request plymouth/plymouth!306
2024-02-26 14:50:25 +00:00
Sabri Ünal
af51a5b96f Translated using Weblate (Turkish)
Currently translated at 100.0% (5 of 5 strings)

Co-authored-by: Sabri Ünal <libreajans@gmail.com>
Translate-URL: https://translate.fedoraproject.org/projects/plymouth/master/tr/
Translation: plymouth/main
2024-02-26 02:36:08 +01:00
n3rdopolis
5113860332 Merge branch 'fix240' into 'main'
ply-boot-splash: Set unbuffered input when creating a text display

Closes #240

See merge request plymouth/plymouth!303
2024-02-07 01:29:18 +00:00
n3rdopolis
10ac8d2dc9 ply-boot-splash: Set unbuffered input when creating a text display 2024-02-06 20:19:23 -05:00
Ray Strode
7a0b0b802d Merge branch 'ev_led_not_needed' into 'main'
xkb_state_led_name_is_active does not appear to require devices to have EV_LED

See merge request plymouth/plymouth!305
2024-02-01 10:39:17 +00:00
n3rdopolis
50aabad06a xkb_state_led_name_is_active does not appear to require devices to have EV_LED
This allows the on-screen caps lock indicator to work on HyperV keyboards, and HyperV has one keyboard
2024-02-01 00:10:47 -05:00
Ray Strode
02bd04d431 Merge branch 'fix245' into 'main'
renderers: Do not assume all keyboards have LEDs

Closes #245

See merge request plymouth/plymouth!304
2024-01-31 16:14:08 +00:00
n3rdopolis
709f21e801 renderers: Do not assume all keyboards have LEDs
This is an attempt to fix #245
2024-01-31 08:38:38 -05:00
Ray Strode
07662e5488 Merge branch 'fix-freetype-fallback' into 'main'
label-freetype: fix fallback not working when fc-match isn't available

Closes #239

See merge request plymouth/plymouth!302
2024-01-16 02:06:59 +00:00
Ferdinand Bachmann
792fe7474a label-freetype: fix fallback not working when fc-match isn't available
The new font loading functions introduced in
544e62ac41 assume that popen() returns
NULL when fc-match is unavailable or fails. This is incorrect, since
popen() will always start a shell to run the passed command and return a
stream to that shell's stdin and stdout.

This results in an non-null but empty font name being passed to
FT_New_Face(), which fails.

This commit fixes this by also using the fallback font when the font
path read from the popen() stream is empty.

Fixes #239
Fixes regression caused by 544e62ac41
2024-01-16 02:13:40 +01:00
n3rdopolis
18590a2159 Merge branch 'inibash' into 'main'
plymouth-set-default-theme: Use a more targeted bash ini-parser function...

Closes #238

See merge request plymouth/plymouth!300
2024-01-13 00:33:26 +00:00
nerdopolis
6d5d3044fe plymouth-set-default-theme: Use a more targeted bash ini-parser function instead of sed to handle the config file 2024-01-13 00:31:19 +00:00
Ray Strode
cc15da222d Merge branch 'fixinigroup' into 'main'
splash plugins: Fix wrong group being used for console viewer settings in...

See merge request plymouth/plymouth!301
2024-01-10 19:46:10 +00:00
nerdopolis
0c4b27e06f splash plugins: Fix wrong group being used for console viewer settings in space-flares and fade-throbber 2024-01-10 07:20:02 -05:00
Ray Strode
0416745438 Merge branch 'fixinputwarnings' into 'main'
ply-input-device: Fix 'may be used uninitialized' warnings

See merge request plymouth/plymouth!299
2024-01-05 15:42:39 +00:00
n3rdopolis
5878235e7d ply-input-device: Fix 'may be used uninitialized' warnings
If libevdev gave plymouth an event with an out of range key event type then plymouth would end up using uninitialized variables.

This commit fixes the compiler warning introduced from that unlikely scenario.
2024-01-05 15:42:39 +00:00
Ray Strode
226c573c39 Merge branch 'fixvtlesscrash' into 'main'
ply-terminal: Fix crash on vt-less kernels when checking the enabled state

See merge request plymouth/plymouth!298
2024-01-05 10:20:26 +00:00
nerdopolis
5c10072a97 renderers: Only call ply_terminal_set_unbuffered_input when there is a terminal 2024-01-04 21:42:28 -05:00
nerdopolis
63597f92d1 ply-terminal: Fix crash on vt-less kernels when checking the enabled state 2024-01-04 21:06:50 -05:00
Ray Strode
d6e6366d62 Merge branch 'fix-hidpi-on-freetype' into 'main'
label-freetype: Fix rowstride bug with hidpi displays

See merge request plymouth/plymouth!297
2024-01-04 21:08:14 +00:00
Ray Strode
345d28b3cb label-freetype: Force resize calculation when moving control
When moving the label around we need to do a full recalculation
of the metrics, because the position is part of the computation.
2024-01-04 16:07:06 -05:00
Ray Strode
1c2c9e622d label-freetype: Fix rowstride bug with hidpi displays
The freetype plugin correctly doubles the DPI on hidpi displays,
but fails to account for the doubled pixels in display's pixel buffer.

This commit adds a factor of 2 to the size and positioncomputations,
to hopefully fix a row stride and a positioning bug.
2024-01-04 15:28:02 -05:00
Ray Strode
2dba038dd7 Merge branch 'weblate-plymouth-master' into 'main'
Translations update from Fedora Weblate

See merge request plymouth/plymouth!234
2024-01-04 09:25:55 +00:00