[coreboot-gerrit] Change in libgfxinit[master]: gma hsw transcoder: Choose PDW path 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/26664


Change subject: gma hsw transcoder: Choose PDW path for scaling on DDI A
......................................................................

gma hsw transcoder: Choose PDW path for scaling on DDI A

If scaling is required, always drive DDI A through the Power Down Well
(PDW) path. If not, keep the current "always on" path to allow power
saving.

Hopefully, this also enables us to use the eDP in legacy VGA text mode.

Change-Id: Ia9135d253083d363872c7cf0b3e2b5b69ba0831f
Signed-off-by: Nico Huber <nico.h at gmx.de>
---
M common/hw-gfx-gma-pipe_setup.adb
M common/hw-gfx-gma-transcoder.adb
M common/hw-gfx-gma-transcoder.ads
3 files changed, 28 insertions(+), 22 deletions(-)



  git pull ssh://review.coreboot.org:29418/libgfxinit refs/changes/64/26664/1

diff --git a/common/hw-gfx-gma-pipe_setup.adb b/common/hw-gfx-gma-pipe_setup.adb
index 1ba4ee0..09fd286 100644
--- a/common/hw-gfx-gma-pipe_setup.adb
+++ b/common/hw-gfx-gma-pipe_setup.adb
@@ -511,7 +511,12 @@
 
       Setup_FB (Pipe, Port_Cfg.Mode, Framebuffer);
 
-      Transcoder.On (Pipe, Port_Cfg, Framebuffer.BPC /= Port_Cfg.Mode.BPC);
+      Transcoder.On
+        (Pipe     => Pipe,
+         Port_Cfg => Port_Cfg,
+         Dither   => Framebuffer.BPC /= Port_Cfg.Mode.BPC,
+         Scale    => Rotated_Width (Framebuffer) /= Port_Cfg.Mode.H_Visible or
+                     Rotated_Height (Framebuffer) /= Port_Cfg.Mode.V_Visible);
    end On;
 
    ----------------------------------------------------------------------------
diff --git a/common/hw-gfx-gma-transcoder.adb b/common/hw-gfx-gma-transcoder.adb
index 97ad069..daa5deb 100644
--- a/common/hw-gfx-gma-transcoder.adb
+++ b/common/hw-gfx-gma-transcoder.adb
@@ -1,5 +1,5 @@
 --
--- Copyright (C) 2015-2016 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
@@ -76,11 +76,6 @@
    DDI_FUNC_CTL_MODE_SELECT_DP_SST     : constant := 2 * 2 ** 24;
    DDI_FUNC_CTL_MODE_SELECT_DP_MST     : constant := 3 * 2 ** 24;
    DDI_FUNC_CTL_MODE_SELECT_FDI        : constant := 4 * 2 ** 24;
-   DDI_FUNC_CTL_EDP_SELECT_MASK        : constant := 7 * 2 ** 12;
-   DDI_FUNC_CTL_EDP_SELECT_ALWAYS_ON   : constant := 0 * 2 ** 12;
-   DDI_FUNC_CTL_EDP_SELECT_A           : constant := 4 * 2 ** 12;
-   DDI_FUNC_CTL_EDP_SELECT_B           : constant := 5 * 2 ** 12;
-   DDI_FUNC_CTL_EDP_SELECT_C           : constant := 6 * 2 ** 12;
 
    type DDI_Select_Array is array (Digital_Port) of Word32;
    DDI_FUNC_CTL_DDI_SELECT : constant DDI_Select_Array :=
@@ -105,16 +100,12 @@
      (False => 0 * 2 ** 16,
       True  => 1 * 2 ** 16);
 
