Commit graph

2018 commits

Author SHA1 Message Date
Ray Strode
fd66c69030 text: don't draw if not animating
That can cause an unrecoverable crash.
2016-06-16 15:08:04 -04:00
Ray Strode
99755d3eac configure: tweak defaults to be more systemd friendly
systemd is everywhere now, yet we configure by default with non-systemd
friendly options.

This commit fixes that.
2016-06-16 14:40:27 -04:00
Ray Strode
c9a805885a main: call show_messages after the splash is assigned
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.
2016-06-14 14:31:40 -04:00
Ray Strode
2c7147ad09 text: add view for new text displays
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.
2016-06-14 14:23:18 -04:00
Ray Strode
375a65fff6 device-manager: fix use after free
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.
2016-06-07 08:28:03 -04:00
Ray Strode
cb50560821 main: make sure to reshow prompts when new display is added
When a display is added, we need to tell the splash plugin
to redisplay any pending questions, so those questions show
up on the new display.
2016-05-23 11:08:41 -04:00
Ray Strode
b99e1a3f07 details: update new views with current boot buffer
if a view is added after the splash is shown, make sure
to update the view with the current contents of the boot
buffer.
2016-05-23 11:06:27 -04:00
Ray Strode
74346ec268 plugins: load view of hot plugged displays immediately
If we're already chugging along, and a new display
gets added make sure to load the view associated with
that display right away.

Using an unloaded view can lead to crashes.
2016-05-23 11:03:18 -04:00
Ray Strode
8d07bfd434 plugins: free views that can't load
Trying to use an unloaded view can lead to crashes.
If a view can't be loaded, free it right away.
2016-05-23 10:56:01 -04:00
Ray Strode
d33b4ef04e plugins: unset draw handler when freeing view
If the view is freed, we definitely shouldn't draw
the view's display anymore.
2016-05-23 10:54:58 -04:00
Ray Strode
29e2763769 device-manager: activate new renderers after adding to renderers list
When a new renderer gets created, we should activate it, if the device
manager is already active.

At the moment we call create_pixel_displays_for_renderer which would
implicitly activate it (from a callback), except we call it one line
too early, so the renderer isn't in the list of known renderers yet.

This commit swaps the two lines and also adds an explicit renderer
activation for clarity.  For symmetry it makes the same change to
keyboards that it makes to renderers.
2016-05-23 10:53:55 -04:00
Ray Strode
2c482f2350 script: only support one message at a time
That's the other themes do, and callers
expect it.
2016-05-20 16:40:08 -04:00
Ray Strode
04ec674d53 two-step: don't tank in updates mode when there's no progress animations
Right now we try to use the progress animation in updates mode, even
if there's not one.  This commit makes the progress animation truely
optional.
2016-05-20 16:39:24 -04:00
Will Woods
22e0596c3f plymouth-populate-initrd: fix THEME_OVERRIDE with empty conf
If you set PLYMOUTH_THEME_NAME to override the theme in an initrd
(as e.g. lorax does when building upgrade.img), plymouth-populate-initrd
tries to edit plymouthd.conf to enable that theme.

Unfortunately, the existing `sed` line doesn't work if your
plymouthd.conf is empty or all commented out - which is how we currently
ship it.

So before modifying the config, make sure it has a [Daemon] section
header, and a Theme=[placeholder] line for us to modify.

Resolves: RHBZ#1223344
2016-05-20 16:31:01 -04:00
Ray Strode
b064b14c08 main: show cursor on crash
In the event there's a crash we don't want the getty
started later to lack a cursor.
2016-05-20 16:16:27 -04:00
Ray Strode
e89adaac8a device-manager: Don't add local console to terminals hash table unless passed on cmdline
it's unexpected for plymouth to show boot messages on the local console
if there is not console=tty0 on the kernel command line.

This commit fixes that.
2016-05-20 16:11:03 -04:00
Ray Strode
9a58de52dd Revert "populate-initrd: support theme subfolders"
This reverts commit 3a60023f26.
2016-05-16 12:13:19 -04:00
Daniel Drake
7e37d58be3 device-manager: use device timeout instead of udev coldplug monitor
https://lists.freedesktop.org/archives/systemd-devel/2015-March/029184.html
As explained there, plymouth watching for coldplug events is not the
behaviour we're looking for.

Replace this with a configurable timeout. We claim DRM devices as soon as
we're aware of them (displaying the splash still subject to ShowDelay),
but legacy framebuffer and text console devices are only claimed after
this new DeviceTimeout.

This avoids an issue where the initramfs finishes (generating a coldplug
event) before udev has informed plymouth of the DRM devices. This was
causing plymouth to activate text mode and ignore the DRM devices appearing
a moment later.

