]> git.ipfire.org Git - thirdparty/plymouth.git/log
thirdparty/plymouth.git
7 years agodrm: ensure drm_fd is closed if open fails wip/fix-text-splash
Ray Strode [Fri, 1 Jun 2018 18:41:32 +0000 (14:41 -0400)] 
drm: ensure drm_fd is closed if open fails

At the moment we open the drm fd right away, then proceed to
check the terminal.  If the terminal doesn't meet specs, we
fail the open call but neglect to close the drm_fd.

This commit fixes the code such that we don't leave the drm
fd open inadvertently.

7 years agorenderer: nullify device if open fails
Ray Strode [Thu, 31 May 2018 17:22:54 +0000 (13:22 -0400)] 
renderer: nullify device if open fails

Since commit e4f86e3c we query the renderer device straight from
the renderer plugin. Unfortunately, we continue to use that
device name even after the renderer fails to open and the plugin
gets unloaded.

This commit changes the code to go back to using the original
device name in that scenario.

7 years agoRevert "wip! plymouth: stub out drm escrow program"
Ray Strode [Thu, 31 May 2018 14:51:55 +0000 (10:51 -0400)] 
Revert "wip! plymouth: stub out drm escrow program"

This reverts commit 12b03bf60e9ba7e3a4e400aca0b7c2fdefbb762f.

7 years agoRevert "wip! systemd-units: add unit to switch back to initrd at shutdown"
Ray Strode [Thu, 31 May 2018 14:51:51 +0000 (10:51 -0400)] 
Revert "wip! systemd-units: add unit to switch back to initrd at shutdown"

This reverts commit 82b2b096392b9305941b3860dd92b18bce1789f8.

7 years agoRevert "main: don't load cache or treat root as mounted on shutdown"
Ray Strode [Thu, 31 May 2018 14:51:46 +0000 (10:51 -0400)] 
Revert "main: don't load cache or treat root as mounted on shutdown"

This reverts commit 55186d76ab699b8c2f536b87874a2fc628612fbd.

7 years agoRevert "utils: add function for running program"
Ray Strode [Thu, 31 May 2018 14:51:42 +0000 (10:51 -0400)] 
Revert "utils: add function for running program"

This reverts commit 0faf4c82bf69709c9de8a6fa2bc7aa2eedf9510b.

7 years agoRevert "main: reap zombies"
Ray Strode [Thu, 31 May 2018 14:51:38 +0000 (10:51 -0400)] 
Revert "main: reap zombies"

This reverts commit c59b031980d10a31f54d2d39023ff2c9b907668e.

7 years agoRevert "wip! main: run plymouth-drm-escrow when switching to initrd"
Ray Strode [Thu, 31 May 2018 14:51:34 +0000 (10:51 -0400)] 
Revert "wip! main: run plymouth-drm-escrow when switching to initrd"

This reverts commit f083f0a150a3f72448d6c3ad27fcd30bf5def1a4.

7 years agoRevert "fixup! utils: add function for running program"
Ray Strode [Thu, 31 May 2018 14:51:22 +0000 (10:51 -0400)] 
Revert "fixup! utils: add function for running program"

This reverts commit 78cf571066c4220f59df0861c8716f51e9f77fa6.

7 years agoRevert "wip! renderer: add disown method"
Ray Strode [Thu, 31 May 2018 14:51:17 +0000 (10:51 -0400)] 
Revert "wip! renderer: add disown method"

This reverts commit 0c006993a4d1f345b80130fe40f378981744b432.

7 years agoclient: fix typo in help text
Ulrich Ölmann [Fri, 27 Apr 2018 13:23:42 +0000 (15:23 +0200)] 
client: fix typo in help text

Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de>
7 years agoconfigure: fix help text
Ulrich Ölmann [Fri, 27 Apr 2018 13:23:04 +0000 (15:23 +0200)] 
configure: fix help text

The used name for the feature "drm" results in the configure option
"--enable-drm" and not "--enable-drm-renderer".

Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de>
7 years agowip! renderer: add disown method
Ray Strode [Tue, 8 May 2018 20:44:46 +0000 (16:44 -0400)] 
wip! renderer: add disown method

