gma display_probing: Make new TGL ports available
Make all the new ports available that were added to `Port_Type` in
commit ad09609c677b (gma: Re-structure TC port types).
Change-Id: I9d96673f931be0086536044694ecd127ba2a823d
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: https://review.sourcearcade.org/c/libgfxinit/+/457
Tested-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
diff --git a/common/hw-gfx-gma-display_probing.adb b/common/hw-gfx-gma-display_probing.adb
index b313ded..491a88f 100644
--- a/common/hw-gfx-gma-display_probing.adb
+++ b/common/hw-gfx-gma-display_probing.adb
@@ -43,6 +43,14 @@
when DP1 => HDMI1,
when DP2 => HDMI2,
when DP3 => HDMI3,
+ when HDMI_TC1 => DP_TC1,
+ when HDMI_TC2 => DP_TC2,
+ when HDMI_TC3 => DP_TC3,
+ when HDMI_TC4 => DP_TC4,
+ when DP_TC1 => HDMI_TC1,
+ when DP_TC2 => HDMI_TC2,
+ when DP_TC3 => HDMI_TC3,
+ when DP_TC4 => HDMI_TC4,
when others => Disabled);
function Has_Sibling_Port (Port : Port_Type) return Boolean is
@@ -75,12 +83,25 @@
declare
DP_Port : constant GMA.DP_Port :=
- (case Port is
- when eDP => DP_A,
- when DP1 => DP_B,
- when DP2 => DP_C,
- when DP3 => DP_D,
- when others => GMA.DP_Port'First);
+ (if Config.Has_Type_C_Ports then
+ (case Config_Helpers.To_GPU_Port (Pipe_Index'First, Port) is
+ when DIGI_A => DP_A,
+ when DIGI_B => DP_B,
+ when DIGI_C => DP_C,
+ when DDI_TC1 => DP_D,
+ when DDI_TC2 => DP_E,
+ when DDI_TC3 => DP_F,
+ when DDI_TC4 => DP_G,
+ when DDI_TC5 => DP_H,
+ when DDI_TC6 => DP_I,
+ when others => GMA.DP_Port'First)
+ else
+ (case Port is
+ when eDP => DP_A,
+ when DP1 => DP_B,
+ when DP2 => DP_C,
+ when DP3 => DP_D,
+ when others => GMA.DP_Port'First));
begin
DP_Aux_Ch.I2C_Read
(Port => DP_Port,
diff --git a/common/hw-gfx-gma-display_probing.ads b/common/hw-gfx-gma-display_probing.ads
index 5dcdbd4..9c59652 100644
--- a/common/hw-gfx-gma-display_probing.ads
+++ b/common/hw-gfx-gma-display_probing.ads
@@ -17,10 +17,13 @@
package HW.GFX.GMA.Display_Probing
is
- type Port_List_Range is range 0 .. 8;
+ type Port_List_Range is range 0 .. 20;
type Port_List is array (Port_List_Range) of Port_Type;
All_Ports : constant Port_List :=
- (DP1, DP2, DP3, HDMI1, HDMI2, HDMI3, Analog, LVDS, eDP);
+ (DP1, DP2, DP3, DP_TC1, DP_TC2, DP_TC3, DP_TC4,
+ HDMI1, HDMI2, HDMI3, HDMI_TC1, HDMI_TC2, HDMI_TC3, HDMI_TC4,
+ USBC1, USBC2, USBC3, USBC4,
+ Analog, LVDS, eDP);
procedure Read_EDID
(Raw_EDID : out EDID.Raw_EDID_Data;