https://bugs.freedesktop.org/show_bug.cgi?id=95356
2016-05-13 14:20:52 -04:00
Ray Strode
3a60023f26 populate-initrd: support theme subfolders
Some themes like to keep their content in subfolders,
but plymouth-populate-initrd currently fails to copy
those subfolders over to the initrd.

This commit fixes that.

https://bugzilla.gnome.org/show_bug.cgi?id=94883
2016-04-11 07:48:40 -04:00
Cosimo Cecchi
5188f19416 libply: unify get_device_scale() method in library
Unify the two copies of this method inside libply. Also add back a check
for 4K displays that went missing.

https://bugs.freedesktop.org/show_bug.cgi?id=84482
2016-03-03 14:32:25 -05:00
Giovanni Campagna
72ae2bd889 label: add support for HiDPI
Set the device scale on the cairo surface based on the pixel
buffer device scale. cairo will do the rest of the magic for
us.

https://bugs.freedesktop.org/show_bug.cgi?id=84482
2016-03-03 14:32:25 -05:00
Giovanni Campagna
dd005c3fd5 x11: allow testing the hidpi support code
Apply the same heuristics as the DRM code, and set a device
scale on the pixel buffer. An environment variable is introduced
to force a scale different than the native one.

https://bugs.freedesktop.org/show_bug.cgi?id=84482
2016-03-03 14:32:25 -05:00
Giovanni Campagna
9bb6c81107 two-step: fix drawing of background image
The background image is tiled to cover the entire screen, so
we must pass a fill area that covers the screen or sampling
will be wrong. But we must also pass a clip area or we will
have expensive overdraw.

https://bugs.freedesktop.org/show_bug.cgi?id=84482
2016-03-03 14:32:25 -05:00
Giovanni Campagna
78e8bbea18 drm: set a device scale of 2 on HiDPI
Using the same heuristics as gnome-settings-daemon (which ensures
that the bootsplash will be scaled if and only if the running system
is)

https://bugs.freedesktop.org/show_bug.cgi?id=84482
2016-03-03 14:32:25 -05:00
Giovanni Campagna
d70c1dc9ee pixel-buffer: add the concept of a device scale
The device scale is a scale transformation that is applied to
the pixel buffer contents, but is transparent to the user of
the buffer (all pixel values are in logical pixels, not device
pixels).
The concept is modeled after the cairo API, and it is useful
to implement HiDPI monitor support.

https://bugs.freedesktop.org/show_bug.cgi?id=84482
2016-03-03 14:32:24 -05:00
Ray Strode
85fac71e08 splash-core: drop last vestigates of ply_seat_t
There's some left over goo.
2016-03-03 14:30:58 -05:00
Miroslav Urbanek
1ed8ec28df pixel-buffer: use double instead of float for scale factor
There are strange red and black dots in a 1280x800 splash screen with
Debian Jessie theme. The problem comes from image rescaling and is
caused by:

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=799953

on i386. The conversion from double to int in functions
ply_pixel_buffer_resize and ply_pixel_buffer_interpolate happens
through an intermediate float. This sometimes results in a truncated
value being larger than the original value.

This commit changes the code to use an intermediate double to
work around the bug.
2015-11-18 10:48:46 -05:00
Ray Strode
f80684387a boot-splash: don't crash in free if module not loaded
ply_boot_splash_free currently calls some code that depends
on a module being loaded.  We call ply_boot_splash_free to
clean up the boot splash object if a module can't be loaded,
leading to crash.

This commit addresses that issue by only calling the module
specific destruction code in ply_boot_splash_free in the case
where a module is loaded.

https://bugs.freedesktop.org/show_bug.cgi?id=91590
2015-08-10 10:15:19 -04:00
Ray Strode
77d303d07b device-manager: force details if serial consoles are used
it's better to skip trying to load the default splash rather than
relying on it failing and falling back.
2015-07-30 16:03:12 -04:00
Ray Strode
ef7adc3677 device-manager: decouple local console from output device
The code currently does a faulty heuristic to figure out which
drm device is associated with the tty.  We shouldn't actually
even need an accurate association, so this commit just makes
sure the terminal gets used for the first device.
2015-07-30 16:03:11 -04:00
Ray Strode
c0ee9474a3 device-manager: drop seat abstraction
The seat abstraction isn't really right, since it forces creating a
link between terminal and video output device, which isn't really
necessary (and other reasons).

