[coreboot-gerrit] Change in libgfxinit[master]: gma hsw: Enable Power Down Well for scaling on DDI A

Nico Huber (Code Review) gerrit at coreboot.org
Tue May 29 12:28:19 CEST 2018


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


Change subject: gma hsw: Enable Power Down Well for scaling on DDI A
......................................................................

gma hsw: Enable Power Down Well for scaling on DDI A

The primary pipe can drive DDI A (eDP) without the Power Down
Well (PDW). The scalers are inside the PDW, though. To enable
scaling for DDI A, ensure the PDW is active.

When switching between scaled / unscaled modes, we'll have to
reconfigure the whole pipe.

Change-Id: I46318bb74d00a584d268a9d76787f8b26249264d
Signed-off-by: Nico Huber <nico.h at gmx.de>
---
M common/haswell_shared/hw-gfx-gma-power_and_clocks_haswell.adb
M common/hw-gfx-gma-config.ads.template
M common/hw-gfx-gma.adb
M common/hw-gfx-gma.ads
4 files changed, 35 insertions(+), 16 deletions(-)



  git pull ssh://review.coreboot.org:29418/libgfxinit refs/changes/63/26663/1

diff --git a/common/haswell_shared/hw-gfx-gma-power_and_clocks_haswell.adb b/common/haswell_shared/hw-gfx-gma-power_and_clocks_haswell.adb
index c0d1e78..1c23254 100644
--- a/common/haswell_shared/hw-gfx-gma-power_and_clocks_haswell.adb
+++ b/common/haswell_shared/hw-gfx-gma-power_and_clocks_haswell.adb
@@ -1,5 +1,5 @@
 --
--- Copyright (C) 2014-2016 secunet Security Networks AG
+-- Copyright (C) 2014-2018 secunet Security Networks AG
 --
 -- This program is free software; you can redistribute it and/or modify
 -- it under the terms of the GNU General Public License as published by
@@ -185,12 +185,19 @@
       end if;
    end PDW_On;
 
-   function Need_PDW (Checked_Configs : Pipe_Configs) return Boolean is
+   function Need_PDW (Checked_Configs : Pipe_Configs) return Boolean
+   is
+      Primary : Pipe_Config renames Checked_Configs (GMA.Primary);
    begin
-      return (Checked_Configs (Primary).Port /= Disabled and
-              Checked_Configs (Primary).Port /= Internal) or
-             Checked_Configs (Secondary).Port /= Disabled or
-             Checked_Configs (Tertiary).Port /= Disabled;
+      return
+         (Config.Use_PDW_For_EDP_Scaling and then
+          (Primary.Port = Internal and Requires_Scaling (Primary)))
+         or
+         (Primary.Port /= Disabled and Primary.Port /= Internal)
+         or
+         Checked_Configs (Secondary).Port /= Disabled
+         or
+         Checked_Configs (Tertiary).Port /= Disabled;
    end Need_PDW;
 
    ----------------------------------------------------------------------------
diff --git a/common/hw-gfx-gma-config.ads.template b/common/hw-gfx-gma-config.ads.template
index 049f473..688113b 100644
--- a/common/hw-gfx-gma-config.ads.template
+++ b/common/hw-gfx-gma-config.ads.template
@@ -1,5 +1,5 @@
 --
--- Copyright (C) 2015-2017 secunet Security Networks AG
+-- Copyright (C) 2015-2018 secunet Security Networks AG
 --
 -- This program is free software; you can redistribute it and/or modify
 -- it under the terms of the GNU General Public License as published by
@@ -47,6 +47,7 @@
                                                 (CPU in Haswell .. Broadwell);
    Pipe_Enabled_Workaround : constant Boolean := CPU = Broadwell;
    Has_EDP_Transcoder      : constant Boolean := CPU >= Haswell;
