Michael Kuhn [Mon, 22 Aug 2016 19:54:18 +0000 (21:54 +0200)]
libply, main: Add device scale setting
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.
Ray Strode [Mon, 20 Jun 2016 15:06:49 +0000 (11:06 -0400)]
drm: don't pick up drm master implicitly
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().
Daniel Drake [Thu, 16 Jun 2016 22:25:05 +0000 (15:25 -0700)]
device-manager: probe existing DRM devices at startup
A regression introduced in 7e37d58be3e9acff36c53c420b399c18d08bd8f8
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.
Ray Strode [Tue, 14 Jun 2016 18:31:40 +0000 (14:31 -0400)]
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.
Ray Strode [Tue, 14 Jun 2016 18:23:18 +0000 (14:23 -0400)]
text: add view for new text displays
commit 74346ec268f609 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.
Ray Strode [Tue, 7 Jun 2016 12:28:03 +0000 (08:28 -0400)]
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.
Ray Strode [Thu, 24 Sep 2015 13:21:18 +0000 (09:21 -0400)]
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.
Will Woods [Wed, 20 May 2015 16:03:58 +0000 (12:03 -0400)]
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.
Daniel Drake [Wed, 11 May 2016 17:21:16 +0000 (11:21 -0600)]
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.
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.
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.
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.
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.
Ray Strode [Mon, 10 Aug 2015 14:11:32 +0000 (10:11 -0400)]
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.
Ray Strode [Fri, 24 Jul 2015 18:12:40 +0000 (14:12 -0400)]
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.
Ray Strode [Thu, 23 Jul 2015 18:16:48 +0000 (14:16 -0400)]
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.
Ray Strode [Tue, 28 Jul 2015 14:00:25 +0000 (10:00 -0400)]
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.
Sjoerd Simons [Mon, 8 Dec 2014 10:50:47 +0000 (11:50 +0100)]
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.
Sjoerd Simons [Mon, 8 Dec 2014 10:47:12 +0000 (11:47 +0100)]
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.
Sjoerd Simons [Mon, 8 Dec 2014 10:42:26 +0000 (11:42 +0100)]
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.
Sjoerd Simons [Mon, 8 Dec 2014 10:39:39 +0000 (11:39 +0100)]
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.
Yixun Lan [Fri, 20 Mar 2015 17:02:35 +0000 (13:02 -0400)]
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.
two-step: Add separate startup / shutdown animations
In the case of Endless, we have a very fluid active bootup animation
that looks quite excellent for turning the computer on, but when turning
it off or restarting, it's sort of awkward to have the same animation
play. For our use case, we want to simply show our watermark.
ply-animation: Fix drawing if it happens before the timeout
animation->frame_area isn't filled in until the timeout, but clients
might draw it beforehand. Since animation->frame_area isn't used
anywhere else and we already have the x/y values in animation->x/y,
just use those and remove animation->frame_area.
Ray Strode [Fri, 7 Nov 2014 18:30:33 +0000 (10:30 -0800)]
animation: don't report success when no frames were added
Currently, the animation object will report success when assets are *found* in
the directory. When loading those assets, code will apply more checks to
determine if the assets are meant for the animation.
In case none of them are, we'll end up not adding any frames, so we
should not report a successful load.
Cosimo Cecchi [Fri, 7 Nov 2014 18:30:33 +0000 (10:30 -0800)]
throbber: don't report success when no frames were added
Currently, the throbber will report success when assets are *found* in
the directory. When loading those assets, code will apply more checks to
determine if the assets are meant for the throbber.
In case none of them are, we'll end up not adding any frames, so we
should not report a successful load.
Cosimo Cecchi [Fri, 7 Nov 2014 18:12:52 +0000 (10:12 -0800)]
throbber: don't report successful load when no assets
Currently, the throbber will report a successful load when zero assets
are loaded. Change it so that zero assets do not result in a
successfully loaded throbber.
Sjoerd Simons [Thu, 13 Nov 2014 12:09:34 +0000 (13:09 +0100)]
script: Add SetRefreshRate function
The script plugin hardcodes an FPS value of 50, which for some themes
and various devices is a bit much. Add a new function
(Plymouth.SetRefreshRate) which sets the rate at which the
RefreshFunction gets called so each script theme can determine their most
appropriate rate.
Ray Strode [Wed, 22 Oct 2014 15:27:31 +0000 (11:27 -0400)]
main: fix up mode confusion
plymouthd runs in a particular mode "boot" "shutdown" "updates" at any
given time. Likewise, the plymouth splash object also takes a mode.
These modes map 1-to-1 with each other, and there is more than one place
in the code where we need to get the splash mode from the overall mode.
This commit adds a helper function to perform this translation, and
cleans up the places where the wrong mode type is used or the
translation performed is incomplete.
Ray Strode [Mon, 28 Jul 2014 13:58:49 +0000 (09:58 -0400)]
text-step-bar: use correct utf-8 multibyte sequence for ■
For some reason in commit 113526408c5706c9efc7f43c3f8258354e762677
I commited the sequence \x25\x96\xa0 in place of the block character
that was there before. I don't know where I got \x25 from, but it's
not right (and couldn't even be right since the high order bit isn't
set which is a requirement for the first byte in multi-byte utf-8
sequences).
This commit uses \xe2 instead which I got from doing:
Ray Strode [Mon, 14 Jul 2014 12:04:54 +0000 (08:04 -0400)]
seat: be a little more forgiving in the case there's no open terminal
We can end up in a situation where a seat object doesn't have a terminal
associated with it. In that case we shouldn't crash, but continue on
with no input available for that seat.
configure: bump point release and ABI versions of libraries.
Due to removed interfaces since 0.8.8:
ply_boot_splash_set_keyboard
ply_boot_splash_unset_keyboard
ply_boot_splash_add_pixel_display
ply_boot_splash_remove_pixel_display
ply_boot_splash_add_text_display
ply_boot_splash_remove_text_display