]> git.ipfire.org Git - thirdparty/plymouth.git/log
thirdparty/plymouth.git
6 years agoply-device-manager: Consume all events in one go
Hans de Goede [Thu, 17 Jan 2019 13:52:41 +0000 (14:52 +0100)] 
ply-device-manager: Consume all events in one go

Drm devices generate a bunch of add and change events when the kms
driver loads, consume these all in one go.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
6 years agodrm: Stop limiting preferred-mode picking to UEFI systems
Hans de Goede [Mon, 21 Jan 2019 14:41:37 +0000 (15:41 +0100)] 
drm: Stop limiting preferred-mode picking to UEFI systems

When the code to pick the preferred-mode for outputs was first added, it
was limited to UEFI systems, since it was necessary there.

It was not enabled everywhere right away because there were some worries
it might cause regressions.

We've been shipping this for a while now and no regressions have been
reported, moreover with the new hotplug support we really want to pick the
preferred-mode rather then falling back to the first mode in the list.

Therefor this commits removes the check for UEFI systems from
should_use_preferred_mode().

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
6 years agodrm: Reset mode on display-port connected outputs with a bad link-status
Hans de Goede [Thu, 17 Jan 2019 10:41:46 +0000 (11:41 +0100)] 
drm: Reset mode on display-port connected outputs with a bad link-status

With Display-Port links, esp. with DP MST links we may need to reset the
mode if the kernel decides to retrain the link.

If the kernel has retrained the link, the list of available modes may
have changed. If it changed and the mode we picked is no longer available
because of this, we treat this as an unplug + replug.

Since we may want to set another mode, the kernel does not automatically
restore the previous mode. So in case the mode did not change we need to
do an explicit mode-set.

This commits adds support for this, by:

1) Adding a scan_out_buffer_needs_reset member to ply_renderer_head
2) Storing the link-status when going over the connector properties
3) Checking the link-status when adding a connector to a head and setting
   the scan_out_buffer_needs_reset flag when the link-status is bad

This commit also makes ply_renderer_head_map set
scan_out_buffer_needs_reset, avoiding an unnecessary round-trip to the
kernel in the first reset_scan_out_buffer_if_needed call.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
6 years agodrm: Implement handle_change_event
Hans de Goede [Wed, 16 Jan 2019 08:41:42 +0000 (09:41 +0100)] 
drm: Implement handle_change_event

Now that we can call create_heads_for_active_connectors multiple times
we can implement handle_change_event.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
6 years agodrm: Ensure heads are mapped before flushing them
Hans de Goede [Wed, 16 Jan 2019 13:50:34 +0000 (14:50 +0100)] 
drm: Ensure heads are mapped before flushing them

The drm plugin's map_to_device function will return true if mapping of
any of the heads has succeeded, potentially leaving some heads unmapped.

This causes the "assert (buffer != NULL)" in begin_flush to trigger when
flushing the heads as head->scan_out_buffer_id is 0.

It seems that even though this is a pre-existing problem we sofar have
not hit this, likely because ply_renderer_head_map in pratice never fails.

However with the new monitor hotplug support, a head may be added after
map_to_device is called, triggering the assert.

This commit fixes both the theoretical pre-existing problem and the
actual problem triggered by hotplug support by ensuring that the head
is mapped before flushing it.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
6 years agodrm: Allow calling create_heads_for_active_connectors multiple times
Hans de Goede [Tue, 15 Jan 2019 09:43:45 +0000 (10:43 +0100)] 
drm: Allow calling create_heads_for_active_connectors multiple times

To support hotplugging monitors while plymouth is running, we must
rebuild our outputs list and create and/or remove heads as necessary
on every change event.

This commit adds support for removing single outputs (rather then
tearing down the whole backend) and adds a new first step to
create_heads_for_active_connectors which goes over our view of the
outputs before the change and removes any changed outputs from the
heads they belong to, destroying the head if the last output/connector
is removed.

On the first call backend->output_len is 0, so this new first step
is a no-op.

On subsequent calls we can simply build the list as we do on the first
call, changed outputs will already be removed by the new first step
and for unchanged outputs we end up in ply_renderer_head_add_connector
which will ignore the already added connector.

Note this drops the "couldn't connect monitor to existing head" message,
this is confusing when create_heads_for_active_connectors is called more
then once and is unnecessary as ply_renderer_head_add_connector already
logs a message on both failure exit paths.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
6 years agodrm: Allow calling ply_renderer_head_add_connector with existing connector_id
Hans de Goede [Tue, 15 Jan 2019 08:54:09 +0000 (09:54 +0100)] 
drm: Allow calling ply_renderer_head_add_connector with existing connector_id

Allow calling ply_renderer_head_add_connector with an existing
connector_id and ignore this call.

This allows calling create_heads_for_active_connectors multiple times,
only creating/adding heads for new connectors.

This is a preparation patch for adding support for hotplugging
monitors while plymouth is running.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
6 years agodrm: Limit backend->resources lifetime to within query_device
Hans de Goede [Tue, 15 Jan 2019 08:21:05 +0000 (09:21 +0100)] 
drm: Limit backend->resources lifetime to within query_device

We do not need / use backend->resources anywhere outside of the query_device
function and with the upcoming hotplug support we need to get a fresh set
of resources on change events, so limit the resources lifetime to
query_device.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
6 years agodrm: Store and keep all the outputs in the backend
Hans de Goede [Tue, 15 Jan 2019 07:58:45 +0000 (08:58 +0100)] 
drm: Store and keep all the outputs in the backend

Put all outputs in the outputs array instead of just the connected ones
and store the outputs array and the controller_id-to-head hashtable in the
backend object instead of temporarily allocating them during enumeration.

Also add new heads to the heads list and to the controller_id-to-head
hashtable in ply_renderer_head_new where this really belongs. This
allows nicely balancing these 2 with removing the head from the list
and hash_table in the ply_renderer_head_remove function which is added
in a follow-up commit.

This is a preparation patch for adding support for hotplugging
monitors while plymouth is running.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
6 years agodrm: Add get_output_info helper function
Hans de Goede [Tue, 15 Jan 2019 07:34:58 +0000 (08:34 +0100)] 
drm: Add get_output_info helper function

