diff options
Diffstat (limited to 'drivers/gpu/drm/i915/i915_dma.c')
-rw-r--r-- | drivers/gpu/drm/i915/i915_dma.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c index 92898035845..f19ffe87af3 100644 --- a/drivers/gpu/drm/i915/i915_dma.c +++ b/drivers/gpu/drm/i915/i915_dma.c | |||
@@ -41,6 +41,8 @@ | |||
41 | #include <linux/vga_switcheroo.h> | 41 | #include <linux/vga_switcheroo.h> |
42 | #include <linux/slab.h> | 42 | #include <linux/slab.h> |
43 | 43 | ||
44 | extern int intel_max_stolen; /* from AGP driver */ | ||
45 | |||
44 | /** | 46 | /** |
45 | * Sets up the hardware status page for devices that need a physical address | 47 | * Sets up the hardware status page for devices that need a physical address |
46 | * in the register. | 48 | * in the register. |
@@ -1257,7 +1259,7 @@ static void i915_setup_compression(struct drm_device *dev, int size) | |||
1257 | drm_mm_put_block(compressed_fb); | 1259 | drm_mm_put_block(compressed_fb); |
1258 | } | 1260 | } |
1259 | 1261 | ||
1260 | if (!IS_GM45(dev)) { | 1262 | if (!(IS_GM45(dev) || IS_IRONLAKE_M(dev))) { |
1261 | compressed_llb = drm_mm_search_free(&dev_priv->vram, 4096, | 1263 | compressed_llb = drm_mm_search_free(&dev_priv->vram, 4096, |
1262 | 4096, 0); | 1264 | 4096, 0); |
1263 | if (!compressed_llb) { | 1265 | if (!compressed_llb) { |
@@ -1283,8 +1285,9 @@ static void i915_setup_compression(struct drm_device *dev, int size) | |||
1283 | 1285 | ||
1284 | intel_disable_fbc(dev); | 1286 | intel_disable_fbc(dev); |
1285 | dev_priv->compressed_fb = compressed_fb; | 1287 | dev_priv->compressed_fb = compressed_fb; |
1286 | 1288 | if (IS_IRONLAKE_M(dev)) | |
1287 | if (IS_GM45(dev)) { | 1289 | I915_WRITE(ILK_DPFC_CB_BASE, compressed_fb->start); |
1290 | else if (IS_GM45(dev)) { | ||
1288 | I915_WRITE(DPFC_CB_BASE, compressed_fb->start); | 1291 | I915_WRITE(DPFC_CB_BASE, compressed_fb->start); |
1289 | } else { | 1292 | } else { |
1290 | I915_WRITE(FBC_CFB_BASE, cfb_base); | 1293 | I915_WRITE(FBC_CFB_BASE, cfb_base); |
@@ -1292,7 +1295,7 @@ static void i915_setup_compression(struct drm_device *dev, int size) | |||
1292 | dev_priv->compressed_llb = compressed_llb; | 1295 | dev_priv->compressed_llb = compressed_llb; |
1293 | } | 1296 | } |
1294 | 1297 | ||
1295 | DRM_DEBUG("FBC base 0x%08lx, ll base 0x%08lx, size %dM\n", cfb_base, | 1298 | DRM_DEBUG_KMS("FBC base 0x%08lx, ll base 0x%08lx, size %dM\n", cfb_base, |
1296 | ll_base, size >> 20); | 1299 | ll_base, size >> 20); |
1297 | } | 1300 | } |
1298 | 1301 | ||
@@ -1301,7 +1304,7 @@ static void i915_cleanup_compression(struct drm_device *dev) | |||
1301 | struct drm_i915_private *dev_priv = dev->dev_private; | 1304 | struct drm_i915_private *dev_priv = dev->dev_private; |
1302 | 1305 | ||
1303 | drm_mm_put_block(dev_priv->compressed_fb); | 1306 | drm_mm_put_block(dev_priv->compressed_fb); |
1304 | if (!IS_GM45(dev)) | 1307 | if (dev_priv->compressed_llb) |
1305 | drm_mm_put_block(dev_priv->compressed_llb); | 1308 | drm_mm_put_block(dev_priv->compressed_llb); |
1306 | } | 1309 | } |
1307 | 1310 | ||
@@ -2105,6 +2108,12 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags) | |||
2105 | if (ret) | 2108 | if (ret) |
2106 | goto out_iomapfree; | 2109 | goto out_iomapfree; |
2107 | 2110 | ||
2111 | if (prealloc_size > intel_max_stolen) { | ||
2112 | DRM_INFO("detected %dM stolen memory, trimming to %dM\n", | ||
2113 | prealloc_size >> 20, intel_max_stolen >> 20); | ||
2114 | prealloc_size = intel_max_stolen; | ||
2115 | } | ||
2116 | |||
2108 | dev_priv->wq = create_singlethread_workqueue("i915"); | 2117 | dev_priv->wq = create_singlethread_workqueue("i915"); |
2109 | if (dev_priv->wq == NULL) { | 2118 | if (dev_priv->wq == NULL) { |
2110 | DRM_ERROR("Failed to create our workqueue.\n"); | 2119 | DRM_ERROR("Failed to create our workqueue.\n"); |