gma pipe_setup: Explicitly disable panel fitter if unused
We assumed that the panel fitter (or pipe scaler) is already turned off
by default. But that won't be true if we only update the framebuffer
configuration without resetting the whole pipe.
Change-Id: I442d2a6a553d5d91187a4d09c8bc5fdd693eb4f4
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/23162
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
diff --git a/common/hw-gfx-gma-pipe_setup.adb b/common/hw-gfx-gma-pipe_setup.adb
index 5c6df37..00f05f7 100644
--- a/common/hw-gfx-gma-pipe_setup.adb
+++ b/common/hw-gfx-gma-pipe_setup.adb
@@ -426,6 +426,26 @@
Value => Shift_Left (Word32 (Width), 16) or Word32 (Height));
end Setup_Ironlake_Panel_Fitter;
+ procedure Panel_Fitter_Off (Controller : Controller_Type)
+ is
+ use type HW.GFX.GMA.Registers.Registers_Invalid_Index;
+ begin
+ -- Writes to WIN_SZ arm the PS/PF registers.
+ if Config.Has_Plane_Control then
+ Registers.Unset_Mask (Controller.PS_CTRL_1, PS_CTRL_ENABLE_SCALER);
+ Registers.Write (Controller.PS_WIN_SZ_1, 16#0000_0000#);
+ if Controller.PS_CTRL_2 /= Registers.Invalid_Register and
+ Controller.PS_WIN_SZ_2 /= Registers.Invalid_Register
+ then
+ Registers.Unset_Mask (Controller.PS_CTRL_2, PS_CTRL_ENABLE_SCALER);
+ Registers.Write (Controller.PS_WIN_SZ_2, 16#0000_0000#);
+ end if;
+ else
+ Registers.Unset_Mask (Controller.PF_CTRL, PF_CTRL_ENABLE);
+ Registers.Write (Controller.PF_WIN_SZ, 16#0000_0000#);
+ end if;
+ end Panel_Fitter_Off;
+
procedure Setup_Scaling
(Controller : in Controller_Type;
Mode : in HW.GFX.Mode_Type;
@@ -444,6 +464,8 @@
else
Setup_Ironlake_Panel_Fitter (Controller, Mode, Framebuffer);
end if;
+ else
+ Panel_Fitter_Off (Controller);
end if;
end Setup_Scaling;
@@ -484,26 +506,6 @@
end if;
end Planes_Off;
- procedure Panel_Fitter_Off (Controller : Controller_Type)
- is
- use type HW.GFX.GMA.Registers.Registers_Invalid_Index;
- begin
- -- Writes to WIN_SZ arm the PS/PF registers.
- if Config.Has_Plane_Control then
- Registers.Unset_Mask (Controller.PS_CTRL_1, PS_CTRL_ENABLE_SCALER);
- Registers.Write (Controller.PS_WIN_SZ_1, 16#0000_0000#);
- if Controller.PS_CTRL_2 /= Registers.Invalid_Register and
- Controller.PS_WIN_SZ_2 /= Registers.Invalid_Register
- then
- Registers.Unset_Mask (Controller.PS_CTRL_2, PS_CTRL_ENABLE_SCALER);
- Registers.Write (Controller.PS_WIN_SZ_2, 16#0000_0000#);
- end if;
- else
- Registers.Unset_Mask (Controller.PF_CTRL, PF_CTRL_ENABLE);
- Registers.Write (Controller.PF_WIN_SZ, 16#0000_0000#);
- end if;
- end Panel_Fitter_Off;
-
procedure Off (Pipe : Pipe_Index)
is
begin