From 02cfbb3df00cd346877a258e2ee54f78ae0e0e16 Mon Sep 17 00:00:00 2001 From: Nico Huber Date: Mon, 9 Jan 2017 17:41:18 +0100 Subject: [PATCH] gma: Choose FDI-link settings after mode determination We chose the FDI-link settings too early, before we even set the mode's BPC in case the default for an output should be selected. This resulted in a too small lane count for the FDI in corner cases. Change-Id: I12c6465c296bda4b7af116bd5a4c3d2ce593a3ac Signed-off-by: Nico Huber Reviewed-on: https://review.coreboot.org/18115 Tested-by: Nico Huber Reviewed-by: Patrick Georgi --- common/hw-gfx-gma-config_helpers.adb | 44 +++++++++++++--------------- 1 file changed, 21 insertions(+), 23 deletions(-) diff --git a/common/hw-gfx-gma-config_helpers.adb b/common/hw-gfx-gma-config_helpers.adb index 3a41baf56c..0f60375d4c 100644 --- a/common/hw-gfx-gma-config_helpers.adb +++ b/common/hw-gfx-gma-config_helpers.adb @@ -139,32 +139,30 @@ is FDI => Default_DP, DP => Default_DP); - if Port_Cfg.Is_FDI then - Configure_FDI_Link (Port_Cfg, Success); + if Port_Cfg.Mode.BPC = Auto_BPC then + Port_Cfg.Mode.BPC := Connector_Info.Default_BPC (Port_Cfg); end if; - if Success then - if Port_Cfg.Mode.BPC = Auto_BPC then - Port_Cfg.Mode.BPC := Connector_Info.Default_BPC (Port_Cfg); - end if; + if Port_Cfg.Display = HDMI then + declare + pragma Assert (Config.HDMI_Max_Clock_24bpp * 8 + / Port_Cfg.Mode.BPC >= Frequency_Type'First); + Max_Dotclock : constant Frequency_Type := + Config.HDMI_Max_Clock_24bpp * 8 / Port_Cfg.Mode.BPC; + begin + if Port_Cfg.Mode.Dotclock > Max_Dotclock then + pragma Debug (Debug.Put ("Dotclock ")); + pragma Debug (Debug.Put_Int64 (Port_Cfg.Mode.Dotclock)); + pragma Debug (Debug.Put (" too high, limiting to ")); + pragma Debug (Debug.Put_Int64 (Max_Dotclock)); + pragma Debug (Debug.Put_Line (".")); + Port_Cfg.Mode.Dotclock := Max_Dotclock; + end if; + end; + end if; - if Port_Cfg.Display = HDMI then - declare - pragma Assert (Config.HDMI_Max_Clock_24bpp * 8 - / Port_Cfg.Mode.BPC >= Frequency_Type'First); - Max_Dotclock : constant Frequency_Type := - Config.HDMI_Max_Clock_24bpp * 8 / Port_Cfg.Mode.BPC; - begin - if Port_Cfg.Mode.Dotclock > Max_Dotclock then - pragma Debug (Debug.Put ("Dotclock ")); - pragma Debug (Debug.Put_Int64 (Port_Cfg.Mode.Dotclock)); - pragma Debug (Debug.Put (" too high, limiting to ")); - pragma Debug (Debug.Put_Int64 (Max_Dotclock)); - pragma Debug (Debug.Put_Line (".")); - Port_Cfg.Mode.Dotclock := Max_Dotclock; - end if; - end; - end if; + if Port_Cfg.Is_FDI then + Configure_FDI_Link (Port_Cfg, Success); end if; else Port_Cfg := Port_Config'