gma: Drop Auto_Configure()
This procedure was never used to its full extent, afaict. It does too
much and that's barely tested. New code should be based on Scan_Ports().
Change-Id: I2367488f4b906a03a226313a41bf3d5f8dc4e6ef
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/17751
Reviewed-by: Reto Buerki <reet@codelabs.ch>
diff --git a/common/hw-gfx-gma.adb b/common/hw-gfx-gma.adb
index 0a92d1c..fbb5d98 100644
--- a/common/hw-gfx-gma.adb
+++ b/common/hw-gfx-gma.adb
@@ -402,109 +402,6 @@
Power_And_Clocks.Power_Set_To (Cur_Configs);
end Scan_Ports;
- procedure Auto_Configure
- (Configs : in out Pipe_Configs;
- Keep_Power : in Boolean := False)
- is
- Raw_EDID : EDID.Raw_EDID_Data := (others => 16#00#);
- Success : Boolean;
-
- Config_Idx : Pipe_Index;
- Port_Cfg : Port_Config;
-
- function Free_Config return Boolean
- with
- Pre => True
- is
- begin
- return Port_Configured (Configs, Disabled);
- end Free_Config;
-
- function First_Free_Config return Pipe_Index
- with
- Pre => Free_Config
- is
- begin
- return (if Configs (Primary).Port = Disabled then Primary else
- (if Configs (Secondary).Port = Disabled then Secondary
- else Tertiary));
- end First_Free_Config;
- begin
- -- TODO: Only check ports with hot-plug event?
-
- if Config.Has_Internal_Display and then
- not Keep_Power and then
- not Port_Configured (Cur_Configs, Internal)
- then
- Panel.On (Wait => False);
- end if;
-
- -- Check if displays are still connected
- for I in Pipe_Index loop
- if Configs (I).Port /= Disabled then
- Fill_Port_Config (Port_Cfg, Configs, I, Success);
- if Success then
- Connector_Info.Read_EDID
- (Raw_EDID => Raw_EDID,
- Port_Cfg => Port_Cfg,
- Success => Success);
- end if;
- if not Success or else
- not EDID.Has_Preferred_Mode (Raw_EDID) or else
- Configs (I).Mode /= EDID.Preferred_Mode (Raw_EDID)
- then
- Configs (I).Port := Disabled;
- end if;
- end if;
- end loop;
-
- -- Add new displays as long as there is a free pipe config
- for Port in Active_Port_Type loop
- if Free_Config and then not Port_Configured (Configs, Port) then
- Config_Idx := First_Free_Config;
- Configs (Config_Idx).Port := Port;
- Fill_Port_Config (Port_Cfg, Configs, Config_Idx, Success);
-
- if Success then
- -- Need power to probe port
- if not Keep_Power and then To_Display_Type (Port) = DP then
- Power_And_Clocks.Power_Up (Cur_Configs, Configs);
- end if;
- if not Keep_Power and then Port = Internal then
- Panel.Wait_On;
- end if;
-
- Connector_Info.Read_EDID
- (Raw_EDID => Raw_EDID,
- Port_Cfg => Port_Cfg,
- Success => Success);
- end if;
-
- if Success and then
- (EDID.Compatible_Display (Raw_EDID, Port_Cfg.Display) and
- EDID.Has_Preferred_Mode (Raw_EDID))
- then
- Configs (Config_Idx) := Pipe_Config'
- (Port => Port,
- Framebuffer => Configs (Config_Idx).Framebuffer,
- Mode => EDID.Preferred_Mode (Raw_EDID));
- else
- Configs (Config_Idx).Port := Disabled;
- end if;
- end if;
- end loop;
-
- if not Keep_Power then
- Power_And_Clocks.Power_Set_To (Cur_Configs);
-
- if Config.Has_Internal_Display and then
- not Port_Configured (Cur_Configs, Internal)
- then
- Panel.Off;
- end if;
- end if;
- end Auto_Configure;
-
----------------------------------------------------------------------------
procedure Update_Outputs (Configs : Pipe_Configs)
diff --git a/common/hw-gfx-gma.ads b/common/hw-gfx-gma.ads
index de00962..baf16da 100644
--- a/common/hw-gfx-gma.ads
+++ b/common/hw-gfx-gma.ads
@@ -82,9 +82,6 @@
(Configs : out Pipe_Configs;
Ports : in Port_List;
Max_Pipe : in Pipe_Index := Pipe_Index'Last);
- procedure Auto_Configure
- (Configs : in out Pipe_Configs;
- Keep_Power : in Boolean := False);
procedure Update_Outputs (Configs : Pipe_Configs);
pragma Warnings (GNATprove, Off, "subprogram ""Dump_Configs"" has no effect",