<p>Nico Huber has uploaded this change for <strong>review</strong>.</p><p><a href="https://review.coreboot.org/26767">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">gma: Revise scaling on G45<br><br>The G45 panel fitter needs a hint how the resulting image will be boxed<br>to keep aspect ratio. As we can't change the panel fitter configuration<br>while the pipe is enabled, we always tear the whole pipe down when the<br>configuration changes.<br><br>Change-Id: Ifedc19abbadcbae61892d0051f08592637f90fd7<br>Signed-off-by: Nico Huber <nico.h@gmx.de><br>---<br>M common/hw-gfx-gma-pipe_setup.adb<br>M common/hw-gfx-gma.adb<br>2 files changed, 23 insertions(+), 6 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://review.coreboot.org:29418/libgfxinit refs/changes/67/26767/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/common/hw-gfx-gma-pipe_setup.adb b/common/hw-gfx-gma-pipe_setup.adb</span><br><span>index 7a53faa..04d1296 100644</span><br><span>--- a/common/hw-gfx-gma-pipe_setup.adb</span><br><span>+++ b/common/hw-gfx-gma-pipe_setup.adb</span><br><span>@@ -118,6 +118,11 @@</span><br><span> GMCH_PFIT_CONTROL_SELECT_MASK : constant := 3 * 2 ** 29;</span><br><span> GMCH_PFIT_CONTROL_SELECT_PIPE_A : constant := 0 * 2 ** 29;</span><br><span> GMCH_PFIT_CONTROL_SELECT_PIPE_B : constant := 1 * 2 ** 29;</span><br><span style="color: hsl(120, 100%, 40%);">+ GMCH_PFIT_CONTROL_SCALING_MASK : constant := 3 * 2 ** 26;</span><br><span style="color: hsl(120, 100%, 40%);">+ GMCH_PFIT_CONTROL_SCALING : constant array (Scaling_Aspect) of Word32 :=</span><br><span style="color: hsl(120, 100%, 40%);">+ (Evenly => 0 * 2 ** 26,</span><br><span style="color: hsl(120, 100%, 40%);">+ Pillarbox => 2 * 2 ** 26,</span><br><span style="color: hsl(120, 100%, 40%);">+ Letterbox => 3 * 2 ** 26);</span><br><span> </span><br><span> VGACNTRL_REG : constant Registers.Registers_Index :=</span><br><span> (if Config.Has_GMCH_VGACNTRL then</span><br><span>@@ -530,13 +535,19 @@</span><br><span> -- Check in Enable_Output if panel fitter has already been enabled</span><br><span> -- Pass this information to Validate_Config</span><br><span> procedure Setup_Gmch_Panel_Fitter</span><br><span style="color: hsl(0, 100%, 40%);">- (Controller : in Controller_Type)</span><br><span style="color: hsl(120, 100%, 40%);">+ (Controller : in Controller_Type;</span><br><span style="color: hsl(120, 100%, 40%);">+ Mode : in HW.GFX.Mode_Type;</span><br><span style="color: hsl(120, 100%, 40%);">+ Framebuffer : in HW.GFX.Framebuffer_Type)</span><br><span> is</span><br><span> PF_Ctrl_Pipe_Sel : constant Word32 :=</span><br><span> (case Controller.Pipe is</span><br><span> when Primary => GMCH_PFIT_CONTROL_SELECT_PIPE_A,</span><br><span> when Secondary => GMCH_PFIT_CONTROL_SELECT_PIPE_B,</span><br><span> when others => 0);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ PF_Ctrl_Scaling : constant Word32 :=</span><br><span style="color: hsl(120, 100%, 40%);">+ GMCH_PFIT_CONTROL_SCALING (Scaling_Type (Framebuffer, Mode));</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> In_Use : Boolean;</span><br><span> begin</span><br><span> Registers.Is_Set_Mask</span><br><span>@@ -547,7 +558,7 @@</span><br><span> if not In_Use then</span><br><span> Registers.Write</span><br><span> (Register => Registers.GMCH_PFIT_CONTROL,</span><br><span style="color: hsl(0, 100%, 40%);">- Value => PF_CTRL_ENABLE or PF_Ctrl_Pipe_Sel);</span><br><span style="color: hsl(120, 100%, 40%);">+ Value => PF_CTRL_ENABLE or PF_Ctrl_Pipe_Sel or PF_Ctrl_Scaling);</span><br><span> else</span><br><span> Debug.Put_Line ("GMCH Pannel fitter already in use, skipping...");</span><br><span> end if;</span><br><span>@@ -600,7 +611,7 @@</span><br><span> if Config.Has_Plane_Control then</span><br><span> Setup_Skylake_Pipe_Scaler (Controller, Mode, Framebuffer);</span><br><span> elsif Config.Has_GMCH_PFIT_CONTROL then</span><br><span style="color: hsl(0, 100%, 40%);">- Setup_Gmch_Panel_Fitter (Controller);</span><br><span style="color: hsl(120, 100%, 40%);">+ Setup_Gmch_Panel_Fitter (Controller, Mode, Framebuffer);</span><br><span> else</span><br><span> Setup_Ironlake_Panel_Fitter (Controller, Mode, Framebuffer);</span><br><span> end if;</span><br><span>diff --git a/common/hw-gfx-gma.adb b/common/hw-gfx-gma.adb</span><br><span>index f962e1c..7e9a959 100644</span><br><span>--- a/common/hw-gfx-gma.adb</span><br><span>+++ b/common/hw-gfx-gma.adb</span><br><span>@@ -237,11 +237,17 @@</span><br><span> is</span><br><span> begin</span><br><span> return</span><br><span style="color: hsl(0, 100%, 40%);">- Cur_Config.Port /= New_Config.Port or else</span><br><span style="color: hsl(0, 100%, 40%);">- Cur_Config.Mode /= New_Config.Mode or else</span><br><span style="color: hsl(120, 100%, 40%);">+ Cur_Config.Port /= New_Config.Port</span><br><span style="color: hsl(120, 100%, 40%);">+ or else</span><br><span style="color: hsl(120, 100%, 40%);">+ Cur_Config.Mode /= New_Config.Mode</span><br><span style="color: hsl(120, 100%, 40%);">+ or else</span><br><span> (Config.Use_PDW_For_EDP_Scaling and then</span><br><span> (Cur_Config.Port = Internal and</span><br><span style="color: hsl(0, 100%, 40%);">- Requires_Scaling (Cur_Config) /= Requires_Scaling (New_Config)));</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%);">+ or else</span><br><span style="color: hsl(120, 100%, 40%);">+ (Config.Has_GMCH_PFIT_CONTROL and then</span><br><span style="color: hsl(120, 100%, 40%);">+ (Requires_Scaling (Cur_Config) /= Requires_Scaling (New_Config) or</span><br><span style="color: hsl(120, 100%, 40%);">+ Scaling_Type (Cur_Config) /= Scaling_Type (New_Config)));</span><br><span> end Full_Update;</span><br><span> begin</span><br><span> Old_Configs := Cur_Configs;</span><br><span></span><br></pre><p>To view, visit <a href="https://review.coreboot.org/26767">change 26767</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/26767"/><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: Ifedc19abbadcbae61892d0051f08592637f90fd7 </div>
<div style="display:none"> Gerrit-Change-Number: 26767 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Nico Huber <nico.h@gmx.de> </div>