This commit drops the abstraction, and moves all the code that was
in ply-seat.c directly to ply-device-manager.c.
2015-07-30 16:03:11 -04:00
Ray Strode
0bb3bd69c1 pixel-display: add getters for renderer data
These functions are useful for matching a pixel display
to its renderer.
2015-07-30 16:03:11 -04:00
Ray Strode
ea91f9baee keyboard: track activeness
Right now, ply-seat has to handle tracking
keyboard activeness on its own.  This commit
moves activeness tracking to ply-keyboard
directly.
2015-07-30 16:03:11 -04:00
Ray Strode
c6a582d05d keyboard: track activeness
Right now, ply-seat has to handle tracking
keyboard activeness on its own.  This commit
moves activeness tracking to ply-keyboard
directly.
2015-07-30 16:03:11 -04:00
Ray Strode
b0052df515 renderer: track activeness
Right now, ply-seat has to handle tracking
renderer activeness on its own.  This commit
moves activeness tracking to ply-renderer
directly.
2015-07-30 16:03:11 -04:00
Ray Strode
02c70f069b animation,throbber: allow calling stop after animation is stopped
Right now if a user calls ply_throbber_stop or ply_animation_stop
after the animation is stopped things malfunction.  In the case
of the throbber we end up never calling the stop completion handler
passed in, and in the case of the animation, we end up setting
some state that shouldn't be set.

This commit checks if the animation and throbber objects are stopped,
and if so does the necessary steps to process the late stop request.

Spotted by Dave Airlie
2015-07-30 16:03:11 -04:00
Ray Strode
d37da49aca drm: fix crasher in unload_backend
we were freeing the state struct and then closing items in it.
2015-07-30 16:03:10 -04:00
Sjoerd Simons
ed5aa69d4a script: Don't draw backgrounds if they're obscured
When drawing sprites it's a waste to draw the background if the target
area will be obscured by the sprit to draw. Optimize for the common case
where only one sprite is being drawn by peeking at the first item in the
sprite list to check if it is opaque and fills the area.

https://bugs.freedesktop.org/show_bug.cgi?id=87105
2015-03-25 21:24:08 -04:00
Sjoerd Simons
c052d9fccd ply-image: Don't do alpha pre-multiplication for opaque pixels
When transforming the output of libpng to ARG32 with pre-multiplied
alpha, only do the multiplications if the pixel isn't opaque. Otherwise
plymouth is just applying a very complicated identity function.

https://bugs.freedesktop.org/show_bug.cgi?id=87105
2015-03-25 21:09:50 -04:00
Sjoerd Simons
61a26f4216 pixel-buffer: Optimize filling with opaque buffers
If the source buffer is known to be fully opaque and the fill is done at
full opacity, simply memcpy the data row-by-row instead of iterating over
every pixel and blending it with the target buffer.

This could be optimized more, in the future, in some cases, by memcpy of
the entire block instead of row-by-row.

https://bugs.freedesktop.org/show_bug.cgi?id=87105
2015-03-25 21:05:33 -04:00
Sjoerd Simons
00ee03695c pixel-buffer: add ability track opaqueness
Pixel buffers contain ARGB32 data. Add functionality to mark a buffer as
containing only fully opaque pixels. This functionality can be used by
rendering functions to be able to optimize drawing of such buffers.

https://bugs.freedesktop.org/show_bug.cgi?id=87105
2015-03-25 20:59:25 -04:00
Ray Strode
4ecd0c2436 drm: rename "buffer" to "output_buffer"
This just makes it more clear that the buffers are used for scan
out.
2015-03-25 20:46:12 -04:00
Ray Strode
54583fdf1b drm: free drm mode resources object
This fixes a small memory leak.
2015-03-25 20:39:30 -04:00
Ray Strode
179fd4efa8 drm: don't try to draw to fbcon on unmap
We don't support mapping the console, so trying to write
to it is a futile endeavour
2015-03-25 20:31:52 -04:00
Ray Strode
9b396fafeb drm: merge ply-renderer-generic-driver.c to plugin.c
Now that we don't have several drivers, having the
backend/driver separation makes little sense.

This commit merges everything in plugin.c
2015-03-25 20:31:51 -04:00
Ray Strode
655b1b2646 drm: assume driver doesn't support mapping console
We only support the generic driver now, and it doesn't
support mapping the console.

This commit removes the supports_mapping_console boolean,
and any code that checks for console mapping.
2015-03-25 19:18:45 -04:00
Yixun Lan
4519fe0db5 systemd: Allow specifying unit dir to configure
systemd isn't necessarily in the buildroot at the time that plymouth
gets built, so autodetection of the unitdir from pkgconfig isn't
necessarily feasible.

This commit adds a new option to configure, --with-systemdunitdir,
that lets distros specify the unit directory manually.

https://bugs.gentoo.org/show_bug.cgi?id=543712
2015-03-20 13:04:12 -04:00
Ray Strode
9d62fefeed configure: bump to 0.9.3 2015-03-17 21:50:43 -04:00
Ray Strode
2c437c364b configure: bump to 0.9.2 2015-03-17 14:52:52 -04:00
Ray Strode
317b211cc6 main: don't handle udev events when deactivated
We don't want to spontaneously reactivate.

https://bugs.freedesktop.org/show_bug.cgi?id=89474
2015-03-06 16:01:59 -05:00