diff options
author | Dave Airlie <airlied@redhat.com> | 2010-05-18 19:35:51 -0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2010-05-18 19:35:51 -0400 |
commit | 05ea893c46805b2981ea8ba6df881e3d65edd63b (patch) | |
tree | ea381e22d99f49bd2c95238f88491d48b797a17b /drivers/gpu/drm/i915/intel_display.c | |
parent | 26481fb15644b5fd85d4cea020f74a234cdf6803 (diff) | |
parent | a7c542782e92f9487c62a571565637be3d6b0ffd (diff) |
Merge remote branch 'anholt/drm-intel-next' into drm-next
* anholt/drm-intel-next: (515 commits)
drm/i915: Fix out of tree builds
drm/i915: move fence lru to struct drm_i915_fence_reg
drm/i915: don't allow tiling changes on pinned buffers v2
drm/i915: Be extra careful about A/D matching for multifunction SDVO
drm/i915: Fix DDC bus selection for multifunction SDVO
drm/i915: cleanup mode setting before unmapping registers
drm/i915: Make fbc control wrapper functions
drm/i915: Wait for the GPU whilst shrinking, if truly desperate.
drm/i915: Use spatio-temporal dithering on PCH
[MTD] Remove zero-length files mtdbdi.c and internal.ho
pata_pcmcia / ide-cs: Fix bad hashes for Transcend and kingston IDs
libata: Fix several inaccuracies in developer's guide
slub: Fix bad boundary check in init_kmem_cache_nodes()
raid6: fix recovery performance regression
KEYS: call_sbin_request_key() must write lock keyrings before modifying them
KEYS: Use RCU dereference wrappers in keyring key type code
KEYS: find_keyring_by_name() can gain access to a freed keyring
ALSA: hda: Fix 0 dB for Packard Bell models using Conexant CX20549 (Venice)
ALSA: hda - Add quirk for Dell Inspiron 19T using a Conexant CX20582
ALSA: take tu->qlock with irqs disabled
...
Diffstat (limited to 'drivers/gpu/drm/i915/intel_display.c')
-rw-r--r-- | drivers/gpu/drm/i915/intel_display.c | 87 |
1 files changed, 56 insertions, 31 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 4d739a1b13ca..8c668e3122a5 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c | |||
@@ -1048,9 +1048,8 @@ void i8xx_disable_fbc(struct drm_device *dev) | |||
1048 | DRM_DEBUG_KMS("disabled FBC\n"); | 1048 | DRM_DEBUG_KMS("disabled FBC\n"); |
1049 | } | 1049 | } |
1050 | 1050 | ||
1051 | static bool i8xx_fbc_enabled(struct drm_crtc *crtc) | 1051 | static bool i8xx_fbc_enabled(struct drm_device *dev) |
1052 | { | 1052 | { |
1053 | struct drm_device *dev = crtc->dev; | ||
1054 | struct drm_i915_private *dev_priv = dev->dev_private; | 1053 | struct drm_i915_private *dev_priv = dev->dev_private; |
1055 | 1054 | ||
1056 | return I915_READ(FBC_CONTROL) & FBC_CTL_EN; | 1055 | return I915_READ(FBC_CONTROL) & FBC_CTL_EN; |
@@ -1107,14 +1106,43 @@ void g4x_disable_fbc(struct drm_device *dev) | |||
1107 | DRM_DEBUG_KMS("disabled FBC\n"); | 1106 | DRM_DEBUG_KMS("disabled FBC\n"); |
1108 | } | 1107 | } |
1109 | 1108 | ||
1110 | static bool g4x_fbc_enabled(struct drm_crtc *crtc) | 1109 | static bool g4x_fbc_enabled(struct drm_device *dev) |
1111 | { | 1110 | { |
1112 | struct drm_device *dev = crtc->dev; | ||
1113 | struct drm_i915_private *dev_priv = dev->dev_private; | 1111 | struct drm_i915_private *dev_priv = dev->dev_private; |
1114 | 1112 | ||
1115 | return I915_READ(DPFC_CONTROL) & DPFC_CTL_EN; | 1113 | return I915_READ(DPFC_CONTROL) & DPFC_CTL_EN; |
1116 | } | 1114 | } |
1117 | 1115 | ||
1116 | bool intel_fbc_enabled(struct drm_device *dev) | ||
1117 | { | ||
1118 | struct drm_i915_private *dev_priv = dev->dev_private; | ||
1119 | |||
1120 | if (!dev_priv->display.fbc_enabled) | ||
1121 | return false; | ||
1122 | |||
1123 | return dev_priv->display.fbc_enabled(dev); | ||
1124 | } | ||
1125 | |||
1126 | void intel_enable_fbc(struct drm_crtc *crtc, unsigned long interval) | ||
1127 | { | ||
1128 | struct drm_i915_private *dev_priv = crtc->dev->dev_private; | ||
1129 | |||
1130 | if (!dev_priv->display.enable_fbc) | ||
1131 | return; | ||
1132 | |||
1133 | dev_priv->display.enable_fbc(crtc, interval); | ||
1134 | } | ||
1135 | |||
1136 | void intel_disable_fbc(struct drm_device *dev) | ||
1137 | { | ||
1138 | struct drm_i915_private *dev_priv = dev->dev_private; | ||
1139 | |||
1140 | if (!dev_priv->display.disable_fbc) | ||
1141 | return; | ||
1142 | |||
1143 | dev_priv->display.disable_fbc(dev); | ||
1144 | } | ||
1145 | |||
1118 | /** | 1146 | /** |
1119 | * intel_update_fbc - enable/disable FBC as needed | 1147 | * intel_update_fbc - enable/disable FBC as needed |
1120 | * @crtc: CRTC to point the compressor at | 1148 | * @crtc: CRTC to point the compressor at |
@@ -1149,9 +1177,7 @@ static void intel_update_fbc(struct drm_crtc *crtc, | |||
1149 | if (!i915_powersave) | 1177 | if (!i915_powersave) |
1150 | return; | 1178 | return; |
1151 | 1179 | ||
1152 | if (!dev_priv->display.fbc_enabled || | 1180 | if (!I915_HAS_FBC(dev)) |
1153 | !dev_priv->display.enable_fbc || | ||
1154 | !dev_priv->display.disable_fbc) | ||
1155 | return; | 1181 | return; |
1156 | 1182 | ||
1157 | if (!crtc->fb) | 1183 | if (!crtc->fb) |
@@ -1198,28 +1224,25 @@ static void intel_update_fbc(struct drm_crtc *crtc, | |||
1198 | goto out_disable; | 1224 | goto out_disable; |
1199 | } | 1225 | } |
1200 | 1226 | ||
1201 | if (dev_priv->display.fbc_enabled(crtc)) { | 1227 | if (intel_fbc_enabled(dev)) { |
1202 | /* We can re-enable it in this case, but need to update pitch */ | 1228 | /* We can re-enable it in this case, but need to update pitch */ |
1203 | if (fb->pitch > dev_priv->cfb_pitch) | 1229 | if ((fb->pitch > dev_priv->cfb_pitch) || |
1204 | dev_priv->display.disable_fbc(dev); | 1230 | (obj_priv->fence_reg != dev_priv->cfb_fence) || |
1205 | if (obj_priv->fence_reg != dev_priv->cfb_fence) | 1231 | (plane != dev_priv->cfb_plane)) |
1206 | dev_priv->display.disable_fbc(dev); | 1232 | intel_disable_fbc(dev); |
1207 | if (plane != dev_priv->cfb_plane) | ||
1208 | dev_priv->display.disable_fbc(dev); | ||
1209 | } | 1233 | } |
1210 | 1234 | ||
1211 | if (!dev_priv->display.fbc_enabled(crtc)) { | 1235 | /* Now try to turn it back on if possible */ |
1212 | /* Now try to turn it back on if possible */ | 1236 | if (!intel_fbc_enabled(dev)) |
1213 | dev_priv->display.enable_fbc(crtc, 500); | 1237 | intel_enable_fbc(crtc, 500); |
1214 | } | ||
1215 | 1238 | ||
1216 | return; | 1239 | return; |
1217 | 1240 | ||
1218 | out_disable: | 1241 | out_disable: |
1219 | DRM_DEBUG_KMS("unsupported config, disabling FBC\n"); | 1242 | DRM_DEBUG_KMS("unsupported config, disabling FBC\n"); |
1220 | /* Multiple disables should be harmless */ | 1243 | /* Multiple disables should be harmless */ |
1221 | if (dev_priv->display.fbc_enabled(crtc)) | 1244 | if (intel_fbc_enabled(dev)) |
1222 | dev_priv->display.disable_fbc(dev); | 1245 | intel_disable_fbc(dev); |
1223 | } | 1246 | } |
1224 | 1247 | ||
1225 | static int | 1248 | static int |
@@ -3677,14 +3700,16 @@ static int intel_crtc_mode_set(struct drm_crtc *crtc, | |||
3677 | /* set the dithering flag */ | 3700 | /* set the dithering flag */ |
3678 | if (IS_I965G(dev)) { | 3701 | if (IS_I965G(dev)) { |
3679 | if (dev_priv->lvds_dither) { | 3702 | if (dev_priv->lvds_dither) { |
3680 | if (HAS_PCH_SPLIT(dev)) | 3703 | if (HAS_PCH_SPLIT(dev)) { |
3681 | pipeconf |= PIPE_ENABLE_DITHER; | 3704 | pipeconf |= PIPE_ENABLE_DITHER; |
3682 | else | 3705 | pipeconf |= PIPE_DITHER_TYPE_ST01; |
3706 | } else | ||
3683 | lvds |= LVDS_ENABLE_DITHER; | 3707 | lvds |= LVDS_ENABLE_DITHER; |
3684 | } else { | 3708 | } else { |
3685 | if (HAS_PCH_SPLIT(dev)) | 3709 | if (HAS_PCH_SPLIT(dev)) { |
3686 | pipeconf &= ~PIPE_ENABLE_DITHER; | 3710 | pipeconf &= ~PIPE_ENABLE_DITHER; |
3687 | else | 3711 | pipeconf &= ~PIPE_DITHER_TYPE_MASK; |
3712 | } else | ||
3688 | lvds &= ~LVDS_ENABLE_DITHER; | 3713 | lvds &= ~LVDS_ENABLE_DITHER; |
3689 | } | 3714 | } |
3690 | } | 3715 | } |
@@ -5202,8 +5227,7 @@ static void intel_init_display(struct drm_device *dev) | |||
5202 | else | 5227 | else |
5203 | dev_priv->display.dpms = i9xx_crtc_dpms; | 5228 | dev_priv->display.dpms = i9xx_crtc_dpms; |
5204 | 5229 | ||
5205 | /* Only mobile has FBC, leave pointers NULL for other chips */ | 5230 | if (I915_HAS_FBC(dev)) { |
5206 | if (IS_MOBILE(dev)) { | ||
5207 | if (IS_GM45(dev)) { | 5231 | if (IS_GM45(dev)) { |
5208 | dev_priv->display.fbc_enabled = g4x_fbc_enabled; | 5232 | dev_priv->display.fbc_enabled = g4x_fbc_enabled; |
5209 | dev_priv->display.enable_fbc = g4x_enable_fbc; | 5233 | dev_priv->display.enable_fbc = g4x_enable_fbc; |
@@ -5268,17 +5292,18 @@ static void intel_init_display(struct drm_device *dev) | |||
5268 | dev_priv->display.update_wm = g4x_update_wm; | 5292 | dev_priv->display.update_wm = g4x_update_wm; |
5269 | else if (IS_I965G(dev)) | 5293 | else if (IS_I965G(dev)) |
5270 | dev_priv->display.update_wm = i965_update_wm; | 5294 | dev_priv->display.update_wm = i965_update_wm; |
5271 | else if (IS_I9XX(dev) || IS_MOBILE(dev)) { | 5295 | else if (IS_I9XX(dev)) { |
5272 | dev_priv->display.update_wm = i9xx_update_wm; | 5296 | dev_priv->display.update_wm = i9xx_update_wm; |
5273 | dev_priv->display.get_fifo_size = i9xx_get_fifo_size; | 5297 | dev_priv->display.get_fifo_size = i9xx_get_fifo_size; |
5298 | } else if (IS_I85X(dev)) { | ||
5299 | dev_priv->display.update_wm = i9xx_update_wm; | ||
5300 | dev_priv->display.get_fifo_size = i85x_get_fifo_size; | ||
5274 | } else { | 5301 | } else { |
5275 | if (IS_I85X(dev)) | 5302 | dev_priv->display.update_wm = i830_update_wm; |
5276 | dev_priv->display.get_fifo_size = i85x_get_fifo_size; | 5303 | if (IS_845G(dev)) |
5277 | else if (IS_845G(dev)) | ||
5278 | dev_priv->display.get_fifo_size = i845_get_fifo_size; | 5304 | dev_priv->display.get_fifo_size = i845_get_fifo_size; |
5279 | else | 5305 | else |
5280 | dev_priv->display.get_fifo_size = i830_get_fifo_size; | 5306 | dev_priv->display.get_fifo_size = i830_get_fifo_size; |
5281 | dev_priv->display.update_wm = i830_update_wm; | ||
5282 | } | 5307 | } |
5283 | } | 5308 | } |
5284 | 5309 | ||