gma: Add option to keep port power after Scan_Ports()
This is useful when we only want to probe for connected displays while
another entity currently controls the outputs.
Also introduce an `All_Ports` list, that can be used when it's unknown
which ports are actually implemented (the default now, when no port
list is provided to `Scan_Ports()`).
Change-Id: I5d8e289a907fe99c673084afbce54da65ba98e9c
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: https://review.coreboot.org/18123
Tested-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
diff --git a/common/hw-gfx-gma-display_probing.adb b/common/hw-gfx-gma-display_probing.adb
index 4420a66..97792cf 100644
--- a/common/hw-gfx-gma-display_probing.adb
+++ b/common/hw-gfx-gma-display_probing.adb
@@ -166,9 +166,10 @@
end Probe_Port;
procedure Scan_Ports
- (Configs : out Pipe_Configs;
- Ports : in Port_List;
- Max_Pipe : in Pipe_Index := Pipe_Index'Last)
+ (Configs : out Pipe_Configs;
+ Ports : in Port_List := All_Ports;
+ Max_Pipe : in Pipe_Index := Pipe_Index'Last;
+ Keep_Power : in Boolean := False)
is
Probe_Internal : Boolean := False;
@@ -211,7 +212,9 @@
end loop;
-- Restore power settings
- Power_And_Clocks.Power_Set_To (Cur_Configs);
+ if not Keep_Power then
+ Power_And_Clocks.Power_Set_To (Cur_Configs);
+ end if;
-- Turn panel power off if probing failed.
if Probe_Internal and not Port_Configured (Configs, Internal) then