gma skl: Use framebuffer size as plane source size
Similar to
770fe4a gma: Use framebuffer size as pipe source size
we have to use the unscaled framebuffer size for the plane fetched
from memory.
Change-Id: I76cabdda5656982af2e8ff7cb67d2ad4a14a40a2
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: https://review.coreboot.org/17748
Tested-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Adrian-Ken Rueegsegger <ken@codelabs.ch>
diff --git a/common/hw-gfx-gma-pipe_setup.adb b/common/hw-gfx-gma-pipe_setup.adb
index 4176ffe..b237241 100644
--- a/common/hw-gfx-gma-pipe_setup.adb
+++ b/common/hw-gfx-gma-pipe_setup.adb
@@ -333,9 +333,8 @@
----------------------------------------------------------------------------
procedure Setup_Hires_Plane
- (Controller : in Controller_Type;
- Mode : in HW.GFX.Mode_Type;
- Framebuffer : in HW.GFX.Framebuffer_Type)
+ (Controller : Controller_Type;
+ Framebuffer : HW.GFX.Framebuffer_Type)
with
Global => (In_Out => Registers.Register_State),
Depends =>
@@ -343,7 +342,6 @@
=>+
(Registers.Register_State,
Controller,
- Mode,
Framebuffer))
is
-- FIXME: setup correct format, based on framebuffer RGB format
@@ -367,7 +365,9 @@
PLANE_CTL_SRC_PIX_FMT_RGB_32B_8888 or
PLANE_CTL_PLANE_GAMMA_DISABLE);
Registers.Write (Controller.PLANE_OFFSET, 16#0000_0000#);
- Registers.Write (Controller.PLANE_SIZE, Encode (Mode.H_Visible, Mode.V_Visible));
+ Registers.Write
+ (Controller.PLANE_SIZE,
+ Encode (Pos16 (Framebuffer.Width), Pos16 (Framebuffer.Height)));
Registers.Write (Controller.PLANE_STRIDE, To_Bytes (Framebuffer.Stride) / 64);
Registers.Write (Controller.PLANE_POS, 16#0000_0000#);
Registers.Write (Controller.PLANE_SURF, Framebuffer.Offset and 16#ffff_f000#);
@@ -444,7 +444,7 @@
Port_IO.InB (Reg8, VGA_SR_DATA);
Port_IO.OutB (VGA_SR_DATA, Reg8 and not (VGA_SR01_SCREEN_OFF));
else
- Setup_Hires_Plane (Controller, Mode, Framebuffer);
+ Setup_Hires_Plane (Controller, Framebuffer);
end if;
Registers.Write