Add a new get_output_info helper function, which fill a ply_output_t with
all info related to the connecter based on a connector-id.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
6 years agodrm: Stop storing a pointer to drmModeConnector in ply_output_t
Hans de Goede [Tue, 15 Jan 2019 07:31:20 +0000 (08:31 +0100)] 
drm: Stop storing a pointer to drmModeConnector in ply_output_t

This is a preparation patch for hotplug support, for hotplug support we
want to keep the ply_output_t for connectors around, this change decouples
the lifetime of the drmModeConnector from the ply_output_t lifetime.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
6 years agodrm: Stop keeing a drmModeConnector instance around
Hans de Goede [Tue, 15 Jan 2019 06:31:32 +0000 (07:31 +0100)] 
drm: Stop keeing a drmModeConnector instance around

Before this commit we were storing a pointer to the drmModeConnector
in struct _ply_renderer_head, solely so that we can free it when
destroying the head. This was necessary because we also stored a pointer
to the mode we picked, which comes from insided the drmModeConnector.

The drmModeModeInfo struct has no pointers, so we can simply store a copy
of it instead of a pointer, which removes the need to keep the
drmModeConnector around after probing the connectors.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
6 years agodrm: Refactor ply_renderer_head_add_connector and ply_renderer_head_new
Hans de Goede [Mon, 14 Jan 2019 16:36:22 +0000 (17:36 +0100)] 
drm: Refactor ply_renderer_head_add_connector and ply_renderer_head_new

Both these function take a bunch of info coming from the ply_output_t
struct and with upcoming changes they are going to be using even more
ply_output_t fields. Instead of passing all these fields one by one,
simply directly pass a pointer to ply_output_t.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
6 years agoply-renderer: Add ply_renderer_handle_change_event function
Hans de Goede [Wed, 16 Jan 2019 08:21:59 +0000 (09:21 +0100)] 
ply-renderer: Add ply_renderer_handle_change_event function

This function can be called to notify the renderer of udev change-events.

This is a preparation patch for adding support for hotplugging
monitors while plymouth is running.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
6 years agoply-array: Add ply_array_contains_uint32_element function
Hans de Goede [Tue, 15 Jan 2019 08:48:30 +0000 (09:48 +0100)] 
ply-array: Add ply_array_contains_uint32_element function

Add a new ply_array_contains_uint32_element which checks if the queried
ply-array contains an element with the passed in uint32_t value.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
6 years agoMerge branch 'spinner-bgrt-theme-update' into 'master'
Hans de Goede [Wed, 16 Jan 2019 08:32:25 +0000 (08:32 +0000)] 
Merge branch 'spinner-bgrt-theme-update' into 'master'

Spinner bgrt theme update

See merge request plymouth/plymouth!22

6 years agothemes: Update spinner and bgrt diskcrypt dialog
Hans de Goede [Wed, 19 Dec 2018 08:37:16 +0000 (09:37 +0100)] 
themes: Update spinner and bgrt diskcrypt dialog

Update the spinner and bgrt themses diskcrypt dialog to match the dialog
from the "Disk decrypt" mockup from:

https://wiki.gnome.org/Design/OS/BootProgress

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
6 years agothemes: spinner: Add watermark alignment settings
Hans de Goede [Wed, 9 Jan 2019 13:52:33 +0000 (14:52 +0100)] 
themes: spinner: Add watermark alignment settings

Add watermark alignment settings, so that distros can simply drop
a watermark.png into the theme dir from another package and then have it
show up in the right place.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
6 years agothemes: bgrt: Remove duplicate images
Hans de Goede [Wed, 9 Jan 2019 13:42:53 +0000 (14:42 +0100)] 
themes: bgrt: Remove duplicate images

The bgrt theme is using the exact same images as the spinner theme,
remove these and point ImageDir to the spinner theme dir instead.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
6 years agoplymouth-populate-initrd: Don't assume the ImageDir is the theme-dir
Hans de Goede [Wed, 9 Jan 2019 13:38:26 +0000 (14:38 +0100)] 
plymouth-populate-initrd: Don't assume the ImageDir is the theme-dir

Before this commit plymouth-populate-initrd was only recursively copying the
/usr/share/plymouth/themes/$PLYMOUTH_THEME_NAME to the initrd, assuming
that ImageDir will point there.

This makes it impossible for 2 themes to share their ImageDir, which is
desirable for example for the spinner and bgrt themes, which use the same
images with slightly different settings.

This commit also makes plymouth-populate-initrd also copy the ImageDir
if it is different from the theme-dir, making it possible for ImageDir
to point to a different dir.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
6 years agoMerge branch 'two-step-dialog-options' into 'master'
Hans de Goede [Wed, 16 Jan 2019 08:28:27 +0000 (08:28 +0000)] 
Merge branch 'two-step-dialog-options' into 'master'

Two step dialog options

See merge request plymouth/plymouth!21

6 years agotwo-step: Make clearing the dialog-background when using the firmware background...
Hans de Goede [Wed, 19 Dec 2018 12:33:08 +0000 (13:33 +0100)] 
two-step: Make clearing the dialog-background when using the firmware background optional

Since the ask-for-password or ask-question dialog and the firmware background
may intersect so far we've been clearing the screen to black when showing a
dialog and using the firmware background.

This is not always desirable, this commit adds a new
"DialogClearsFirmwareBackground" option to the two-step based theme config
file, which enables this behavior when set.

The new default is to keep using the initial (firmware) background when
showing a dialog, which matches the non firmware-background paths.

Also update the bgrt theme to use the "DialogClearsFirmwareBackground"
option, keeping the current behavior for that theme.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
6 years agotwo-step: Add support for non center alignment of the (diskcrypt) dialog
Hans de Goede [Wed, 19 Dec 2018 12:28:28 +0000 (13:28 +0100)] 
two-step: Add support for non center alignment of the (diskcrypt) dialog

Add DialogHorizontalAlignment and DialogVerticalAlignment options which
allow placing the (diskcrypt) dialog aligned at another place then the
center of the screen.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
6 years agotwo-step: Make the box image surrounding the unlock dialog optional
Hans de Goede [Wed, 19 Dec 2018 10:52:03 +0000 (11:52 +0100)] 
two-step: Make the box image surrounding the unlock dialog optional

