[Intel-gfx] [PATCH 02/30] drm/i915: Move the vblank pre/post modeset to the common crtc_mode_set.

Chris Wilson chris at chris-wilson.co.uk
Tue Apr 12 22:31:30 CEST 2011


From: Eric Anholt <eric at anholt.net>

Signed-off-by: Eric Anholt <eric at anholt.net>
Reviewed-by: Jesse Barnes <jbarnes at virtuousgeek.org>
Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
---
 drivers/gpu/drm/i915/intel_display.c |   16 ++++++----------
 1 files changed, 6 insertions(+), 10 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index abb7203..13a939e 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -4540,8 +4540,6 @@ static int i9xx_crtc_mode_set(struct drm_crtc *crtc,
 	u32 lvds_sync = 0;
 	int target_clock;
 
-	drm_vblank_pre_modeset(dev, pipe);
-
 	list_for_each_entry(encoder, &mode_config->encoder_list, base.head) {
 		if (encoder->base.crtc != crtc)
 			continue;
@@ -4598,7 +4596,6 @@ static int i9xx_crtc_mode_set(struct drm_crtc *crtc,
 	ok = limit->find_pll(limit, crtc, adjusted_mode->clock, refclk, &clock);
 	if (!ok) {
 		DRM_ERROR("Couldn't find PLL settings for mode!\n");
-		drm_vblank_post_modeset(dev, pipe);
 		return -EINVAL;
 	}
 
@@ -5158,8 +5155,6 @@ static int i9xx_crtc_mode_set(struct drm_crtc *crtc,
 
 	intel_update_watermarks(dev);
 
-	drm_vblank_post_modeset(dev, pipe);
-
 	return ret;
 }
 
@@ -5190,8 +5185,6 @@ static int ironlake_crtc_mode_set(struct drm_crtc *crtc,
 	u32 lvds_sync = 0;
 	int target_clock;
 
-	drm_vblank_pre_modeset(dev, pipe);
-
 	list_for_each_entry(encoder, &mode_config->encoder_list, base.head) {
 		if (encoder->base.crtc != crtc)
 			continue;
@@ -5248,7 +5241,6 @@ static int ironlake_crtc_mode_set(struct drm_crtc *crtc,
 	ok = limit->find_pll(limit, crtc, adjusted_mode->clock, refclk, &clock);
 	if (!ok) {
 		DRM_ERROR("Couldn't find PLL settings for mode!\n");
-		drm_vblank_post_modeset(dev, pipe);
 		return -EINVAL;
 	}
 
@@ -5808,8 +5800,6 @@ static int ironlake_crtc_mode_set(struct drm_crtc *crtc,
 
 	intel_update_watermarks(dev);
 
-	drm_vblank_post_modeset(dev, pipe);
-
 	return ret;
 }
 
@@ -5821,11 +5811,17 @@ static int intel_crtc_mode_set(struct drm_crtc *crtc,
 {
 	struct drm_device *dev = crtc->dev;
 	struct drm_i915_private *dev_priv = dev->dev_private;
+	struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
+	int pipe = intel_crtc->pipe;
 	int ret;
 
+	drm_vblank_pre_modeset(dev, pipe);
+
 	ret = dev_priv->display.crtc_mode_set(crtc, mode, adjusted_mode,
 					      x, y, old_fb);
 
+	drm_vblank_post_modeset(dev, pipe);
+
 	return ret;
 }
 
-- 
1.7.4.1




More information about the Intel-gfx mailing list