7 years agofixup! utils: add function for running program
Ray Strode [Tue, 1 May 2018 20:33:48 +0000 (16:33 -0400)] 
fixup! utils: add function for running program

7 years agowip! main: run plymouth-drm-escrow when switching to initrd
Ray Strode [Thu, 26 Apr 2018 17:22:27 +0000 (13:22 -0400)] 
wip! main: run plymouth-drm-escrow when switching to initrd

7 years agomain: reap zombies
Ray Strode [Thu, 26 Apr 2018 16:42:20 +0000 (12:42 -0400)] 
main: reap zombies

Now that we have the ability to run a child we should make sure
that zombie children get reaped.

7 years agoutils: add function for running program
Ray Strode [Thu, 26 Apr 2018 16:36:31 +0000 (12:36 -0400)] 
utils: add function for running program

In order to hand off the drm fd to another program we need
to be able to run that other program.

This commit adds an API for running a program with no arguments,
in the background.

7 years agomain: don't load cache or treat root as mounted on shutdown
Ray Strode [Thu, 26 Apr 2018 14:45:39 +0000 (10:45 -0400)] 
main: don't load cache or treat root as mounted on shutdown

Right now, anytime we update the root fs in the daemon we treat
it like we switched from initramfs to the main root filesystem.

We shoudn't do that when shutting down since we're going to go
the other direction.

This commit changes on_newroot to look at the current mode to
decide what to do.

For the moment it doesn't do anything in the shutdown case, but
that will change shortly.

7 years agowip! systemd-units: add unit to switch back to initrd at shutdown
Ray Strode [Thu, 26 Apr 2018 14:39:50 +0000 (10:39 -0400)] 
wip! systemd-units: add unit to switch back to initrd at shutdown

plymouthd currently sticks around on the main filesystem during
shutdown, while shutdown proceeds on the initramfs.

This commit adds a unit to make it jump into the initramfs too.

This is important, so we can run the drm escrow binary from
the initramfs.

7 years agowip! plymouth: stub out drm escrow program
Ray Strode [Thu, 26 Apr 2018 14:15:14 +0000 (10:15 -0400)] 
wip! plymouth: stub out drm escrow program

Right now plymouthd forces itself to stay alive for the duration of
shutdown, so the splash screen can stay up until the power is killed.

This causes unclean mounts in some situations following system updates.

Rather than keep plymouthd around, all we really need to do is keep
the drm fd around.  That can be down with a separate program executed
just in time from the initramfs.

As a first step toward acheiving that goal, this commit creates a
simple new program "plymouth-drm-escrow" that doesn't do anything
at all but try to stay alive.

A future commit will change plymouthd to run plymouth-drm-escrow,
and pass it the drm fd.

7 years agopixel-buffer: switch device rotation to an enum
Ray Strode [Tue, 10 Apr 2018 20:40:06 +0000 (16:40 -0400)] 
pixel-buffer: switch device rotation to an enum

Right now device rotation is stored in a bare integer.

For clarity, switch that to an enum.

7 years agobranch-merge: support device rotation
Hans de Goede [Tue, 10 Apr 2018 15:33:31 +0000 (11:33 -0400)] 
branch-merge: support device rotation

On some devices the LCD panel is mounted in the casing in such a way
that the up/top side of the panel does not match with the top side of
the device.

Examples of this are:
-Tablets where the LCD panel is mounted upside-down (various models)
-Clamshell design devices use portrait tablet screens in a landscape fashion /
 a landscape case, e.g. the GPD pocket, GPD win, Asus T100HA and the VIOS LTH17
 (so the didplay is mounted rotated 90 degrees clock-wise or counter-clock-wise).

Starting with kernel 4.16 there is code in the kernel to:
-Detect affected devices
-Automatically rotate the fbconsole to compensate
-Let userspace know about this with a new "panel orientation" property on the drm connector of the panel

The patch series I'm attaching to this bug adds support for this to
plymouth, so that the boot-splash and diskcrypt-ask-password are shown
with the correct orientation / the right way up on these devices.

7 years agodrm: Reset primary plane rotation to DRM_MODE_ROTATE_0
Hans de Goede [Sat, 20 Jan 2018 11:20:29 +0000 (12:20 +0100)] 
drm: Reset primary plane rotation to DRM_MODE_ROTATE_0

