diff options
author | Jesse Barnes <jbarnes@virtuousgeek.org> | 2010-07-08 12:22:46 -0400 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2010-08-01 22:58:57 -0400 |
commit | d1d6ca73ef548748e141747e7260798327d6a2c1 (patch) | |
tree | 0a69cbfb66f2b30d707f24861baf3399d77c350b /drivers/char | |
parent | cda4b7d3a5b1dcbc0d8e7bad52134347798e9047 (diff) |
drm/agp/i915: trim stolen space to 32M
Some BIOSes will claim a large chunk of stolen space. Unless we
reclaim it, our aperture for remapping buffer objects will be
constrained. So clamp the stolen space to 32M and ignore the rest.
Fixes https://bugzilla.kernel.org/show_bug.cgi?id=15469 among others.
Adding the ignored stolen memory back into the general pool using the
memory hotplug code is left as an exercise for the reader.
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Reviewed-by: Simon Farnsworth <simon.farnsworth@onelan.com>
Tested-by: Artem S. Tashkinov <t.artem@mailcity.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
Diffstat (limited to 'drivers/char')
-rw-r--r-- | drivers/char/agp/intel-gtt.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/char/agp/intel-gtt.c b/drivers/char/agp/intel-gtt.c index f804325a735e..d22ffb811bf2 100644 --- a/drivers/char/agp/intel-gtt.c +++ b/drivers/char/agp/intel-gtt.c | |||
@@ -25,6 +25,10 @@ | |||
25 | #define USE_PCI_DMA_API 1 | 25 | #define USE_PCI_DMA_API 1 |
26 | #endif | 26 | #endif |
27 | 27 | ||
28 | /* Max amount of stolen space, anything above will be returned to Linux */ | ||
29 | int intel_max_stolen = 32 * 1024 * 1024; | ||
30 | EXPORT_SYMBOL(intel_max_stolen); | ||
31 | |||
28 | static const struct aper_size_info_fixed intel_i810_sizes[] = | 32 | static const struct aper_size_info_fixed intel_i810_sizes[] = |
29 | { | 33 | { |
30 | {64, 16384, 4}, | 34 | {64, 16384, 4}, |
@@ -713,7 +717,12 @@ static void intel_i830_init_gtt_entries(void) | |||
713 | break; | 717 | break; |
714 | } | 718 | } |
715 | } | 719 | } |
716 | if (gtt_entries > 0) { | 720 | if (!local && gtt_entries > intel_max_stolen) { |
721 | dev_info(&agp_bridge->dev->dev, | ||
722 | "detected %dK stolen memory, trimming to %dK\n", | ||
723 | gtt_entries / KB(1), intel_max_stolen / KB(1)); | ||
724 | gtt_entries = intel_max_stolen / KB(4); | ||
725 | } else if (gtt_entries > 0) { | ||
717 | dev_info(&agp_bridge->dev->dev, "detected %dK %s memory\n", | 726 | dev_info(&agp_bridge->dev->dev, "detected %dK %s memory\n", |
718 | gtt_entries / KB(1), local ? "local" : "stolen"); | 727 | gtt_entries / KB(1), local ? "local" : "stolen"); |
719 | gtt_entries /= KB(4); | 728 | gtt_entries /= KB(4); |