Hello Angel Pons, Arthur Heymans,
I'd like you to do a code review. Please visit
https://review.coreboot.org/c/libgfxinit/+/35999
to review the following change.
Change subject: gma: Fix GTT size reading for Gen8+ ......................................................................
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 --- M common/hw-gfx-gma.adb 1 file changed, 3 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/libgfxinit refs/changes/99/35999/1
diff --git a/common/hw-gfx-gma.adb b/common/hw-gfx-gma.adb index 3221e3e..0d4cf15 100644 --- a/common/hw-gfx-gma.adb +++ b/common/hw-gfx-gma.adb @@ -690,8 +690,10 @@ 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 2 ** (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#));
Arthur Heymans has posted comments on this change. ( https://review.coreboot.org/c/libgfxinit/+/35999 )
Change subject: gma: Fix GTT size reading for Gen8+ ......................................................................
Patch Set 1: Code-Review+2
Hello Angel Pons, Arthur Heymans,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/libgfxinit/+/35999
to look at the new patch set (#2).
Change subject: gma: Fix GTT size reading for Gen8+ ......................................................................
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 --- M common/hw-gfx-gma.adb 1 file changed, 4 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/libgfxinit refs/changes/99/35999/2
Nico Huber has posted comments on this change. ( https://review.coreboot.org/c/libgfxinit/+/35999 )
Change subject: gma: Fix GTT size reading for Gen8+ ......................................................................
Patch Set 2: Verified+1
Nico Huber has posted comments on this change. ( https://review.coreboot.org/c/libgfxinit/+/35999 )
Change subject: gma: Fix GTT size reading for Gen8+ ......................................................................
Patch Set 2:
(1 comment)
https://review.coreboot.org/c/libgfxinit/+/35999/2/common/hw-gfx-gma.adb File common/hw-gfx-gma.adb:
https://review.coreboot.org/c/libgfxinit/+/35999/2/common/hw-gfx-gma.adb@697 PS2, Line 697: Natural (Shift_Left (Word32'(1), 20 + GGMS_Gen8 (GGC))) else 0); The prover didn't like the exponentiation. actually I would have expected the opposite, that it fails to prove the shift result...
Arthur Heymans has posted comments on this change. ( https://review.coreboot.org/c/libgfxinit/+/35999 )
Change subject: gma: Fix GTT size reading for Gen8+ ......................................................................
Patch Set 2: Code-Review+2
Nico Huber has submitted this change. ( https://review.coreboot.org/c/libgfxinit/+/35999 )
Change subject: gma: Fix GTT size reading for Gen8+ ......................................................................
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 --- M common/hw-gfx-gma.adb 1 file changed, 4 insertions(+), 1 deletion(-)
Approvals: Nico Huber: Verified Arthur Heymans: Looks good to me, approved
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#));