aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-04-21 12:57:13 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-04-21 12:57:13 -0400
commit25b210371f76ac63b30d998549f5f4891d805f3b (patch)
treeb8a90dba0876716bdd56bf478c6949249e4a55dd
parentec616048ea21da2b32ed1a820e637c74c61c618c (diff)
parent5c72d064f7ead1126bed6faab0c2bfb7418036e2 (diff)
Merge branch 'drm-intel-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/keithp/linux-2.6
* 'drm-intel-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/keithp/linux-2.6: drm/i915: Initialise g4x watermarks for disabled pipes drm/i915: Sanitize the output registers after resume drm/i915/tv: Fix modeset flickering introduced in 7f58aabc3 drm/i915/tv: Only poll for TV connections drm/i915/tv: Remember the detected TV type
-rw-r--r--drivers/gpu/drm/i915/intel_display.c73
-rw-r--r--drivers/gpu/drm/i915/intel_tv.c9
2 files changed, 45 insertions, 37 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 432fc04c6bff..e522c702b04e 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -3771,8 +3771,11 @@ static bool g4x_compute_wm0(struct drm_device *dev,
3771 int entries, tlb_miss; 3771 int entries, tlb_miss;
3772 3772
3773 crtc = intel_get_crtc_for_plane(dev, plane); 3773 crtc = intel_get_crtc_for_plane(dev, plane);
3774 if (crtc->fb == NULL || !crtc->enabled) 3774 if (crtc->fb == NULL || !crtc->enabled) {
3775 *cursor_wm = cursor->guard_size;
3776 *plane_wm = display->guard_size;
3775 return false; 3777 return false;
3778 }
3776 3779
3777 htotal = crtc->mode.htotal; 3780 htotal = crtc->mode.htotal;
3778 hdisplay = crtc->mode.hdisplay; 3781 hdisplay = crtc->mode.hdisplay;
@@ -6215,36 +6218,6 @@ cleanup_work:
6215 return ret; 6218 return ret;
6216} 6219}
6217 6220
6218static void intel_crtc_reset(struct drm_crtc *crtc)
6219{
6220 struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
6221
6222 /* Reset flags back to the 'unknown' status so that they
6223 * will be correctly set on the initial modeset.
6224 */
6225 intel_crtc->dpms_mode = -1;
6226}
6227
6228static struct drm_crtc_helper_funcs intel_helper_funcs = {
6229 .dpms = intel_crtc_dpms,
6230 .mode_fixup = intel_crtc_mode_fixup,
6231 .mode_set = intel_crtc_mode_set,
6232 .mode_set_base = intel_pipe_set_base,
6233 .mode_set_base_atomic = intel_pipe_set_base_atomic,
6234 .load_lut = intel_crtc_load_lut,
6235 .disable = intel_crtc_disable,
6236};
6237
6238static const struct drm_crtc_funcs intel_crtc_funcs = {
6239 .reset = intel_crtc_reset,
6240 .cursor_set = intel_crtc_cursor_set,
6241 .cursor_move = intel_crtc_cursor_move,
6242 .gamma_set = intel_crtc_gamma_set,
6243 .set_config = drm_crtc_helper_set_config,
6244 .destroy = intel_crtc_destroy,
6245 .page_flip = intel_crtc_page_flip,
6246};
6247
6248static void intel_sanitize_modesetting(struct drm_device *dev, 6221static void intel_sanitize_modesetting(struct drm_device *dev,
6249 int pipe, int plane) 6222 int pipe, int plane)
6250{ 6223{
@@ -6281,6 +6254,42 @@ static void intel_sanitize_modesetting(struct drm_device *dev,
6281 intel_disable_pipe(dev_priv, pipe); 6254 intel_disable_pipe(dev_priv, pipe);
6282} 6255}
6283 6256
6257static void intel_crtc_reset(struct drm_crtc *crtc)
6258{
6259 struct drm_device *dev = crtc->dev;
6260 struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
6261
6262 /* Reset flags back to the 'unknown' status so that they
6263 * will be correctly set on the initial modeset.
6264 */
6265 intel_crtc->dpms_mode = -1;
6266
6267 /* We need to fix up any BIOS configuration that conflicts with
6268 * our expectations.
6269 */
6270 intel_sanitize_modesetting(dev, intel_crtc->pipe, intel_crtc->plane);
6271}
6272
6273static struct drm_crtc_helper_funcs intel_helper_funcs = {
6274 .dpms = intel_crtc_dpms,
6275 .mode_fixup = intel_crtc_mode_fixup,
6276 .mode_set = intel_crtc_mode_set,
6277 .mode_set_base = intel_pipe_set_base,
6278 .mode_set_base_atomic = intel_pipe_set_base_atomic,
6279 .load_lut = intel_crtc_load_lut,
6280 .disable = intel_crtc_disable,
6281};
6282
6283static const struct drm_crtc_funcs intel_crtc_funcs = {
6284 .reset = intel_crtc_reset,
6285 .cursor_set = intel_crtc_cursor_set,
6286 .cursor_move = intel_crtc_cursor_move,
6287 .gamma_set = intel_crtc_gamma_set,
6288 .set_config = drm_crtc_helper_set_config,
6289 .destroy = intel_crtc_destroy,
6290 .page_flip = intel_crtc_page_flip,
6291};
6292
6284static void intel_crtc_init(struct drm_device *dev, int pipe) 6293static void intel_crtc_init(struct drm_device *dev, int pipe)
6285{ 6294{
6286 drm_i915_private_t *dev_priv = dev->dev_private; 6295 drm_i915_private_t *dev_priv = dev->dev_private;
@@ -6330,8 +6339,6 @@ static void intel_crtc_init(struct drm_device *dev, int pipe)
6330 6339
6331 setup_timer(&intel_crtc->idle_timer, intel_crtc_idle_timer, 6340 setup_timer(&intel_crtc->idle_timer, intel_crtc_idle_timer,
6332 (unsigned long)intel_crtc); 6341 (unsigned long)intel_crtc);
6333
6334 intel_sanitize_modesetting(dev, intel_crtc->pipe, intel_crtc->plane);
6335} 6342}
6336 6343
6337int intel_get_pipe_from_crtc_id(struct drm_device *dev, void *data, 6344int intel_get_pipe_from_crtc_id(struct drm_device *dev, void *data,
diff --git a/drivers/gpu/drm/i915/intel_tv.c b/drivers/gpu/drm/i915/intel_tv.c
index 4256b8ef3947..6b22c1dcc015 100644
--- a/drivers/gpu/drm/i915/intel_tv.c
+++ b/drivers/gpu/drm/i915/intel_tv.c
@@ -1151,10 +1151,10 @@ intel_tv_mode_set(struct drm_encoder *encoder, struct drm_display_mode *mode,
1151 (video_levels->blank << TV_BLANK_LEVEL_SHIFT))); 1151 (video_levels->blank << TV_BLANK_LEVEL_SHIFT)));
1152 { 1152 {
1153 int pipeconf_reg = PIPECONF(pipe); 1153 int pipeconf_reg = PIPECONF(pipe);
1154 int dspcntr_reg = DSPCNTR(pipe); 1154 int dspcntr_reg = DSPCNTR(intel_crtc->plane);
1155 int pipeconf = I915_READ(pipeconf_reg); 1155 int pipeconf = I915_READ(pipeconf_reg);
1156 int dspcntr = I915_READ(dspcntr_reg); 1156 int dspcntr = I915_READ(dspcntr_reg);
1157 int dspbase_reg = DSPADDR(pipe); 1157 int dspbase_reg = DSPADDR(intel_crtc->plane);
1158 int xpos = 0x0, ypos = 0x0; 1158 int xpos = 0x0, ypos = 0x0;
1159 unsigned int xsize, ysize; 1159 unsigned int xsize, ysize;
1160 /* Pipe must be off here */ 1160 /* Pipe must be off here */
@@ -1378,7 +1378,9 @@ intel_tv_detect(struct drm_connector *connector, bool force)
1378 if (type < 0) 1378 if (type < 0)
1379 return connector_status_disconnected; 1379 return connector_status_disconnected;
1380 1380
1381 intel_tv->type = type;
1381 intel_tv_find_better_format(connector); 1382 intel_tv_find_better_format(connector);
1383
1382 return connector_status_connected; 1384 return connector_status_connected;
1383} 1385}
1384 1386
@@ -1670,8 +1672,7 @@ intel_tv_init(struct drm_device *dev)
1670 * 1672 *
1671 * More recent chipsets favour HDMI rather than integrated S-Video. 1673 * More recent chipsets favour HDMI rather than integrated S-Video.
1672 */ 1674 */
1673 connector->polled = 1675 connector->polled = DRM_CONNECTOR_POLL_CONNECT;
1674 DRM_CONNECTOR_POLL_CONNECT | DRM_CONNECTOR_POLL_DISCONNECT;
1675 1676
1676 drm_connector_init(dev, connector, &intel_tv_connector_funcs, 1677 drm_connector_init(dev, connector, &intel_tv_connector_funcs,
1677 DRM_MODE_CONNECTOR_SVIDEO); 1678 DRM_MODE_CONNECTOR_SVIDEO);