On devices where the (LCD) panel is mounted upside-down in the case
the kernel's drm_fb_helper code may have set up rotation on the primary
plane to make the text-console (and other fbdev using apps) show the right
way up.

We inherit this rotation from the text-mode and since we do our own rotation
where necessary we end up rotating twice and showing the boot-splash
upside-down again.

Dealing with hardware rotation may require using a specific framebuffer
tiling which we do not support, so we should just disable the hardware
rotation and keep using our own software rotation.

This commit adds code to find the primary plane and its rotation property
and if it is not DRM_MODE_ROTATE_0 then sets it to DRM_MODE_ROTATE_0. fixing
the double rotation issue.

https://bugs.freedesktop.org/show_bug.cgi?id=104714

7 years agodrm: Check for "panel orientation" connector property
Hans de Goede [Tue, 12 Dec 2017 18:47:26 +0000 (19:47 +0100)] 
drm: Check for "panel orientation" connector property

On some devices the LCD panel is mounted in the casing in such a way
that the up/top side of the panel does not match with the top side of
the device (e.g. it is mounted upside-down).

Kernel 4.16 introduces a new "panel-orientation" property on the drm
connector which allows modesetting applications / code to check for
such LCD panels.

This commit adds support for this new property and passes this to the
pixel_buffer code using the new ply_pixel_buffer_new_with_device_rotation
method, so that the pixel_buffer code will automatically rotate the
image to correct for the panel orientation.

https://bugs.freedesktop.org/show_bug.cgi?id=104714

7 years agopixel-buffer: Add the concept of device rotation
Hans de Goede [Wed, 6 Dec 2017 16:37:12 +0000 (17:37 +0100)] 
pixel-buffer: Add the concept of device rotation

On some devices the LCD panel is mounted in the casing in such a way
that the up/top side of the panel does not match with the top side of
the device (e.g. it is mounted upside-down).

This commit adds support to the ply-pixel-buffer code to create
buffers which take device rotation into account and which will rotate
the picture to compensate.

https://bugs.freedesktop.org/show_bug.cgi?id=104714

7 years agomain: Do not update the display on backspace when there is no input to remove
Hans de Goede [Sun, 21 Jan 2018 13:07:39 +0000 (14:07 +0100)] 
main: Do not update the display on backspace when there is no input to remove

On machines with a slow CPU (Atom) and a highres screen drawing the
diskcrypt dialog may take longer then the keyrepeat speed, this leads to
a long delay before showing keypresses when doing the following:

1) Type long password
2) Realize it is wrong, press + hold backspace
   the key-repeat will now generate backspace key presses faster then we
   process them as main.c does an update_display for each press
3) Users releases backspace when we've processed input-length backspace
   key-presses, but since we were drawing slower then key-presses were
   coming in many more backspace keypresses are in the keyboard buffer
4) User types first character of the right password, this shows up up to
   a couple of seconds later because first we are still processing all
   the queued up backspace presses and doing a redraw for each.

This commit fixes this by skipping the redraws in on_backspace when there
is no more input left in the input buffer.

https://bugs.freedesktop.org/show_bug.cgi?id=104714

7 years agodevice-manager: drop superfluous create_pixel_displays_for_renderer call
Ray Strode [Wed, 20 Dec 2017 15:49:19 +0000 (10:49 -0500)] 
device-manager: drop superfluous create_pixel_displays_for_renderer call

commit 29e27637694eefc962d53333c729e6cac1c66518 tried to move
create_pixel_displays_for_renderer down a couple of lines, but it
inadvertently copied it instead of moved it.

This commit fixes that.

https://bugs.freedesktop.org/show_bug.cgi?id=104353

7 years agox11: don't call gdk_display_get_name before gtk_init
Ray Strode [Mon, 11 Dec 2017 15:39:13 +0000 (10:39 -0500)] 
x11: don't call gdk_display_get_name before gtk_init

The x11 plugin calls gdk_display_get_name at load time
to set the device name state.  This no longer works, since
gtk_init_check() happens later at open_device time, and
GTK+ no longer allows gdk_display_get_name before gtk_init.

This commit moves the gtk_init call earlier, to
create_backend, so gdk_display_get_name works again.

