[coreboot-gerrit] Change in libgfxinit[master]: gma pipe_setup: Explicitly disable panel fitter if unused

Nico Huber (Code Review) gerrit at coreboot.org
Mon Jan 8 13:32:43 CET 2018


Nico Huber has uploaded this change for review. ( https://review.coreboot.org/23162


Change subject: gma pipe_setup: Explicitly disable panel fitter if unused
......................................................................

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 reseting the whole pipe.

Change-Id: I442d2a6a553d5d91187a4d09c8bc5fdd693eb4f4
Signed-off-by: Nico Huber <nico.h at gmx.de>
---
M common/hw-gfx-gma-pipe_setup.adb
1 file changed, 22 insertions(+), 20 deletions(-)



  git pull ssh://review.coreboot.org:29418/libgfxinit refs/changes/62/23162/1

diff --git a/common/hw-gfx-gma-pipe_setup.adb b/common/hw-gfx-gma-pipe_setup.adb
index e64edc9..08a4fa4 100644
--- a/common/hw-gfx-gma-pipe_setup.adb
+++ b/common/hw-gfx-gma-pipe_setup.adb
@@ -416,6 +416,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;
@@ -434,6 +454,8 @@
          else
             Setup_Ironlake_Panel_Fitter (Controller, Mode, Framebuffer);
          end if;
+      else
+         Panel_Fitter_Off (Controller);
       end if;
    end Setup_Scaling;
 
@@ -474,26 +496,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

-- 
To view, visit https://review.coreboot.org/23162
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings

Gerrit-Project: libgfxinit
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I442d2a6a553d5d91187a4d09c8bc5fdd693eb4f4
Gerrit-Change-Number: 23162
Gerrit-PatchSet: 1
Gerrit-Owner: Nico Huber <nico.h at gmx.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot-gerrit/attachments/20180108/d078b630/attachment-0001.html>


More information about the coreboot-gerrit mailing list