In order to hand off the drm fd to another program we need
to be able to run that other program.
This commit adds an API for running a program with no arguments,
in the background.
Right now, anytime we update the root fs in the daemon we treat
it like we switched from initramfs to the main root filesystem.
We shoudn't do that when shutting down since we're going to go
the other direction.
This commit changes on_newroot to look at the current mode to
decide what to do.
For the moment it doesn't do anything in the shutdown case, but
that will change shortly.
plymouthd currently sticks around on the main filesystem during
shutdown, while shutdown proceeds on the initramfs.
This commit adds a unit to make it jump into the initramfs too.
This is important, so we can run the drm escrow binary from
the initramfs.
Right now plymouthd forces itself to stay alive for the duration of
shutdown, so the splash screen can stay up until the power is killed.
This causes unclean mounts in some situations following system updates.
Rather than keep plymouthd around, all we really need to do is keep
the drm fd around. That can be down with a separate program executed
just in time from the initramfs.
As a first step toward acheiving that goal, this commit creates a
simple new program "plymouth-drm-escrow" that doesn't do anything
at all but try to stay alive.
A future commit will change plymouthd to run plymouth-drm-escrow,
and pass it the drm fd.
On some devices the LCD panel is mounted in the casing in such a way
that the up/top side of the panel does not match with the top side of
the device.
Examples of this are:
-Tablets where the LCD panel is mounted upside-down (various models)
-Clamshell design devices use portrait tablet screens in a landscape fashion /
a landscape case, e.g. the GPD pocket, GPD win, Asus T100HA and the VIOS LTH17
(so the didplay is mounted rotated 90 degrees clock-wise or counter-clock-wise).
Starting with kernel 4.16 there is code in the kernel to:
-Detect affected devices
-Automatically rotate the fbconsole to compensate
-Let userspace know about this with a new "panel orientation" property on the drm connector of the panel
The patch series I'm attaching to this bug adds support for this to
plymouth, so that the boot-splash and diskcrypt-ask-password are shown
with the correct orientation / the right way up on these devices.
On devices where the (LCD) panel is mounted upside-down in the case
the kernel's drm_fb_helper code may have set up rotation on the primary
plane to make the text-console (and other fbdev using apps) show the right
way up.
We inherit this rotation from the text-mode and since we do our own rotation
where necessary we end up rotating twice and showing the boot-splash
upside-down again.
Dealing with hardware rotation may require using a specific framebuffer
tiling which we do not support, so we should just disable the hardware
rotation and keep using our own software rotation.
This commit adds code to find the primary plane and its rotation property
and if it is not DRM_MODE_ROTATE_0 then sets it to DRM_MODE_ROTATE_0. fixing
the double rotation issue.
https://bugs.freedesktop.org/show_bug.cgi?id=104714
On some devices the LCD panel is mounted in the casing in such a way
that the up/top side of the panel does not match with the top side of
the device (e.g. it is mounted upside-down).
Kernel 4.16 introduces a new "panel-orientation" property on the drm
connector which allows modesetting applications / code to check for
such LCD panels.
This commit adds support for this new property and passes this to the
pixel_buffer code using the new ply_pixel_buffer_new_with_device_rotation
method, so that the pixel_buffer code will automatically rotate the
image to correct for the panel orientation.
https://bugs.freedesktop.org/show_bug.cgi?id=104714
On some devices the LCD panel is mounted in the casing in such a way
that the up/top side of the panel does not match with the top side of
the device (e.g. it is mounted upside-down).
This commit adds support to the ply-pixel-buffer code to create
buffers which take device rotation into account and which will rotate
the picture to compensate.
https://bugs.freedesktop.org/show_bug.cgi?id=104714
On machines with a slow CPU (Atom) and a highres screen drawing the
diskcrypt dialog may take longer then the keyrepeat speed, this leads to
a long delay before showing keypresses when doing the following:
1) Type long password
2) Realize it is wrong, press + hold backspace
the key-repeat will now generate backspace key presses faster then we
process them as main.c does an update_display for each press
3) Users releases backspace when we've processed input-length backspace
key-presses, but since we were drawing slower then key-presses were
coming in many more backspace keypresses are in the keyboard buffer
4) User types first character of the right password, this shows up up to
a couple of seconds later because first we are still processing all
the queued up backspace presses and doing a redraw for each.
This commit fixes this by skipping the redraws in on_backspace when there
is no more input left in the input buffer.
https://bugs.freedesktop.org/show_bug.cgi?id=104714
The x11 plugin calls gdk_display_get_name at load time
to set the device name state. This no longer works, since
gtk_init_check() happens later at open_device time, and
GTK+ no longer allows gdk_display_get_name before gtk_init.
This commit moves the gtk_init call earlier, to
create_backend, so gdk_display_get_name works again.
https://bugzilla.gnome.org/show_bug.cgi?id=104204
Not all distros use the upstream plymouth-populate-initrd
script to populate their initramfs. As a consequence,
some themes have been developed that use subdirectories,
(which is not supported by plymouth-populate-initrd).
This commit adds support for that feature, so that
preexisting themes get properly installed.
https://bugs.freedesktop.org/show_bug.cgi?id=103424
Right now we assume if we find a /dev/dri/card0 that it will work.
That may not be true. The proprietary nvidia driver, for instance,
provides /dev/dri/card0 but disables modesetting by default.
This commit makes sure we fall back to text mode if /dev/dri/card0
is insufficient for our needs.
https://bugs.freedesktop.org/show_bug.cgi?id=103612
This makes possible to support shipping a self-contained initrd which
completely overrides the plymouth theme. The configuration and theme are
copied to /run by a custom service before plymouth starts, so plymouth
can load the correct config from /run both during bootup and shutdown.
This commit changes the routine which resolves plymouth.defaults' path,
to have it look first in plymouth's runtime directory.
Signed-off-by: João Paulo Rechi Vita <jprvita@endlessm.com>
When a theme is shipped exclusively in the initrd, plymouth will not be
able to load is if it starts the boot splash after the bootup process
already switched from the initrd. One way to make it work is to copy the
theme to plymouth's runtime directory in /run, which is preserved during
switch root.
This commit changes the routine which resolves a theme's path to have it
look first in themes/ under plymouth's runtime directory.
Signed-off-by: João Paulo Rechi Vita <jprvita@endlessm.com>
If the user holds down ESC the system can easily get
overrun toggling details and the theme back and forth.
This commit changes the code to ignore any ESC key events
that come in while ESC is getting processed.
At the moment, libudev is unconditionally linked into plymouth
even if it's configured to be not used.
This commit moves the pkg-config check, so that it doesn't get
made at all if --without-udev is passed.
Right now the renderer keeps its own copy of the device name, which
may be NULL or out of date after the renderer is opened.
This commit makes sure the device name gets updated to be current.
Various bits of fall back code pass the terminal device
as the renderer device. This is wrong, ply_renderer is
a graphical renderer abstraction.
This commit passes NULL in those cases, so each renderer
does what it's configured to do by default.
https://bugs.freedesktop.org/show_bug.cgi?id=99104
This adds a DeviceScale setting to plymouthd.conf. It can be used to
override the device scale detection when setting the
PLYMOUTH_FORCE_SCALE environment variable is too complicated.
https://bugs.freedesktop.org/show_bug.cgi?id=97424
It's quite likely that afer the drm device arrives, the number
of rows and columns in the terminal will change.
This commit makes sure to refresh the terminal state.
If a client opens the drm device, they're given drm master
implicitly. We already explicitly take DRM master when we need it,
so that featuer is unneeded.
Furthermore, it's actively harmful, since fbdev won't let you change
the color palette of the terminal if drm master is held.
This commit makes sure to drop master as soon as we get it from
open().
A regression introduced in 7e37d58be3
means that we only look for DRM devices that appear while we're waiting,
we don't consider any that are already present before we started.
shutdown splash was not appearing because of this.
Solve this by explicitly searching for already-initialized DRM devices as
we start up.
https://bugs.freedesktop.org/show_bug.cgi?id=96560
The show_messages function shows any queued messages sent to the
daemon on the active boot splash. It's currently only ever called
in a place in the code where the splash hasn't yet been assigned,
so it's effectively always a noop.
This commit moves the call a little later so it won't bail immediately.
commit 74346ec268 tried to fix a case where views are
added after the text splash is shown. That commit inadvertently
removed the code that adds a view for a new text display.
This commit adds back the accidentaly excised line.
If a renderer fails to open, then we need to make sure we nullify,
the renderer variable after freeing it, since subsequent code checks
if the renderer is null to know whether or not to proceed with
fallback.