From 10fddacd1e9a45c8f7345067d61974ef249a1deb Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Mon, 3 Dec 2018 16:20:59 +0100 Subject: [PATCH] two-step: Do not rotate bgrt background image for upside-down panels Upside-down LCD panels are fixed up in HW by the GOP, so the bgrt image is not rotated in this case and we should not rotate it to compensate. While at it also fixup the wrong indentation of the ply_pixel_buffer_set_device_scale() call. Signed-off-by: Hans de Goede --- src/plugins/splash/two-step/plugin.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/plugins/splash/two-step/plugin.c b/src/plugins/splash/two-step/plugin.c index 641eb703..16b8fc87 100644 --- a/src/plugins/splash/two-step/plugin.c +++ b/src/plugins/splash/two-step/plugin.c @@ -312,8 +312,12 @@ view_set_bgrt_background (view_t *view) if (ply_renderer_get_panel_properties (ply_pixel_display_get_renderer (view->display), &panel_width, &panel_height, &panel_rotation, &panel_scale)) { - ply_pixel_buffer_set_device_rotation (bgrt_buffer, panel_rotation); - ply_pixel_buffer_set_device_scale (bgrt_buffer, panel_scale); + /* Upside-down panels are fixed up in HW by the GOP, so the + * bgrt image is not rotated in this case. + */ + if (panel_rotation != PLY_PIXEL_BUFFER_ROTATE_UPSIDE_DOWN) + ply_pixel_buffer_set_device_rotation (bgrt_buffer, panel_rotation); + ply_pixel_buffer_set_device_scale (bgrt_buffer, panel_scale); } width = ply_pixel_buffer_get_width (bgrt_buffer);