aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2010-09-13 09:19:16 -0400
committerChris Wilson <chris@chris-wilson.co.uk>2010-09-13 09:32:18 -0400
commitf7abfe8b281991c66406c42c1a6c6c9ee0daa0ff (patch)
tree22ac64e9f3e5e7ec7044abafefa23e1b0ae14f63
parent6b383a7f6378f193c30200435d8170f95916b5f0 (diff)
drm/i915: Fix an overlay regression from 7e7d76c
When separating out the prepare/commit into its own separate functions we overlooked that the intel_crtc->dpms_mode was being used elsewhere to check on the actual status of the pipe. Track that bit of logic separately from the actual dpms mode, so there is no confusion should we be able to handle multiple dpms modes, nor any semantic conflict between prepare/commit and dpms. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--drivers/gpu/drm/i915/intel_display.c18
-rw-r--r--drivers/gpu/drm/i915/intel_drv.h1
-rw-r--r--drivers/gpu/drm/i915/intel_overlay.c8
3 files changed, 21 insertions, 6 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 1e2a17d66ebb..a54b701f867c 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -1956,6 +1956,10 @@ static void ironlake_crtc_enable(struct drm_crtc *crtc)
1956 int plane = intel_crtc->plane; 1956 int plane = intel_crtc->plane;
1957 u32 reg, temp; 1957 u32 reg, temp;
1958 1958
1959 if (intel_crtc->active)
1960 return;
1961
1962 intel_crtc->active = true;
1959 intel_update_watermarks(dev); 1963 intel_update_watermarks(dev);
1960 1964
1961 if (intel_pipe_has_type(crtc, INTEL_OUTPUT_LVDS)) { 1965 if (intel_pipe_has_type(crtc, INTEL_OUTPUT_LVDS)) {
@@ -2116,6 +2120,9 @@ static void ironlake_crtc_disable(struct drm_crtc *crtc)
2116 int plane = intel_crtc->plane; 2120 int plane = intel_crtc->plane;
2117 u32 reg, temp; 2121 u32 reg, temp;
2118 2122
2123 if (!intel_crtc->active)
2124 return;
2125
2119 drm_vblank_off(dev, pipe); 2126 drm_vblank_off(dev, pipe);
2120 intel_crtc_update_cursor(crtc, false); 2127 intel_crtc_update_cursor(crtc, false);
2121 2128
@@ -2245,6 +2252,7 @@ static void ironlake_crtc_disable(struct drm_crtc *crtc)
2245 POSTING_READ(reg); 2252 POSTING_READ(reg);
2246 udelay(100); 2253 udelay(100);
2247 2254
2255 intel_crtc->active = false;
2248 intel_update_watermarks(dev); 2256 intel_update_watermarks(dev);
2249 intel_update_fbc(dev); 2257 intel_update_fbc(dev);
2250 intel_clear_scanline_wait(dev); 2258 intel_clear_scanline_wait(dev);
@@ -2298,6 +2306,10 @@ static void i9xx_crtc_enable(struct drm_crtc *crtc)
2298 int plane = intel_crtc->plane; 2306 int plane = intel_crtc->plane;
2299 u32 reg, temp; 2307 u32 reg, temp;
2300 2308
2309 if (intel_crtc->active)
2310 return;
2311
2312 intel_crtc->active = true;
2301 intel_update_watermarks(dev); 2313 intel_update_watermarks(dev);
2302 2314
2303 /* Enable the DPLL */ 2315 /* Enable the DPLL */
@@ -2354,6 +2366,9 @@ static void i9xx_crtc_disable(struct drm_crtc *crtc)
2354 int plane = intel_crtc->plane; 2366 int plane = intel_crtc->plane;
2355 u32 reg, temp; 2367 u32 reg, temp;
2356 2368
2369 if (!intel_crtc->active)
2370 return;
2371
2357 /* Give the overlay scaler a chance to disable if it's on this pipe */ 2372 /* Give the overlay scaler a chance to disable if it's on this pipe */
2358 intel_crtc_dpms_overlay(intel_crtc, false); 2373 intel_crtc_dpms_overlay(intel_crtc, false);
2359 intel_crtc_update_cursor(crtc, false); 2374 intel_crtc_update_cursor(crtc, false);
@@ -2402,6 +2417,7 @@ static void i9xx_crtc_disable(struct drm_crtc *crtc)
2402 } 2417 }
2403 2418
2404done: 2419done:
2420 intel_crtc->active = false;
2405 intel_update_fbc(dev); 2421 intel_update_fbc(dev);
2406 intel_update_watermarks(dev); 2422 intel_update_watermarks(dev);
2407 intel_clear_scanline_wait(dev); 2423 intel_clear_scanline_wait(dev);
@@ -3463,7 +3479,7 @@ static void intel_update_watermarks(struct drm_device *dev)
3463 /* Get the clock config from both planes */ 3479 /* Get the clock config from both planes */
3464 list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) { 3480 list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) {
3465 struct intel_crtc *intel_crtc = to_intel_crtc(crtc); 3481 struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
3466 if (intel_crtc->dpms_mode == DRM_MODE_DPMS_ON) { 3482 if (intel_crtc->active) {
3467 enabled++; 3483 enabled++;
3468 if (intel_crtc->plane == 0) { 3484 if (intel_crtc->plane == 0) {
3469 DRM_DEBUG_KMS("plane A (pipe %d) clock: %d\n", 3485 DRM_DEBUG_KMS("plane A (pipe %d) clock: %d\n",
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
index c0891b1ec7b5..5171b0523178 100644
--- a/drivers/gpu/drm/i915/intel_drv.h
+++ b/drivers/gpu/drm/i915/intel_drv.h
@@ -169,6 +169,7 @@ struct intel_crtc {
169 enum plane plane; 169 enum plane plane;
170 u8 lut_r[256], lut_g[256], lut_b[256]; 170 u8 lut_r[256], lut_g[256], lut_b[256];
171 int dpms_mode; 171 int dpms_mode;
172 bool active; /* is the crtc on? independent of the dpms mode */
172 bool busy; /* is scanout buffer being updated frequently? */ 173 bool busy; /* is scanout buffer being updated frequently? */
173 struct timer_list idle_timer; 174 struct timer_list idle_timer;
174 bool lowfreq_avail; 175 bool lowfreq_avail;
diff --git a/drivers/gpu/drm/i915/intel_overlay.c b/drivers/gpu/drm/i915/intel_overlay.c
index 3dff16118ee5..c4699c916698 100644
--- a/drivers/gpu/drm/i915/intel_overlay.c
+++ b/drivers/gpu/drm/i915/intel_overlay.c
@@ -875,15 +875,13 @@ static int check_overlay_possible_on_crtc(struct intel_overlay *overlay,
875 struct intel_crtc *crtc) 875 struct intel_crtc *crtc)
876{ 876{
877 drm_i915_private_t *dev_priv = overlay->dev->dev_private; 877 drm_i915_private_t *dev_priv = overlay->dev->dev_private;
878 u32 pipeconf;
879 878
880 if (!crtc->base.enabled || crtc->dpms_mode != DRM_MODE_DPMS_ON) 879 if (!crtc->active)
881 return -EINVAL; 880 return -EINVAL;
882 881
883 pipeconf = I915_READ(PIPECONF(crtc->pipe));
884
885 /* can't use the overlay with double wide pipe */ 882 /* can't use the overlay with double wide pipe */
886 if (!IS_I965G(overlay->dev) && pipeconf & PIPECONF_DOUBLE_WIDE) 883 if (!IS_I965G(overlay->dev) &&
884 (I915_READ(PIPECONF(crtc->pipe)) & (PIPECONF_DOUBLE_WIDE | PIPECONF_ENABLE)) != PIPECONF_ENABLE)
887 return -EINVAL; 885 return -EINVAL;
888 886
889 return 0; 887 return 0;