Commit graph

1875 commits

Author SHA1 Message Date
Ray Strode
1a0bfabbef main: reconsolidate loading and showing of splashes
Recently, loading a splash was separated from showing the
splash.  This ends up breaking fall back to the text splash,
because we don't know if we need to fall back until after
the default splash fails to show.

This commit recombines loading with showing.
2013-12-11 13:00:02 -05:00
Ray Strode
b654806fc1 device-manager: handle text fallback better
Right now, we'll wait indefinitely for graphics devices to show up
before showing the splash screen.

This means text splashes don't get shown, at all.

This commit changes the initial scan for graphics devices, to
include uninitialized ones. If there aren't any, then we fall
back. If there are some, we know an add event will be coming, so
we don't fall back. We still handle already initialized devices
right away.
2013-12-11 13:00:02 -05:00
Ray Strode
aaad73c396 systemd-units: ensure udevd is started before plymouthd
We need to make sure udevd is started before plymouthd since we
need to know that "queue is empty" means "coldplug complete" not
"coldplug hasn't started yet".
2013-12-11 13:00:02 -05:00
Ray Strode
6fbb99ef71 configure: build with -Wno-unused-result
It creates too many spurious warnings that will need to get mopped
up some day, but not today.
2013-12-10 08:48:39 -05:00
Ray Strode
a3937c8c37 configure: remove tests/ references from configure
A few commits back I dropped the bitrotted, not-unittized,
tests, but forgot to take the tests directories out of configure.

This commit fixes that.
2013-12-10 08:08:50 -05:00
Ray Strode
e982dc255c branch-merge: land udev support
A certain class of machines don't work in plymouth because
they draw the kernel console to /dev/dri/card1 instead of
/dev/dri/card2.

This branch fixes that, by adding support for querying udev
to determine the available drm devices.

As part of this effort, some clean up was performed:

1) a bunch of bit rotted tests were removed
2) large chunks of code were moved from main.c to helper
objects implemented in other files.
3) Other parts of main.c were moved around or refactored
so they were easier to read.

Based on work from Kevin Murphy <kemurphy.cmu@gmail.com>

https://bugs.freedesktop.org/show_bug.cgi?id=25943
2013-12-10 01:40:31 -05:00
Ray Strode
90a23b832d systemd: don't call udevadm settle before show-splash
Since we're monitoring udev explicitly now, we have no
need to block the client show-splash request until graphics
devices settle.

This commit removes the udevadm calls from plymouth-start.service.
2013-12-10 01:01:34 -05:00
Ray Strode
487092edd4 main: provide way to toggle udev device enumeration off
We don't want to use udev for device enumeration if:

1) DISPLAY is set (since we're going to use the X11 renderer)
2) if it's disabled explicitly on the kernel command line

This commit adds support for those two things.
2013-12-10 01:01:34 -05:00
Ray Strode
c66c207d2e device-manager: add support for udev device enumeration
At the moment, we hardcode /dev/dri/card0 for the DRM device.
This works well enough in the lion's share of cases, but there are cases
where it falls over.  Namely, machines with multiple GPUs, such as
optimus hardware, sometimes end up with the kernel fb console going to
/dev/dri/card1.

Rather than trying /dev/dri/card0 then /dev/dri/card1 etc in succession,
this commit, instead, adds support for querying udev for the
information.
2013-12-10 01:01:33 -05:00
Ray Strode
83c59f344e renderer: add way to get device_name that was passed to constructor
It's useful to be able to figure out which renderer a given renderer
is, by examining the device that is associated with it.

This commit adds and accessor function to return the device that
was passed to ply_renderer_new.

At the moment, it does not return the device name if NULL was passed
to the constructor and the device was figured out automatically.  A
future commit may add that ability if it becomes necessary.
2013-12-10 01:01:33 -05:00
Ray Strode
42d885c83b configure: add libudev dependency
We're going to want to support multiple graphics devices, as
specified by udev.

