diff options
Diffstat (limited to 'drivers/gpu/drm/i915/i915_dma.c')
-rw-r--r-- | drivers/gpu/drm/i915/i915_dma.c | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c index 2305a1234f1e..f19ffe87af3c 100644 --- a/drivers/gpu/drm/i915/i915_dma.c +++ b/drivers/gpu/drm/i915/i915_dma.c | |||
@@ -34,12 +34,15 @@ | |||
34 | #include "i915_drm.h" | 34 | #include "i915_drm.h" |
35 | #include "i915_drv.h" | 35 | #include "i915_drv.h" |
36 | #include "i915_trace.h" | 36 | #include "i915_trace.h" |
37 | #include <linux/pci.h> | ||
37 | #include <linux/vgaarb.h> | 38 | #include <linux/vgaarb.h> |
38 | #include <linux/acpi.h> | 39 | #include <linux/acpi.h> |
39 | #include <linux/pnp.h> | 40 | #include <linux/pnp.h> |
40 | #include <linux/vga_switcheroo.h> | 41 | #include <linux/vga_switcheroo.h> |
41 | #include <linux/slab.h> | 42 | #include <linux/slab.h> |
42 | 43 | ||
44 | extern int intel_max_stolen; /* from AGP driver */ | ||
45 | |||
43 | /** | 46 | /** |
44 | * 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 |
45 | * in the register. | 48 | * in the register. |
@@ -1256,7 +1259,7 @@ static void i915_setup_compression(struct drm_device *dev, int size) | |||
1256 | drm_mm_put_block(compressed_fb); | 1259 | drm_mm_put_block(compressed_fb); |
1257 | } | 1260 | } |
1258 | 1261 | ||
1259 | if (!IS_GM45(dev)) { | 1262 | if (!(IS_GM45(dev) || IS_IRONLAKE_M(dev))) { |
1260 | compressed_llb = drm_mm_search_free(&dev_priv->vram, 4096, | 1263 | compressed_llb = drm_mm_search_free(&dev_priv->vram, 4096, |
1261 | 4096, 0); | 1264 | 4096, 0); |
1262 | if (!compressed_llb) { | 1265 | if (!compressed_llb) { |
@@ -1282,8 +1285,9 @@ static void i915_setup_compression(struct drm_device *dev, int size) | |||
1282 | 1285 | ||
1283 | intel_disable_fbc(dev); | 1286 | intel_disable_fbc(dev); |
1284 | dev_priv->compressed_fb = compressed_fb; | 1287 | dev_priv->compressed_fb = compressed_fb; |
1285 | 1288 | if (IS_IRONLAKE_M(dev)) | |
1286 | if (IS_GM45(dev)) { | 1289 | I915_WRITE(ILK_DPFC_CB_BASE, compressed_fb->start); |
1290 | else if (IS_GM45(dev)) { | ||
1287 | I915_WRITE(DPFC_CB_BASE, compressed_fb->start); | 1291 | I915_WRITE(DPFC_CB_BASE, compressed_fb->start); |
1288 | } else { | 1292 | } else { |
1289 | I915_WRITE(FBC_CFB_BASE, cfb_base); | 1293 | I915_WRITE(FBC_CFB_BASE, cfb_base); |
@@ -1291,7 +1295,7 @@ static void i915_setup_compression(struct drm_device *dev, int size) | |||
1291 | dev_priv->compressed_llb = compressed_llb; | 1295 | dev_priv->compressed_llb = compressed_llb; |
1292 | } | 1296 | } |
1293 | 1297 | ||
1294 | 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, |
1295 | ll_base, size >> 20); | 1299 | ll_base, size >> 20); |
1296 | } | 1300 | } |
1297 | 1301 | ||
@@ -1354,7 +1358,7 @@ static int i915_load_modeset_init(struct drm_device *dev, | |||
1354 | int fb_bar = IS_I9XX(dev) ? 2 : 0; | 1358 | int fb_bar = IS_I9XX(dev) ? 2 : 0; |
1355 | int ret = 0; | 1359 | int ret = 0; |
1356 | 1360 | ||
1357 | dev->mode_config.fb_base = drm_get_resource_start(dev, fb_bar) & | 1361 | dev->mode_config.fb_base = pci_resource_start(dev->pdev, fb_bar) & |
1358 | 0xff000000; | 1362 | 0xff000000; |
1359 | 1363 | ||
1360 | /* Basic memrange allocator for stolen space (aka vram) */ | 1364 | /* Basic memrange allocator for stolen space (aka vram) */ |
@@ -2063,8 +2067,8 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags) | |||
2063 | 2067 | ||
2064 | /* Add register map (needed for suspend/resume) */ | 2068 | /* Add register map (needed for suspend/resume) */ |
2065 | mmio_bar = IS_I9XX(dev) ? 0 : 1; | 2069 | mmio_bar = IS_I9XX(dev) ? 0 : 1; |
2066 | base = drm_get_resource_start(dev, mmio_bar); | 2070 | base = pci_resource_start(dev->pdev, mmio_bar); |
2067 | size = drm_get_resource_len(dev, mmio_bar); | 2071 | size = pci_resource_len(dev->pdev, mmio_bar); |
2068 | 2072 | ||
2069 | if (i915_get_bridge_dev(dev)) { | 2073 | if (i915_get_bridge_dev(dev)) { |
2070 | ret = -EIO; | 2074 | ret = -EIO; |
@@ -2104,6 +2108,12 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags) | |||
2104 | if (ret) | 2108 | if (ret) |
2105 | goto out_iomapfree; | 2109 | goto out_iomapfree; |
2106 | 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 | |||
2107 | dev_priv->wq = create_singlethread_workqueue("i915"); | 2117 | dev_priv->wq = create_singlethread_workqueue("i915"); |
2108 | if (dev_priv->wq == NULL) { | 2118 | if (dev_priv->wq == NULL) { |
2109 | DRM_ERROR("Failed to create our workqueue.\n"); | 2119 | DRM_ERROR("Failed to create our workqueue.\n"); |