Nico Huber has uploaded this change for review. ( https://review.coreboot.org/c/libgfxinit/+/35529 )
Change subject: gma config_helpers: Add Maximum_Dotclock() function ......................................................................
gma config_helpers: Add Maximum_Dotclock() function
Change-Id: Iaa25e774d38c7af12150523739d902cf8e758674 Signed-off-by: Nico Huber nico.h@gmx.de --- M common/hw-gfx-gma-config_helpers.adb M common/hw-gfx-gma-config_helpers.ads 2 files changed, 14 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/libgfxinit refs/changes/29/35529/1
diff --git a/common/hw-gfx-gma-config_helpers.adb b/common/hw-gfx-gma-config_helpers.adb index a86af9e..8614787 100644 --- a/common/hw-gfx-gma-config_helpers.adb +++ b/common/hw-gfx-gma-config_helpers.adb @@ -79,6 +79,18 @@ when DP1 .. DP3 => DP); end To_Display_Type;
+ function Maximum_Dotclock (Configs : Pipe_Configs) return Frequency_Type + is + Max : Frequency_Type := Frequency_Type'First; + begin + for I in Pipe_Index loop + if Max < Configs (I).Mode.Dotclock then + Max := Configs (I).Mode.Dotclock; + end if; + end loop; + return Max; + end Maximum_Dotclock; + ----------------------------------------------------------------------------
-- Prepares link rate and lane count settings for an FDI connection. diff --git a/common/hw-gfx-gma-config_helpers.ads b/common/hw-gfx-gma-config_helpers.ads index a2aeb06..4756af2 100644 --- a/common/hw-gfx-gma-config_helpers.ads +++ b/common/hw-gfx-gma-config_helpers.ads @@ -28,6 +28,8 @@
function To_Display_Type (Port : Active_Port_Type) return Display_Type;
+ function Maximum_Dotclock (Configs : Pipe_Configs) return Frequency_Type; + procedure Fill_Port_Config (Port_Cfg : out Port_Config; Pipe : in Pipe_Index;
Nico Huber has uploaded a new patch set (#2). ( https://review.coreboot.org/c/libgfxinit/+/35529 )
Change subject: gma config_helpers: Add dot clock helper functions ......................................................................
gma config_helpers: Add dot clock helper functions
Highest_Dotclock() returns the highest dot clock in a set of pipe configurations.
Limit_Dotclock() reduces any dot clock to the given maximum if it exceeds the latter.
Change-Id: Iaa25e774d38c7af12150523739d902cf8e758674 Signed-off-by: Nico Huber nico.h@gmx.de --- M common/hw-gfx-gma-config_helpers.adb M common/hw-gfx-gma-config_helpers.ads 2 files changed, 42 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/libgfxinit refs/changes/29/35529/2
Hello Arthur Heymans, Matt DeVillier, Thomas Heijligen,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/libgfxinit/+/35529
to look at the new patch set (#4).
Change subject: gma config_helpers: Add dot-clock helper functions ......................................................................
gma config_helpers: Add dot-clock helper functions
Highest_Dotclock() returns the highest dot clock in a set of pipe configurations.
Limit_Dotclocks() reduces any dot clock to the given maximum if it exceeds the latter. To prove that Limit_Dotclocks() only changes timing, we introduce Stable_FB().
Change-Id: Iaa25e774d38c7af12150523739d902cf8e758674 Signed-off-by: Nico Huber nico.h@gmx.de --- M common/hw-gfx-gma-config_helpers.adb M common/hw-gfx-gma-config_helpers.ads 2 files changed, 48 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/libgfxinit refs/changes/29/35529/4
Nico Huber has posted comments on this change. ( https://review.coreboot.org/c/libgfxinit/+/35529 )
Change subject: gma config_helpers: Add dot-clock helper functions ......................................................................
Patch Set 4: Verified+1
Hello Arthur Heymans, Matt DeVillier, Thomas Heijligen,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/libgfxinit/+/35529
to look at the new patch set (#5).
Change subject: gma config_helpers: Add dot-clock helper functions ......................................................................
gma config_helpers: Add dot-clock helper functions
Highest_Dotclock() returns the highest dot clock in a set of pipe configurations.
Limit_Dotclocks() reduces any dot clock to the given maximum if it exceeds the latter. To prove that Limit_Dotclocks() only changes timing, we introduce Stable_FB().
Change-Id: Iaa25e774d38c7af12150523739d902cf8e758674 Signed-off-by: Nico Huber nico.h@gmx.de --- M common/hw-gfx-gma-config_helpers.adb M common/hw-gfx-gma-config_helpers.ads 2 files changed, 49 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/libgfxinit refs/changes/29/35529/5
Nico Huber has posted comments on this change. ( https://review.coreboot.org/c/libgfxinit/+/35529 )
Change subject: gma config_helpers: Add dot-clock helper functions ......................................................................
Patch Set 5: Verified+1
Arthur Heymans has posted comments on this change. ( https://review.coreboot.org/c/libgfxinit/+/35529 )
Change subject: gma config_helpers: Add dot-clock helper functions ......................................................................
Patch Set 5: Code-Review+2
Nico Huber has submitted this change. ( https://review.coreboot.org/c/libgfxinit/+/35529 )
Change subject: gma config_helpers: Add dot-clock helper functions ......................................................................
gma config_helpers: Add dot-clock helper functions
Highest_Dotclock() returns the highest dot clock in a set of pipe configurations.
Limit_Dotclocks() reduces any dot clock to the given maximum if it exceeds the latter. To prove that Limit_Dotclocks() only changes timing, we introduce Stable_FB().
Change-Id: Iaa25e774d38c7af12150523739d902cf8e758674 Signed-off-by: Nico Huber nico.h@gmx.de Reviewed-on: https://review.coreboot.org/c/libgfxinit/+/35529 Reviewed-by: Arthur Heymans arthur@aheymans.xyz --- M common/hw-gfx-gma-config_helpers.adb M common/hw-gfx-gma-config_helpers.ads 2 files changed, 49 insertions(+), 1 deletion(-)
Approvals: Nico Huber: Verified Arthur Heymans: Looks good to me, approved
diff --git a/common/hw-gfx-gma-config_helpers.adb b/common/hw-gfx-gma-config_helpers.adb index c95bebc..162c9c6 100644 --- a/common/hw-gfx-gma-config_helpers.adb +++ b/common/hw-gfx-gma-config_helpers.adb @@ -1,5 +1,5 @@ -- --- Copyright (C) 2015-2016 secunet Security Networks AG +-- Copyright (C) 2015-2016, 2019 secunet Security Networks AG -- -- This program is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by @@ -80,6 +80,33 @@ when DP1 .. DP3 => DP); end To_Display_Type;
+ function Highest_Dotclock (Configs : Pipe_Configs) return Frequency_Type + is + Max : Frequency_Type := Frequency_Type'First; + begin + for I in Pipe_Index loop + if Configs (I).Port /= Disabled and + Max < Configs (I).Mode.Dotclock + then + Max := Configs (I).Mode.Dotclock; + end if; + end loop; + return Max; + end Highest_Dotclock; + + procedure Limit_Dotclocks + (Configs : in out Pipe_Configs; + Max : in Frequency_Type) is + begin + for I in Pipe_Index loop + if Configs (I).Port /= Disabled and + Max < Configs (I).Mode.Dotclock + then + Configs (I).Mode.Dotclock := Max; + end if; + end loop; + end Limit_Dotclocks; + ----------------------------------------------------------------------------
-- Prepares link rate and lane count settings for an FDI connection. diff --git a/common/hw-gfx-gma-config_helpers.ads b/common/hw-gfx-gma-config_helpers.ads index 7bbf423..f02b6e5 100644 --- a/common/hw-gfx-gma-config_helpers.ads +++ b/common/hw-gfx-gma-config_helpers.ads @@ -60,4 +60,25 @@ with Post => (if Validate_Config'Result then Valid_FB (FB, Mode));
+ -- For still active pipes, ensure only timings + -- changed that don't affect FB validity. + function Stable_FB (Old_C, New_C : Pipe_Configs) return Boolean is + (for all P in Pipe_Index => + New_C (P).Port = Disabled or + (New_C (P).Port = Old_C (P).Port and + New_C (P).Framebuffer = Old_C (P).Framebuffer and + New_C (P).Cursor = Old_C (P).Cursor and + New_C (P).Mode.H_Visible = Old_C (P).Mode.H_Visible and + New_C (P).Mode.V_Visible = Old_C (P).Mode.V_Visible)); + + ---------------------------------------------------------------------------- + + function Highest_Dotclock (Configs : Pipe_Configs) return Frequency_Type; + + procedure Limit_Dotclocks + (Configs : in out Pipe_Configs; + Max : in Frequency_Type) + with + Post => Stable_FB (Configs'Old, Configs); + end HW.GFX.GMA.Config_Helpers;