common: Turn off VGA when not in use anymore
When VGA mode is up on Alder Lake or Raptor Lake devices,
`Update_Outputs' does successfully turn off graphics but it also
leaves some undesirable configuration which can confuse following
graphics drivers such as the PEIM graphics driver.
Experimentally, we have identified that `libgfxinit' should turn off
VGA when it disables the ouput which was using this mode.
BUG=b:264526798
BRANCH=firmware-brya-14505.B
TEST=Developer screen shows up on the recovery flow on skolas
Change-Id: Id39c308a4d0408b996834439186645b33e692d02
Signed-off-by: Jeremy Compostella <jeremy.compostella@intel.com>
Reviewed-on: https://review.coreboot.org/c/libgfxinit/+/72123
Reviewed-by: Tarun Tuli <taruntuli@google.com>
Reviewed-by: Nick Vaccaro <nvaccaro@google.com>
Tested-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
diff --git a/common/hw-gfx-gma.adb b/common/hw-gfx-gma.adb
index 1db493f..4a1050e 100644
--- a/common/hw-gfx-gma.adb
+++ b/common/hw-gfx-gma.adb
@@ -210,6 +210,10 @@
("Disabling port " & Port_Names (Pipe_Cfg.Port)));
pragma Debug (Debug.New_Line);
+ if Pipe_Cfg.Framebuffer.Offset = VGA_PLANE_FRAMEBUFFER_OFFSET then
+ Display_Controller.Legacy_VGA_Off;
+ end if;
+
Connectors.Pre_Off (Port_Cfg);
Display_Controller.Off (Pipe);
Connectors.Post_Off (Port_Cfg);