gma: Fix decoding the size of Stolen Memory on Gen4
The size of stolen memory needs to be decoded in MiB.
Change-Id: I1ceb9ffd85d6ebb54a0e099e200a5068c34a6251
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-on: https://review.coreboot.org/21514
Reviewed-by: Nico Huber <nico.h@gmx.de>
Tested-by: Nico Huber <nico.h@gmx.de>
diff --git a/common/hw-gfx-gma.adb b/common/hw-gfx-gma.adb
index 6bc6fea..9f835d2 100644
--- a/common/hw-gfx-gma.adb
+++ b/common/hw-gfx-gma.adb
@@ -519,7 +519,7 @@
(1, 4, 8, 16, 32, 48, 64, 128, 256, 96, 160, 224, 352);
function Stolen_Size_Gen4 (GGC : Word16) return Stolen_Size_Range is
(if GMS_Gen4 (GGC) in Valid_Stolen_Size_Gen4'Range then
- Valid_Stolen_Size_Gen4 (GMS_Gen4 (GGC)) else 0);
+ Valid_Stolen_Size_Gen4 (GMS_Gen4 (GGC)) * 2 ** 20 else 0);
function GTT_Size_Gen6 (GGC : Word16) return Natural is
(Natural (Shift_Right (GGC, 8) and 16#03#) * 2 ** 20);