Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 205175
b: refs/heads/master
c: d1d6ca7
h: refs/heads/master
i:
  205173: c972ea1
  205171: 38275c5
  205167: a75fa6d
v: v3
  • Loading branch information
Jesse Barnes authored and Eric Anholt committed Aug 2, 2010
1 parent 844bf5e commit 693f194
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: cda4b7d3a5b1dcbc0d8e7bad52134347798e9047
refs/heads/master: d1d6ca73ef548748e141747e7260798327d6a2c1
11 changes: 10 additions & 1 deletion trunk/drivers/char/agp/intel-gtt.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@
#define USE_PCI_DMA_API 1
#endif

/* Max amount of stolen space, anything above will be returned to Linux */
int intel_max_stolen = 32 * 1024 * 1024;
EXPORT_SYMBOL(intel_max_stolen);

static const struct aper_size_info_fixed intel_i810_sizes[] =
{
{64, 16384, 4},
Expand Down Expand Up @@ -713,7 +717,12 @@ static void intel_i830_init_gtt_entries(void)
break;
}
}
if (gtt_entries > 0) {
if (!local && gtt_entries > intel_max_stolen) {
dev_info(&agp_bridge->dev->dev,
"detected %dK stolen memory, trimming to %dK\n",
gtt_entries / KB(1), intel_max_stolen / KB(1));
gtt_entries = intel_max_stolen / KB(4);
} else if (gtt_entries > 0) {
dev_info(&agp_bridge->dev->dev, "detected %dK %s memory\n",
gtt_entries / KB(1), local ? "local" : "stolen");
gtt_entries /= KB(4);
Expand Down
8 changes: 8 additions & 0 deletions trunk/drivers/gpu/drm/i915/i915_dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@
#include <linux/vga_switcheroo.h>
#include <linux/slab.h>

extern int intel_max_stolen; /* from AGP driver */

/**
* Sets up the hardware status page for devices that need a physical address
* in the register.
Expand Down Expand Up @@ -2106,6 +2108,12 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags)
if (ret)
goto out_iomapfree;

if (prealloc_size > intel_max_stolen) {
DRM_INFO("detected %dM stolen memory, trimming to %dM\n",
prealloc_size >> 20, intel_max_stolen >> 20);
prealloc_size = intel_max_stolen;
}

dev_priv->wq = create_singlethread_workqueue("i915");
if (dev_priv->wq == NULL) {
DRM_ERROR("Failed to create our workqueue.\n");
Expand Down

0 comments on commit 693f194

Please sign in to comment.