This first commit, merely adds the libudev dependency to the
build goo.
2013-12-10 01:01:33 -05:00
Ray Strode
f1f54ff1be frame-buffer: support activating without a terminal
This is the same as the previous drm commit, but for
the frame-buffer backend.
2013-12-10 01:01:33 -05:00
Ray Strode
27f6e5f3f8 drm: support activating without terminal
If there are multiple DRM devices, only one
can really be reading from the terminal at a time.

We currently punt this issue by ignoring all but
the first drm device.

In preparation for supporting more than one DRM device,
we need to come up with a solution.

This commit changes the DRM renderer plugin to allow getting
a NULL terminal.  In this way, we can assign the terminal to
one of the DRM cards, but still output to the others.

Note, we never pass NULL for a terminal yet, that comes later.
2013-12-10 01:01:33 -05:00
Ray Strode
c17a836b77 main: use new device manager class
Now that we have a class for managing our seats, let's use it.
This gets a lot of the nitty gritty logic out of main.c and
paves the way for us to do smartcard device management going
forward.
2013-12-10 01:01:30 -05:00
Ray Strode
edd0335d45 splash-core: add device manager class
There's quite a bit of logic for managing input and output in
main.c right now.  That code is already a bit too complicated,
but will get even more complicated going forward if we want
to add udev support, etc.

In an effort to keep things from getting too unwieldly, this
commit breaks out a lot of the logic into a new
ply-device-manager class.

A subsequent commit will make main.c use the new class.
2013-12-10 00:16:00 -05:00
Ray Strode
321d553c9c main: move show_messages into show_theme
Everywhere we call show_theme we call show_messages immediately,
afterward.

Since showing the messages on the theme is arguable part of showing
it, this commit moves show_messages into the show_theme function.
2013-12-10 00:16:00 -05:00
Ray Strode
1c715945f2 main: refactor on_show_splash
Now that showing the theme is separated out, this
commit refactors on_show_splash to move the splash
loading specific bits to its own function.
2013-12-10 00:15:59 -05:00
Ray Strode
c203bb1250 main: refactor show_*_splash
Right now show_default_splash and show_detailed_splash,
load the relevant splash and then show it.

This commit drops the "show" part and renames the functions to
load_default_splash and load_detailed_splash, respectively.

It, of course, also updates the callers to call show_theme
explicitly.

This refactorization will make it easier to later move device
management out of main.c
2013-12-10 00:15:59 -05:00
Ray Strode
df6708ef3d boot-splash: strip out old api
Now that main.c is attaching seat objects to the boot splash,
instead of the seat's individual components, we can drop the
apis that allow doing things piecewise.
2013-12-10 00:15:59 -05:00
Ray Strode
b8883565dd main: port over to seat objects
We create one seat object for the main display and one seat
for each serial console.
2013-12-10 00:15:59 -05:00
Ray Strode
24a21ee0f3 boot-splash: add support for seat objects
ply_boot_splash_t currently gets notified about displays and keyboard
objects to pass along to the splash plugins.

Now that we have a ply_seat_t object that can encapsulate display
and keyboard objects, we should add support to ply_boot_splash_t for
using it.

This commit does that. For now, it does it without changing the plugin
interface (which is still in terms of displays and keyboards).

Note, this commit only adds support for seat objects to
ply_boot_splash_t. It doesn't actually change any of the calling code
to use that support. That will come in a subsequent commit.
2013-12-10 00:15:59 -05:00
Ray Strode
a36c0bec2b splash-core: add new seat object
Right now we maintain parallel lists of displays in several different
layers of code.

This commit introduces a "seat" object to encapsulate a set of displays,
and associated input device.

A subsequently commit will actually change the code over to use the
seat object.
2013-12-09 12:47:17 -05:00
Ray Strode
a6eddfd839 main: get rid of start_boot_splash
start_boot_splash is a convenience function that's going to
get in the way in the future.  It also has the annoying
"boolean argument" problem that load_theme had.

