[Intel-gfx] [PATCH 23/24] drm/i915: Unify plane updates.

Maarten Lankhorst maarten.lankhorst at linux.intel.com
Mon Jun 1 06:27:26 PDT 2015


Remove almost all updates from begin/finish crtc commit and call them
from intel_atomic_commit.

This allows using drm_atomic_helper_commit_planes_on_crtc on modeset.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst at linux.intel.com>
---
 drivers/gpu/drm/i915/intel_display.c | 50 ++++++++++++------------------------
 1 file changed, 16 insertions(+), 34 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index f6c6f8f8df95..4683d2bb716a 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -4763,17 +4763,6 @@ static void intel_pre_plane_update(struct intel_crtc *crtc)
 		intel_pre_disable_primary(&crtc->base);
 }
 
-static void intel_crtc_enable_planes(struct drm_crtc *crtc)
-{
-	struct drm_plane *p;
-
-	drm_for_each_plane_mask(p, crtc->dev, crtc->state->plane_mask) {
-		struct intel_plane *plane = to_intel_plane(p);
-
-		plane->commit_plane(p, to_intel_plane_state(p->state));
-	}
-}
-
 static void intel_crtc_disable_planes(struct drm_crtc *crtc,
 				      struct drm_crtc_state *old_crtc_state)
 {
@@ -12856,20 +12845,22 @@ static int intel_atomic_commit(struct drm_device *dev,
 
 	/* Now enable the clocks, plane, pipe, and connectors that we set up. */
 	for_each_crtc_in_state(state, crtc, crtc_state, i) {
-		if (!needs_modeset(crtc->state)) {
-			drm_atomic_helper_commit_planes_on_crtc(crtc_state);
-			continue;
-		}
+		struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
 
-		if (crtc->state->active) {
-			update_scanline_offset(to_intel_crtc(crtc));
+		if (!needs_modeset(crtc->state)) {
+			intel_pre_plane_update(intel_crtc);
+		} else if (crtc->state->active) {
+			update_scanline_offset(intel_crtc);
 			dev_priv->display.crtc_enable(crtc);
-			intel_crtc_enable_planes(crtc);
-		} else {
-			if (to_intel_crtc(crtc)->atomic.update_wm)
-				intel_update_watermarks(crtc);
 		}
-		intel_post_plane_update(to_intel_crtc(crtc));
+
+		if (intel_crtc->atomic.update_wm)
+			intel_update_watermarks(crtc);
+
+		if (crtc->state->active)
+			drm_atomic_helper_commit_planes_on_crtc(crtc_state);
+
+		intel_post_plane_update(intel_crtc);
 	}
 
 	/* FIXME: add subpixel order */
@@ -13247,20 +13238,13 @@ static void intel_begin_crtc_commit(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);
-	struct drm_crtc_state *crtc_state = intel_crtc->base.state;
-
-	intel_pre_plane_update(intel_crtc);
-
-	if (intel_crtc->atomic.update_wm)
-		intel_update_watermarks(crtc);
 
 	intel_runtime_pm_get(dev_priv);
 
 	/* Perform vblank evasion around commit operation */
-	if (crtc_state->active && !needs_modeset(crtc_state))
-		intel_crtc->atomic.evade =
-			intel_pipe_update_start(intel_crtc,
-						&intel_crtc->atomic.start_vbl_count);
+	intel_crtc->atomic.evade =
+		intel_pipe_update_start(intel_crtc,
+					&intel_crtc->atomic.start_vbl_count);
 
 	if (intel_crtc->atomic.skl_update_scaler0) {
 		uint32_t ps_ctrl, ps_win_sz;
@@ -13286,8 +13270,6 @@ static void intel_finish_crtc_commit(struct drm_crtc *crtc)
 				      intel_crtc->atomic.start_vbl_count);
 
 	intel_runtime_pm_put(dev_priv);
-
-	intel_post_plane_update(intel_crtc);
 }
 
 /**
-- 
2.1.0



More information about the Intel-gfx mailing list