+   Use_PDW_For_EDP_Scaling : constant Boolean := CPU = Haswell;
    Has_Pipe_DDI_Func       : constant Boolean := CPU >= Haswell;
    Has_Trans_Clk_Sel       : constant Boolean := CPU >= Haswell;
    Has_Pipe_MSA_Misc       : constant Boolean := CPU >= Haswell;
diff --git a/common/hw-gfx-gma.adb b/common/hw-gfx-gma.adb
index 809881a..2a8e843 100644
--- a/common/hw-gfx-gma.adb
+++ b/common/hw-gfx-gma.adb
@@ -1,5 +1,5 @@
 --
--- Copyright (C) 2014-2017 secunet Security Networks AG
+-- Copyright (C) 2014-2018 secunet Security Networks AG
 -- Copyright (C) 2017 Nico Huber <nico.h at gmx.de>
 --
 -- This program is free software; you can redistribute it and/or modify
@@ -231,6 +231,17 @@
             Power_Changed := True;
          end if;
       end Update_Power;
+
+      function Full_Update (Cur_Config, New_Config : Pipe_Config) return Boolean
+      is
+      begin
+         return
+            Cur_Config.Port /= New_Config.Port or else
+            Cur_Config.Mode /= New_Config.Mode or else
+            (Config.Use_PDW_For_EDP_Scaling and then
+             (Cur_Config.Port = Internal and
+              Requires_Scaling (Cur_Config) /= Requires_Scaling (New_Config)));
+      end Full_Update;
    begin
       Old_Configs := Cur_Configs;
 
@@ -244,10 +255,7 @@
             if Cur_Config.Port /= Disabled then
                Check_HPD (Cur_Config.Port, Unplug_Detected);
 
-               if Cur_Config.Port /= New_Config.Port or
-                  Cur_Config.Mode /= New_Config.Mode or
-                  Unplug_Detected
-               then
+               if Full_Update (Cur_Config, New_Config) or Unplug_Detected then
                   Disable_Output (Pipe, Cur_Config);
                   Cur_Config.Port := Disabled;
                   Update_Power;
@@ -263,9 +271,8 @@
             Cur_Config : Pipe_Config renames Cur_Configs (Pipe);
             New_Config : Pipe_Config renames Configs (Pipe);
          begin
-            if New_Config.Port /= Disabled and then
-               (Cur_Config.Port /= New_Config.Port or
-                Cur_Config.Mode /= New_Config.Mode)
+            if New_Config.Port /= Disabled and
+               Full_Update (Cur_Config, New_Config)
             then
                if Wait_For_HPD (New_Config.Port) then
                   Check_HPD (New_Config.Port, Success);
diff --git a/common/hw-gfx-gma.ads b/common/hw-gfx-gma.ads
index f66625e..877528c 100644
--- a/common/hw-gfx-gma.ads
+++ b/common/hw-gfx-gma.ads
@@ -1,5 +1,5 @@
 --
--- Copyright (C) 2015-2017 secunet Security Networks AG
+-- Copyright (C) 2015-2018 secunet Security Networks AG
 -- Copyright (C) 2017 Nico Huber <nico.h at gmx.de>
 --
 -- This program is free software; you can redistribute it and/or modify
@@ -129,6 +129,10 @@
 
    Cur_Configs : Pipe_Configs with Part_Of => State;
 
+   function Requires_Scaling (Pipe_Cfg : Pipe_Config) return Boolean is
+     (Pipe_Cfg.Framebuffer.Width /= Pos32 (Pipe_Cfg.Mode.H_Visible) or
+      Pipe_Cfg.Framebuffer.Height /= Pos32 (Pipe_Cfg.Mode.V_Visible));
+
    ----------------------------------------------------------------------------
    -- Internal representation of a single pipe's configuration
 

-- 
To view, visit https://review.coreboot.org/26663
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: I46318bb74d00a584d268a9d76787f8b26249264d
Gerrit-Change-Number: 26663
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/20180529/90e32001/attachment-0001.html>


More information about the coreboot-gerrit mailing list