[coreboot-gerrit] Change in libgfxinit[master]: Add GPU_Port types that are convenient for GMCH to use

Arthur Heymans (Code Review) gerrit at coreboot.org
Wed Mar 28 17:29:49 CEST 2018


Arthur Heymans has uploaded this change for review. ( https://review.coreboot.org/25407


Change subject: Add GPU_Port types that are convenient for GMCH to use
......................................................................

Add GPU_Port types that are convenient for GMCH to use

Change-Id: I9120d084637d36a7e2276fcf3f630b3f7ed32509
Signed-off-by: Arthur Heymans <arthur at aheymans.xyz>
---
M common/haswell_shared/hw-gfx-gma-connectors-ddi.ads
M common/haswell_shared/hw-gfx-gma-connectors.adb
M common/hw-gfx-gma-connector_info.adb
M common/hw-gfx-gma.ads
4 files changed, 25 insertions(+), 11 deletions(-)



  git pull ssh://review.coreboot.org:29418/libgfxinit refs/changes/07/25407/1

diff --git a/common/haswell_shared/hw-gfx-gma-connectors-ddi.ads b/common/haswell_shared/hw-gfx-gma-connectors-ddi.ads
index ec1fce2..d43db97 100644
--- a/common/haswell_shared/hw-gfx-gma-connectors-ddi.ads
+++ b/common/haswell_shared/hw-gfx-gma-connectors-ddi.ads
@@ -22,9 +22,14 @@
    procedure Pre_On
      (Port_Cfg : in     Port_Config;
       PLL_Hint : in     Word32;
-      Success  :    out Boolean);
+      Success  :    out Boolean)
+   with
+     Pre => Port_Cfg.Port in Digital_Port;
 
-   procedure Post_On (Port_Cfg : Port_Config);
+   procedure Post_On (Port_Cfg : Port_Config)
+   with
+     Pre => Port_Cfg.Port in Digital_Port;
+
 
    procedure Off (Port : Digital_Port);
 
diff --git a/common/haswell_shared/hw-gfx-gma-connectors.adb b/common/haswell_shared/hw-gfx-gma-connectors.adb
index 0d0ed71..0aed750 100644
--- a/common/haswell_shared/hw-gfx-gma-connectors.adb
+++ b/common/haswell_shared/hw-gfx-gma-connectors.adb
@@ -41,8 +41,11 @@
    is
    begin
       pragma Debug (Debug.Put_Line (GNAT.Source_Info.Enclosing_Entity));
-
-      DDI.Pre_On (Port_Cfg, PLL_Hint, Success);
+      if Port_Cfg.Port in Digital_Port then
+         DDI.Pre_On (Port_Cfg, PLL_Hint, Success);
+      else
+         success := False; -- Should not happen
+      end if;
    end Pre_On;
 
    procedure Post_On
@@ -53,10 +56,12 @@
    begin
       pragma Debug (Debug.Put_Line (GNAT.Source_Info.Enclosing_Entity));
 
-      DDI.Post_On (Port_Cfg);
+      if Port_Cfg.Port in Digital_Port then
+         DDI.Post_On (Port_Cfg);
 
-      if Port_Cfg.Port = DIGI_A then
-         Panel.Backlight_On;
+         if Port_Cfg.Port = DIGI_A then
+            Panel.Backlight_On;
+         end if;
       end if;
 
       Success := True;
@@ -79,8 +84,9 @@
    is
    begin
       pragma Debug (Debug.Put_Line (GNAT.Source_Info.Enclosing_Entity));
-
-      DDI.Off (Port_Cfg.Port);
+      if Port_Cfg.Port in Digital_Port then
+         DDI.Off (Port_Cfg.Port);
+      end if;
    end Post_Off;
 
    ----------------------------------------------------------------------------
diff --git a/common/hw-gfx-gma-connector_info.adb b/common/hw-gfx-gma-connector_info.adb
index 798e61c..e8357be 100644
--- a/common/hw-gfx-gma-connector_info.adb
+++ b/common/hw-gfx-gma-connector_info.adb
@@ -87,7 +87,8 @@
    begin
       return
         (if Port_Cfg.Port = DIGI_A or
-            (Port_Cfg.Is_FDI and Port_Cfg.PCH_Port = PCH_LVDS)
+           (Port_Cfg.Is_FDI and Port_Cfg.PCH_Port = PCH_LVDS) or
+           Port_Cfg.Port = LVDS
          then 6
          else 8);
    end Default_BPC;
diff --git a/common/hw-gfx-gma.ads b/common/hw-gfx-gma.ads
index 50a76a0..fadf437 100644
--- a/common/hw-gfx-gma.ads
+++ b/common/hw-gfx-gma.ads
@@ -126,9 +126,11 @@
    subtype Active_Port_Type is Port_Type
       range Port_Type'Succ (Disabled) .. Port_Type'Last;
 
-   type GPU_Port is (DIGI_A, DIGI_B, DIGI_C, DIGI_D, DIGI_E);
+   type GPU_Port is (DIGI_A, DIGI_B, DIGI_C, DIGI_D, DIGI_E, LVDS, VGA);
 
    subtype Digital_Port is GPU_Port range DIGI_A .. DIGI_E;
+   subtype GMCH_DP_Port is GPU_Port range DIGI_B .. DIGI_D;
+   subtype GMCH_HDMI_Port is GPU_Port range DIGI_B .. DIGI_C;
 
    type PCH_Port is
      (PCH_DAC, PCH_LVDS,

-- 
To view, visit https://review.coreboot.org/25407
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: I9120d084637d36a7e2276fcf3f630b3f7ed32509
Gerrit-Change-Number: 25407
Gerrit-PatchSet: 1
Gerrit-Owner: Arthur Heymans <arthur at aheymans.xyz>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot-gerrit/attachments/20180328/beec3752/attachment-0001.html>


More information about the coreboot-gerrit mailing list