diff -Nru plymouth-24.004.60/debian/changelog plymouth-24.004.60/debian/changelog --- plymouth-24.004.60/debian/changelog 2024-03-19 07:14:11.000000000 +0100 +++ plymouth-24.004.60/debian/changelog 2024-03-21 14:46:56.000000000 +0100 @@ -1,3 +1,16 @@ +plymouth (24.004.60-1ubuntu6) noble; urgency=medium + + * Cherry-pick upstream fixes for consistent default scale selection + that matches what Mutter chooses on the login screen (LP: #2054769) + * plymouth.hook: Stop automatically re-installing DRM kernel modules in + initrd. initramfs-tools already does this for us in hooks/framebuffer and + should be the authority for which drivers to include. + * Install a /usr/share/initramfs-tools/conf-hooks.d/plymouth with + FRAMEBUFFER=y to make it clear to initramfs-tools that we always want + framebuffer support when Plymouth is installed. (LP: #1970069) + + -- Daniel van Vugt Thu, 21 Mar 2024 14:46:56 +0100 + plymouth (24.004.60-1ubuntu5) noble; urgency=medium * No-change rebuild against libgtk-3-0t64 @@ -3594,4 +3607,3 @@ * Initial release (Closes: #506899). -- Daniel Baumann Sat, 07 Feb 2009 19:02:00 +0100 - diff -Nru plymouth-24.004.60/debian/local/plymouth.conf plymouth-24.004.60/debian/local/plymouth.conf --- plymouth-24.004.60/debian/local/plymouth.conf 1970-01-01 01:00:00.000000000 +0100 +++ plymouth-24.004.60/debian/local/plymouth.conf 2024-03-21 14:46:03.000000000 +0100 @@ -0,0 +1,3 @@ +# We would like graphics drivers installed to start the Plymouth splash screen +# as early as possible. +FRAMEBUFFER=y diff -Nru plymouth-24.004.60/debian/local/plymouth.hook plymouth-24.004.60/debian/local/plymouth.hook --- plymouth-24.004.60/debian/local/plymouth.hook 2024-02-07 12:32:30.000000000 +0100 +++ plymouth-24.004.60/debian/local/plymouth.hook 2024-03-21 14:46:03.000000000 +0100 @@ -166,29 +166,6 @@ ;; esac -# add drm modules -MODULES_EXCLUDE="mga r128 savage sis tdfx via panfrost" -if [ "$MODULES" = "dep" ]; then - for DRM_DEVICE in "/sys/class/drm"/*; do - DRM_DEVICE="$(readlink -f "$DRM_DEVICE")" || continue - MODULE_PATH="$(readlink -f "$DRM_DEVICE/device/driver/module")" || continue - MODULE_NAME="$(basename "$MODULE_PATH")" || continue - - for m in $MODULES_EXCLUDE; do - if [ "$MODULE_NAME" = "$m" ]; then - continue 2 - fi - done - - sys_walk_mod_add "$DRM_DEVICE" \ - || echo "W: plymouth: couldn't include modules for '$DRM_DEVICE'" - done -elif [ "$MODULES" = "list" ]; then - echo "W: plymouth: not including drm modules since MODULES=list" -else - copy_modules_dir kernel/drivers/gpu/drm $MODULES_EXCLUDE -fi - # copy renderers copy_exec /usr/lib/@DEB_HOST_MULTIARCH@/plymouth/renderers/frame-buffer.so copy_exec /usr/lib/@DEB_HOST_MULTIARCH@/plymouth/renderers/drm.so diff -Nru plymouth-24.004.60/debian/patches/0016-ply-utils-Match-mutter-s-default-device-scale-choice.patch plymouth-24.004.60/debian/patches/0016-ply-utils-Match-mutter-s-default-device-scale-choice.patch --- plymouth-24.004.60/debian/patches/0016-ply-utils-Match-mutter-s-default-device-scale-choice.patch 1970-01-01 01:00:00.000000000 +0100 +++ plymouth-24.004.60/debian/patches/0016-ply-utils-Match-mutter-s-default-device-scale-choice.patch 2024-03-21 14:43:58.000000000 +0100 @@ -0,0 +1,98 @@ +From: Daniel van Vugt +Date: Tue, 27 Feb 2024 14:47:59 +0800 +Subject: ply-utils: Match mutter's default device scale choice + +Until now, laptops with a DPI between 192 and 202 would be given a +default scale of 2 by Plymouth, and 1 by Mutter for the login screen. +That made the visual transition a bit ugly so let's match Mutter's +default scale selection. This means the threshold for laptops is now +1.5 x 135 = 202 DPI instead of 192 DPI. And for desktop monitors it's +now 1.5 x 110 = 165 DPI instead of 192 DPI. + +Origin: Upstream commit acf97c73670b80a65329aaa35e40438d86fca3c6 +Bug-Ubuntu: https://bugs.launchpad.net/bugs/2054769 +Forwarded: not-needed +Last-Update: 2024-03-08 +--- + src/libply/ply-utils.c | 40 ++++++++++++++++++++++------------------ + 1 file changed, 22 insertions(+), 18 deletions(-) + +diff --git a/src/libply/ply-utils.c b/src/libply/ply-utils.c +index 463f61c..ad816f1 100644 +--- a/src/libply/ply-utils.c ++++ b/src/libply/ply-utils.c +@@ -29,6 +29,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -1001,8 +1002,6 @@ ply_set_device_scale (int device_scale) + ply_trace ("Device scale is set to %d", device_scale); + } + +-/* The minimum resolution at which we turn on a device-scale of 2 */ +-#define HIDPI_LIMIT 192 + #define HIDPI_MIN_HEIGHT 1200 + #define HIDPI_MIN_WIDTH 2560 /* For heuristic / guessed device-scale */ + +@@ -1019,8 +1018,8 @@ get_device_scale (uint32_t width, + uint32_t height_mm, + bool guess) + { +- int device_scale; +- double dpi_x, dpi_y; ++ int device_scale, target_dpi; ++ float diag_inches, diag_pixels, physical_dpi, perfect_scale; + const char *force_device_scale; + + device_scale = 1; +@@ -1031,11 +1030,10 @@ get_device_scale (uint32_t width, + if (overridden_device_scale != 0) + return overridden_device_scale; + +- if (height < HIDPI_MIN_HEIGHT) +- return 1; +- +- if (guess) +- return (width >= HIDPI_MIN_WIDTH) ? 2 : 1; ++ if (guess) { ++ return (width >= HIDPI_MIN_WIDTH && ++ height >= HIDPI_MIN_HEIGHT) ? 2 : 1; ++ } + + /* Somebody encoded the aspect ratio (16/9 or 16/10) + * instead of the physical size */ +@@ -1045,15 +1043,21 @@ get_device_scale (uint32_t width, + (width_mm == 16 && height_mm == 10)) + return 1; + +- if (width_mm > 0 && height_mm > 0) { +- dpi_x = (double) width / (width_mm / 25.4); +- dpi_y = (double) height / (height_mm / 25.4); +- /* We don't completely trust these values so both +- * must be high, and never pick higher ratio than +- * 2 automatically */ +- if (dpi_x > HIDPI_LIMIT && dpi_y > HIDPI_LIMIT) +- device_scale = 2; +- } ++ if (width_mm == 0 || height_mm == 0) ++ return 1; ++ ++ diag_inches = sqrtf (width_mm * width_mm + height_mm * height_mm) / ++ 25.4f; ++ diag_pixels = sqrtf (width * width + height * height); ++ physical_dpi = diag_pixels / diag_inches; ++ ++ /* These constants are copied from Mutter's meta-monitor.c in order ++ * to match the default scale choice of the login screen. ++ */ ++ target_dpi = (diag_inches >= 20.f) ? 110 : 135; ++ ++ perfect_scale = physical_dpi / target_dpi; ++ device_scale = (perfect_scale > 1.5f) ? 2 : 1; + + return device_scale; + } diff -Nru plymouth-24.004.60/debian/patches/0017-ply-utils-Only-choose-scale-2-when-the-perfect-scale.patch plymouth-24.004.60/debian/patches/0017-ply-utils-Only-choose-scale-2-when-the-perfect-scale.patch --- plymouth-24.004.60/debian/patches/0017-ply-utils-Only-choose-scale-2-when-the-perfect-scale.patch 1970-01-01 01:00:00.000000000 +0100 +++ plymouth-24.004.60/debian/patches/0017-ply-utils-Only-choose-scale-2-when-the-perfect-scale.patch 2024-03-21 14:43:58.000000000 +0100 @@ -0,0 +1,32 @@ +From: Daniel van Vugt +Date: Tue, 5 Mar 2024 17:51:11 +0800 +Subject: ply-utils: Only choose scale 2 when the perfect scale would be >= + 1.75 + +This is the intended design documented in: +https://gitlab.gnome.org/GNOME/mutter/-/commit/d03dce43786d + +And discussed in: +https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3616 + +Origin: Upstream commit 3b8e918479f47a845d4f88d281f7dfe412195628 +Improves: https://bugs.launchpad.net/bugs/2054769 +Forwarded: not-needed +Last-Update: 2024-03-08 +--- + src/libply/ply-utils.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/libply/ply-utils.c b/src/libply/ply-utils.c +index ad816f1..44a9309 100644 +--- a/src/libply/ply-utils.c ++++ b/src/libply/ply-utils.c +@@ -1057,7 +1057,7 @@ get_device_scale (uint32_t width, + target_dpi = (diag_inches >= 20.f) ? 110 : 135; + + perfect_scale = physical_dpi / target_dpi; +- device_scale = (perfect_scale > 1.5f) ? 2 : 1; ++ device_scale = (perfect_scale >= 1.75f) ? 2 : 1; + + return device_scale; + } diff -Nru plymouth-24.004.60/debian/patches/series plymouth-24.004.60/debian/patches/series --- plymouth-24.004.60/debian/patches/series 2024-02-07 11:47:47.000000000 +0100 +++ plymouth-24.004.60/debian/patches/series 2024-03-21 14:46:03.000000000 +0100 @@ -13,3 +13,5 @@ ubuntu-text.patch spinfinity-no-meson-symlink.patch renderers-Do-not-assume-all-keyboards-have-LEDs.patch +0016-ply-utils-Match-mutter-s-default-device-scale-choice.patch +0017-ply-utils-Only-choose-scale-2-when-the-perfect-scale.patch diff -Nru plymouth-24.004.60/debian/rules plymouth-24.004.60/debian/rules --- plymouth-24.004.60/debian/rules 2024-02-07 12:32:30.000000000 +0100 +++ plymouth-24.004.60/debian/rules 2024-03-21 14:46:03.000000000 +0100 @@ -69,6 +69,7 @@ # Adding initramfs-tools integration install -D -m 0755 debian/local/plymouth.hook debian/plymouth/usr/share/initramfs-tools/hooks/plymouth sed -i -e 's|@DEB_HOST_MULTIARCH@|$(DEB_HOST_MULTIARCH)|g' debian/plymouth/usr/share/initramfs-tools/hooks/plymouth + install -D -m 0644 debian/local/plymouth.conf debian/plymouth/usr/share/initramfs-tools/conf-hooks.d/plymouth install -D -m 0755 debian/local/plymouth.init-premount debian/plymouth/usr/share/initramfs-tools/scripts/init-premount/plymouth install -D -m 0755 debian/local/plymouth.init-bottom debian/plymouth/usr/share/initramfs-tools/scripts/init-bottom/plymouth install -D -m 0755 debian/local/plymouth.panic debian/plymouth/usr/share/initramfs-tools/scripts/panic/plymouth