https://bugzilla.gnome.org/show_bug.cgi?id=104204

7 years agoINSTALL: Fix a spelling error in the command example
zhaoqiang [Thu, 30 Nov 2017 09:21:39 +0000 (17:21 +0800)] 
INSTALL: Fix a spelling error in the command example

https://bugs.freedesktop.org/show_bug.cgi?id=103995

7 years agopopulate-initrd: handle themes with subdirs
mike@mgoodwin.net [Mon, 23 Oct 2017 14:22:52 +0000 (10:22 -0400)] 
populate-initrd: handle themes with subdirs

Not all distros use the upstream plymouth-populate-initrd
script to populate their initramfs.  As a consequence,
some themes have been developed that use subdirectories,
(which is not supported by plymouth-populate-initrd).

This commit adds support for that feature, so that
preexisting themes get properly installed.

https://bugs.freedesktop.org/show_bug.cgi?id=103424

7 years agodevice-manager: fall back to text mode if graphical devices fail
Ray Strode [Tue, 7 Nov 2017 18:49:30 +0000 (13:49 -0500)] 
device-manager: fall back to text mode if graphical devices fail

Right now we assume if we find a /dev/dri/card0 that it will work.
That may not be true. The proprietary nvidia driver, for instance,
provides /dev/dri/card0 but disables modesetting by default.

This commit makes sure we fall back to text mode if /dev/dri/card0
is insufficient for our needs.

https://bugs.freedesktop.org/show_bug.cgi?id=103612

7 years agoscripts: Use >&2 instead of /dev/stderr
Daniel Baumann [Thu, 24 Aug 2017 15:12:37 +0000 (17:12 +0200)] 
scripts: Use >&2 instead of /dev/stderr

/dev/stderr isn't always available in chroots, so use
>&2 instead.

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=581649
https://bugs.freedesktop.org/show_bug.cgi?id=102388

7 years agoterminal: add include for sysmacros.h
Sakaki [Fri, 18 Aug 2017 14:08:23 +0000 (10:08 -0400)] 
terminal: add include for sysmacros.h

That file is, in some cases, not included implicitly by sys/types.h.

This commit explicitly includes it.

8 years agoconfigure: bump to 0.9.4
Ray Strode [Wed, 9 Aug 2017 13:16:52 +0000 (09:16 -0400)] 
configure: bump to 0.9.4

8 years agoterminal-session: don't delete boot.log 0.9.3
Ray Strode [Thu, 11 May 2017 20:46:33 +0000 (16:46 -0400)] 
terminal-session: don't delete boot.log

We want to append to it now.

8 years agoRevert "Make boot.log world readable by default"
Ray Strode [Thu, 11 May 2017 14:52:30 +0000 (10:52 -0400)] 
Revert "Make boot.log world readable by default"

This reverts commit fc5cd88767db61805519fef53182386ba56c6405.

It's better to let the admin of the system decide the permissions,
than forcefully change them.

8 years agoRevert "main: don't allow ESC key repeat to flood console"
Ray Strode [Mon, 24 Apr 2017 20:16:47 +0000 (16:16 -0400)] 
Revert "main: don't allow ESC key repeat to flood console"

This reverts commit 1f1d83bf71fc4d1748bed3366fd6a597d34fbabd.

8 years agomain: Look for config in runtime dir first
João Paulo Rechi Vita [Fri, 7 Apr 2017 14:01:17 +0000 (10:01 -0400)] 
main: Look for config in runtime dir first

This makes possible to support shipping a self-contained initrd which
completely overrides the plymouth theme. The configuration and theme are
copied to /run by a custom service before plymouth starts, so plymouth
can load the correct config from /run both during bootup and shutdown.

This commit changes the routine which resolves plymouth.defaults' path,
to have it look first in plymouth's runtime directory.

Signed-off-by: João Paulo Rechi Vita <jprvita@endlessm.com>
8 years agomain: Look for theme in runtime dir first
João Paulo Rechi Vita [Fri, 7 Apr 2017 14:01:16 +0000 (10:01 -0400)] 
main: Look for theme in runtime dir first

When a theme is shipped exclusively in the initrd, plymouth will not be
able to load is if it starts the boot splash after the bootup process
already switched from the initrd. One way to make it work is to copy the
theme to plymouth's runtime directory in /run, which is preserved during
switch root.