In some themes we want a simple style text entry without a dialog like
box around it.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
6 years agotwo-step: Rename UseBGRT to UseFirmwareBackground
Hans de Goede [Thu, 20 Dec 2018 11:47:39 +0000 (12:47 +0100)] 
two-step: Rename UseBGRT to UseFirmwareBackground

Rename the UseBGRT theme configfile option to UseFirmwareBackground,
to make it clear what this does using language which most users will be
able to understand, rather then using the cryptic BGRT ACPI table reference.

While at it also switch to using the new ply_key_file_get_bool function, so
that users can edit an existing configfile with "UseFirmwareBackground=true"
in there and change it to "=false" and actually have that work as expected.

The switch to ply_key_file_get_bool also fixes a memleak as
ply_key_file_get_value returns a strdup-ed value which we were not free-ing.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
6 years agolibply: Add ply_key_file_get_bool function
Hans de Goede [Wed, 9 Jan 2019 10:31:06 +0000 (11:31 +0100)] 
libply: Add ply_key_file_get_bool function

Add a function to read a boolean value from a ply-key-file.

This function will return true if the key exists and it has a value of "1",
"y", "yes" or "true" (case-insensitive). In all other cases it returns
false.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
6 years agoMerge branch 'strtod-locale-fix' into 'master'
Hans de Goede [Wed, 19 Dec 2018 18:28:37 +0000 (18:28 +0000)] 
Merge branch 'strtod-locale-fix' into 'master'

Strtod locale fix

See merge request plymouth/plymouth!20

6 years agotwo-step: Use plymouth_strtod
Hans de Goede [Wed, 19 Dec 2018 09:45:51 +0000 (10:45 +0100)] 
two-step: Use plymouth_strtod

Use the locale agnostic plymouth_strtod helper which always uses a "."
as decimal seperator. This fixes the various Alignment options not working
with some locales.

While at it also add a ply_trace to log the size and chosen centering for
the watermark image.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
6 years agolibply: Add ply_strtod helper
Hans de Goede [Wed, 19 Dec 2018 09:43:09 +0000 (10:43 +0100)] 
libply: Add ply_strtod helper

Add a ply_strtod helper which always uses "." as decimal separator
independent of the locale.

Using this fixes e.g. HorizontalAlignment in the two-step plugin
not working with some locales.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
6 years agoMerge branch 'ply-keyb-compiler-warning' into 'master'
Hans de Goede [Sun, 9 Dec 2018 14:25:16 +0000 (14:25 +0000)] 
Merge branch 'ply-keyb-compiler-warning' into 'master'

ply-keyboard: Fix compiler warning

See merge request plymouth/plymouth!18

6 years agoply-keyboard: Fix compiler warning
Hans de Goede [Sun, 9 Dec 2018 14:22:48 +0000 (15:22 +0100)] 
ply-keyboard: Fix compiler warning

Fix: "warning: enumeration value ‘PLY_KEYBOARD_PROVIDER_TYPE_TERMINAL’
not handled in switch [-Wswitch-enum]" compiler warning.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
6 years agoMerge branch 'plugin-iface' into 'master'
Hans de Goede [Sun, 9 Dec 2018 14:19:08 +0000 (14:19 +0000)] 
Merge branch 'plugin-iface' into 'master'

When a renderer goes away on a udev remove event, free keyboards associated with the renderer, before freeing the renderer. This avoids a null pointer dereference when ply_device_manager_deactivate_keyboards gets called later on:
https://bugs.launchpad.net/ubuntu/+source/plymouth/+bug/1794292

See merge request plymouth/plymouth!10

6 years agodevice-manager: free keyboards when deactivating a renderer
Mathieu Trudel-Lapierre [Tue, 4 Dec 2018 19:41:35 +0000 (14:41 -0500)] 
device-manager: free keyboards when deactivating a renderer

Based on an original patch by Gert van de Kraats, on Ubuntu Launchpad bug:
https://bugs.launchpad.net/ubuntu/+source/plymouth/+bug/1794292

Signed-off-by: Mathieu Trudel-Lapierre <mathieu.trudel-lapierre@canonical.com>
6 years agokeyboard: add helper to get the keyboard's renderer, if applicable
Mathieu Trudel-Lapierre [Tue, 4 Dec 2018 19:31:13 +0000 (14:31 -0500)] 
keyboard: add helper to get the keyboard's renderer, if applicable

Based on an original patch from Gert van de Kraats on Ubuntu's Launchpad:
https://bugs.launchpad.net/ubuntu/+source/plymouth/+bug/1794292

Signed-off-by: Mathieu Trudel-Lapierre <mathieu.trudel-lapierre@canonical.com>
6 years agoMerge branch 'drm-pick-crtcs' into 'master'
Hans de Goede [Tue, 4 Dec 2018 11:36:54 +0000 (11:36 +0000)] 
Merge branch 'drm-pick-crtcs' into 'master'

Drm pick crtcs

See merge request plymouth/plymouth!16

6 years agodrm: Pick a controller for unconfigured connectors
Hans de Goede [Tue, 27 Nov 2018 23:53:46 +0000 (00:53 +0100)] 
drm: Pick a controller for unconfigured connectors

So far we've been relying on the kernel fbcon code to set up all outputs,
now that distros have started using deferred fbcon takeover for flickerfree
booting, we can no longer rely on this and in some cases we must pick
our own controllers.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
6 years agodrm: Drop crtcs for clones for which we've picked different modes
Hans de Goede [Tue, 27 Nov 2018 21:51:58 +0000 (22:51 +0100)] 
drm: Drop crtcs for clones for which we've picked different modes

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
6 years agodrm: More connector enumeration refactoring
Hans de Goede [Tue, 27 Nov 2018 22:58:26 +0000 (23:58 +0100)] 
drm: More connector enumeration refactoring

Some further refactoring to prepare for adding code to picking crtcs
for unconfigured connectors.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
6 years agodrm: Store tiled and rotation in ply_output_t
Hans de Goede [Tue, 27 Nov 2018 22:09:27 +0000 (23:09 +0100)] 
drm: Store tiled and rotation in ply_output_t

