Commit graph

2139 commits

Author SHA1 Message Date
Hans de Goede
bf8a2e893e 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>
2018-12-04 09:41:31 +01:00
Hans de Goede
42bbee8c38 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>
2018-12-03 16:52:08 +01:00
Hans de Goede
534aa0cfd5 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>
2018-12-03 16:52:08 +01:00
Hans de Goede
b24e5f38a4 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
2018-12-03 15:51:41 +00:00
Hans de Goede
10fddacd1e 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>
2018-12-03 16:50:18 +01:00
Hans de Goede
a7ec3e65ba 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
2018-11-29 08:40:27 +00:00
Hans de Goede
4925a485c5 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>
2018-11-27 08:56:02 +01:00
Hans de Goede
d45c477d44 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>
2018-11-27 08:48:56 +01:00
Hans de Goede
856297c7a4 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>
2018-11-27 08:48:56 +01:00
Hans de Goede
e10ed13fff 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>
2018-11-27 08:48:56 +01:00
Hans de Goede
9f3aff2e7c 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>
2018-11-27 08:48:56 +01:00
Hans de Goede
ae8a676c09 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>
2018-11-27 08:48:56 +01:00
Hans de Goede
3f71c28e45 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>
2018-11-27 08:48:56 +01:00
Hans de Goede
385a008c83 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>
2018-11-27 08:48:56 +01:00
Hans de Goede
e1e9e554d2 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>
2018-11-27 08:48:56 +01:00
Hans de Goede
986c911e21 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>
2018-11-27 08:48:56 +01:00
Hans de Goede
ed3aae9d8f drm: Implement ply_renderer_get_panel_properties
Implement the get_panel_properties plugin interface.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2018-11-27 08:48:56 +01:00
Hans de Goede
1723419e6c 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>
2018-11-27 08:48:56 +01:00
Hans de Goede
f5915187b4 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>
2018-11-27 08:48:56 +01:00
Hans de Goede
addff821e0 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>
2018-11-27 08:48:56 +01:00
Hans de Goede
70f0c7a029 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
2018-11-27 07:48:14 +00:00
Hans de Goede
50adbfd300 two-step: Fix crash asking for password with multiple heads
Commit 9639ed8953 ("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: 9639ed8953 ("two-step: Fix animation not starting on ... added heads")
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2018-11-27 08:30:00 +01:00
Hans de Goede
59e3095253 Merge branch 'jimmac1/plymouth-master' 2018-11-23 17:19:18 +01:00
Jakub Steiner
75d93c0f30 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.
2018-11-23 17:18:50 +01:00
Ray Strode
aaa140b838 Merge branch 'misc-fixes' into 'master'
Misc fixes

Closes #29

See merge request plymouth/plymouth!9
2018-11-22 19:49:55 +00:00
Hans de Goede
9639ed8953 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>
2018-11-12 14:57:18 +01:00
Hans de Goede
059390ac56 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>
2018-11-12 14:57:18 +01:00
Hans de Goede
4de54f598b 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>
2018-11-12 14:57:18 +01:00
Ray Strode
118c5ca1bc Merge branch 'master' into 'master'
systemd-units: Also add "ConditionVirtualization=!container" in…

See merge request plymouth/plymouth!8
2018-11-11 02:15:33 +00:00
Laurent Bigonville
763c023caa systemd-units: Also add "ConditionVirtualization=!container" in systemd-ask-password-plymouth.path.in
This completes the fix for #27
2018-11-08 11:05:05 +00:00
Ray Strode
f898586543 configure: bump to 0.9.5 2018-11-05 15:45:53 -05:00
Hans de Goede
025ce59825 Merge branch 'drm-preferred-mode' into 'master'
drm: use preferred mode for outputs

Closes #68 and #59

See merge request plymouth/plymouth!4
2018-10-31 15:04:55 +00:00
Hans de Goede
da2c997072 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>
2018-10-31 15:28:03 +01:00
Hans de Goede
9dfb4c575c 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>
2018-10-31 15:28:01 +01:00
Hans de Goede
659dbb300e 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>
2018-10-31 15:26:58 +01:00
Hans de Goede
d253ad6238 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>
2018-10-31 15:25:15 +01:00
Michal Srb
b4f751b5f1 Merge branch 'fix-infinite-throbber' into 'master'
throbber: Don't skip last frame when waiting for end.

See merge request plymouth/plymouth!7
2018-10-26 14:30:45 +00:00
Michal Srb
121783eff1 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).
2018-10-26 09:02:04 +02:00
Ray Strode
a588b3f7d1 Merge branch 'coverity-fixes' into 'master'
Coverity fixes

See merge request plymouth/plymouth!6
2018-10-16 03:10:53 +00:00
Ray Strode
3945071e39 boot-server: free the argument and triggers
coverity found some pervasive leaking of the argument
and triggers.

This commit mops them up.
2018-10-15 21:56:03 -04:00
Ray Strode
5badb95b8e script: fix various memory leaks
coverity found a few leaks.

this commit mops them up.
2018-10-15 21:44:10 -04:00
Ray Strode
322a3635fa 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.
2018-10-15 21:13:58 -04:00
Ray Strode
656444ed26 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.
2018-10-15 21:07:01 -04:00
Ray Strode
310b63cd15 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.
2018-10-15 21:04:47 -04:00
Ray Strode
4ff6d59d10 populate-initrd: drop unused local variable
the inst_library function declares a variable `_lib`
that's completely unused.

This commit removes the declaration.
2018-10-15 21:02:50 -04:00
Iain Lane
89283f38b0 Merge branch 'fix-deactivate-udev-race' into 'master'
device-manager: don't watch for udev events when deactivated

See merge request plymouth/plymouth!5
2018-10-10 20:42:27 +00:00
Ray Strode
85d843af84
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.
2018-10-10 20:09:52 +01:00
Ray Strode
0a66272326 Merge branch 'wip/dont-muck-with-login-screen-tty' into 'master'
main: ensure tty is closed on deactivate

See merge request plymouth/plymouth!2
2018-08-27 19:19:41 +00:00
Ray Strode
28ee4012c9 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.
2018-08-27 15:16:18 -04:00
Ray Strode
7663b0c587 Merge branch 'wip/container-condition-check' into 'master'
systemd-units: Add "ConditionVirtualization=!container"

Closes #27

See merge request plymouth/plymouth!1
2018-08-07 15:41:15 +00:00