This commit gets rid of start_boot_splash entirely.
2013-12-09 11:38:23 -05:00
Ray Strode
09428a1b01 main: drop fall back feature of load_theme
load_theme currently takes a boolean that if true, will
make it load the built-in "details" plugin if the main plugin
fails to load.

Boolean arguments are hard to read, so this commit drops it.
2013-12-06 16:24:30 -05:00
Ray Strode
731db96ca3 main: load built-in theme instead of details plugin
We already have the details theme "built" in, so there's
little point in loading the details.so plugin when we want
details internally.

This commit fixes that.
2013-12-06 16:23:49 -05:00
Ray Strode
6e99200ce2 main: split start_boot_splash up into two functions
Right now start_boot_splash loads the theme, then
shows it.

It's going to be useful in the future to preload the
theme, so this commit breaks the two operations out
into two functions, load_theme and show_theme,
and makes start_boot_splash just call those two
functions.
2013-12-06 16:23:45 -05:00
Ray Strode
7bdd4fc0e1 main: don't unredirect /dev/console from on_show_splash
The code that's there, doesn't make much sense, so this
commit removes it.
2013-12-05 13:11:16 -05:00
Ray Strode
68fd7da44c main: require /sys/class/tty/console/active to have plymouth on serial consoles
This commit drops the aging fallback code for when
/sys/class/tty/console/active is unavailable.

This should have no impact for people running recent kernels, and
minimal impact for people running old kernels.
2013-12-05 13:11:13 -05:00
Ray Strode
3a356a450f tests: drop for now
They're fairly bitrotten, don't tie into make check,
and aren't that useful.

Drop them for now, until we can come up with a better
story.
2013-12-03 13:50:34 -05:00
Ray Strode
9b211cb173 boot-splash: set KD_TEXT from main instead of boot_splash object
Now that debugging keybindings are gone, ply-boot-splash is really
just a wrapper around splash plugins.  As such, it doesn't really
make sense to be mucking with terminal objects from it.

This commit moves that mucking to main until I can find a better
destination for it.
2013-12-03 13:50:34 -05:00
Ray Strode
ca0b7cc87d boot-splash: drop debugging keybindings
The boot splash currently lets the user hit ctrl-L to refresh,
ctrl-T to force text mode, and ctrl-V to toggle verbose messages.

These easter eggs are undocumented and really only used when I
was first writing plymouth.

These days it's just taking up space, so drop it.
2013-12-03 13:50:34 -05:00
Ray Strode
a20a99790c main: maintain better accounting of terminals
Currently terminals are created in the main file and passed
down to other layers, with no direct reference maintained in
the main file.

There are points when we need to get references to all those
terminals again, and we have to fish them out from other layers.

This commit makes it all more explicit, maintaining the terminals
in a hash table in the main state object.
2013-12-03 13:50:30 -05:00
Ray Strode
27f0711414 hashtable: add get_size method
Right now there's no easy way to know if a hash table is empty,
which I'm going to need in a future commit.

This commit adds a get_size method to return the number of items in
the hash table.
2013-12-03 10:51:32 -05:00
Ray Strode
c72bf93546 terminal: add new get_name() method
The name is passed in at construct time, but it gets canonicalized.

This commit adds api to get the final name. The api is also useful,
since it prevents callers that need the mapping from having to maintain
it separately, which will be good for a future clean up.
2013-12-03 10:51:32 -05:00
Ray Strode
67addd18e3 renderer: use enum for selecting renderer type, not plugin path
ply_renderer_new takes a path to a renderer plugin, or NULL to
try each one in turn.

It's cleaner to abstract the path behind an enum type, so this
commit makes that change.

Now it will be possible to instantiate specific renderers without
hardcoding the paths to plugins in more than one place.
2013-12-03 10:51:32 -05:00
Ray Strode
43583e44dc main: drop check_for_consoles call at startup
It was only used to make kernel_console_tty get set,
which we no longer have.
2013-12-03 10:51:32 -05:00
Ray Strode
6b2b068e04 main: drop kernel_console_tty
We aren't actually really using it anymore.  It gets checked
in on place in the debugging code, but only before it's set.

