aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2012-04-19 09:13:52 -0400
committerDave Airlie <airlied@redhat.com>2012-04-19 09:13:52 -0400
commitd6b8395262a9d90e4ab11b614a5fb8f858e2b3df (patch)
treeafe4b8ae6affe84e95169bcc0c3bf1c32004a568 /drivers/gpu
parente36325071832f1ba96ac54fb8ba1459f08b05dd8 (diff)
parent99d9acdd0c5ce970eaf8e8671c0bc4cb7c6fb0c1 (diff)
Merge branch 'drm-intel-fixes' of git://people.freedesktop.org/~danvet/drm-intel into drm-fixes
* 'drm-intel-fixes' of git://people.freedesktop.org/~danvet/drm-intel: drm/i915: Do not set "Enable Panel Fitter" on SNB pageflips drm/i915: Hold mode_config lock whilst changing mode for lastclose() drm/i915: don't clobber the special upscaling lvds timings
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/i915/intel_display.c15
-rw-r--r--drivers/gpu/drm/i915/intel_drv.h4
-rw-r--r--drivers/gpu/drm/i915/intel_fb.c4
-rw-r--r--drivers/gpu/drm/i915/intel_lvds.c6
-rw-r--r--drivers/gpu/drm/i915/intel_panel.c2
5 files changed, 26 insertions, 5 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index bae38acf44dc..5908cd563400 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -3478,8 +3478,11 @@ static bool intel_crtc_mode_fixup(struct drm_crtc *crtc,
3478 return false; 3478 return false;
3479 } 3479 }
3480 3480
3481 /* All interlaced capable intel hw wants timings in frames. */ 3481 /* All interlaced capable intel hw wants timings in frames. Note though
3482 drm_mode_set_crtcinfo(adjusted_mode, 0); 3482 * that intel_lvds_mode_fixup does some funny tricks with the crtc
3483 * timings, so we need to be careful not to clobber these.*/
3484 if (!(adjusted_mode->private_flags & INTEL_MODE_CRTC_TIMINGS_SET))
3485 drm_mode_set_crtcinfo(adjusted_mode, 0);
3483 3486
3484 return true; 3487 return true;
3485} 3488}
@@ -7465,7 +7468,13 @@ static int intel_gen6_queue_flip(struct drm_device *dev,
7465 OUT_RING(fb->pitches[0] | obj->tiling_mode); 7468 OUT_RING(fb->pitches[0] | obj->tiling_mode);
7466 OUT_RING(obj->gtt_offset); 7469 OUT_RING(obj->gtt_offset);
7467 7470
7468 pf = I915_READ(PF_CTL(intel_crtc->pipe)) & PF_ENABLE; 7471 /* Contrary to the suggestions in the documentation,
7472 * "Enable Panel Fitter" does not seem to be required when page
7473 * flipping with a non-native mode, and worse causes a normal
7474 * modeset to fail.
7475 * pf = I915_READ(PF_CTL(intel_crtc->pipe)) & PF_ENABLE;
7476 */
7477 pf = 0;
7469 pipesrc = I915_READ(PIPESRC(intel_crtc->pipe)) & 0x0fff0fff; 7478 pipesrc = I915_READ(PIPESRC(intel_crtc->pipe)) & 0x0fff0fff;
7470 OUT_RING(pf | pipesrc); 7479 OUT_RING(pf | pipesrc);
7471 ADVANCE_LP_RING(); 7480 ADVANCE_LP_RING();
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
index 5a14149b3794..715afa153025 100644
--- a/drivers/gpu/drm/i915/intel_drv.h
+++ b/drivers/gpu/drm/i915/intel_drv.h
@@ -105,6 +105,10 @@
105#define INTEL_MODE_PIXEL_MULTIPLIER_SHIFT (0x0) 105#define INTEL_MODE_PIXEL_MULTIPLIER_SHIFT (0x0)
106#define INTEL_MODE_PIXEL_MULTIPLIER_MASK (0xf << INTEL_MODE_PIXEL_MULTIPLIER_SHIFT) 106#define INTEL_MODE_PIXEL_MULTIPLIER_MASK (0xf << INTEL_MODE_PIXEL_MULTIPLIER_SHIFT)
107#define INTEL_MODE_DP_FORCE_6BPC (0x10) 107#define INTEL_MODE_DP_FORCE_6BPC (0x10)
108/* This flag must be set by the encoder's mode_fixup if it changes the crtc
109 * timings in the mode to prevent the crtc fixup from overwriting them.
110 * Currently only lvds needs that. */
111#define INTEL_MODE_CRTC_TIMINGS_SET (0x20)
108 112
109static inline void 113static inline void
110intel_mode_set_pixel_multiplier(struct drm_display_mode *mode, 114intel_mode_set_pixel_multiplier(struct drm_display_mode *mode,
diff --git a/drivers/gpu/drm/i915/intel_fb.c b/drivers/gpu/drm/i915/intel_fb.c
index 19ecd78b8a2c..6e9ee33fd412 100644
--- a/drivers/gpu/drm/i915/intel_fb.c
+++ b/drivers/gpu/drm/i915/intel_fb.c
@@ -279,6 +279,8 @@ void intel_fb_restore_mode(struct drm_device *dev)
279 struct drm_mode_config *config = &dev->mode_config; 279 struct drm_mode_config *config = &dev->mode_config;
280 struct drm_plane *plane; 280 struct drm_plane *plane;
281 281
282 mutex_lock(&dev->mode_config.mutex);
283
282 ret = drm_fb_helper_restore_fbdev_mode(&dev_priv->fbdev->helper); 284 ret = drm_fb_helper_restore_fbdev_mode(&dev_priv->fbdev->helper);
283 if (ret) 285 if (ret)
284 DRM_DEBUG("failed to restore crtc mode\n"); 286 DRM_DEBUG("failed to restore crtc mode\n");
@@ -286,4 +288,6 @@ void intel_fb_restore_mode(struct drm_device *dev)
286 /* Be sure to shut off any planes that may be active */ 288 /* Be sure to shut off any planes that may be active */
287 list_for_each_entry(plane, &config->plane_list, head) 289 list_for_each_entry(plane, &config->plane_list, head)
288 plane->funcs->disable_plane(plane); 290 plane->funcs->disable_plane(plane);
291
292 mutex_unlock(&dev->mode_config.mutex);
289} 293}
diff --git a/drivers/gpu/drm/i915/intel_lvds.c b/drivers/gpu/drm/i915/intel_lvds.c
index 95db2e988227..30e2c82101de 100644
--- a/drivers/gpu/drm/i915/intel_lvds.c
+++ b/drivers/gpu/drm/i915/intel_lvds.c
@@ -187,6 +187,8 @@ centre_horizontally(struct drm_display_mode *mode,
187 187
188 mode->crtc_hsync_start = mode->crtc_hblank_start + sync_pos; 188 mode->crtc_hsync_start = mode->crtc_hblank_start + sync_pos;
189 mode->crtc_hsync_end = mode->crtc_hsync_start + sync_width; 189 mode->crtc_hsync_end = mode->crtc_hsync_start + sync_width;
190
191 mode->private_flags |= INTEL_MODE_CRTC_TIMINGS_SET;
190} 192}
191 193
192static void 194static void
@@ -208,6 +210,8 @@ centre_vertically(struct drm_display_mode *mode,
208 210
209 mode->crtc_vsync_start = mode->crtc_vblank_start + sync_pos; 211 mode->crtc_vsync_start = mode->crtc_vblank_start + sync_pos;
210 mode->crtc_vsync_end = mode->crtc_vsync_start + sync_width; 212 mode->crtc_vsync_end = mode->crtc_vsync_start + sync_width;
213
214 mode->private_flags |= INTEL_MODE_CRTC_TIMINGS_SET;
211} 215}
212 216
213static inline u32 panel_fitter_scaling(u32 source, u32 target) 217static inline u32 panel_fitter_scaling(u32 source, u32 target)
@@ -283,6 +287,8 @@ static bool intel_lvds_mode_fixup(struct drm_encoder *encoder,
283 for_each_pipe(pipe) 287 for_each_pipe(pipe)
284 I915_WRITE(BCLRPAT(pipe), 0); 288 I915_WRITE(BCLRPAT(pipe), 0);
285 289
290 drm_mode_set_crtcinfo(adjusted_mode, 0);
291
286 switch (intel_lvds->fitting_mode) { 292 switch (intel_lvds->fitting_mode) {
287 case DRM_MODE_SCALE_CENTER: 293 case DRM_MODE_SCALE_CENTER:
288 /* 294 /*
diff --git a/drivers/gpu/drm/i915/intel_panel.c b/drivers/gpu/drm/i915/intel_panel.c
index 230a141dbea3..48177ec4720e 100644
--- a/drivers/gpu/drm/i915/intel_panel.c
+++ b/drivers/gpu/drm/i915/intel_panel.c
@@ -47,8 +47,6 @@ intel_fixed_panel_mode(struct drm_display_mode *fixed_mode,
47 adjusted_mode->vtotal = fixed_mode->vtotal; 47 adjusted_mode->vtotal = fixed_mode->vtotal;
48 48
49 adjusted_mode->clock = fixed_mode->clock; 49 adjusted_mode->clock = fixed_mode->clock;
50
51 drm_mode_set_crtcinfo(adjusted_mode, 0);
52} 50}
53 51
54/* adjusted_mode has been preset to be the panel's fixed mode */ 52/* adjusted_mode has been preset to be the panel's fixed mode */