aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/i915_dma.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/i915/i915_dma.c')
-rw-r--r--drivers/gpu/drm/i915/i915_dma.c51
1 files changed, 32 insertions, 19 deletions
diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c
index 250999cdf814..59826c5b8760 100644
--- a/drivers/gpu/drm/i915/i915_dma.c
+++ b/drivers/gpu/drm/i915/i915_dma.c
@@ -1119,34 +1119,47 @@ static void i915_setup_compression(struct drm_device *dev, int size)
1119 return; 1119 return;
1120 } 1120 }
1121 1121
1122 compressed_llb = drm_mm_search_free(&dev_priv->vram, 4096, 4096, 0); 1122 cfb_base = i915_gtt_to_phys(dev, compressed_fb->start);
1123 if (!compressed_llb) { 1123 if (!cfb_base) {
1124 i915_warn_stolen(dev); 1124 DRM_ERROR("failed to get stolen phys addr, disabling FBC\n");
1125 return; 1125 drm_mm_put_block(compressed_fb);
1126 } 1126 }
1127 1127
1128 compressed_llb = drm_mm_get_block(compressed_llb, 4096, 4096); 1128 if (!IS_GM45(dev)) {
1129 if (!compressed_llb) { 1129 compressed_llb = drm_mm_search_free(&dev_priv->vram, 4096,
1130 i915_warn_stolen(dev); 1130 4096, 0);
1131 return; 1131 if (!compressed_llb) {
1132 i915_warn_stolen(dev);
1133 return;
1134 }
1135
1136 compressed_llb = drm_mm_get_block(compressed_llb, 4096, 4096);
1137 if (!compressed_llb) {
1138 i915_warn_stolen(dev);
1139 return;
1140 }
1141
1142 ll_base = i915_gtt_to_phys(dev, compressed_llb->start);
1143 if (!ll_base) {
1144 DRM_ERROR("failed to get stolen phys addr, disabling FBC\n");
1145 drm_mm_put_block(compressed_fb);
1146 drm_mm_put_block(compressed_llb);
1147 }
1132 } 1148 }
1133 1149
1134 dev_priv->cfb_size = size; 1150 dev_priv->cfb_size = size;
1135 1151
1136 cfb_base = i915_gtt_to_phys(dev, compressed_fb->start); 1152 if (IS_GM45(dev)) {
1137 ll_base = i915_gtt_to_phys(dev, compressed_llb->start); 1153 g4x_disable_fbc(dev);
1138 if (!cfb_base || !ll_base) { 1154 I915_WRITE(DPFC_CB_BASE, compressed_fb->start);
1139 DRM_ERROR("failed to get stolen phys addr, disabling FBC\n"); 1155 } else {
1140 drm_mm_put_block(compressed_fb); 1156 i8xx_disable_fbc(dev);
1141 drm_mm_put_block(compressed_llb); 1157 I915_WRITE(FBC_CFB_BASE, cfb_base);
1158 I915_WRITE(FBC_LL_BASE, ll_base);
1142 } 1159 }
1143 1160
1144 i8xx_disable_fbc(dev);
1145
1146 DRM_DEBUG("FBC base 0x%08lx, ll base 0x%08lx, size %dM\n", cfb_base, 1161 DRM_DEBUG("FBC base 0x%08lx, ll base 0x%08lx, size %dM\n", cfb_base,
1147 ll_base, size >> 20); 1162 ll_base, size >> 20);
1148 I915_WRITE(FBC_CFB_BASE, cfb_base);
1149 I915_WRITE(FBC_LL_BASE, ll_base);
1150} 1163}
1151 1164
1152static int i915_load_modeset_init(struct drm_device *dev, 1165static int i915_load_modeset_init(struct drm_device *dev,
@@ -1194,7 +1207,7 @@ static int i915_load_modeset_init(struct drm_device *dev,
1194 goto out; 1207 goto out;
1195 1208
1196 /* Try to set up FBC with a reasonable compressed buffer size */ 1209 /* Try to set up FBC with a reasonable compressed buffer size */
1197 if (IS_MOBILE(dev) && (IS_I9XX(dev) || IS_I965G(dev)) && 1210 if (IS_MOBILE(dev) && (IS_I9XX(dev) || IS_I965G(dev) || IS_GM45(dev)) &&
1198 i915_powersave) { 1211 i915_powersave) {
1199 int cfb_size; 1212 int cfb_size;
1200 1213