Commit graph

2067 commits

Author SHA1 Message Date
Ulrich Ölmann
2b5b27cbdc client: fix typo in help text
Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de>
2018-05-17 15:24:43 -04:00
Ulrich Ölmann
99dc44e212 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>
2018-05-17 15:24:08 -04:00
Ray Strode
0c006993a4 wip! renderer: add disown method 2018-05-08 16:44:46 -04:00
Ray Strode
78cf571066 fixup! utils: add function for running program 2018-05-01 16:33:48 -04:00
Ray Strode
f083f0a150 wip! main: run plymouth-drm-escrow when switching to initrd 2018-04-26 13:22:27 -04:00
Ray Strode
c59b031980 main: reap zombies
Now that we have the ability to run a child we should make sure
that zombie children get reaped.
2018-04-26 12:42:20 -04:00
Ray Strode
0faf4c82bf 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.
2018-04-26 12:36:31 -04:00
Ray Strode
55186d76ab 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.
2018-04-26 10:45:39 -04:00
Ray Strode
82b2b09639 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.
2018-04-26 10:41:22 -04:00
Ray Strode
12b03bf60e 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.
2018-04-26 10:15:14 -04:00
Ray Strode
555257c74f 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.
2018-04-10 16:40:06 -04:00
Hans de Goede
4992f06138 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.
2018-04-10 11:35:42 -04:00
Hans de Goede
d769f1194c 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
2018-04-10 11:32:59 -04:00
Hans de Goede
a6f25b7276 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
2018-04-10 11:32:58 -04:00
Hans de Goede
0e4e268844 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
2018-04-10 11:32:55 -04:00
Hans de Goede
da27e42316 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
2018-04-10 11:32:52 -04:00
Ray Strode
6e9e95dc0f device-manager: drop superfluous create_pixel_displays_for_renderer call
commit 29e2763769 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
2017-12-20 10:51:10 -05:00
Ray Strode
e953e47216 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
2017-12-11 10:41:44 -05:00
zhaoqiang
fa66a5b667 INSTALL: Fix a spelling error in the command example
https://bugs.freedesktop.org/show_bug.cgi?id=103995
2017-11-30 09:10:46 -05:00
mike@mgoodwin.net
8982822bd8 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
2017-11-09 13:23:24 -05:00
Ray Strode
bdfcf889f8 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
2017-11-07 13:57:39 -05:00
Daniel Baumann
f9425978e1 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
2017-08-24 11:42:24 -04:00
Sakaki
e12b5ee34c terminal: add include for sysmacros.h
That file is, in some cases, not included implicitly by sys/types.h.

This commit explicitly includes it.
2017-08-18 10:10:49 -04:00
Ray Strode
3a9334edbb configure: bump to 0.9.4 2017-08-09 09:16:52 -04:00
Ray Strode
ca06f77036 terminal-session: don't delete boot.log
We want to append to it now.
2017-05-11 16:46:33 -04:00
Ray Strode
1fa54b06c7 Revert "Make boot.log world readable by default"
This reverts commit fc5cd88767.

It's better to let the admin of the system decide the permissions,
than forcefully change them.
2017-05-11 10:52:55 -04:00
Ray Strode
6fd5c6b260 Revert "main: don't allow ESC key repeat to flood console"
This reverts commit 1f1d83bf71.
2017-04-24 16:16:47 -04:00
João Paulo Rechi Vita
11b0ce04de 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>
2017-04-07 11:43:58 -04:00
João Paulo Rechi Vita
6535986079 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>
2017-04-07 11:43:45 -04:00
Ray Strode
61ae21f1e8 Revert "Recreate boot log at each boot instead of appending"
This reverts commit 9abbd88835.

I'm getting requests to keep old boot logs around.  If anyone
wants to carve up boot.log, they can just use logrotate.d
2017-03-24 15:15:03 -04:00
Ray Strode
1f1d83bf71 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.
2017-03-24 15:12:12 -04:00
Ray Strode
63148b20a1 x11: implement get_display_name
For completeness, implement get_display_name in the x11 renderer too.
2017-01-18 13:09:53 -05:00
Ray Strode
8d1764981b drm: implement get_display_name
This just allows the drm plugin to work if udev is disabled.
2017-01-18 13:09:02 -05:00
Lukas Rusak
d1912192f2 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.
2017-01-18 12:56:26 -05:00
Ray Strode
e4f86e3cbe 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.
2017-01-18 12:53:58 -05:00
Ray Strode
fdda9af2c3 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.
2017-01-18 10:08:36 -05:00
Ray Strode
18dd75589b 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
2016-12-15 14:24:40 -05:00
Ray Strode
0503571895 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
2016-12-15 14:24:34 -05:00
Michael Kuhn
e4b7e4955c 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
2016-08-23 10:01:33 -04:00
Michael Kuhn
91b983277c 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
2016-08-23 10:01:29 -04:00
Michael Kuhn
a4226bd054 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
2016-08-23 09:58:59 -04:00
Ray Strode
0e65b86c68 configure: switch to tar.xz instead tar.bz2
It's 2016 after all.
2016-06-20 15:53:49 -04:00
Ray Strode
8efc272a7a systemd-units: Fix uninstall script
This commit fixes some typos in the uninstall: target
2016-06-20 15:53:48 -04:00
Ray Strode
ad9f1b7da6 build-goo: don't install systemd units during distcheck 2016-06-20 15:53:48 -04:00
Ray Strode
3ceaf08b97 logger: stop using carriage returns
I believe we fixed up tty settings sometime ago such that we don't
need carriage returns anymore.
2016-06-20 13:46:34 -04:00
Ray Strode
041ea9a59c 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.
2016-06-20 13:45:37 -04:00
Ray Strode
3cb0ac59ed 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().
2016-06-20 11:06:49 -04:00
Daniel Drake
adaa298965 device-manager: probe existing DRM devices at startup
A regression introduced in 7e37d58be3
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
2016-06-17 10:30:25 -04:00
Ray Strode
c207314659 terminal: always open terminal in non-blocking mode
In theory this is safer since open calls can block
indefinitely without O_NONBLOCK.
2016-06-16 15:23:15 -04:00
Ray Strode
fd66c69030 text: don't draw if not animating
That can cause an unrecoverable crash.
2016-06-16 15:08:04 -04:00