gma: Fix GTT size reading for Gen8+

It seems the GTT size is not given in MiB any more but as a power
of 2 of MiB.

Change-Id: I13e40ad1d389d389c6fab6b2b42895179649f6da
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/c/libgfxinit/+/35999
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
diff --git a/common/hw-gfx-gma.adb b/common/hw-gfx-gma.adb
index 8d58841..0fe360d 100644
--- a/common/hw-gfx-gma.adb
+++ b/common/hw-gfx-gma.adb
@@ -703,8 +703,11 @@
    function Stolen_Size_Gen6 (GGC : Word16) return Stolen_Size_Range is
      (Stolen_Size_Range (Shift_Right (GGC, 3) and 16#1f#) * 32 * 2 ** 20);
 
+   function GGMS_Gen8 (GGC : Word16) return Natural is
+     (Natural (Shift_Right (GGC, 6) and 16#03#));
    function GTT_Size_Gen8 (GGC : Word16) return Natural is
-     (Natural (Shift_Right (GGC, 6) and 16#03#) * 2 ** 20);
+     (if GGMS_Gen8 (GGC) /= 0 then
+         Natural (Shift_Left (Word32'(1), 20 + GGMS_Gen8 (GGC))) else 0);
 
    function GMS_Gen8 (GGC : Word16) return Stolen_Size_Range is
      (Stolen_Size_Range (Shift_Right (GGC, 8) and 16#ff#));