1440 is only 33% more then FHD, so using 2x there is a bit too much and
leads to the spinner being much too large on e.g 27" monitors.
And on e.g. Dell ultrawide 34" 3440x1440 which are only 110 DPI this effect
is even worse.
Change the threshold to >= 2880x1620 to avoid using 2x scaling on 1440p
monitors. 2880x1620 is ~240DPI when used in a 14" laptop at which point
using 2x scaling is really necessary.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
3:2 screens are only used in mobile form factors, add a special case for
this with a lower threshold to enable 2x hiDPI scaling.
Also remove the HIDPI_MIN_* defines these were only used in one place
and adding a second set for the 3:2 screens just makes things harder
to read.
Instead write the actual width/height thresholds directly in the code
of the new get_device_scale_guess () helper.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Swap width <-> height for portrait screens when guessing device-scale,
this fixes the heuristics not working for portrait screens.
Also move the heuristics to a new get_device_scale_guess () helper, because
it has become a bit larger now.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
The comment about why SimpleDRM devices should be skipped is no longer
accurate, the kernel does provide rotation info now; and plymouth now
has heuristics to guess the device-scale.
If SimpleDRM devices should be used or not now mostly is a user
preference.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Sometimes the EFI firmware initializes the framebuffer at a very low
resolution rather then at the panel's native resolution.
In this case it is better to wait for the native GPU driver to load
rather then rendering a not-so-pretty splash at this very low resolution.
Reject these low resolutions for simpledrm devices except when
query_device () is called with force=true.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Sometimes a renderer plugin may want to refuse to open a device
because it has suboptimal settings, like e.g. an EFI framebuffer
based simpledrm when the EFI firmware has set the resolution to
800x600 instead of the native panel resolution.
In such a case it might be better to wait for another better
/dev/dri/card# device to show up.
This skipping of devices by renderer plugins needs to be configurable
in case the timeout hits, or the user wishes to override things.
Add a force argument to ply_renderer_open () to allow overriding
this behavior. User can force using simpledrm by passing
plymouth.use-simpledrm=2 on the kernel commandline or by setting
UseSimpledrm=2 in the config-file.
This flag is passed to the renderer plugin's query_device () method
as that is the best place for the renderer plugin to determine
a device's usability.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Move the handling of the "plymouth.use-simpledrm" commandline argument from
ply-device-manager to main.c, and allow specifying its default value in
the "[Daemon]" section of the config-file using a new UseSimpledrm keyword.
Extend the "plymouth.use-simpledrm" handling to also accept a value e.g.
"plymouth.use-simpledrm=0" to allow overriding a "UseSimpledrm=1" in
the configfile.
And pass the use-simpledrm value to ply_device_manager_new () through a new
PLY_DEVICE_MANAGER_FLAGS_USE_SIMPLEDRM flag.
This also moves the kernel commandline handling to src/main.c grouping
it together with most of the other commandline handling.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
main () calls functions to get the theme and other config settings from
the commandline / config files in order of *descending* priority:
1. find_override_splash () /* Parses commandline */
2. find_system_default_splash () /* /etc/plymouth/plymouthd.conf */
3. find_distribution_default_splash () /* /usr/share/plymouth/plymouthd.defaults */
To avoid the later parsed config files *with lower priorities* overriding
earlier settings the code initializes the config variables to NAN and only
sets them if they are still set to NAN.
Except for the device_scale handling, where load_settings () always calls
ply_set_device_scale () overriding earlier values, the commandline
handling for "plymouth.force-scale=..." is done separately later so that
the commandline does take priority over the config files, but since
/usr/share/plymouth/plymouthd.defaults is parsed last any DeviceScale
setting there will override /etc/plymouth/plymouthd.conf settings.
Fix this by following the pattern used by start_time/splash_delay/
device_timeout, add a device_scale variable initialized to -1 and
only override that variable if it is at -1.
This also allows removing find_force_scale () moving the commandline
parsing to find_override_splash () together with the other commandline
handling.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Change ply_key_file_get_long () into ply_key_file_get_ulong () and add
error checking.
All callers of ply_key_file_get_long () expect a positive / unsigned number.
Rename it to ply_key_file_get_ulong ().
Also add error checkig for non valid numbers and return the default value
for these instead of 0.
Note this also fixes the return value of ply_key_file_get_long () being
a double (this is now changed to an unsigned long).
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Run keymap-render.py to update the pre-rendered keymap used by
ply-keymap-icon.c.
This adds 2 new console keymaps: "mod" and "nz" and 1 new xkb keymap:
"English (New Zealand)".
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
When using evdev support the XKB keymap name (with variant) for Dvorak
users will be e.g. "US (Dvorak)". The Dvorak layouts are not described
in /usr/share/X11/xkb/rules/evdev.xml, so these are not added to
ply-keymap-metadata.h / keymap-render.png .
For the console-keymap case dvorak is handled specially in:
keymap-render.py:normalize_keymaps()
ply-keymap-icon.c:ply_keymap_normalize_keymap()
mapping all keymap-names with a lowercase dvorak in there to "dvorak",
change this special handling to be case-insensitive so that it also works
for the xkb-keymap case.
Note the keymap-render.py change really is a no-op since keymap-render.py
only calls normalize_keymaps() on console-keymaps which are always
lower-case. normalize_keymaps() should still be updated though to keep
the 2 functions in sync.
Link: https://bugzilla.redhat.com/show_bug.cgi?id=2341810
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Bold monospace fonts are prominently used in the console output printed
by systemd. Without them, the output looks incorrect compared to pango.
This still is far from a complete implementation of rich text, but
brings label-freetype much closer to what label-pango does for the
default theme.
This commit introduces a glyph_face variable in load_glyphs() that holds
the correct face for the current glyph (label->face or
label->bold_face). This face is then passed on to load_glyph() and
finish_measuring_line() to ensure correct font measurements.
Since commit 48881ba2ef plymouth
goes into GRAPHICS mode early on. Unfortunately, there are cases
where it neglects to go back to TEXT mode when quitting. That can
happen if boot finishes before the splash screen is created.
This commit fixes that.
This is possible on some kernels that were built with CONFIG_NULL_TTY enabled, and were booted with console=ttynull
/sys/class/tty/console/active is empty in this case, so the file being empty is not always an error worth logging