Hans de Goede [Mon, 14 Oct 2019 20:08:21 +0000 (22:08 +0200)]
themes: spinner/bgrt: Modify password dialog to match gnome 3.34 changes
There have been some small tweaks to the gnome lockscreen password
entry filed which we use as template for the diskcrypt password dialog,
adjust our dialog to match these tweaks.
Also move the keyboard indicator to be close to the entry, so that it
is clear it belongs to the entry.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Hans de Goede [Mon, 14 Oct 2019 06:11:07 +0000 (08:11 +0200)]
two-step: Remove workaround for upside-down panels
Now that the drm plugin uses hw-rotation for upside down panels when
the GOP does so, there is no need to treat the bgrt rotation for
upside-down panels special anymore,
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Hans de Goede [Sun, 13 Oct 2019 21:46:31 +0000 (23:46 +0200)]
drm: Keep hw-rotation on devices with upside down LCD panels
On devices with an upside down LCD panel and where the hw is capable of
rotating the image to correct this the firmware will program the primary
plane to use hw rotation. When we reset this, this may lead to a small
flicker, where the vendor logo is briefly shown upside down.
A bigger problem is the transition to gdm/mutter. We leave the splash
on screen when mutter loads for a smooth transition, when mutter turns
hw-rotation back on, the splash turns upside down! And mutter then fades
from the upside-down splash to the login screen, which looks kinda bad.
Keeping the hw-rotation (and disabling our sw rotation) on devices like
this fixes both issues.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Hans de Goede [Sun, 13 Oct 2019 20:42:24 +0000 (22:42 +0200)]
drm: Add get_primary_plane_rotation() helper function
Factor most of the code in ply_renderer_head_clear_plane_rotation() out
into a get_primary_plane_rotation() helper, this is a preparation patch
for adding support for using hw-rotation in some cases.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Hans de Goede [Sun, 13 Oct 2019 14:39:22 +0000 (16:39 +0200)]
systemd-ask-password-plymouth.service.in: Do not hardcode /run path to pid file
Use @plymouthruntimedir@/pid in systemd-ask-password-plymouth.service.in so
that the way the path to the pidfile is build there is identical to the
way the --pidfile argument is build in plymouth-start.service.in.
Fixes #26
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Hans de Goede [Sun, 13 Oct 2019 08:22:43 +0000 (10:22 +0200)]
configure: Make runtimedir configurable
On modern systems we should use /run/plymouth to store things like the
pid file, instead of /var/run/plymouth, make the runtime dir configurable
with --with-runtimedir. This keeps the old default behavior of using
/var/run/plymouth, users can pass --with-runtimedir=/run to use
/run/plymouth instead.
Fixes: #75 Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Hans de Goede [Sat, 12 Oct 2019 10:38:25 +0000 (12:38 +0200)]
ply-pixel-buffer: Fix bottom edge rendering of scaled buffers
Commit 4e1c00b89a71 (" ply-pixel-buffer: Fix right and bottom edge rendering
of scaled buffers"), which tried to fix a minor rendering issue with the right
and bottom edge of scaled images, contains a typo which actually makes things
worse :|
When checking if iy exceeds the height of the image, ix gets set to the height
instead of iy leading to addressing pass part of the buffer which leads to
various rendering artifacts.
This commit fixes the typo and thus also the artifacts.
Fixes: #83 Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Hans de Goede [Mon, 30 Sep 2019 22:19:48 +0000 (00:19 +0200)]
themes: Add images for keyboard indicator support to spinner and spinfinity
Add capslock.png, keyboard.png and keymap-render.png files to the
spinner and spinfinity themes, this enables keyboard indicator
(keymap and capslock state) support for these themes.
capslock.png was made by me drawing the icon in xfig, then export as
svg, at some blank rows at the bottom and save as png. I've added the
capslock.fig file to the spinner theme dir.
keyboard.png comes from google's material-design-icons (original is
apache licensed): https://github.com/google/material-design-icons/
I've also added a copy of the 2 svg source files to the spinner theme dir.
keymap-render.png is generated by scripts/keymap-render.py.
Fixes: #85 Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Alberto Ruiz [Mon, 30 Sep 2019 14:58:55 +0000 (16:58 +0200)]
scripts: Add keymap-render.py script
Add a script for generating a png with the short-name (ignoring variants)
of all keymaps listed by "localectl list-keymaps" pre-generated.
This scripts also generates a ply-keymap-metadata.h file with info on
which pre-generated keymap name is where in the png.
This will be used in a follow-up commit to add support for a new
keyboard-keymap-icon control to libply-splash-graphics.
Note that this commit does not add the generated keymap-render.png file,
this file will be added to each themes image-dir separately as the color
of the pre-generated text may differ per theme.
Changes by Hans de Goede:
- Change generated metadata into a C header file
- Drop drawing of curved corners, we just want the text
- Add special handling for dvorak
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Hans de Goede [Sat, 28 Sep 2019 20:31:38 +0000 (22:31 +0200)]
key-file: Add support for non ini style config files
In some cases me way want to parse key=value style config files from
outside of plymouth which lack ini style groups.
This commit adds a new ply_key_file_load_groupless_file function which
supports loading such files. When a file is loaded this way, NULL must
be passed as group_name for subsequent ply_key_file_get_* calls.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Hans de Goede [Mon, 30 Sep 2019 09:12:45 +0000 (11:12 +0200)]
space-flares: Fix compiler warning
Recent gcc versions give the following compiler warning with space-flares:
./plugin.c: In function ‘star_bg_update’:
./plugin.c:762:21: warning: taking the absolute value of unsigned type ‘uint32_t’ {aka ‘unsigned int’} has no effect [-Wabsolute-value]
762 | if (abs (((image_data[x + y * width] >> 16) & 0xff) - ((pixel_colour >> 16) & 0xff)) > 8) {
| ^~~
This commit fixes this, assuming that gcc actually optimises the abs()
away, this will also make the code behave as intended again.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
ply_kernel_command_line_get_string_after_prefix returns the rest of
the commandline after the passed in prefix. When parsing key=value parts
of the commandline, we really only want the value part and stop at the
whitespace separating it from other kernel commandline arguments.
This commit adds a new helper which returns a strdup-ed string containing
just the value; instead of the entire rest of the kernel commandline.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Hans de Goede [Sat, 28 Sep 2019 12:29:02 +0000 (14:29 +0200)]
two-step: Merge show_password_prompt and show_prompt into 1 function
These 2 functions were doing almost the same. Move the setting of the
entry text or bullet count into view_show_prompt were it belongs and
merge these 2 functions into 1 function.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Hans de Goede [Sat, 28 Sep 2019 10:05:11 +0000 (12:05 +0200)]
twp-step: Remove superflous is_hidden / is_stopped checks from on_draw
Remove superflous is_hidden / is_stopped checks from our on_draw
handler. In all 3 cases the is_hidden / is_stopped check guards
a draw_area call, but the draw_area calls themselves contain the
same check, so it checking this in on_draw is not necessary.
Also note that we are already not doing such a check for e.g. the
progress_bar so lets be consistent and remove the check everywhere.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Hans de Goede [Sat, 28 Sep 2019 09:59:47 +0000 (11:59 +0200)]
two-step: Cleanup stop_animation function
Cleanup the stop_animation function:
- Remove the trigger argument as all callers pass NULL
- Remove the logging of "hiding progress animation" we already log a
generic "stopping animation" message and we do not log such a message
for the other animated controls, so remove this one for consistency
- Add a NULL pointer check for view->end_animation, as this can actually
be NULL when view_load_end_animation fails
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Hans de Goede [Thu, 26 Sep 2019 13:59:38 +0000 (15:59 +0200)]
themes: Move spinifity from the throbgress splash to the two-step splash
At one point in time the two-step splash plugin was forked from the
throbgress splash. Since then the two-step plugin has grown to be more
flexible / configurable.
The two-step plugin is now flexible enough that with the right config
it can mimick the throbgress plugin. Moving the spinifity theme to
use the two-step plugin allows us to remove the throbgress plugin,
removing the code duplication between the 2 plugins.
An added advantage of this is that the two-step plugin has more functionality,
such as capslock indicator support for the password dialog.
Note the throbber-??.png images were modified to add 24 transparant rows at
the top, to get the extra hardcoded throbber-height / 2 space which the
throbgress plugin added between the throbber and the header-image, this
was done automatically using the following command:
convert old.png -background transparent -gravity northwest -splice 0x24 new.png
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Hans de Goede [Wed, 25 Sep 2019 16:56:34 +0000 (18:56 +0200)]
two-step: Add new UseAnimation setting
Until now we have been disabling the animations when the theme specifies
that a progress-bar should be drawn for the current mode.
This commit adds a new UseAnimation setting which defaults to
!UseProgressBar to preserve the old behavior if UseAnimation is not
set by the theme.
This makes two-step more flexible. Specifically it will allow implementing
the spinfinity theme using two-step; and spinifinity is the only user of
the throbgress plugin, so this will allow removal of that plugin.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Hans de Goede [Wed, 25 Sep 2019 20:36:47 +0000 (22:36 +0200)]
two-step: Make progress-bar location and size configurable
This commit makes the progress-bar location configurable seperately from
the animation location and it makes the progress-bar size configurable
instead of hardcoding it.
This makes two-step more flexible. Specifically it will allow implementing
the spinfinity theme using two-step; and spinifinity is the only user of
the throbgress plugin, so this will allow removal of that plugin.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Hans de Goede [Thu, 26 Sep 2019 08:37:07 +0000 (10:37 +0200)]
two-step: Fix progress-bar not hiding when it should
Before this commit we were not hiding the progress-bar when starting the
end-animation nor when stop_animation gets called. This adds the 2 missing
hide calls, making the handling of the progress-bar identical to that of
the progress-animation.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Hans de Goede [Wed, 25 Sep 2019 22:52:48 +0000 (00:52 +0200)]
two-step: Fix progress-bar not updating on normal boot
We were only calling ply_progress_bar_set_percent_done from the
system_update callback and not from the on_boot_progress callback.
This commit fixes this by adding the missing calls for this to
update_progress_animation and it makes system_update use
update_progress_animation instead of duplicating the code.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Hans de Goede [Thu, 26 Sep 2019 08:15:23 +0000 (10:15 +0200)]
two-step: Fold ply_progress_animation_hide call into view_start_end_animation
We should always disable (hide) the progress-animation when
starting the end-animation. Instead of having all callers of
view_start_end_animation do this themselves, do it at the beginning
of view_start_end_animation.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Hans de Goede [Thu, 19 Sep 2019 14:05:17 +0000 (16:05 +0200)]
label: Properly deal with pixel-buffers with non-upright device_rotation
Fix the label plugin rendering garbled (wrong pitch) top to bottom text,
instead of proper left to right text when the pixel-buffer has a
device-rotation of rotate-clockwise or rotate-counter-clockwise.
Hans de Goede [Fri, 6 Sep 2019 15:21:45 +0000 (17:21 +0200)]
ply-device-manager: De-activate and close renderer on device hot unplug
When a device gets hot unplugged, we should de-activate and close the
renderer before freeing it.
Speficially this fixes a problem where plymouth's display "freezes" when
used with AMD GPUs which can be handled by both the radeon or the amdgpu
kms driver and the user has added kernel commandline options to prefer
the amdgpu driver. In this case the following happens:
1) radeon driver gets loaded, creates /dev/dri/card0 generating a udev
"add /dev/dri/card0" event.
2) radeon driver's "load" method checks if it should bind, comes to the
conclusion it should not, causing the probe of the device to be
aborted and /dev/dri/card0 to be unregistered generating a udev
"remove /dev/dri/card0" event
3) amdgpu driver loads, creates /dev/dri/card0 generating another udev
"add /dev/dri/card0" event.
4) plymouth loads while udev is still catching up with kernel events,
plymouth sees the first "add" event opens /dev/dri/card0 (which is
already managed by amdgpu at this time) finds outputs, shows splash
5) plymouth gets the "remove" events tears down the renderer, but
since deactivate and close were not called before this commit,
plymouth keeps the master rights attached to the old-fd which is
leaked at this point
6) plymouth gets the second "add" event brings everything back up, but
it cannot get master rights, since there can only be 1 master and the
leaked fd is the master. This leads to lots of:
"Couldn't set scan out buffer" errors and plymouth appears frozen
because of this, this is esp. bad with the disk encryption unlock screen
7) When gdm starts, it deactivates plymouth, but does not yet tell it to quit
to avoid flickering. The deactivate makes plymouth drop its master rights,
but this happens on the new broken fd which never got the master rights.
This also makes it impossible for gdm to get master rights, also breaking
gdm, with the following error in the logs:
"(EE) wl_drm@4: error 0: authenicate failed"
Note in theory calling ply_renderer_close() on teardown (from
ply_device_manager_free()) should be fine too, but for some reason
this causes the framebuffer to be all messed up (looks like wrong pitch /
tiling) when this is done after gdm has taken over the framebuffer.
Where as just exiting without calling drmModeRmFB, letting the kernel
clean up behind us, does not trigger this. This feels like it is a kernel
bug bug and I will file a bug for this. But for now we should not call
ply_renderer_close() on teardown to avoid this issue (which would be a
regression).
Hans de Goede [Fri, 6 Sep 2019 15:40:06 +0000 (17:40 +0200)]
plymouthd.defaults: Bump default DeviceTimeout to 8 seconds
The amdgpu driver needs up to 5 seconds to initialize / boot some
AMD GPUs, which makes our 5 second timeout much too close to the actual
needed time, leading to systems where sometimes the boot is fine and the
next boot we fallback to a text based splash because we won the race from
the GPU probe code.
This commit bumps the default DeviceTimeout to 8 seconds giving us a
decent marging here without making it overly long.
Hans de Goede [Sun, 25 Aug 2019 16:01:59 +0000 (18:01 +0200)]
two-step: bgrt: Add workaround for desktops which do not use the golden ratio
On desktops (no panel) we normally do not use the BGRT provided
xoffset and yoffset because the resolution they are intended for
may be differtent then the resolution of the current display.
On some desktops (no panel) the image gets centered not only
horizontally, but also vertically. In this case our default of using
the golden ratio for the vertical position causes the BGRT image
to jump.
To avoid this this commits adds an extra check to see if the provided
xoffset and yoffset perfectly center the image and in that case uses them.
An example of a system needing this workaround is the Minix Neo Z83-4.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Hans de Goede [Thu, 18 Jul 2019 15:51:54 +0000 (17:51 +0200)]
two-step: Deal with buggy firmware which does not pre-rotate the bgrt image
Some buggy Lenovo 2-in-1s with a 90 degree rotated panel, behave as
if the panel is mounted up-right / not rotated at all. These devices
have a buggy efifb size (landscape resolution instead of the actual
portrait resolution of the panel), this gets fixed-up by the kernel.
These buggy devices also do not pre-rotate the bgrt_image nor do
they set the ACPI-6.2 rotation status-bits. We can detect this by
checking that the bgrt_image is perfectly centered horizontally
when we use the panel's height as the width.
This commit uses this check to override the bgrt-rotation read from
the ACPI-6.2 rotation status-bits, fixing us displaying the bgrt image
with the wrong rotation.
ply terminal session: Drop function ply_terminal_session_execute and
ply_terminal_session_open_console, Since this is a feature from a bygone
time which is no longer in use without ply_terminal_session_run.
Hans de Goede [Fri, 24 May 2019 20:49:15 +0000 (22:49 +0200)]
two-step: Add support for firmware-splashes with rotation status bits set
Before the ACPI 6.2 specification, the BGRT table did not contain any rotation
information, so to make sure that the firmware-splash showed the right way up
the firmware would contain a pre-rotated image and our BGRT / firmware-splash
loading code assumed this is alwast true.
Starting with ACPI 6.2 tge bgrt status fields has 2 bits to tell the firmware
the image needs to be rotated before being displayed. If these bits are set
then the firmwares-splash is not pre-rotated and we must handle it differently.
This commit adds support for reading the new rotation bits from the sysfs
bgrt/status file and adds handling for the case where the bits indicate
that the image is not pre-rotated.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>