This avoids the need to call ply_renderer_connector_get_rotation_and_tiled
twice and thus also the need to call drmModeGetProperty twice for all
properties.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
6 years agodrm: Refactor create_heads_for_active_connectors
Hans de Goede [Tue, 27 Nov 2018 18:50:33 +0000 (19:50 +0100)] 
drm: Refactor create_heads_for_active_connectors

Refactor create_heads_for_active_connectors to prepare it for adding a
step where we assign controllers to connected outputs which do not have
a controller assigned yet.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
6 years agodrm: Directly store the mode instead of the mode_index
Hans de Goede [Mon, 3 Dec 2018 11:25:25 +0000 (12:25 +0100)] 
drm: Directly store the mode instead of the mode_index

The only way we use mode_index is to get the mode, so its easier to
directly store the mode when we create a head.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
6 years agodrm: Drop unused encoder_id
Hans de Goede [Tue, 27 Nov 2018 18:21:33 +0000 (19:21 +0100)] 
drm: Drop unused encoder_id

We cache the encoder-id, but we never use it, so stop caching it.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
6 years agoMerge branch 'two-step-bgrt-upside-down-fix' into 'master'
Hans de Goede [Mon, 3 Dec 2018 15:51:41 +0000 (15:51 +0000)] 
Merge branch 'two-step-bgrt-upside-down-fix' into 'master'

two-step: Do not rotate bgrt background image for upside-down panels

See merge request plymouth/plymouth!17

6 years agotwo-step: Do not rotate bgrt background image for upside-down panels
Hans de Goede [Mon, 3 Dec 2018 15:20:59 +0000 (16:20 +0100)] 
two-step: Do not rotate bgrt background image for upside-down panels

Upside-down LCD panels are fixed up in HW by the GOP, so the bgrt image is
not rotated in this case and we should not rotate it to compensate.

While at it also fixup the wrong indentation of the
ply_pixel_buffer_set_device_scale() call.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
6 years agoMerge branch 'bgrt' into 'master'
Hans de Goede [Thu, 29 Nov 2018 08:40:27 +0000 (08:40 +0000)] 
Merge branch 'bgrt' into 'master'

Add support for using the firmware splash as background for the two-step splash plugin using the ACPI BGRT extension

See merge request plymouth/plymouth!14

6 years agothemes: Add new BGRT theme, using the firmware boot splash as background
Hans de Goede [Tue, 13 Nov 2018 08:51:32 +0000 (09:51 +0100)] 
themes: Add new BGRT theme, using the firmware boot splash as background

Add a new BGRT theme, this is a copy of the spinner theme, using the ACPI
BGRT graphics (firmware boot splash) as logo when available.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
6 years agotwo-step: bgrt: Deal with quirky firmwares
Hans de Goede [Tue, 13 Nov 2018 08:03:10 +0000 (09:03 +0100)] 
two-step: bgrt: Deal with quirky firmwares

On laptops / tablets the LCD panel is typically brought up in
its native resolution, so we can trust the x- and y-offset values
provided by the firmware to be correct for a screen with the panels
resolution.

Moreover some laptop / tablet firmwares to do all kind of hacks wrt
the y-offset. This happens especially on devices where the panel is
mounted 90 degrees rotated, but also on other devices.

So on devices with an internal LCD panel, we prefer to use the firmware
provided offsets, to make sure we match its quirky behavior.

We check that the x-offset matches what we expect for the panel's
native resolution to make sure that the values are indeed for the
panel's native resolution and then we correct for any difference
between the (external) screen's and the panel's resolution.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
6 years agotwo-step: Add ACPI BGRT extension support
Hans de Goede [Tue, 6 Nov 2018 13:55:29 +0000 (14:55 +0100)] 
two-step: Add ACPI BGRT extension support

Add support to (optionally) use the firmware splash screen logo
from the ACPI BGRT extension as background.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
6 years agotwo-step: Speed up background-tile drawing on HiDPI screens
Hans de Goede [Wed, 7 Nov 2018 19:27:08 +0000 (20:27 +0100)] 
two-step: Speed up background-tile drawing on HiDPI screens

Before this commit background drawing on HiDPI screens is quite slow
and CPU intensive, because we do the interpolating scale, which does
a whole bunch of double-precision float operations for *each* pixel
for every frame we draw.

When using two-step with a background-tile on a Cherry Trail machine with
a HiDPI screen this results in the diskcrypt password entry being visible
laggy, I can type the password much faster then the bullets show up.

This also means we are pegging the CPU during boot, significantly slowing
down the boot.

This commit fixes this by creating the background_buffer at the screen's
device_scale and rotation, only doing the scaling once.

This commit further speeds things up by also doing the solid/gradient fill
of the background + the alpha blend of the tiled background-image once,
creating a solid background which allows us to hit the
ply_pixel_buffer_fill_with_buffer memcpy fast-path and avoids the need to
re-do the solid/gradient fill + alpha-blend each frame we render.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
6 years agotwo-step: Use a pixel-buffer instead of an image for the view's background
Hans de Goede [Tue, 6 Nov 2018 13:41:38 +0000 (14:41 +0100)] 
two-step: Use a pixel-buffer instead of an image for the view's background

Use a pixel-buffer instead of an image, this gives us more flexibility.

This is a preparation patch for adding support to (optionally) use
the firmware splash screen logo (from the ACPI BGRT extension) as
background.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
6 years agoply-pixel-display: Add ply_pixel_display_get_device_scale() function
Hans de Goede [Wed, 7 Nov 2018 14:46:06 +0000 (15:46 +0100)] 
ply-pixel-display: Add ply_pixel_display_get_device_scale() function

Add a function to get the device scale for a ply-pixel-display.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
6 years agoply-pixel-buffer: Add ply_pixel_buffer_rotate_upright helper
Hans de Goede [Thu, 8 Nov 2018 13:25:05 +0000 (14:25 +0100)] 
ply-pixel-buffer: Add ply_pixel_buffer_rotate_upright helper

For some themes we want to use the firmware-logo / splash as background,
when the LCD panel of a laptop is mounted non-upright then the image which
we get from the firmware will be pre-rotated to match the LCD panel mount.

Until now our device-rotation support was limited to using rotated
pixel_buffer-s as destination / canvas only.

