gma: Replace Is_Digital_Port() with DDI_Port range check
Change-Id: Ida4396e9485ae207a62f24a35507b0f4c2cfde71
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.sourcearcade.org/c/libgfxinit/+/511
Tested-by: Ada SPARK <gnatbot@sourcearcade.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: Thomas Heijligen <src@posteo.de>
diff --git a/common/hw-gfx-gma-transcoder.adb b/common/hw-gfx-gma-transcoder.adb
index 40dcaaf..74d5970 100644
--- a/common/hw-gfx-gma-transcoder.adb
+++ b/common/hw-gfx-gma-transcoder.adb
@@ -330,7 +330,7 @@
begin
pragma Debug (Debug.Put_Line (GNAT.Source_Info.Enclosing_Entity));
if Config.Has_Pipe_DDI_Func then
- if Is_Digital_Port (Port_Cfg.Port) then
+ if Port_Cfg.Port in DDI_Port then
Registers.Write
(Register => Trans.DDI_FUNC_CTL,
Value => DDI_Select or
@@ -362,7 +362,7 @@
Configure (Pipe, Port_Cfg, Scale);
end if;
- if Config.Has_Pipe_DDI_Func and Is_Digital_Port (Port_Cfg.Port) then
+ if Config.Has_Pipe_DDI_Func and then Port_Cfg.Port in DDI_Port then
Registers.Set_Mask
(Register => Trans.DDI_FUNC_CTL,
Mask => DDI_FUNC_CTL_ENABLE);
diff --git a/common/hw-gfx-gma.ads b/common/hw-gfx-gma.ads
index 3ee3d18..d33dfc3 100644
--- a/common/hw-gfx-gma.ads
+++ b/common/hw-gfx-gma.ads
@@ -332,9 +332,6 @@
Static_Predicate => (TGL_Digital_Port /= DIGI_D and TGL_Digital_Port /= DIGI_E);
subtype XELPD_Digital_Port is GPU_Port range DIGI_A .. DDI_TC4;
- function Is_Digital_Port (Port : GPU_Port) return Boolean is
- (Port in Digital_Port or Port in TGL_Digital_Port);
-
type PCH_Port is
(PCH_DAC, PCH_LVDS,
PCH_HDMI_A, PCH_HDMI_B, PCH_HDMI_C, PCH_HDMI_D,