This commit drops it.
2013-12-03 10:51:32 -05:00
Ray Strode
63e9b4faee main: drop parameters for check_for_consoles function
both the default tty and whether or not displays should be added
are available in the global state object (as state->default_tty
and state->is_shown respectively), so they don't need to be parameters.

The latter one was a boolean, so having it as a parameter was confusing
at the call sites.

This commit drops the parameters.
2013-12-03 10:51:32 -05:00
Daniel Drake
10e0810976 drm: simplify device open
libdrm's open functions are just wrappers around open(), and our
detection of which parameter to pass to drmOpen() is not 100%
reliable.

Simplify the code and just call open() directly.

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=71590
2013-12-03 10:28:07 -05:00
Ray Strode
37d2e400d2 systemd-units: don't timeout the plymouth waiting
A timeout causes things to fail, so we shouldn't timeout.
2013-11-15 12:41:59 -05:00
Ray Strode
540ae58fe0 two-step: fix unlock screen
The previous commit introduced a bug where the unlock screen won't
get shown if it's requested within the first 5 seconds of startup.

This commit fixes that by forcing a redraw if the state switches from
NORMAL.
2013-11-08 08:39:37 -05:00
Ray Strode
17976ac538 two-step: introduce delayed startup
Many machines these days can boot in 5 seconds or less.
In those cases, there's little point in showing a boot splash.

This commit introduces a StartupDelay option to the two step
plugin to prevent it from displaying anything for a few seconds.
2013-10-25 16:24:47 -04:00
Ray Strode
a834730ce7 two-step: add support for watermark
The watermark is overlaid on top of the background but below all the
other content.
2013-10-24 09:33:17 -04:00
Ray Strode
b817332e2a two-step: delete extraneous log spew 2013-10-23 20:19:35 -04:00
Ray Strode
73695b0979 two-step: add support for tiled background image
If there's a file named background-tile.png in the theme
then it will get used as the background behind the other
content in place of the background gradient.
2013-10-23 17:00:25 -04:00
Ray Strode
051c935ab8 ply-image: add tiling support
This follow up commit adds tiling support to images, so
that splash screens can have been background patterns instead
of just background colors.
2013-10-23 15:55:52 -04:00
Ray Strode
4bdf650605 pixel-buffer: add tiling function
It can be useful to tile a group of pixels across the screen
(for e.g. backgrounds).

This commit adds API to pixel buffer to do that tiling.

A follow up commit will add support into ply-image so images can
be loaded from disk and then tiled on screen.
2013-10-23 15:55:52 -04:00
Ray Strode
c5a9005b1c configure: add back --enable-tracing
It was accidentally removed, when dropping device specific drm support.
2013-10-23 15:55:06 -04:00
Matthias Clasen
efc285dab8 docs: add docbook based man pages
This commit adds man pages for the plymouthd and plymouth client
commands.
2013-10-21 17:56:45 -04:00
Ray Strode
319448f651 scripts: make plymouth-update-initrd somewhat more useful
plymouth-update-initrd is a script that should probably be eventually
dropped.  It was originally created to unpack and initrd and graft
plymouth in.  Later, it just became a thin wrapper around mkinitrd.

These days, very few (any?) distros use mkinitrd.  Change it to call
dracut instead.

Relevant irc log:

<newfo> this is SO WRONG:
http://cgit.freedesktop.org/plymouth/tree/scripts/plymouth-update-initrd
<newfo> it won't work on any distro
<newfo> would you mind updating that please?
<newfo> replace the mkinitrd line in
/usr/libexec/plymouth/plymouth-update-initrd to  dracut -f
/boot/initramfs-$(uname -r).img $(uname -r)
<-- newfo has quit (Client Quit)
2013-10-15 09:52:46 -04:00