This commit adds a ply_pixel_buffer_rotate_upright helper to rotate
a nop-upright source buffer upright so that we can use it as source-buffer
to other functions which expect source-buffers to always be upright.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
6 years agoply-pixel-buffer: Add ply_pixel_buffer_get/set_device_rotation helpers
Hans de Goede [Tue, 6 Nov 2018 17:55:27 +0000 (18:55 +0100)] 
ply-pixel-buffer: Add ply_pixel_buffer_get/set_device_rotation helpers

For some themes we want to use the firmware-logo / splash as background,
when the LCD panel of a laptop is mounted non-upright then the image which
we get from the firmware will be pre-rotated to match the LCD panel mount.

This commit adds ply_pixel_buffer_set/get_device_rotation helpers to
help deal with this.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
6 years agoply-pixel-buffer: Fix marking buffers as opaque when doing a solid fill
Hans de Goede [Fri, 9 Nov 2018 22:05:24 +0000 (23:05 +0100)] 
ply-pixel-buffer: Fix marking buffers as opaque when doing a solid fill

Instead of comparing fill_area addresses actually compare the contents
of the ply_rectangles.

This allows us to use the memcpy fastpath in ply_pixel_buffer_with_buffer
more often.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
6 years agoply-pixel-buffer: Fix fill_with_buffer fastpath when device_scale != 1
Hans de Goede [Wed, 7 Nov 2018 14:49:40 +0000 (15:49 +0100)] 
ply-pixel-buffer: Fix fill_with_buffer fastpath when device_scale != 1

After calling ply_pixel_buffer_crop_area_to_clip_area cropped_area.x/y
are in device coordinates. So when calculating the x/y offset in the
source-buffer due to device-clip areas possible making cropped_area.x/y
larger then just the xoffset/yoffset (in the canvas) we must multiply
the original xoffset/yoffset by device_scale before subtracting.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
6 years agodrm: Implement ply_renderer_get_panel_properties
Hans de Goede [Wed, 7 Nov 2018 13:26:11 +0000 (14:26 +0100)] 
drm: Implement ply_renderer_get_panel_properties

Implement the get_panel_properties plugin interface.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
6 years agoply-renderer: Add ply_renderer_get_panel_properties function
Hans de Goede [Wed, 7 Nov 2018 11:24:12 +0000 (12:24 +0100)] 
ply-renderer: Add ply_renderer_get_panel_properties function

For some themes we want to read the firmware-logo to use as background,
when the LCD panel of a laptop is mounted non-upright and/or if it is
using scaling because of HiDPI then the image which we get from the
firmware will be pre-rotated and scaled to match the LCD panel.

This new function will allow renderers to let themes know about this so
that they can adjust for the logo being pre-rotated and scaled.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
6 years agoply-image: Add support for loading BMPs
Hans de Goede [Tue, 6 Nov 2018 08:15:22 +0000 (09:15 +0100)] 
ply-image: Add support for loading BMPs

Add support for loading BMP files. This is needed to be able to read the
the ACPI BGRT graphics (the firmware splash shown at boot by the firmware).

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
6 years agoply-image: Do not assume all files are PNGs
Hans de Goede [Mon, 5 Nov 2018 14:03:28 +0000 (15:03 +0100)] 
ply-image: Do not assume all files are PNGs

So far the image loading code has been assuming that all files are PNGs,
this commit makes the code check the file-header before assuming the file
is a PNG.

This is a preparation patch for adding support for also being able to load
BMP files.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
6 years agoMerge branch 'two-step-multi-head-pw-crash-fix' into 'master'
Hans de Goede [Tue, 27 Nov 2018 07:48:14 +0000 (07:48 +0000)] 
Merge branch 'two-step-multi-head-pw-crash-fix' into 'master'

two-step: Fix crash asking for password with multiple heads

See merge request plymouth/plymouth!15

6 years agotwo-step: Fix crash asking for password with multiple heads
Hans de Goede [Tue, 27 Nov 2018 07:24:20 +0000 (08:24 +0100)] 
two-step: Fix crash asking for password with multiple heads

