<p>Nico Huber has uploaded this change for <strong>review</strong>.</p><p><a href="https://review.coreboot.org/26663">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">gma hsw: Enable Power Down Well for scaling on DDI A<br><br>The primary pipe can drive DDI A (eDP) without the Power Down<br>Well (PDW). The scalers are inside the PDW, though. To enable<br>scaling for DDI A, ensure the PDW is active.<br><br>When switching between scaled / unscaled modes, we'll have to<br>reconfigure the whole pipe.<br><br>Change-Id: I46318bb74d00a584d268a9d76787f8b26249264d<br>Signed-off-by: Nico Huber <nico.h@gmx.de><br>---<br>M common/haswell_shared/hw-gfx-gma-power_and_clocks_haswell.adb<br>M common/hw-gfx-gma-config.ads.template<br>M common/hw-gfx-gma.adb<br>M common/hw-gfx-gma.ads<br>4 files changed, 35 insertions(+), 16 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://review.coreboot.org:29418/libgfxinit refs/changes/63/26663/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/common/haswell_shared/hw-gfx-gma-power_and_clocks_haswell.adb b/common/haswell_shared/hw-gfx-gma-power_and_clocks_haswell.adb</span><br><span>index c0d1e78..1c23254 100644</span><br><span>--- a/common/haswell_shared/hw-gfx-gma-power_and_clocks_haswell.adb</span><br><span>+++ b/common/haswell_shared/hw-gfx-gma-power_and_clocks_haswell.adb</span><br><span>@@ -1,5 +1,5 @@</span><br><span> --</span><br><span>--- Copyright (C) 2014-2016 secunet Security Networks AG</span><br><span style="color: hsl(120, 100%, 40%);">+-- Copyright (C) 2014-2018 secunet Security Networks AG</span><br><span> --</span><br><span> -- This program is free software; you can redistribute it and/or modify</span><br><span> -- it under the terms of the GNU General Public License as published by</span><br><span>@@ -185,12 +185,19 @@</span><br><span> end if;</span><br><span> end PDW_On;</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">- function Need_PDW (Checked_Configs : Pipe_Configs) return Boolean is</span><br><span style="color: hsl(120, 100%, 40%);">+ function Need_PDW (Checked_Configs : Pipe_Configs) return Boolean</span><br><span style="color: hsl(120, 100%, 40%);">+ is</span><br><span style="color: hsl(120, 100%, 40%);">+ Primary : Pipe_Config renames Checked_Configs (GMA.Primary);</span><br><span> begin</span><br><span style="color: hsl(0, 100%, 40%);">- return (Checked_Configs (Primary).Port /= Disabled and</span><br><span style="color: hsl(0, 100%, 40%);">- Checked_Configs (Primary).Port /= Internal) or</span><br><span style="color: hsl(0, 100%, 40%);">- Checked_Configs (Secondary).Port /= Disabled or</span><br><span style="color: hsl(0, 100%, 40%);">- Checked_Configs (Tertiary).Port /= Disabled;</span><br><span style="color: hsl(120, 100%, 40%);">+ return</span><br><span style="color: hsl(120, 100%, 40%);">+ (Config.Use_PDW_For_EDP_Scaling and then</span><br><span style="color: hsl(120, 100%, 40%);">+ (Primary.Port = Internal and Requires_Scaling (Primary)))</span><br><span style="color: hsl(120, 100%, 40%);">+ or</span><br><span style="color: hsl(120, 100%, 40%);">+ (Primary.Port /= Disabled and Primary.Port /= Internal)</span><br><span style="color: hsl(120, 100%, 40%);">+ or</span><br><span style="color: hsl(120, 100%, 40%);">+ Checked_Configs (Secondary).Port /= Disabled</span><br><span style="color: hsl(120, 100%, 40%);">+ or</span><br><span style="color: hsl(120, 100%, 40%);">+ Checked_Configs (Tertiary).Port /= Disabled;</span><br><span> end Need_PDW;</span><br><span> </span><br><span> ----------------------------------------------------------------------------</span><br><span>diff --git a/common/hw-gfx-gma-config.ads.template b/common/hw-gfx-gma-config.ads.template</span><br><span>index 049f473..688113b 100644</span><br><span>--- a/common/hw-gfx-gma-config.ads.template</span><br><span>+++ b/common/hw-gfx-gma-config.ads.template</span><br><span>@@ -1,5 +1,5 @@</span><br><span> --</span><br><span>--- Copyright (C) 2015-2017 secunet Security Networks AG</span><br><span style="color: hsl(120, 100%, 40%);">+-- Copyright (C) 2015-2018 secunet Security Networks AG</span><br><span> --</span><br><span> -- This program is free software; you can redistribute it and/or modify</span><br><span> -- it under the terms of the GNU General Public License as published by</span><br><span>@@ -47,6 +47,7 @@</span><br><span> (CPU in Haswell .. Broadwell);</span><br><span> Pipe_Enabled_Workaround : constant Boolean := CPU = Broadwell;</span><br><span> Has_EDP_Transcoder : constant Boolean := CPU >= Haswell;</span><br><span style="color: hsl(120, 100%, 40%);">+ Use_PDW_For_EDP_Scaling : constant Boolean := CPU = Haswell;</span><br><span> Has_Pipe_DDI_Func : constant Boolean := CPU >= Haswell;</span><br><span> Has_Trans_Clk_Sel : constant Boolean := CPU >= Haswell;</span><br><span> Has_Pipe_MSA_Misc : constant Boolean := CPU >= Haswell;</span><br><span>diff --git a/common/hw-gfx-gma.adb b/common/hw-gfx-gma.adb</span><br><span>index 809881a..2a8e843 100644</span><br><span>--- a/common/hw-gfx-gma.adb</span><br><span>+++ b/common/hw-gfx-gma.adb</span><br><span>@@ -1,5 +1,5 @@</span><br><span> --</span><br><span>--- Copyright (C) 2014-2017 secunet Security Networks AG</span><br><span style="color: hsl(120, 100%, 40%);">+-- Copyright (C) 2014-2018 secunet Security Networks AG</span><br><span> -- Copyright (C) 2017 Nico Huber <nico.h@gmx.de></span><br><span> --</span><br><span> -- This program is free software; you can redistribute it and/or modify</span><br><span>@@ -231,6 +231,17 @@</span><br><span> Power_Changed := True;</span><br><span> end if;</span><br><span> end Update_Power;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ function Full_Update (Cur_Config, New_Config : Pipe_Config) return Boolean</span><br><span style="color: hsl(120, 100%, 40%);">+ is</span><br><span style="color: hsl(120, 100%, 40%);">+ begin</span><br><span style="color: hsl(120, 100%, 40%);">+ return</span><br><span style="color: hsl(120, 100%, 40%);">+ Cur_Config.Port /= New_Config.Port or else</span><br><span style="color: hsl(120, 100%, 40%);">+ Cur_Config.Mode /= New_Config.Mode or else</span><br><span style="color: hsl(120, 100%, 40%);">+ (Config.Use_PDW_For_EDP_Scaling and then</span><br><span style="color: hsl(120, 100%, 40%);">+ (Cur_Config.Port = Internal and</span><br><span style="color: hsl(120, 100%, 40%);">+ Requires_Scaling (Cur_Config) /= Requires_Scaling (New_Config)));</span><br><span style="color: hsl(120, 100%, 40%);">+ end Full_Update;</span><br><span> begin</span><br><span> Old_Configs := Cur_Configs;</span><br><span> </span><br><span>@@ -244,10 +255,7 @@</span><br><span> if Cur_Config.Port /= Disabled then</span><br><span> Check_HPD (Cur_Config.Port, Unplug_Detected);</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">- if Cur_Config.Port /= New_Config.Port or</span><br><span style="color: hsl(0, 100%, 40%);">- Cur_Config.Mode /= New_Config.Mode or</span><br><span style="color: hsl(0, 100%, 40%);">- Unplug_Detected</span><br><span style="color: hsl(0, 100%, 40%);">- then</span><br><span style="color: hsl(120, 100%, 40%);">+ if Full_Update (Cur_Config, New_Config) or Unplug_Detected then</span><br><span> Disable_Output (Pipe, Cur_Config);</span><br><span> Cur_Config.Port := Disabled;</span><br><span> Update_Power;</span><br><span>@@ -263,9 +271,8 @@</span><br><span> Cur_Config : Pipe_Config renames Cur_Configs (Pipe);</span><br><span> New_Config : Pipe_Config renames Configs (Pipe);</span><br><span> begin</span><br><span style="color: hsl(0, 100%, 40%);">- if New_Config.Port /= Disabled and then</span><br><span style="color: hsl(0, 100%, 40%);">- (Cur_Config.Port /= New_Config.Port or</span><br><span style="color: hsl(0, 100%, 40%);">- Cur_Config.Mode /= New_Config.Mode)</span><br><span style="color: hsl(120, 100%, 40%);">+ if New_Config.Port /= Disabled and</span><br><span style="color: hsl(120, 100%, 40%);">+ Full_Update (Cur_Config, New_Config)</span><br><span> then</span><br><span> if Wait_For_HPD (New_Config.Port) then</span><br><span> Check_HPD (New_Config.Port, Success);</span><br><span>diff --git a/common/hw-gfx-gma.ads b/common/hw-gfx-gma.ads</span><br><span>index f66625e..877528c 100644</span><br><span>--- a/common/hw-gfx-gma.ads</span><br><span>+++ b/common/hw-gfx-gma.ads</span><br><span>@@ -1,5 +1,5 @@</span><br><span> --</span><br><span>--- Copyright (C) 2015-2017 secunet Security Networks AG</span><br><span style="color: hsl(120, 100%, 40%);">+-- Copyright (C) 2015-2018 secunet Security Networks AG</span><br><span> -- Copyright (C) 2017 Nico Huber <nico.h@gmx.de></span><br><span> --</span><br><span> -- This program is free software; you can redistribute it and/or modify</span><br><span>@@ -129,6 +129,10 @@</span><br><span> </span><br><span> Cur_Configs : Pipe_Configs with Part_Of => State;</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+ function Requires_Scaling (Pipe_Cfg : Pipe_Config) return Boolean is</span><br><span style="color: hsl(120, 100%, 40%);">+ (Pipe_Cfg.Framebuffer.Width /= Pos32 (Pipe_Cfg.Mode.H_Visible) or</span><br><span style="color: hsl(120, 100%, 40%);">+ Pipe_Cfg.Framebuffer.Height /= Pos32 (Pipe_Cfg.Mode.V_Visible));</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> ----------------------------------------------------------------------------</span><br><span> -- Internal representation of a single pipe's configuration</span><br><span> </span><br><span></span><br></pre><p>To view, visit <a href="https://review.coreboot.org/26663">change 26663</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://review.coreboot.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://review.coreboot.org/26663"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: libgfxinit </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: I46318bb74d00a584d268a9d76787f8b26249264d </div>
<div style="display:none"> Gerrit-Change-Number: 26663 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Nico Huber <nico.h@gmx.de> </div>