Nico Huber has submitted this change. ( https://review.coreboot.org/c/libgfxinit/+/35720 )
Change subject: gma display_probing: Add Hotplug_Events() ......................................................................
gma display_probing: Add Hotplug_Events()
The Hotplug_Events() procedure returns a list of ports with hotplug events. The events are automatically cleared, so it's the caller's responsibility to act accordingly (e.g. run Update_Outputs() with updated configurations).
Change-Id: Iff5e812d3119bfd44f5ea58e5086aa3ccba7c0bf Signed-off-by: Nico Huber nico.h@gmx.de Reviewed-on: https://review.coreboot.org/c/libgfxinit/+/35720 Reviewed-by: Arthur Heymans arthur@aheymans.xyz Reviewed-by: Angel Pons th3fanbus@gmail.com Reviewed-by: Matt DeVillier matt.devillier@gmail.com --- M common/hw-gfx-gma-display_probing.adb M common/hw-gfx-gma-display_probing.ads 2 files changed, 19 insertions(+), 0 deletions(-)
Approvals: Nico Huber: Verified Matt DeVillier: Looks good to me, but someone else must approve Arthur Heymans: Looks good to me, approved Angel Pons: Looks good to me, approved
diff --git a/common/hw-gfx-gma-display_probing.adb b/common/hw-gfx-gma-display_probing.adb index 74e2ad8..0d7cd37 100644 --- a/common/hw-gfx-gma-display_probing.adb +++ b/common/hw-gfx-gma-display_probing.adb @@ -19,6 +19,7 @@ with HW.GFX.GMA.I2C; with HW.GFX.GMA.DP_Aux_Ch; with HW.GFX.GMA.Panel; +with HW.GFX.GMA.Port_Detect; with HW.GFX.GMA.Power_And_Clocks;
with HW.Debug; @@ -215,4 +216,20 @@ end if; end Scan_Ports;
+ procedure Hotplug_Events (Ports : out Port_List) + is + I : Port_List_Range := Port_List_Range'First; + Detected : Boolean; + begin + Ports := (others => Disabled); + for P in Active_Port_Type loop + Port_Detect.Hotplug_Detect (P, Detected); + if Detected then + Ports (I) := P; + exit when I = Port_List_Range'Last; + I := Port_List_Range'Succ (I); + end if; + end loop; + end Hotplug_Events; + end HW.GFX.GMA.Display_Probing; diff --git a/common/hw-gfx-gma-display_probing.ads b/common/hw-gfx-gma-display_probing.ads index e51de88..5e8abe4 100644 --- a/common/hw-gfx-gma-display_probing.ads +++ b/common/hw-gfx-gma-display_probing.ads @@ -35,4 +35,6 @@ Max_Pipe : in Pipe_Index := Pipe_Index'Last; Keep_Power : in Boolean := False);
+ procedure Hotplug_Events (Ports : out Port_List); + end HW.GFX.GMA.Display_Probing;