From 0e56037ed66b498fb82cfd023fe9006f010238d4 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Fri, 19 Jul 2019 11:48:32 +0200 Subject: [PATCH] One more patch for dealing with some devices with a non-upright mounted LCD-panel (rhbz#1730783) --- plymouth-more-updates.patch | 57 +++++++++++++++++++++++++++++++++++++ plymouth.spec | 6 +++- 2 files changed, 62 insertions(+), 1 deletion(-) diff --git a/plymouth-more-updates.patch b/plymouth-more-updates.patch index 39498c5..5f61264 100644 --- a/plymouth-more-updates.patch +++ b/plymouth-more-updates.patch @@ -613,3 +613,60 @@ index 434bcf2..795bded 100644 -- 2.21.0 +From aac0f839ec120fdd4dadd198709216f313bb0ac0 Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Thu, 18 Jul 2019 17:51:54 +0200 +Subject: [PATCH] two-step: Deal with buggy firmware which does not pre-rotate + the bgrt image + +Some buggy Lenovo 2-in-1s with a 90 degree rotated panel, behave as +if the panel is mounted up-right / not rotated at all. These devices +have a buggy efifb size (landscape resolution instead of the actual +portrait resolution of the panel), this gets fixed-up by the kernel. + +These buggy devices also do not pre-rotate the bgrt_image nor do +they set the ACPI-6.2 rotation status-bits. We can detect this by +checking that the bgrt_image is perfectly centered horizontally +when we use the panel's height as the width. + +This commit uses this check to override the bgrt-rotation read from +the ACPI-6.2 rotation status-bits, fixing us displaying the bgrt image +with the wrong rotation. + +BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1730783 +Signed-off-by: Hans de Goede +--- + src/plugins/splash/two-step/plugin.c | 17 +++++++++++++++++ + 1 file changed, 17 insertions(+) + +diff --git a/src/plugins/splash/two-step/plugin.c b/src/plugins/splash/two-step/plugin.c +index 795bded..2e596d5 100644 +--- a/src/plugins/splash/two-step/plugin.c ++++ b/src/plugins/splash/two-step/plugin.c +@@ -408,6 +408,23 @@ view_set_bgrt_background (view_t *view) + &panel_width, &panel_height, + &panel_rotation, &panel_scale); + ++ /* ++ * Some buggy Lenovo 2-in-1s with a 90 degree rotated panel, behave as ++ * if the panel is mounted up-right / not rotated at all. These devices ++ * have a buggy efifb size (landscape resolution instead of the actual ++ * portrait resolution of the panel), this gets fixed-up by the kernel. ++ * These buggy devices also do not pre-rotate the bgrt_image nor do ++ * they set the ACPI-6.2 rotation status-bits. We can detect this by ++ * checking that the bgrt_image is perfectly centered horizontally ++ * when we use the panel's height as the width. ++ */ ++ if (have_panel_props && ++ (panel_rotation == PLY_PIXEL_BUFFER_ROTATE_CLOCKWISE || ++ panel_rotation == PLY_PIXEL_BUFFER_ROTATE_COUNTER_CLOCKWISE) && ++ (panel_width - view->plugin->background_bgrt_raw_width) / 2 != sysfs_x_offset && ++ (panel_height - view->plugin->background_bgrt_raw_width) / 2 == sysfs_x_offset) ++ bgrt_rotation = panel_rotation; ++ + /* + * Before the ACPI 6.2 specification, the BGRT table did not contain + * any rotation information, so to make sure that the firmware-splash +-- +2.21.0 + diff --git a/plymouth.spec b/plymouth.spec index c7627fe..f17b482 100644 --- a/plymouth.spec +++ b/plymouth.spec @@ -1,7 +1,7 @@ Summary: Graphical Boot Animation and Logger Name: plymouth Version: 0.9.4 -Release: 6%{?dist} +Release: 7%{?dist} License: GPLv2+ URL: http://www.freedesktop.org/wiki/Software/Plymouth @@ -415,6 +415,10 @@ fi %changelog +* Fri Jul 19 2019 Hans de Goede - 0.9.4-7 +- One more patch for dealing with some devices with a non-upright mounted + LCD-panel (rhbz#1730783) + * Wed Jun 12 2019 Hans de Goede - 0.9.4-6 - Add patches from upstream for: - Fix failing to pick the native monitor mode starting with kernel 5.2