Hans de Goede [Tue, 15 Aug 2023 17:25:21 +0000 (19:25 +0200)]
drm: Guess device-scale when using simpledrm
When displaying on a simpledrm kms device the physical dimensions
of the screen are unknown. Use the heuristics from ply_get_device_scale ()
to guess the device scale to avoid rendering things too small
on 4K screens.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Hans de Goede [Tue, 15 Aug 2023 16:41:29 +0000 (18:41 +0200)]
drm: Add check if the driver used is simpledrm
Add a check to see if the driver used is simpledrm,
this is a preparation patch for adding support to set
device_scale based on heuristics when using simpledrm.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Hans de Goede [Tue, 15 Aug 2023 16:42:46 +0000 (18:42 +0200)]
drm: Initialize rotation local variable
Initialize rotation local variable to fix the following
false positive compiler warning:
src/plugins/renderers/drm/plugin.c: In function ‘get_primary_plane_rotation’:
src/plugins/renderers/drm/plugin.c:485:31: warning: ‘rotation’ may be used uninitialized [-Wmaybe-uninitialized]
485 | *rotation_ret = rotation;
| ~~~~~~~~~~~~~~^~~~~~~~~~
src/plugins/renderers/drm/plugin.c:419:18: note: ‘rotation’ was declared here
419 | uint64_t rotation;
| ^~~~~~~~
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Hans de Goede [Mon, 14 Aug 2023 14:50:22 +0000 (16:50 +0200)]
drm: Use first output for panel info if there is no builtin display
The two-step renderer uses ply_renderer_get_panel_properties() to get
the device-scale used for the builtin panel, assuming this is most likely
light-up by the firmware on boot and that this is thus also displaying
the bgrt boot splash shown by the firmware at boot.
It needs to know the device-scale for this output so that if hi-dpi
(device-scale=2) rendering is used on the output it can also set
device-scale=2 on the ply_pixel_buffer() used for the bgrt background
so that the pixel-buffer code knows the splash is pre-scaled and
doesn't double it in size making it twice as big as original.
ATM this doubling in size of the splash is exactly what happens
when using a desktop with a hidpi monitor because the drm plugin
does not provide any "panel" properties in this case.
To avoid this fall-back to using the properties of the first
enumerated (connected) output for get_panel_properties().
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Hans de Goede [Tue, 15 Aug 2023 10:23:05 +0000 (12:23 +0200)]
i18n: Check for NL plymouth.mo file instead of /usr/share/locale existence
setlocale () does not work when there is no locale info for
the selected LANG / LC_MESSAGES. But it does cache the set
LANG / LC_MESSAGES and on subsequent setlocale () calls with
the same LANG / LC_MESSAGES it does not recheck for the locale info.
Thus if the initrd does not have translations then the setlocale ()
call should be delayed to after the chroot so that e.g.
the "Installing Updates..." text, which only is shown after
the chroot, gets translated properly.
So far we have been checking the /usr/share/locale dir exists,
but it is possible that some initrd generators may create
that without the necessary locale info being available.
Instead check for the NL plymouth.mo file, assuming that
if that is available we have all the necessary locale info.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Hans de Goede [Tue, 15 Aug 2023 10:16:47 +0000 (12:16 +0200)]
meson: Fix PLYMOUTH_LOCALE_DIRECTORY and PLYMOUTH_DRM_ESCROW_DIRECTORY defines
After the conversion to meson to following CFLAGS were passed:
-DPLYMOUTH_LOCALE_DIRECTORY="share/locale"
-DPLYMOUTH_DRM_ESCROW_DIRECTORY="libexec/plymouth"
Note the missing "/usr/" prefix.
Fix these so that the locale check and drm-escrow binary work
again.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Tomás Pinho [Fri, 2 Jun 2023 12:13:34 +0000 (13:13 +0100)]
script: adds a new native GetCapslockState function to lib-plymouth
Allows Plymouth Script-based themes to query the Capslock state
directly to act on it by showing an icon or message.
Takes in Ray's suggestions and base the implemention around the keyboard
type instead, delegating to the renderer/terminal renderer types instead.
Timo Teräs [Wed, 22 Mar 2023 11:49:47 +0000 (13:49 +0200)]
script: fix deletion of sprites after full refresh
The node pointer is reused in the if (data->full_refresh) block
causing the following sprite list walking to fail. Fix this by
moving the sprite list first node getting next to the while loop
where it belongs.
n3rdopolis [Mon, 2 Jan 2023 16:57:21 +0000 (11:57 -0500)]
ply-input-device: Ensure that the LED state is updated on the keyboard of which the lock key was pressed on
When a lock modifier is pressed, plymouth goes through some gymnastics
to ensure the LEDs on all attached keyboards are appropriately updated.
Unfortunately, an optimization in the code used to avoid redundant
updates of keyboards that already have the correct state is actually
preventing the initiating keyboard from getting its LEDs turned on.
This is because the initiating keyboard gets its state updated at
key press time before the LED handling code runs, thus making it
seem like that run is redundant.
This commit introduces a new state variable `leds_state_invalid`
on the input device to mark this situation and updates the optimization
check to also check the new variable.
Ray Strode [Wed, 30 Nov 2022 14:51:17 +0000 (09:51 -0500)]
device-manager: Actually fall back to reading from tty if no xkb layout specified
Commit 7fcfcdf2d63025151a160f7948ee7406f0f16843 tried to fall back to
reading from a tty if no xkb layout was specified, but neglected to
actually check if no xkb layout was specified and force fall back to
reading from a tty in that case.
This commit changes device manager to actually disable reading from
/dev/input if the user doesn't specify a layout to use in vconsole.conf.
Ray Strode [Wed, 30 Nov 2022 14:51:17 +0000 (09:51 -0500)]
device-manager: Fall back to reading from tty if no xkb layout specified
At the moment if a user doesn't specify a xkb layout in vconsole.conf we
just fall back to assuming a us qwerty layout.
This isn't really optimal, since it might not match the keyboard.
Furthermore, the tty does have a usable layout, so it makes more sense
to fall back to it.
This commit changes device manager to disable reading from /dev/input
if the user doesn't specify a layout to use in vconsole.conf.
Close https://gitlab.freedesktop.org/plymouth/plymouth/-/issues/199
Ray Strode [Tue, 29 Nov 2022 19:46:08 +0000 (14:46 -0500)]
ci: Fix check-format
In commit bb6580212d45f9ab0a459a9335aec2ff20818a6e we tried to stop
running check-format on debian. We did this by moving the check-format
details to its own map and then adding a "<<" merge key to only pull
it in on Fedora.
The Fedora map already has a "<<" merge key however for doing the actual
build.
It's not allowed for their to be two, and gitlab's ci just ignores
the second one.