gma-display_probing: Enable panel power early
Before probing the internal panels EDID, we have to wait for the panel
power up delay. To use this time, we enable the panel power before pro-
bing any port and can probe external ports during the delay. On a T420
this saves about 5ms without an external display connected and 15ms
with.
Change-Id: Idce2ebbdb60182c9161e0a92ee4d42ff50c95688
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/17759
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 7320004..4420a66 100644
--- a/common/hw-gfx-gma-display_probing.adb
+++ b/common/hw-gfx-gma-display_probing.adb
@@ -128,7 +128,7 @@
if Success then
if Port = Internal then
- Panel.On;
+ Panel.Wait_On;
end if;
Read_EDID (Raw_EDID, Port, Success);
end if;
@@ -162,9 +162,6 @@
pragma Warnings (GNATprove, On, "unused assignment to ""Raw_EDID""");
else
Success := False;
- if Port = Internal then
- Panel.Off;
- end if;
end if;
end Probe_Port;
@@ -173,6 +170,8 @@
Ports : in Port_List;
Max_Pipe : in Pipe_Index := Pipe_Index'Last)
is
+ Probe_Internal : Boolean := False;
+
Port_Idx : Port_List_Range := Port_List_Range'First;
Success : Boolean;
begin
@@ -181,6 +180,16 @@
Mode => Invalid_Mode,
Framebuffer => Default_FB));
+ -- Turn panel on early to probe other ports during the power on delay.
+ for Idx in Port_List_Range loop
+ exit when Ports (Idx) = Disabled;
+ if Ports (Idx) = Internal then
+ Panel.On (Wait => False);
+ Probe_Internal := True;
+ exit;
+ end if;
+ end loop;
+
for Pipe in Pipe_Index range
Pipe_Index'First .. Pipe_Index'Min (Max_Pipe, Config.Max_Pipe)
loop
@@ -203,6 +212,11 @@
-- Restore power settings
Power_And_Clocks.Power_Set_To (Cur_Configs);
+
+ -- Turn panel power off if probing failed.
+ if Probe_Internal and not Port_Configured (Configs, Internal) then
+ Panel.Off;
+ end if;
end Scan_Ports;
end HW.GFX.GMA.Display_Probing;