gma: Add cursor infrastructure

Allow ARGB cursors of 64x64, 128x128 or 256x256 pixels. Valid positions
depend a lot on the hardware generation, so we'll accept arbitrary
integer values in the interface and filter them internally. An out of
bounds cursor will simply be invisible.

It's unclear if the parameters also apply to other GFX hardware. Thus,
we keep the types in the GMA sub-package for now.

Change-Id: I1a380037ac91ba2beeb33c27a6882eb5caa126f9
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: https://review.coreboot.org/23185
Tested-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
diff --git a/common/hw-gfx-gma-config.ads.template b/common/hw-gfx-gma-config.ads.template
index 46e2782..dcfcb4e 100644
--- a/common/hw-gfx-gma-config.ads.template
+++ b/common/hw-gfx-gma-config.ads.template
@@ -286,6 +286,13 @@
             Secondary   => 4096,
             Tertiary    => 4096));
 
+   -- Maximum X position of hardware cursors
+   Maximum_Cursor_X : constant := (case CPU is
+                                    when G45 .. Ivybridge      => 4095,
+                                    when Haswell .. Skylake    => 8191);
+
+   Maximum_Cursor_Y : constant := 4095;
+
    ----------------------------------------------------------------------------
 
    -- FIXME: Unknown for Broxton, Linux' i915 contains a fixme too :-D