This commit changes the routine which resolves a theme's path to have it
look first in themes/ under plymouth's runtime directory.

Signed-off-by: João Paulo Rechi Vita <jprvita@endlessm.com>
8 years agoRevert "Recreate boot log at each boot instead of appending"
Ray Strode [Fri, 24 Mar 2017 19:15:03 +0000 (15:15 -0400)] 
Revert "Recreate boot log at each boot instead of appending"

This reverts commit 9abbd88835a181cda1427d61d92ef5685ad8a81b.

I'm getting requests to keep old boot logs around.  If anyone
wants to carve up boot.log, they can just use logrotate.d

8 years agomain: don't allow ESC key repeat to flood console
Ray Strode [Fri, 17 Mar 2017 20:35:46 +0000 (16:35 -0400)] 
main: don't allow ESC key repeat to flood console

If the user holds down ESC the system can easily get
overrun toggling details and the theme back and forth.

This commit changes the code to ignore any ESC key events
that come in while ESC is getting processed.

8 years agox11: implement get_display_name
Ray Strode [Wed, 18 Jan 2017 18:09:53 +0000 (13:09 -0500)] 
x11: implement get_display_name

For completeness, implement get_display_name in the x11 renderer too.

8 years agodrm: implement get_display_name
Ray Strode [Wed, 18 Jan 2017 18:09:02 +0000 (13:09 -0500)] 
drm: implement get_display_name

This just allows the drm plugin to work if udev is disabled.

8 years agoconfigure: don't look for libudev when --without-udev is passed
Lukas Rusak [Tue, 17 Jan 2017 23:09:18 +0000 (15:09 -0800)] 
configure: don't look for libudev when --without-udev is passed

At the moment, libudev is unconditionally linked into plymouth
even if it's configured to be not used.

This commit moves the pkg-config check, so that it doesn't get
made at all if --without-udev is passed.

8 years agorenderer: export device name from plugin
Ray Strode [Wed, 18 Jan 2017 17:53:58 +0000 (12:53 -0500)] 
renderer: export device name from plugin

Right now the renderer keeps its own copy of the device name, which
may be NULL or out of date after the renderer is opened.

This commit makes sure the device name gets updated to be current.

8 years agodevice-manager: handle NULL renderer better
Ray Strode [Wed, 18 Jan 2017 15:07:00 +0000 (10:07 -0500)] 
device-manager: handle NULL renderer better

Right now we'll pass a NULL device name and crash if the renderer
fails to open.

This commit fixes that.

8 years agodevice-manager: dont pass terminal as renderer device
Ray Strode [Thu, 8 Dec 2016 20:23:54 +0000 (15:23 -0500)] 
device-manager: dont pass terminal as renderer device

Various bits of fall back code pass the terminal device
as the renderer device.  This is wrong, ply_renderer is
a graphical renderer abstraction.

This commit passes NULL in those cases, so each renderer
does what it's configured to do by default.

https://bugs.freedesktop.org/show_bug.cgi?id=99104

8 years agobuild-goo: make udev support build time optional
Ray Strode [Thu, 8 Dec 2016 20:37:50 +0000 (15:37 -0500)] 
build-goo: make udev support build time optional

Some set ups just use /dev/fb0 and don't need udev.

https://bugs.freedesktop.org/show_bug.cgi?id=99104

8 years agomain: support plymouth.force-scale on the kernel command line
Michael Kuhn [Mon, 22 Aug 2016 16:39:35 +0000 (18:39 +0200)] 
main: support plymouth.force-scale on the kernel command line

This can be used to override the DeviceScale setting.

https://bugs.freedesktop.org/show_bug.cgi?id=97424

8 years agolibply, main: Add device scale setting
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.

https://bugs.freedesktop.org/show_bug.cgi?id=97424

8 years agolibply: fix HiDPI detection
Michael Kuhn [Mon, 22 Aug 2016 19:54:52 +0000 (21:54 +0200)] 
libply: fix HiDPI detection

The check would erroneously turn off HiDPI mode for devices with a
resolution less than 4K.

https://bugs.freedesktop.org/show_bug.cgi?id=97424

