gma hsw: Enable Power Down Well for scaling on DDI A

The primary pipe can drive DDI A (eDP) without the Power Down
Well (PDW). The scalers are inside the PDW, though. To enable
scaling for DDI A, ensure the PDW is active.

When switching between scaled / unscaled modes, we'll have to
reconfigure the whole pipe.

Change-Id: I46318bb74d00a584d268a9d76787f8b26249264d
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/26663
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
diff --git a/common/hw-gfx-gma.ads b/common/hw-gfx-gma.ads
index fb5c7e5..824a59e 100644
--- a/common/hw-gfx-gma.ads
+++ b/common/hw-gfx-gma.ads
@@ -1,5 +1,5 @@
 --
--- Copyright (C) 2015-2017 secunet Security Networks AG
+-- Copyright (C) 2015-2018 secunet Security Networks AG
 -- Copyright (C) 2017 Nico Huber <nico.h@gmx.de>
 --
 -- This program is free software; you can redistribute it and/or modify
@@ -130,6 +130,13 @@
 
    Cur_Configs : Pipe_Configs with Part_Of => State;
 
+   function Requires_Scaling (FB : Framebuffer_Type; Mode : Mode_Type)
+      return Boolean is
+     (Rotated_Width (FB) /= Mode.H_Visible or
+      Rotated_Height (FB) /= Mode.V_Visible);
+   function Requires_Scaling (Pipe_Cfg : Pipe_Config) return Boolean is
+     (Requires_Scaling (Pipe_Cfg.Framebuffer, Pipe_Cfg.Mode));
+
    ----------------------------------------------------------------------------
    -- Internal representation of a single pipe's configuration