gma: Rename Config_Type => Pipe_Config

This was long overdue. Originally, we only had one type of `confi-
guration` but those times are over. Thus, rename `Config_Type` to
`Pipe_Config` along with `Configs_Type` to `Pipe_Configs` and
`Config_Index` to `Pipe_Index` to give them more meaningful names.

Change-Id: Ic02c738f51b01a883e05eff1c94f9c2d6058fdc4
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/17749
Reviewed-by: Reto Buerki <reet@codelabs.ch>
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 e83efa9..41d340a 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
@@ -185,7 +185,7 @@
       end if;
    end PDW_On;
 
-   function Need_PDW (Checked_Configs : Configs_Type) return Boolean is
+   function Need_PDW (Checked_Configs : Pipe_Configs) return Boolean is
    begin
       return (Checked_Configs (Primary).Port /= Disabled and
               Checked_Configs (Primary).Port /= Internal) or
@@ -209,7 +209,7 @@
       PDW_Off;
    end Initialize;
 
-   procedure Power_Set_To (Configs : Configs_Type) is
+   procedure Power_Set_To (Configs : Pipe_Configs) is
    begin
       if Need_PDW (Configs) then
          PDW_On;
@@ -218,14 +218,14 @@
       end if;
    end Power_Set_To;
 
-   procedure Power_Up (Old_Configs, New_Configs : Configs_Type) is
+   procedure Power_Up (Old_Configs, New_Configs : Pipe_Configs) is
    begin
       if not Need_PDW (Old_Configs) and Need_PDW (New_Configs) then
          PDW_On;
       end if;
    end Power_Up;
 
-   procedure Power_Down (Old_Configs, Tmp_Configs, New_Configs : Configs_Type)
+   procedure Power_Down (Old_Configs, Tmp_Configs, New_Configs : Pipe_Configs)
    is
    begin
       if (Need_PDW (Old_Configs) or Need_PDW (Tmp_Configs)) and
diff --git a/common/haswell_shared/hw-gfx-gma-power_and_clocks_haswell.ads b/common/haswell_shared/hw-gfx-gma-power_and_clocks_haswell.ads
index bbeb348..7c5a647 100644
--- a/common/haswell_shared/hw-gfx-gma-power_and_clocks_haswell.ads
+++ b/common/haswell_shared/hw-gfx-gma-power_and_clocks_haswell.ads
@@ -21,8 +21,8 @@
 
    procedure Initialize;
 
-   procedure Power_Set_To (Configs : Configs_Type);
-   procedure Power_Up (Old_Configs, New_Configs : Configs_Type);
-   procedure Power_Down (Old_Configs, Tmp_Configs, New_Configs : Configs_Type);
+   procedure Power_Set_To (Configs : Pipe_Configs);
+   procedure Power_Up (Old_Configs, New_Configs : Pipe_Configs);
+   procedure Power_Down (Old_Configs, Tmp_Configs, New_Configs : Pipe_Configs);
 
 end HW.GFX.GMA.Power_And_Clocks_Haswell;
diff --git a/common/hw-gfx-gma-config.ads.template b/common/hw-gfx-gma-config.ads.template
index 357b93f..6ef5555 100644
--- a/common/hw-gfx-gma-config.ads.template
+++ b/common/hw-gfx-gma-config.ads.template
@@ -107,7 +107,7 @@
 
    ----------------------------------------------------------------------------
 
