Skip to content

Commit

Permalink
agp/intel: Use the correct mask to detect i830 aperture size.
Browse files Browse the repository at this point in the history
BugLink: https://bugs.launchpad.net/bugs/597075

commit f1befe7 introduced a
regression when detecting aperture size of some i915 adapters, e.g.,
those on the Intel Q35 chipset.

The original report: https://bugzilla.kernel.org/show_bug.cgi?id=15733
The regression report: https://bugzilla.kernel.org/show_bug.cgi?id=16294

According to the specification found at
http://intellinuxgraphics.org/VOL_1_graphics_core.pdf, the PCI config
space register I830_GMCH_CTRL is a mirror of GMCH Graphics
Control. The correct macro for isolating the aperture size bits is
therefore I830_GMCH_GMS_MASK along with the attendant changes to the
case statement.

Signed-off-by: Tim Gardner <[email protected]>
Tested-by: Kees Cook <[email protected]>
Cc: Chris Wilson <[email protected]>
Cc: Eric Anholt <[email protected]>
Cc: Jesse Barnes <[email protected]>
Signed-off-by: Eric Anholt <[email protected]>
  • Loading branch information
rtg-canonical authored and anholt committed Jul 26, 2010
1 parent 9c928d1 commit e7b96f2
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions drivers/char/agp/intel-gtt.c
Original file line number Diff line number Diff line change
Expand Up @@ -1216,17 +1216,20 @@ static int intel_i915_get_gtt_size(void)

/* G33's GTT size defined in gmch_ctrl */
pci_read_config_word(agp_bridge->dev, I830_GMCH_CTRL, &gmch_ctrl);
switch (gmch_ctrl & G33_PGETBL_SIZE_MASK) {
case G33_PGETBL_SIZE_1M:
switch (gmch_ctrl & I830_GMCH_GMS_MASK) {
case I830_GMCH_GMS_STOLEN_512:
size = 512;
break;
case I830_GMCH_GMS_STOLEN_1024:
size = 1024;
break;
case G33_PGETBL_SIZE_2M:
size = 2048;
case I830_GMCH_GMS_STOLEN_8192:
size = 8*1024;
break;
default:
dev_info(&agp_bridge->dev->dev,
"unknown page table size 0x%x, assuming 512KB\n",
(gmch_ctrl & G33_PGETBL_SIZE_MASK));
(gmch_ctrl & I830_GMCH_GMS_MASK));
size = 512;
}
} else {
Expand Down

0 comments on commit e7b96f2

Please sign in to comment.