[coreboot-gerrit] Change in coreboot[master]: nb/intel/gm45: Don't allow too low values for gfx_uma_size
Arthur Heymans (Code Review)
gerrit at coreboot.org
Tue Jun 13 20:58:42 CEST 2017
Arthur Heymans has uploaded this change for review. ( https://review.coreboot.org/20194
Change subject: nb/intel/gm45: Don't allow too low values for gfx_uma_size
......................................................................
nb/intel/gm45: Don't allow too low values for gfx_uma_size
Too low_gfx_uma size can result in problems if the framebuffer
does not fit.
Change-Id: I485d24198cb784db5d2cfce0a8646e861a4a1695
Signed-off-by: Arthur Heymans <arthur at aheymans.xyz>
---
M src/mainboard/lenovo/t400/cmos.layout
M src/mainboard/lenovo/x200/cmos.layout
M src/mainboard/roda/rk9/cmos.layout
M src/northbridge/intel/gm45/igd.c
4 files changed, 6 insertions(+), 19 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/94/20194/1
diff --git a/src/mainboard/lenovo/t400/cmos.layout b/src/mainboard/lenovo/t400/cmos.layout
index 3b1e32a..4f89e2d 100644
--- a/src/mainboard/lenovo/t400/cmos.layout
+++ b/src/mainboard/lenovo/t400/cmos.layout
@@ -125,10 +125,6 @@
9 1 Primary
10 0 AHCI
10 1 Compatible
-11 0 1M
-11 1 4M
-11 2 8M
-11 3 16M
11 4 32M
11 5 48M
11 6 64M
diff --git a/src/mainboard/lenovo/x200/cmos.layout b/src/mainboard/lenovo/x200/cmos.layout
index 59a1c6d..f3cfe70 100644
--- a/src/mainboard/lenovo/x200/cmos.layout
+++ b/src/mainboard/lenovo/x200/cmos.layout
@@ -123,10 +123,6 @@
9 1 Primary
10 0 AHCI
10 1 Compatible
-11 0 1M
-11 1 4M
-11 2 8M
-11 3 16M
11 4 32M
11 5 48M
11 6 64M
diff --git a/src/mainboard/roda/rk9/cmos.layout b/src/mainboard/roda/rk9/cmos.layout
index d9119b3..f775afe 100644
--- a/src/mainboard/roda/rk9/cmos.layout
+++ b/src/mainboard/roda/rk9/cmos.layout
@@ -112,10 +112,6 @@
8 1 Yes
9 0 AHCI
9 1 Compatible
-11 0 1M
-11 1 4M
-11 2 8M
-11 3 16M
11 4 32M
11 5 48M
11 6 64M
diff --git a/src/northbridge/intel/gm45/igd.c b/src/northbridge/intel/gm45/igd.c
index 1164339..45144aa 100644
--- a/src/northbridge/intel/gm45/igd.c
+++ b/src/northbridge/intel/gm45/igd.c
@@ -153,17 +153,16 @@
if (!sysinfo->enable_igd || (capid & (1 << (33 - 32))))
sysinfo->ggc = 0x0002;
else {
- u8 gfxsize;
+ /* 4 for 32MB, default if not set in cmos */
+ u8 gfxsize = 4;
/* Graphics Stolen Memory: 2MB GTT (0x0300) when VT-d disabled,
2MB GTT + 2MB shadow GTT (0x0b00) else. */
- if (get_option(&gfxsize, "gfx_uma_size") != CB_SUCCESS) {
- /* 4 for 32MB, default if not set in cmos */
- gfxsize = 4;
- }
+ get_option(&gfxsize, "gfx_uma_size");
/* Handle invalid cmos settings */
- if (gfxsize > 12)
- gfxsize = 4;
+ /* Only allow settings between 32MB and 352MB */
+ gfxsize = MIN(MAX(gfxsize, 4), 12);
+
sysinfo->ggc = 0x0300 | ((gfxsize + 1) << 4);
if (!(capid & (1 << (48 - 32))))
sysinfo->ggc |= 0x0800;
--
To view, visit https://review.coreboot.org/20194
To unsubscribe, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I485d24198cb784db5d2cfce0a8646e861a4a1695
Gerrit-Change-Number: 20194
Gerrit-PatchSet: 1
Gerrit-Owner: Arthur Heymans <arthur at aheymans.xyz>
More information about the coreboot-gerrit
mailing list