Nico Huber has uploaded this change for review.

View Change

gma hsw+: Treat DDI E and PCH DAC disabling separately

We only use DDI E for analog VGA outputs through the PCH DAC. DDI E
might be configured differently, though, by a previously running dri-
ver, so we have to treat the two entities seperately on the All_Off()
path.

Change-Id: I603ecd29c48af43bc21acaadbedaeae451acbcf3
Signed-off-by: Nico Huber <nico.h@gmx.de>
---
M common/haswell_shared/hw-gfx-gma-connectors-ddi.adb
M common/haswell_shared/hw-gfx-gma-connectors.adb
M common/haswell_shared/hw-gfx-gma-port_detect.adb
M common/hw-gfx-gma-config.ads.template
4 files changed, 10 insertions(+), 12 deletions(-)

git pull ssh://review.coreboot.org:29418/libgfxinit refs/changes/22/20822/1
diff --git a/common/haswell_shared/hw-gfx-gma-connectors-ddi.adb b/common/haswell_shared/hw-gfx-gma-connectors-ddi.adb
index 4440376..a93f3ec 100644
--- a/common/haswell_shared/hw-gfx-gma-connectors-ddi.adb
+++ b/common/haswell_shared/hw-gfx-gma-connectors-ddi.adb
@@ -559,7 +559,7 @@
begin
pragma Debug (Debug.Put_Line (GNAT.Source_Info.Enclosing_Entity));

- if Port = DIGI_E then
+ if Config.Has_PCH_DAC and then Port = DIGI_E then
PCH.VGA.Off;
PCH.Transcoder.Off (PCH.FDI_A);
-- PCH.VGA.Clock_Off; -- Can't tell what Linux does, if anything.
@@ -570,7 +570,9 @@

if Port = DIGI_E then
SPLL.Off;
- PCH.FDI.Off (PCH.FDI_A, PCH.FDI.Clock_Off);
+ if Config.Has_PCH_DAC then
+ PCH.FDI.Off (PCH.FDI_A, PCH.FDI.Clock_Off);
+ end if;
end if;
end Off;

diff --git a/common/haswell_shared/hw-gfx-gma-connectors.adb b/common/haswell_shared/hw-gfx-gma-connectors.adb
index 734b11a..6a8227c 100644
--- a/common/haswell_shared/hw-gfx-gma-connectors.adb
+++ b/common/haswell_shared/hw-gfx-gma-connectors.adb
@@ -86,9 +86,6 @@
for Port in Digital_Port range DIGI_A .. Config.Last_Digital_Port loop
DDI.Off (Port);
end loop;
- if Config.Is_FDI_Port (Analog) then
- DDI.Off (DIGI_E);
- end if;
end Post_All_Off;

end HW.GFX.GMA.Connectors;
diff --git a/common/haswell_shared/hw-gfx-gma-port_detect.adb b/common/haswell_shared/hw-gfx-gma-port_detect.adb
index 1302cf0..be83bd5 100644
--- a/common/haswell_shared/hw-gfx-gma-port_detect.adb
+++ b/common/haswell_shared/hw-gfx-gma-port_detect.adb
@@ -124,7 +124,9 @@
Config.Valid_Port (Internal) := Internal_Detected;

-- DDI_[BCD]
- for Port in Ext_Digital_Port range DIGI_B .. Config.Last_Digital_Port loop
+ for Port in Ext_Digital_Port range
+ DIGI_B .. Ext_Digital_Port'Min (DIGI_D, Config.Last_Digital_Port)
+ loop
if Config.Has_Presence_Straps then
Registers.Is_Set_Mask
(Register => Registers.SFUSE_STRAP,
diff --git a/common/hw-gfx-gma-config.ads.template b/common/hw-gfx-gma-config.ads.template
index 55696c7..5b51941 100644
--- a/common/hw-gfx-gma-config.ads.template
+++ b/common/hw-gfx-gma-config.ads.template
@@ -172,7 +172,7 @@
Valid_Port : Valid_Per_Port renames Valid_Port_GPU (CPU);

Last_Digital_Port : constant Digital_Port :=
- (if Has_DDI_D then DIGI_D else DIGI_C);
+ (if Has_DDI_E then DIGI_E else DIGI_C);

----------------------------------------------------------------------------

@@ -182,11 +182,8 @@
when Ironlake .. Ivybridge => FDI_Per_Port'
(Internal => Internal_Display = LVDS,
others => True),
- when Haswell => FDI_Per_Port'
- (Analog => True,
- others => False),
- when Broadwell => FDI_Per_Port'
- (Analog => CPU_Var = Normal,
+ when Haswell .. Broadwell => FDI_Per_Port'
+ (Analog => Has_PCH_DAC,
others => False),
when others => FDI_Per_Port'
(others => False));

To view, visit change 20822. To unsubscribe, visit settings.

Gerrit-Project: libgfxinit
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I603ecd29c48af43bc21acaadbedaeae451acbcf3
Gerrit-Change-Number: 20822
Gerrit-PatchSet: 1
Gerrit-Owner: Nico Huber <nico.h@gmx.de>