gma g45: Read CDClk and calculate dot-clock limits
Numbers are taken from `intel_cdclk.c` of Linux' i915 driver.
We introduce three new procedures to the `Power_And_Clocks` interface:
o Limit_Dotclocks() limits the dot clocks of all pipe configs
according to the maximum supported CDClk. It also reports if
CDClk has to be switched for these configs.
o Update_CDClk() performs the CDClk switch if necessary. It may
further limit the dot clocks if the switch didn't succeed.
o Enable_CDClk() ensures that the CDClk is running. This may be
necessary to probe for DP displays when no pipes are active.
The latter two are no-ops for G45, as the CDClk runs at a fixed rate.
Dot clocks are limited to 90% of CDClk.
Change-Id: Ie50c0f8f51b3a0a6ed58c6461069c556cc92f51e
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/c/libgfxinit/+/35715
Reviewed-by: Matt DeVillier <matt.devillier@gmail.com>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
diff --git a/common/g45/hw-gfx-gma-power_and_clocks.ads b/common/g45/hw-gfx-gma-power_and_clocks.ads
index 8f6c13c..313239b 100644
--- a/common/g45/hw-gfx-gma-power_and_clocks.ads
+++ b/common/g45/hw-gfx-gma-power_and_clocks.ads
@@ -12,10 +12,22 @@
-- GNU General Public License for more details.
--
+with HW.GFX.GMA.Config_Helpers;
+
private package HW.GFX.GMA.Power_And_Clocks is
procedure Initialize;
+ procedure Limit_Dotclocks
+ (Configs : in out Pipe_Configs;
+ CDClk_Switch : out Boolean)
+ with
+ Post =>
+ not CDClk_Switch and
+ Config_Helpers.Stable_FB (Configs'Old, Configs);
+ procedure Update_CDClk (Configs : in out Pipe_Configs) is null;
+ procedure Enable_CDClk is null;
+
procedure Pre_All_Off is null;
procedure Post_All_Off is null;