gma: Set tiled framebuffers up through Plane_Control

On platforms with Plane_Control registers (Broxton/Skylake+) we can
use X and Y tiled framebuffers for scanout (older platforms support
X tiling only). As our main use case is 90° rotation with Y tiled
framebuffers, we implement it for the newer platforms only for now.

We also set up a fence register for linear access to the tiled frame-
buffer through the aperture.

Change-Id: I913c82f62fd28b681a06ce13f41160a07e559799
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/22709
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Tested-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
diff --git a/common/hw-gfx.ads b/common/hw-gfx.ads
index c5d9631..67662ed 100644
--- a/common/hw-gfx.ads
+++ b/common/hw-gfx.ads
@@ -20,6 +20,9 @@
 
 package HW.GFX is
 
+   -- such that the count of pixels in any framebuffer may fit
+   subtype Pixel_Type is Pos32 range 1 .. 8192 * 8192;
+
    -- implementation only supports 4800p for now ;-)
    subtype Width_Type  is Pos32 range 1 .. 4800;
    subtype Height_Type is Pos32 range 1 .. 7680;
@@ -40,8 +43,10 @@
       Offset   : Word32;
    end record;
 
+   function Pixel_To_Bytes (Pixel : Pixel_Type; FB : Framebuffer_Type)
+      return Pos32 is (Pixel * Pos32 (FB.BPC) / (8 / 4));
    function FB_Size (FB : Framebuffer_Type) return Pos32 is
-     (FB.Stride * FB.Height * Pos32 (FB.BPC) / (8 / 4));
+     (Pixel_To_Bytes (FB.Stride * FB.Height, FB));
 
    Default_FB : constant Framebuffer_Type := Framebuffer_Type'
      (Width    => 1,