gma: Fix Ironlake panel fitting, revisited
This time avoid scaling to odd heights, too. At least Sandy Bridge
has trouble with this.
Change-Id: Ib7dfe1fd289661ecd6949eca4b39860dbecc4463
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/c/libgfxinit/+/27153
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
diff --git a/common/hw-gfx-gma-pipe_setup.adb b/common/hw-gfx-gma-pipe_setup.adb
index 76051dd..0a2cbcf 100644
--- a/common/hw-gfx-gma-pipe_setup.adb
+++ b/common/hw-gfx-gma-pipe_setup.adb
@@ -508,6 +508,10 @@
if Width < Mode.H_Visible and Width mod 2 = 1 then
Width := Width + 1;
end if;
+ -- Do not scale to odd height (at least Sandy Bridge makes trouble).
+ if Height < Mode.V_Visible and Height mod 2 = 1 then
+ Height := Height + 1;
+ end if;
X := (Mode.H_Visible - Width) / 2;
Y := (Mode.V_Visible - Height) / 2;