Commit 9639ed895331 ("two-step: Fix animation not starting on later
added heads") unconditionally calls view_start_progress_animation() when
adding secondary heads, to fix the animation not running on secondary
heads when not asking for a password.

But we should not start the animation when adding a head after we've
already entered PLY_BOOT_SPLASH_DISPLAY_PASSWORD_ENTRY state, otherwise
we end up starting it a second time when the user is done entering his
password, causing plymouth to crash and the boot to hang.

We already have the is_animating bool to indicate whether animations have
been started or not, use this to decide if we should start the animation
when adding a new head, fixing the crash.

Fixes: 9639ed895331 ("two-step: Fix animation not starting on ... added heads")
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
6 years agoMerge branch 'jimmac1/plymouth-master'
Hans de Goede [Fri, 23 Nov 2018 16:19:18 +0000 (17:19 +0100)] 
Merge branch 'jimmac1/plymouth-master'

6 years agospinner theme: update
Jakub Steiner [Wed, 21 Nov 2018 14:44:39 +0000 (15:44 +0100)] 
spinner theme: update

- update spinner & lock to current visuals

Hans de Goede: Add extra throbber-00##.png files to Makefile.am, small tweak
to the new lock image.

6 years agoMerge branch 'misc-fixes' into 'master'
Ray Strode [Thu, 22 Nov 2018 19:49:55 +0000 (19:49 +0000)] 
Merge branch 'misc-fixes' into 'master'

Misc fixes

Closes #29

See merge request plymouth/plymouth!9

6 years agotwo-step: Fix animation not starting on later added heads
Hans de Goede [Mon, 12 Nov 2018 11:50:33 +0000 (12:50 +0100)] 
two-step: Fix animation not starting on later added heads

Fix the animation not starting on heads added after show_splash_screen
has been called. Since the core calls show_splash_screen after adding
the first head / pixel_display in practice this fixes the animation not
starting on all monitors other then the first.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
6 years agoply-device-manager: Fix race causing undesired creation of non-gfx devs
Hans de Goede [Sat, 10 Nov 2018 15:04:31 +0000 (16:04 +0100)] 
ply-device-manager: Fix race causing undesired creation of non-gfx devs

On systems with working drm/kms devices we still sometimes see:
"Creating non-graphical devices, since there's no suitable graphics hardware"
in the logs (and actually create non-gfx devices).

This is caused by a race where the create_devices_from_udev timeout handler
runs just after the pivot-root, just at the time when the "udev trigger"
from the real root is done.

This causes create_devices_for_subsystem() to hit the "it's not initialized"
code-path for all drm and fb devices, even though before (from the initrd)
drm-devices where already setup successfully.

One way of solving this would be to stop the timer as soon as we successfully
enumerate the first drm device. But we need the timer to enumerate fb devices
so on machines where some outputs only have a fbdev driver (corner case) this
would break support for those outputs.

Instead this commit moves the found_drm_device and found_fb_device to the
global manager state and sets them from create_devices_for_udev_device().
This way they will be set when we check them from the create_devices_from_udev
timeout handler even if create_devices_for_subsystem skips over the devices
because of the udev trigger race.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
6 years agologger: Add a separator between different boot logs
Hans de Goede [Tue, 17 Jul 2018 07:46:12 +0000 (09:46 +0200)] 
logger: Add a separator between different boot logs

Since we concatenate boot logs one after the other in /var/log/boot.log
it is hard to tell where the logs from one boot end the next boot starts.

This commit makes plymouth write out a separator including a time + date
of the date, when the log file gets opened to add new boot messages to it.

Note ply_logger_open_file() is only called from ply_terminal_session_open_log()
which in turn is only used for /var/log/boot.log, so this only effects
/var/log/boot.log.

Closes #29

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
6 years agoMerge branch 'master' into 'master'
Ray Strode [Sun, 11 Nov 2018 02:15:33 +0000 (02:15 +0000)] 
Merge branch 'master' into 'master'

systemd-units: Also add "ConditionVirtualization=!container" in…

See merge request plymouth/plymouth!8

6 years agosystemd-units: Also add "ConditionVirtualization=!container" in systemd-ask-password...
Laurent Bigonville [Thu, 8 Nov 2018 11:05:05 +0000 (11:05 +0000)] 
systemd-units: Also add "ConditionVirtualization=!container" in systemd-ask-password-plymouth.path.in

This completes the fix for #27

6 years agoconfigure: bump to 0.9.5
Ray Strode [Mon, 5 Nov 2018 20:45:53 +0000 (15:45 -0500)] 
configure: bump to 0.9.5

7 years agoMerge branch 'drm-preferred-mode' into 'master' 0.9.4
Hans de Goede [Wed, 31 Oct 2018 15:04:55 +0000 (15:04 +0000)] 
Merge branch 'drm-preferred-mode' into 'master'

drm: use preferred mode for outputs

Closes #68 and #59

See merge request plymouth/plymouth!4

7 years agodrm: Use preferred mode for outputs instead of current mode
Hans de Goede [Tue, 2 Oct 2018 09:44:28 +0000 (11:44 +0200)] 
drm: Use preferred mode for outputs instead of current mode

When enumerating outputs pick the preferred mode instead of the current
active mode, which may be e.g. a very low res mode.

Sofar we've been relying on fbcon setting up the modes for us, but as
mentioned in https://bugs.freedesktop.org/show_bug.cgi?id=101520#c22
we really should not rely on this.

With the recent flickerfree boot changes we can no longer rely on fbcon
to do the setup for us, hence this commit. For now this commit only
changes the mode-picking logic on UEFI setups as we only have
flickerfree boot there. Once the setup code is more mature we should
probably always use it.

Closes #68

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
7 years agodrm: Refactor ply_renderer_connector_get_rotation
Hans de Goede [Tue, 2 Oct 2018 12:13:19 +0000 (14:13 +0200)] 
drm: Refactor ply_renderer_connector_get_rotation

ply_renderer_connector_get_rotation walks over all properties to add
support for selecting the preferred mode we also want to know if a connector
is part of a tiled output or not, which also requires walking over the props.

This commit refactors ply_renderer_connector_get_rotation into
ply_renderer_connector_get_rotation_and_tiled to prepare for this.

While at also properly use ply_pixel_buffer_rotation_t for the orientation
instead of an int.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
7 years agodrm: Reset LUT/gamma table before the first drmModeSetCrtc call
Hans de Goede [Tue, 2 Oct 2018 08:26:28 +0000 (10:26 +0200)] 
drm: Reset LUT/gamma table before the first drmModeSetCrtc call

When we takeover the kms master from whatever process came before us the
LUT table may be a mess making the graphics funky. So lets reset it once
before our first drmModeSetCrtc call.

Closes #59

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
7 years agolibply: Move kernel commandline parsing functions to libply/ply-utils
Hans de Goede [Thu, 4 Oct 2018 10:47:52 +0000 (12:47 +0200)] 
libply: Move kernel commandline parsing functions to libply/ply-utils

Move kernel commandline parsing functions to libply/ply-utils to avoid
code duplication between the daemon, the client and the plugins.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
7 years agoMerge branch 'fix-infinite-throbber' into 'master'
Michal Srb [Fri, 26 Oct 2018 14:30:45 +0000 (14:30 +0000)] 
Merge branch 'fix-infinite-throbber' into 'master'

throbber: Don't skip last frame when waiting for end.

See merge request plymouth/plymouth!7

7 years agothrobber: Don't skip last frame when waiting for end.
Michal Srb [Tue, 23 Oct 2018 07:10:25 +0000 (09:10 +0200)] 
throbber: Don't skip last frame when waiting for end.

If the stop_trigger is set and we are waiting for the last frame to stop the
animation, make sure we don't accidentally skip the last frame. It could
happen if the machine is busy and can't keep up with the frames or when the
animation has more than 60 frames (30FPS * 2 seconds).

7 years agoMerge branch 'coverity-fixes' into 'master'
Ray Strode [Tue, 16 Oct 2018 03:10:53 +0000 (03:10 +0000)] 
Merge branch 'coverity-fixes' into 'master'

Coverity fixes

See merge request plymouth/plymouth!6

7 years agoboot-server: free the argument and triggers
Ray Strode [Tue, 16 Oct 2018 01:56:03 +0000 (21:56 -0400)] 
boot-server: free the argument and triggers

coverity found some pervasive leaking of the argument
and triggers.

This commit mops them up.

7 years agoscript: fix various memory leaks
Ray Strode [Tue, 16 Oct 2018 01:44:10 +0000 (21:44 -0400)] 
script: fix various memory leaks

coverity found a few leaks.

this commit mops them up.

7 years agokey-file: ply_key_file_get_value returns duplicated memory, don't leak
Ray Strode [Tue, 16 Oct 2018 01:13:58 +0000 (21:13 -0400)] 
key-file: ply_key_file_get_value returns duplicated memory, don't leak

For some reason I made the same api misdesign with ply_key_file_t
that I made when writing GKeyFile...it returns duplicated memory for
no good reason.

This commit sprinkles frees around.

7 years agoevent-loop: fix leak in error path
Ray Strode [Tue, 16 Oct 2018 01:07:01 +0000 (21:07 -0400)] 
event-loop: fix leak in error path

ply_event_loop_new fails to clean itself up if it's unable to
create a pipe for dispatching signals.

This commit fixes that.

7 years agoboot-splash: fix memory leak in error path
Ray Strode [Tue, 16 Oct 2018 01:04:47 +0000 (21:04 -0400)] 
boot-splash: fix memory leak in error path

If the splash key file fails to load, we don't free
the associated key file object.

This commit fixes that.

7 years agopopulate-initrd: drop unused local variable
Ray Strode [Tue, 16 Oct 2018 01:02:50 +0000 (21:02 -0400)] 
populate-initrd: drop unused local variable

the inst_library function declares a variable `_lib`
that's completely unused.

This commit removes the declaration.

7 years agoMerge branch 'fix-deactivate-udev-race' into 'master'
Iain Lane [Wed, 10 Oct 2018 20:42:27 +0000 (20:42 +0000)] 
Merge branch 'fix-deactivate-udev-race' into 'master'

device-manager: don't watch for udev events when deactivated

See merge request plymouth/plymouth!5

7 years agodevice-manager: don't watch for udev events when deactivated
Ray Strode [Wed, 10 Oct 2018 19:07:37 +0000 (20:07 +0100)] 
device-manager: don't watch for udev events when deactivated

If a device gets added when we're already deactivated, plymouth shouldn't
process the device, since processing it effectively activates plymouth.

This commit pulls the udev monitor fd out of the event loop while
plymouth is deactivated so new events are deferred until reactivation.

Modified by Iain Lane <iain.lane@canonical.com>: Also deactivate the
timer that finds all devices known to udev after an interval, when
paused.

7 years agoMerge branch 'wip/dont-muck-with-login-screen-tty' into 'master'
Ray Strode [Mon, 27 Aug 2018 19:19:41 +0000 (19:19 +0000)] 
Merge branch 'wip/dont-muck-with-login-screen-tty' into 'master'

main: ensure tty is closed on deactivate

See merge request plymouth/plymouth!2

7 years agomain: ensure tty is closed on deactivate
Ray Strode [Sat, 25 Aug 2018 16:21:45 +0000 (12:21 -0400)] 
main: ensure tty is closed on deactivate

If plymouth doesn't get explicitly "activated" then when
GDM tries to deactivate it, the deactivation request is
a noop.

One aspect of being active, though is having ownership and
control of the terminal.  This happens immediately, even
before a splash is shown.

The `deactivate` request needs to relinguish such control,
unconditionally, since some display server is about to use
the tty.

This commit fixes that.

7 years agoMerge branch 'wip/container-condition-check' into 'master'
Ray Strode [Tue, 7 Aug 2018 15:41:15 +0000 (15:41 +0000)] 
Merge branch 'wip/container-condition-check' into 'master'

systemd-units: Add "ConditionVirtualization=!container"

Closes #27

See merge request plymouth/plymouth!1

7 years agosystemd-units: Add "ConditionVirtualization=!container"
Hans de Goede [Tue, 7 Aug 2018 08:15:56 +0000 (10:15 +0200)] 
systemd-units: Add "ConditionVirtualization=!container"

When running in a container with plymouth installed, plymouth is started
unnecessarily and systemd prints warnings:

[  OK  ] Reached target Shutdown.
Sending SIGTERM to remaining processes...
Sending SIGKILL to remaining processes...
Process 253 (plymouthd) has been been marked to be excluded from killing. It is running from the root file system, and thus likely to block re-mounting of the root file system to read-only. Please consider moving it into an initrd file system instead.

It makes little sense to start plymouth in contains, so add
'ConditionVirtualization=!container' everywhere where
ConditionKernelCommandLine=!plymouth.enable=0 appears to disable plymouth
in containers.

BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1337611
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Closes: https://gitlab.freedesktop.org/plymouth/plymouth/issues/27
7 years agoREADME: add link to Code of Conduct
Ray Strode [Mon, 6 Aug 2018 18:58:18 +0000 (14:58 -0400)] 
README: add link to Code of Conduct

7 years agotwo-step: add unhandled splash mode case to switch
Ray Strode [Tue, 10 Jul 2018 20:00:18 +0000 (16:00 -0400)] 
two-step: add unhandled splash mode case to switch

This fixes a compiler warning.

7 years agomain: fix build
Ray Strode [Tue, 10 Jul 2018 19:58:04 +0000 (15:58 -0400)] 
main: fix build

I slightly modified Hans patch in commit 129b4a50 before pushing it
and broke the build.

This fixes the build by adding a forward declaration.

7 years agoFix miscellaneous compiler warnings
Hans de Goede [Mon, 2 Jul 2018 08:29:53 +0000 (10:29 +0200)] 
Fix miscellaneous compiler warnings

Fix all compiler warnings (and one type) except for the deprectation warnings
for the gdk_screen_get_monitor_* functions used in the x11 renderer.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
7 years agoconfigure: Pass -Wno-cast-function-type if available
Hans de Goede [Mon, 2 Jul 2018 08:01:05 +0000 (10:01 +0200)] 
configure: Pass -Wno-cast-function-type if available

plymouth uses function type casts for callbacks in quite a few places, fixing
these needlessly complicates the code, so lets pass -Wno-cast-function-type.

This fixes 218 warnings like this one:

ply-command-parser.c: In function â€˜ply_command_parser_stop_parsing_arguments’:
ply-command-parser.c:680:48: warning: cast between incompatible function types from â€˜void (*)(ply_command_parser_t *)’ {aka â€˜void (*)(struct _ply_command_parser *)’} to â€˜void (*)(void *, int,  ply_event_loop_t *)’ {aka â€˜void (*)(void *, int,  struct _ply_event_loop *)’} [-Wcast-function-type]
                                                (ply_event_loop_exit_handler_t)

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
7 years agomain: Fix getting detailed logs from systemd
Hans de Goede [Tue, 26 Jun 2018 07:15:25 +0000 (09:15 +0200)] 
main: Fix getting detailed logs from systemd

This are 3 issues with the detailed logs handling:

1) plymouth attaches to the session directly on a show-splash command
(in on_show_splash()), but it does not tell systemd to start printing
details until the splash is actually shown after the splash_delay.

