gma: Always clear hot-plug events before enabling a pipe
For cold plugging, we don't wait for a hot-plug event. But, even if we
are not supposed to wait for a hot-plug event, we have to clear any
pending event. Also, a failed DP training can result in another hot-plug
event.
A stale event would be spuriously interpreted as a disconnect, resul-
ting in an infinite loop of cycling the pipe on and off.
Change-Id: I4c7bbe0ac792553c94e928ba0a5eeb822a857f9c
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: https://review.coreboot.org/18122
Tested-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
diff --git a/common/haswell_shared/hw-gfx-gma-port_detect.adb b/common/haswell_shared/hw-gfx-gma-port_detect.adb
index 2f5854d..01bd0fe 100644
--- a/common/haswell_shared/hw-gfx-gma-port_detect.adb
+++ b/common/haswell_shared/hw-gfx-gma-port_detect.adb
@@ -189,4 +189,14 @@
end if;
end Hotplug_Detect;
+ procedure Clear_Hotplug_Detect (Port : Active_Port_Type)
+ is
+ Ignored_HPD : Boolean;
+ begin
+ pragma Warnings (GNATprove, Off, "unused assignment to ""Ignored_HPD""",
+ Reason => "We want to clear pending events only");
+ Port_Detect.Hotplug_Detect (Port, Ignored_HPD);
+ pragma Warnings (GNATprove, On, "unused assignment to ""Ignored_HPD""");
+ end Clear_Hotplug_Detect;
+
end HW.GFX.GMA.Port_Detect;