From 4c7356db3bddbf07f85ab52787dc49ca9b600cb3 Mon Sep 17 00:00:00 2001 From: Nico Huber Date: Fri, 16 Dec 2016 14:22:32 +0100 Subject: [PATCH] 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 Reviewed-on: https://review.coreboot.org/18123 Tested-by: Nico Huber Reviewed-by: Arthur Heymans --- common/hw-gfx-gma-display_probing.adb | 11 +++++++---- common/hw-gfx-gma-display_probing.ads | 9 ++++++--- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/common/hw-gfx-gma-display_probing.adb b/common/hw-gfx-gma-display_probing.adb index 4420a660b0..97792cf800 100644 --- a/common/hw-gfx-gma-display_probing.adb +++ b/common/hw-gfx-gma-display_probing.adb @@ -166,9 +166,10 @@ is 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 @@ is 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 diff --git a/common/hw-gfx-gma-display_probing.ads b/common/hw-gfx-gma-display_probing.ads index 3d1e9147ad..f5cd839bd1 100644 --- a/common/hw-gfx-gma-display_probing.ads +++ b/common/hw-gfx-gma-display_probing.ads @@ -17,10 +17,13 @@ is type Port_List_Range is range 0 .. 7; type Port_List is array (Port_List_Range) of Port_Type; + All_Ports : constant Port_List := + (DP1, DP2, DP3, HDMI1, HDMI2, HDMI3, Analog, Internal); 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); end HW.GFX.GMA.Display_Probing;