9 years agoconfigure: switch to tar.xz instead tar.bz2
Ray Strode [Mon, 20 Jun 2016 19:15:40 +0000 (15:15 -0400)] 
configure: switch to tar.xz instead tar.bz2

It's 2016 after all.

9 years agosystemd-units: Fix uninstall script
Ray Strode [Mon, 20 Jun 2016 19:15:11 +0000 (15:15 -0400)] 
systemd-units: Fix uninstall script

This commit fixes some typos in the uninstall: target

9 years agobuild-goo: don't install systemd units during distcheck
Ray Strode [Mon, 20 Jun 2016 19:53:26 +0000 (15:53 -0400)] 
build-goo: don't install systemd units during distcheck

9 years agologger: stop using carriage returns
Ray Strode [Mon, 20 Jun 2016 17:46:34 +0000 (13:46 -0400)] 
logger: stop using carriage returns

I believe we fixed up tty settings sometime ago such that we don't
need carriage returns anymore.

9 years agoterminal: refresh geometry after drm device arrives
Ray Strode [Mon, 20 Jun 2016 17:45:37 +0000 (13:45 -0400)] 
terminal: refresh geometry after drm device arrives

It's quite likely that afer the drm device arrives, the number
of rows and columns in the terminal will change.

This commit makes sure to refresh the terminal state.

9 years agodrm: don't pick up drm master implicitly
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().

9 years agodevice-manager: probe existing DRM devices at startup
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.

https://bugs.freedesktop.org/show_bug.cgi?id=96560

9 years agoterminal: always open terminal in non-blocking mode
Ray Strode [Thu, 16 Jun 2016 19:23:15 +0000 (15:23 -0400)] 
terminal: always open terminal in non-blocking mode

In theory this is safer since open calls can block
indefinitely without O_NONBLOCK.

9 years agotext: don't draw if not animating
Ray Strode [Thu, 16 Jun 2016 19:08:04 +0000 (15:08 -0400)] 
text: don't draw if not animating

That can cause an unrecoverable crash.

9 years agoconfigure: tweak defaults to be more systemd friendly
Ray Strode [Thu, 16 Jun 2016 18:40:27 +0000 (14:40 -0400)] 
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.

9 years agomain: call show_messages after the splash is assigned
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.

9 years agotext: add view for new text displays
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.

9 years agodevice-manager: fix use after free
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.

9 years agomain: make sure to reshow prompts when new display is added
Ray Strode [Fri, 9 Oct 2015 16:48:17 +0000 (12:48 -0400)] 
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.

9 years agodetails: update new views with current boot buffer
Ray Strode [Fri, 9 Oct 2015 16:46:49 +0000 (12:46 -0400)] 
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.

9 years agoplugins: load view of hot plugged displays immediately
Ray Strode [Thu, 24 Sep 2015 19:57:59 +0000 (15:57 -0400)] 
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.

9 years agoplugins: free views that can't load
Ray Strode [Thu, 24 Sep 2015 19:55:08 +0000 (15:55 -0400)] 
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.

9 years agoplugins: unset draw handler when freeing view
Ray Strode [Thu, 24 Sep 2015 19:53:01 +0000 (15:53 -0400)] 
plugins: unset draw handler when freeing view

If the view is freed, we definitely shouldn't draw
the view's display anymore.

9 years agodevice-manager: activate new renderers after adding to renderers list
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.

9 years agoscript: only support one message at a time
Ray Strode [Mon, 26 Oct 2015 17:28:33 +0000 (13:28 -0400)] 
script: only support one message at a time

That's the other themes do, and callers
expect it.

9 years agotwo-step: don't tank in updates mode when there's no progress animations
Ray Strode [Mon, 26 Oct 2015 17:20:18 +0000 (13:20 -0400)] 
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.

9 years agoplymouth-populate-initrd: fix THEME_OVERRIDE with empty conf
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.

Resolves: RHBZ#1223344

9 years agomain: show cursor on crash
Ray Strode [Fri, 20 May 2016 20:16:27 +0000 (16:16 -0400)] 
main: show cursor on crash

In the event there's a crash we don't want the getty
started later to lack a cursor.

9 years agodevice-manager: Don't add local console to terminals hash table unless passed on...
Ray Strode [Thu, 6 Mar 2014 20:31:20 +0000 (15:31 -0500)] 
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.