2) If the splash is actually shown during the initrd (e.g. a diskcript
password is necessary) then we tell the initrd systemd instance to
print details, but we don't tell the regular initrd instance which takes
over as pid 1 after the switch-root to print details.

This leads to rather inconsistent logging/printing behavior, e.g.:

* If a diskcrypt password is asked for, we only log details from
the initrd phase.

* If the boot is shorter then splash_delay no details are logged

* If the user presses ESC during boot during the initrd, only initrd
  messages are printed

* If the user presses ESC during boot after the initrd, only normal
  messages are printed

This commit fixes both these issues by:

1) Telling systemd to print details as soon as we have attached to the session;
   and to stop printing details when we detach from the session (*)
2) Telling systemd to print details after the rootfs has been remounted rw

*) This is necessary to have a smooth transition to e.g. gdm if the splash
has not shown because the boot is shorter then splash_delay

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
7 years agomain: Show details when ESC is pressed during splash_delay
Hans de Goede [Tue, 3 Jul 2018 06:44:33 +0000 (08:44 +0200)] 
main: Show details when ESC is pressed during splash_delay

Start listening for keypresses on the first show_splash() call, so that
pressing ESC while we're delaying show the non-details splash will show
the details splash.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
7 years agodrm: Remove unnecessary reset_scan_out_buffer_if_needed() call from ply_renderer_head...
Hans de Goede [Mon, 2 Jul 2018 21:46:59 +0000 (23:46 +0200)] 
drm: Remove unnecessary reset_scan_out_buffer_if_needed() call from ply_renderer_head_map()

