[coreboot-gerrit] New patch to review for coreboot: 34334d9 Lenovo ThinkPad X60: Native VGA init: Add MARK_GRAPHICS_MEM_WRCOMB
Denis Carikli (GNUtoo@no-log.org)
gerrit at coreboot.org
Thu May 23 14:17:59 CEST 2013
Denis Carikli (GNUtoo at no-log.org) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/3273
-gerrit
commit 34334d963b4e9306868cba35507f3a273e968c1a
Author: Denis 'GNUtoo' Carikli <GNUtoo at no-log.org>
Date: Mon Apr 22 00:13:15 2013 +0200
Lenovo ThinkPad X60: Native VGA init: Add MARK_GRAPHICS_MEM_WRCOMB
This commit is based on the commit f567f16af4c3cbfcadc3bc5c44b569a592829262
(sandybridge: add option to mark graphics memory write-combining.)
Change-Id: If4bfbe6fe975fbda93b08d68596ef0a1378a2c17
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo at no-log.org>
---
src/mainboard/lenovo/x60/Kconfig | 1 +
src/northbridge/intel/i945/Kconfig | 8 ++++++++
src/northbridge/intel/i945/gma.c | 19 ++++++++++++++++++-
3 files changed, 27 insertions(+), 1 deletion(-)
diff --git a/src/mainboard/lenovo/x60/Kconfig b/src/mainboard/lenovo/x60/Kconfig
index 1431a2f..737a789 100644
--- a/src/mainboard/lenovo/x60/Kconfig
+++ b/src/mainboard/lenovo/x60/Kconfig
@@ -25,6 +25,7 @@ config BOARD_SPECIFIC_OPTIONS # dummy
select USE_OPTION_TABLE
select MAINBOARD_HAS_NATIVE_VGA_INIT
select EARLY_CBMEM_INIT
+ select MARK_GRAPHICS_MEM_WRCOMB
config MAINBOARD_DIR
string
diff --git a/src/northbridge/intel/i945/Kconfig b/src/northbridge/intel/i945/Kconfig
index aec3e33..98170d2 100644
--- a/src/northbridge/intel/i945/Kconfig
+++ b/src/northbridge/intel/i945/Kconfig
@@ -66,4 +66,12 @@ config CHECK_SLFRCS_ON_RESUME
On other boards the check always creates a false positive,
effectively making it impossible to resume.
+config MARK_GRAPHICS_MEM_WRCOMB
+ bool "Mark graphics memory as write-combining."
+ default n
+ help
+ The graphics performance may increase if the graphics
+ memory is set as write-combining cache type. This option
+ enables marking the graphics memory as write-combining.
+
endif
diff --git a/src/northbridge/intel/i945/gma.c b/src/northbridge/intel/i945/gma.c
index 20e8bf3..e63178d 100644
--- a/src/northbridge/intel/i945/gma.c
+++ b/src/northbridge/intel/i945/gma.c
@@ -107,12 +107,29 @@ static void gma_set_subsystem(device_t dev, unsigned vendor, unsigned device)
}
}
+static void gma_read_resources(struct device *dev)
+{
+ pci_dev_read_resources(dev);
+
+#if CONFIG_MARK_GRAPHICS_MEM_WRCOMB
+ struct resource *res;
+
+ /* Set the graphics memory to write combining. */
+ res = find_resource(dev, PCI_BASE_ADDRESS_2);
+ if (res == NULL) {
+ printk(BIOS_DEBUG, "gma: memory resource not found.\n");
+ return;
+ }
+ res->flags |= IORESOURCE_WRCOMB;
+#endif
+}
+
static struct pci_operations gma_pci_ops = {
.set_subsystem = gma_set_subsystem,
};
static struct device_operations gma_func0_ops = {
- .read_resources = pci_dev_read_resources,
+ .read_resources = gma_read_resources,
.set_resources = pci_dev_set_resources,
.enable_resources = pci_dev_enable_resources,
.init = gma_func0_init,
More information about the coreboot-gerrit
mailing list