-   type Supported_Pipe_Array is array (Config_Index) of Boolean;
+   type Supported_Pipe_Array is array (Pipe_Index) of Boolean;
    Supported_Pipe : constant Supported_Pipe_Array :=
      (Primary     => True,
       Secondary   => True,
@@ -235,7 +235,7 @@
    -- Maximum source width with enabled scaler. This only accounts
    -- for simple 1:1 pipe:scaler mappings.
 
-   type Width_Per_Pipe is array (Config_Index) of Width_Type;
+   type Width_Per_Pipe is array (Pipe_Index) of Width_Type;
 
    Maximum_Scalable_Width : constant Width_Per_Pipe :=
      (case CPU is
diff --git a/common/hw-gfx-gma.adb b/common/hw-gfx-gma.adb
index b64cc91..e020d90 100644
--- a/common/hw-gfx-gma.adb
+++ b/common/hw-gfx-gma.adb
@@ -60,14 +60,14 @@
 
    package Display_Controller renames Pipe_Setup;
 
-   type PLLs_Type is array (Config_Index) of PLLs.T;
+   type PLLs_Type is array (Pipe_Index) of PLLs.T;
 
-   type Links_Type is array (Config_Index) of DP_Link;
+   type Links_Type is array (Pipe_Index) of DP_Link;
 
    type HPD_Type is array (Port_Type) of Boolean;
    type HPD_Delay_Type is array (Port_Type) of Time.T;
 
-   Cur_Configs : Configs_Type;
+   Cur_Configs : Pipe_Configs;
    Allocated_PLLs : PLLs_Type;
    DP_Links : Links_Type;
    HPD_Delay : HPD_Delay_Type;
@@ -89,8 +89,8 @@
    ----------------------------------------------------------------------------
 
    function To_GPU_Port
-     (Configs  : Configs_Type;
-      Idx      : Config_Index)
+     (Configs  : Pipe_Configs;
+      Idx      : Pipe_Index)
       return GPU_Port
    is
    begin
@@ -181,7 +181,7 @@
    function Validate_Config
      (Framebuffer : Framebuffer_Type;
       Port_Cfg    : Port_Config;
-      I           : Config_Index)
+      I           : Pipe_Index)
       return Boolean
    with
       Post =>
@@ -209,8 +209,8 @@
 
    procedure Fill_Port_Config
      (Port_Cfg :    out Port_Config;
-      Configs  : in     Configs_Type;
-      Idx      : in     Config_Index;
+      Configs  : in     Pipe_Configs;
+      Idx      : in     Pipe_Index;
       Success  :    out Boolean)
    with Pre => True
    is
@@ -270,7 +270,7 @@
    ----------------------------------------------------------------------------
 
    function To_Controller
-      (Dsp_Config : Config_Index) return Display_Controller.Controller_Type
+      (Dsp_Config : Pipe_Index) return Display_Controller.Controller_Type
    is
       Result : Display_Controller.Controller_Type;
    begin
@@ -290,7 +290,7 @@
    ----------------------------------------------------------------------------
 
    function To_Head
-     (N_Config : Config_Index;
+     (N_Config : Pipe_Index;
       Port     : Active_Port_Type)
       return Display_Controller.Head_Type
    is
@@ -330,7 +330,7 @@
    ----------------------------------------------------------------------------
 
    function Port_Configured
-     (Configs  : Configs_Type;
+     (Configs  : Pipe_Configs;
       Port     : Port_Type)
       return Boolean
    with
@@ -343,21 +343,21 @@
    end Port_Configured;
 
    procedure Scan_Ports
-     (Configs  :    out Configs_Type;
+     (Configs  :    out Pipe_Configs;
       Ports    : in     Port_List;
-      Max_Pipe : in     Config_Index := Config_Index'Last)
+      Max_Pipe : in     Pipe_Index := Pipe_Index'Last)
    is
       Raw_EDID : EDID.Raw_EDID_Data := (others => 16#00#);
       Port_Idx : Port_List_Range := Port_List_Range'First;
       Port_Cfg : Port_Config;
       Success  : Boolean := False;
    begin
-      Configs := (Config_Index =>
+      Configs := (Pipe_Index =>
                     (Port        => Disabled,
                      Mode        => Invalid_Mode,
                      Framebuffer => Default_FB));
 
-      for Config_Idx in Config_Index range Config_Index'First .. Max_Pipe loop
+      for Config_Idx in Pipe_Index range Pipe_Index'First .. Max_Pipe loop
          while Ports (Port_Idx) /= Disabled loop
             if not Port_Configured (Configs, Ports (Port_Idx)) then
                Configs (Config_Idx).Port := Ports (Port_Idx);
@@ -403,13 +403,13 @@
    end Scan_Ports;
 
    procedure Auto_Configure
-     (Configs     : in out Configs_Type;
+     (Configs     : in out Pipe_Configs;
       Keep_Power  : in     Boolean := False)
    is
       Raw_EDID : EDID.Raw_EDID_Data := (others => 16#00#);
       Success : Boolean;
 
-      Config_Idx : Config_Index;
+      Config_Idx : Pipe_Index;
       Port_Cfg : Port_Config;
 
       function Free_Config return Boolean
@@ -420,7 +420,7 @@
          return Port_Configured (Configs, Disabled);
       end Free_Config;
 
-      function First_Free_Config return Config_Index
+      function First_Free_Config return Pipe_Index
       with
          Pre => Free_Config
       is
@@ -440,7 +440,7 @@
       end if;
 
       -- Check if displays are still connected
-      for I in Config_Index loop
+      for I in Pipe_Index loop
          if Configs (I).Port /= Disabled then
             Fill_Port_Config (Port_Cfg, Configs, I, Success);
             if Success then
@@ -484,7 +484,7 @@
                (EDID.Compatible_Display (Raw_EDID, Port_Cfg.Display) and
                 EDID.Has_Preferred_Mode (Raw_EDID))
             then
-               Configs (Config_Idx) := Config_Type'
+               Configs (Config_Idx) := Pipe_Config'
                  (Port        => Port,
                   Framebuffer => Configs (Config_Idx).Framebuffer,
                   Mode        => EDID.Preferred_Mode (Raw_EDID));
@@ -507,13 +507,13 @@
 
    ----------------------------------------------------------------------------
 
-   procedure Update_Outputs (Configs : Configs_Type)
+   procedure Update_Outputs (Configs : Pipe_Configs)
    is
       Did_Power_Up : Boolean := False;
 
       HPD, HPD_Delay_Over, Success : Boolean;
-      Old_Config, New_Config : Config_Type;
-      Old_Configs : Configs_Type;
+      Old_Config, New_Config : Pipe_Config;
+      Old_Configs : Pipe_Configs;
       Port_Cfg : Port_Config;
 
       procedure Check_HPD
@@ -533,7 +533,7 @@
    begin
       Old_Configs := Cur_Configs;
 
-      for I in Config_Index loop
+      for I in Pipe_Index loop
          HPD := False;
 
          Old_Config := Cur_Configs (I);
@@ -743,8 +743,8 @@
       HPD_Delay := HPD_Delay_Type'(others => Now);
       DP_Links := Links_Type'(others => HW.GFX.Default_DP);
       Allocated_PLLs := (others => PLLs.Invalid);
-      Cur_Configs := Configs_Type'
-        (others => Config_Type'
+      Cur_Configs := Pipe_Configs'
+        (others => Pipe_Config'
            (Port        => Disabled,
             Framebuffer => HW.GFX.Default_FB,
             Mode        => HW.GFX.Invalid_Mode));
@@ -827,10 +827,10 @@
 
    ----------------------------------------------------------------------------
 
-   procedure Dump_Configs (Configs : Configs_Type)
+   procedure Dump_Configs (Configs : Pipe_Configs)
    is
       subtype Pipe_Name is String (1 .. 9);
-      type Pipe_Name_Array is array (Config_Index) of Pipe_Name;
+      type Pipe_Name_Array is array (Pipe_Index) of Pipe_Name;
       Pipe_Names : constant Pipe_Name_Array :=
         (Primary     => "Primary  ",
          Secondary   => "Secondary",
@@ -838,8 +838,8 @@
    begin
       Debug.New_Line;
       Debug.Put_Line ("CONFIG => ");
-      for Pipe in Config_Index loop
-         if Pipe = Config_Index'First then
+      for Pipe in Pipe_Index loop
+         if Pipe = Pipe_Index'First then
             Debug.Put ("  (");
          else
             Debug.Put ("   ");
@@ -901,7 +901,7 @@
             else "False,"));
          Debug.Put ("         BPC                => ");
          Debug.Put_Int64 (Configs (Pipe).Mode.BPC);
-         if Pipe /= Config_Index'Last then
+         if Pipe /= Pipe_Index'Last then
             Debug.Put_Line (")),");
          else
             Debug.Put_Line (")));");
diff --git a/common/hw-gfx-gma.ads b/common/hw-gfx-gma.ads
index 8967ee8..b7d0b47 100644
--- a/common/hw-gfx-gma.ads
+++ b/common/hw-gfx-gma.ads
@@ -50,13 +50,13 @@
    type Port_List_Range is range 0 .. 7;
    type Port_List is array (Port_List_Range) of Port_Type;
 
-   type Config_Type is record
+   type Pipe_Config is record
       Port        : Port_Type;
       Framebuffer : Framebuffer_Type;
       Mode        : Mode_Type;
    end record;
-   type Config_Index is (Primary, Secondary, Tertiary);
-   type Configs_Type is array (Config_Index) of Config_Type;
+   type Pipe_Index is (Primary, Secondary, Tertiary);
+   type Pipe_Configs is array (Pipe_Index) of Pipe_Config;
 
    -- Special framebuffer offset to indicate legacy VGA plane.
    -- Only valid on primary pipe.
@@ -79,17 +79,17 @@
    procedure Legacy_VGA_Off;
 
    procedure Scan_Ports
-     (Configs  :    out Configs_Type;
+     (Configs  :    out Pipe_Configs;
       Ports    : in     Port_List;
-      Max_Pipe : in     Config_Index := Config_Index'Last);
+      Max_Pipe : in     Pipe_Index := Pipe_Index'Last);
    procedure Auto_Configure
-     (Configs     : in out Configs_Type;
+     (Configs     : in out Pipe_Configs;
       Keep_Power  : in     Boolean := False);
-   procedure Update_Outputs (Configs : Configs_Type);
+   procedure Update_Outputs (Configs : Pipe_Configs);
 
    pragma Warnings (GNATprove, Off, "subprogram ""Dump_Configs"" has no effect",
                     Reason => "It's only used for debugging");
-   procedure Dump_Configs (Configs : Configs_Type);
+   procedure Dump_Configs (Configs : Pipe_Configs);
 
    type GTT_Address_Type is mod 2 ** 39;
    type GTT_Range is range 0 .. 16#8_0000# - 1;
diff --git a/common/ironlake/hw-gfx-gma-power_and_clocks_ironlake.ads b/common/ironlake/hw-gfx-gma-power_and_clocks_ironlake.ads
index c2c8583..fc58d75 100644
--- a/common/ironlake/hw-gfx-gma-power_and_clocks_ironlake.ads
+++ b/common/ironlake/hw-gfx-gma-power_and_clocks_ironlake.ads
@@ -20,11 +20,11 @@
 
    procedure Post_All_Off is null;
 
-   procedure Power_Set_To (Configs : Configs_Type) is null;
+   procedure Power_Set_To (Configs : Pipe_Configs) is null;
 
-   procedure Power_Up (Old_Configs, New_Configs : Configs_Type) is null;
+   procedure Power_Up (Old_Configs, New_Configs : Pipe_Configs) is null;
 
-   procedure Power_Down (Old_Configs, Tmp_Configs, New_Configs : Configs_Type)
+   procedure Power_Down (Old_Configs, Tmp_Configs, New_Configs : Pipe_Configs)
    is null;
 
 end HW.GFX.GMA.Power_And_Clocks_Ironlake;
diff --git a/common/skylake/hw-gfx-gma-power_and_clocks_skylake.adb b/common/skylake/hw-gfx-gma-power_and_clocks_skylake.adb
index ab2f1fa..8503435 100644
--- a/common/skylake/hw-gfx-gma-power_and_clocks_skylake.adb
+++ b/common/skylake/hw-gfx-gma-power_and_clocks_skylake.adb
@@ -187,7 +187,7 @@
       end if;
    end PD_On;
 
-   function Need_PD (PD : Dynamic_Domain; Configs : Configs_Type) return Boolean
+   function Need_PD (PD : Dynamic_Domain; Configs : Pipe_Configs) return Boolean
    is
    begin
       return (case PD is
@@ -314,7 +314,7 @@
       end if;
    end Initialize;
 
-   procedure Power_Set_To (Configs : Configs_Type) is
+   procedure Power_Set_To (Configs : Pipe_Configs) is
    begin
       for PD in reverse Dynamic_Domain loop
          if not Need_PD (PD, Configs) then
@@ -328,7 +328,7 @@
       end loop;
    end Power_Set_To;
 
-   procedure Power_Up (Old_Configs, New_Configs : Configs_Type) is
+   procedure Power_Up (Old_Configs, New_Configs : Pipe_Configs) is
    begin
       for PD in Dynamic_Domain loop
          if not Need_PD (PD, Old_Configs) and Need_PD (PD, New_Configs) then
@@ -337,7 +337,7 @@
       end loop;
    end Power_Up;
 
-   procedure Power_Down (Old_Configs, Tmp_Configs, New_Configs : Configs_Type)
+   procedure Power_Down (Old_Configs, Tmp_Configs, New_Configs : Pipe_Configs)
    is
    begin
       for PD in reverse Dynamic_Domain loop
diff --git a/common/skylake/hw-gfx-gma-power_and_clocks_skylake.ads b/common/skylake/hw-gfx-gma-power_and_clocks_skylake.ads
index 0c5fcf9..4db9ab5 100644
--- a/common/skylake/hw-gfx-gma-power_and_clocks_skylake.ads
+++ b/common/skylake/hw-gfx-gma-power_and_clocks_skylake.ads
@@ -19,8 +19,8 @@
 
    procedure Initialize;
 
-   procedure Power_Set_To (Configs : Configs_Type);
-   procedure Power_Up (Old_Configs, New_Configs : Configs_Type);
-   procedure Power_Down (Old_Configs, Tmp_Configs, New_Configs : Configs_Type);
+   procedure Power_Set_To (Configs : Pipe_Configs);
+   procedure Power_Up (Old_Configs, New_Configs : Pipe_Configs);
+   procedure Power_Down (Old_Configs, Tmp_Configs, New_Configs : Pipe_Configs);
 
 end HW.GFX.GMA.Power_And_Clocks_Skylake;