9 years agoRevert "populate-initrd: support theme subfolders"
Ray Strode [Mon, 16 May 2016 16:13:19 +0000 (12:13 -0400)] 
Revert "populate-initrd: support theme subfolders"

This reverts commit 3a60023f26638d549c57bcf5b536d226fe0a2fd8.

9 years agodevice-manager: use device timeout instead of udev coldplug monitor
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.

https://bugs.freedesktop.org/show_bug.cgi?id=95356

9 years agopopulate-initrd: support theme subfolders
Ray Strode [Mon, 11 Apr 2016 11:47:07 +0000 (07:47 -0400)] 
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

9 years agolibply: unify get_device_scale() method in library
Cosimo Cecchi [Wed, 9 Sep 2015 22:32:27 +0000 (15:32 -0700)] 
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

9 years agolabel: add support for HiDPI
Giovanni Campagna [Sun, 22 Mar 2015 04:54:32 +0000 (21:54 -0700)] 
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

9 years agox11: allow testing the hidpi support code
Giovanni Campagna [Sun, 22 Mar 2015 04:44:43 +0000 (21:44 -0700)] 
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

9 years agotwo-step: fix drawing of background image
Giovanni Campagna [Sun, 22 Mar 2015 04:42:22 +0000 (21:42 -0700)] 
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

9 years agodrm: set a device scale of 2 on HiDPI
Giovanni Campagna [Sun, 18 Jan 2015 10:17:47 +0000 (02:17 -0800)] 
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

9 years agopixel-buffer: add the concept of a device scale
Giovanni Campagna [Sun, 18 Jan 2015 09:56:33 +0000 (01:56 -0800)] 
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

9 years agosplash-core: drop last vestigates of ply_seat_t
Ray Strode [Thu, 3 Mar 2016 19:30:58 +0000 (14:30 -0500)] 
splash-core: drop last vestigates of ply_seat_t

There's some left over goo.

9 years agopixel-buffer: use double instead of float for scale factor
Miroslav Urbanek [Wed, 18 Nov 2015 15:48:46 +0000 (10:48 -0500)] 
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.

10 years agoboot-splash: don't crash in free if module not loaded
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.

https://bugs.freedesktop.org/show_bug.cgi?id=91590

10 years agodevice-manager: force details if serial consoles are used
Ray Strode [Fri, 24 Jul 2015 20:23:00 +0000 (16:23 -0400)] 
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.

10 years agodevice-manager: decouple local console from output device
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.

10 years agodevice-manager: drop seat abstraction
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.

10 years agopixel-display: add getters for renderer data
Ray Strode [Wed, 22 Jul 2015 18:45:05 +0000 (14:45 -0400)] 
pixel-display: add getters for renderer data

These functions are useful for matching a pixel display
to its renderer.

10 years agokeyboard: track activeness
Ray Strode [Wed, 22 Jul 2015 14:05:51 +0000 (10:05 -0400)] 
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.

10 years agokeyboard: track activeness
Ray Strode [Wed, 29 Jul 2015 18:55:41 +0000 (14:55 -0400)] 
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.

10 years agorenderer: track activeness
Ray Strode [Wed, 22 Jul 2015 14:05:51 +0000 (10:05 -0400)] 
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.

10 years agoanimation,throbber: allow calling stop after animation is stopped
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.

Spotted by Dave Airlie

10 years agodrm: fix crasher in unload_backend
Ray Strode [Thu, 30 Jul 2015 19:55:28 +0000 (15:55 -0400)] 
drm: fix crasher in unload_backend

we were freeing the state struct and then closing items in it.

10 years agoscript: Don't draw backgrounds if they're obscured
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.

https://bugs.freedesktop.org/show_bug.cgi?id=87105

10 years agoply-image: Don't do alpha pre-multiplication for opaque pixels
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.

https://bugs.freedesktop.org/show_bug.cgi?id=87105

10 years agopixel-buffer: Optimize filling with opaque buffers
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.

https://bugs.freedesktop.org/show_bug.cgi?id=87105

10 years agopixel-buffer: add ability track opaqueness
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.

https://bugs.freedesktop.org/show_bug.cgi?id=87105