ply_renderer_head_map() gets only called from map_to_device() which
calls activate() directly afterwards which calls
ply_renderer_head_set_scan_out_buffer(), so there is no need for the
reset_scan_out_buffer_if_needed() call.

Not only is it not needed, but it is actually harmful, there are 2 problems
woth it:

1) Normally the drm plugin gets instantiated by ply-renderer.c with
   rendered->is_active=true, backend->is_active=false. The
   rendered->is_active=true causes the first ply_renderer_activate call
   to be a no-op without calling backend->activate(). So when the first
   map_to_device() calls happen activate() has not been called yet and we've
   not yet claimed master rights, so ply_renderer_head_set_scan_out_buffer()
   calls will always fail, resulting in this in a ply-trace:

   Mapping buffer for 1920x1080 renderer head
   Redrawing 1920x1080 renderer head
   Setting scan out buffer of 1920x1080 head to our buffer
   Couldn't set scan out buffer for head with controller id 41

   This is harmless, but also shows that the reset_scan_out_buffer_if_needed()
   is really not needed.

2. If deactivate_renderer() gets called before the first show-splash then
   rendered->is_active will become false, so renderer_activate() done before
   map_to_device() will now actually call backend->activate() claiming
   drm master rights and setting backend->is_active=true.

   The map_to_device() -> ply_renderer_head_map() call done after this, calls
   ply_renderer_head_redraw() -> flush_head() which under 1. was a no-op
   as it exits directly when backend->is_active=false. But now it actually
   flushes the buffers by calling reset_scan_out_buffer_if_needed(). This
   itself is fine.

   But since reset_scan_out_buffer_if_needed() has already happened in
   ply_renderer_head_redraw() the reset_scan_out_buffer_if_needed() call this
   commit removes would always return false (no reset necessary) causing
   ply_renderer_head_map() to destroy the buffer and return an error.

   This results in the splash briefly showing, followed by the core soon after
   trying another map_to_device(), which again briefly shows the splash, etc.
   With the end result being a badly flickering display.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
7 years agomain: Only activate renderers if the splash uses pixel-displays
Hans de Goede [Mon, 2 Jul 2018 07:39:12 +0000 (09:39 +0200)] 
main: Only activate renderers if the splash uses pixel-displays

Since commit eb147e52b123 ("renderer: support reactivating renderer without
closing it first"), the show_theme() call done by
toggle_between_splash_and_details() will reactivate the renderers after
switching to details mode, causing the drm renderer to switch the screen
from text to graphics mode hiding the details being logged on the console.

This commit fixes this by only calling ply_device_manager_activate_renderers()
and ply_device_manager_deactivate_renderers if the splash uses pixel-displays.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
https://bugs.freedesktop.org/show_bug.cgi?id=107047

7 years agomain: move ply_device_manager_deactivate_renderers() into hide_splash()
Hans de Goede [Mon, 25 Jun 2018 14:55:39 +0000 (16:55 +0200)] 
main: move ply_device_manager_deactivate_renderers() into hide_splash()

hide_splash() should be the counter-part of show_splash(). show_splash()
calls ply_device_manager_activate_renderers() (through show_theme()).

2 of the 3 callers of hide_splash() are already calling
ply_device_manager_deactivate_renderers() directly before calling
hide_splash(). This commit moves the deactivate call into hide_splash()
so that it also gets called from the 3th code-path, which is when
the user hits the escape to key to toggle from the splash to details.

It's important that plymouth deactivates its renderers before going
to details, because those renderers can block the kernel from
initializing fbcon, which the kernel will start doing lazily in the
future:

https://lkml.org/lkml/2018/6/26/489.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
https://bugs.freedesktop.org/show_bug.cgi?id=107047