-   type EDP_Select_Array is array (Pipe_Index) of Word32;
-   DDI_FUNC_CTL_EDP_SELECT : constant EDP_Select_Array :=
-     (Primary     => DDI_FUNC_CTL_EDP_SELECT_ALWAYS_ON,  -- we never use
-                                                         -- panel fitter
-      Secondary   => DDI_FUNC_CTL_EDP_SELECT_B,
-      Tertiary    => DDI_FUNC_CTL_EDP_SELECT_C);
-   DDI_FUNC_CTL_EDP_SELECT_ONOFF : constant EDP_Select_Array :=
-     (Primary     => DDI_FUNC_CTL_EDP_SELECT_A,
-      Secondary   => DDI_FUNC_CTL_EDP_SELECT_B,
-      Tertiary    => DDI_FUNC_CTL_EDP_SELECT_C);
+   DDI_FUNC_CTL_EDP_SELECT_MASK        : constant := 7 * 2 ** 12;
+   DDI_FUNC_CTL_EDP_SELECT_ALWAYS_ON   : constant := 0 * 2 ** 12;
+   DDI_FUNC_CTL_EDP_SELECT : constant array (Pipe_Index) of Word32 :=
+     (Primary     => 4 * 2 ** 12,
+      Secondary   => 5 * 2 ** 12,
+      Tertiary    => 6 * 2 ** 12);
 
    type Port_Width_Array is array (DP_Lane_Count) of Word32;
    DDI_FUNC_CTL_PORT_WIDTH : constant Port_Width_Array :=
@@ -245,10 +236,16 @@
    procedure On
      (Pipe     : Pipe_Index;
       Port_Cfg : Port_Config;
-      Dither   : Boolean)
+      Dither   : Boolean;
+      Scale    : Boolean)
    is
       Trans : Transcoder_Regs renames
                Transcoders (Get_Idx (Pipe, Port_Cfg.Port));
+      EDP_Select : constant Word32 :=
+        (if Pipe = Primary and not Scale then
+            DDI_FUNC_CTL_EDP_SELECT_ALWAYS_ON
+         else
+            DDI_FUNC_CTL_EDP_SELECT (Pipe));
    begin
       if Config.Has_Pipe_DDI_Func and Port_Cfg.Port in Digital_Port then
          Registers.Write
@@ -259,7 +256,7 @@
                         DDI_FUNC_CTL_BPC (Port_Cfg.Mode.BPC) or
                         DDI_FUNC_CTL_VSYNC (Port_Cfg.Mode.V_Sync_Active_High) or
                         DDI_FUNC_CTL_HSYNC (Port_Cfg.Mode.H_Sync_Active_High) or
-                        DDI_FUNC_CTL_EDP_SELECT (Pipe) or
+                        EDP_Select or
                         DDI_FUNC_CTL_PORT_WIDTH (Port_Cfg.DP.Lane_Count));
       end if;
 
@@ -308,7 +305,7 @@
 
          if (Pipe = Primary and
              DDI_Func_Ctl = DDI_FUNC_CTL_EDP_SELECT_ALWAYS_ON) or
-            DDI_Func_Ctl = DDI_FUNC_CTL_EDP_SELECT_ONOFF (Pipe)
+            DDI_Func_Ctl = DDI_FUNC_CTL_EDP_SELECT (Pipe)
          then
             Trans_Off (Transcoders (Trans_EDP));
          end if;
diff --git a/common/hw-gfx-gma-transcoder.ads b/common/hw-gfx-gma-transcoder.ads
index 79be8f7..b026933 100644
--- a/common/hw-gfx-gma-transcoder.ads
+++ b/common/hw-gfx-gma-transcoder.ads
@@ -1,5 +1,5 @@
 --
--- Copyright (C) 2015-2016 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
@@ -19,7 +19,11 @@
 is
 
    procedure Setup (Pipe : Pipe_Index; Port_Cfg : Port_Config);
-   procedure On (Pipe : Pipe_Index; Port_Cfg : Port_Config; Dither : Boolean);
+   procedure On
+     (Pipe     : Pipe_Index;
+      Port_Cfg : Port_Config;
+      Dither   : Boolean;
+      Scale    : Boolean);
 
    procedure Off (Pipe : Pipe_Index);
    procedure Clk_Off (Pipe : Pipe_Index);

-- 
To view, visit https://review.coreboot.org/26664
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: Ia9135d253083d363872c7cf0b3e2b5b69ba0831f
Gerrit-Change-Number: 26664
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/8b6cbf28/attachment.html>


More information about the coreboot-gerrit mailing list