[PATCH 24/26] drm/i915: Run pre_plane_update asynchronously.

Maarten Lankhorst maarten.lankhorst at linux.intel.com
Thu May 12 20:50:29 UTC 2016


This could have been done in the previous commit, but it was easy to
split out without side effects.

Only crtc disabling is run synchronously now.

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

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index fb83b1f0a631..10359194ff95 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -4539,24 +4539,20 @@ intel_pre_disable_primary_noatomic(struct drm_crtc *crtc)
 	}
 }
 
-static void intel_pre_plane_update(struct intel_crtc_state *old_crtc_state)
+static void intel_pre_plane_update(struct intel_crtc *crtc,
+				   struct intel_flip_work *work)
 {
-	struct intel_crtc *crtc = to_intel_crtc(old_crtc_state->base.crtc);
 	struct drm_device *dev = crtc->base.dev;
 	struct drm_i915_private *dev_priv = dev->dev_private;
-	struct intel_crtc_state *pipe_config =
-		to_intel_crtc_state(crtc->base.state);
-	struct drm_atomic_state *old_state = old_crtc_state->base.state;
-	struct drm_plane *primary = crtc->base.primary;
-	struct drm_plane_state *old_pri_state =
-		drm_atomic_get_existing_plane_state(old_state, primary);
+	struct intel_crtc_state *pipe_config = work->new_crtc_state;
 	bool modeset = needs_modeset(&pipe_config->base);
 
-	if (old_pri_state) {
+	if (work->num_planes >= 1 &&
+	    work->old_plane_state[0]->base.plane == crtc->base.primary) {
 		struct intel_plane_state *primary_state =
-			to_intel_plane_state(primary->state);
+			work->new_plane_state[0];
 		struct intel_plane_state *old_primary_state =
-			to_intel_plane_state(old_pri_state);
+			work->old_plane_state[0];
 
 		intel_fbc_pre_update(crtc, pipe_config, primary_state);
 
@@ -4577,7 +4573,7 @@ static void intel_pre_plane_update(struct intel_crtc_state *old_crtc_state)
 		 * event which is after the vblank start event, so we need to have a
 		 * wait-for-vblank between disabling the plane and the pipe.
 		 */
-		if (old_crtc_state->base.active) {
+		if (work->old_crtc_state->base.active) {
 			intel_set_memory_cxsr(dev_priv, false);
 			dev_priv->wm.vlv.cxsr = false;
 			intel_wait_for_vblank(dev, crtc->pipe);
@@ -11013,6 +11009,8 @@ static void intel_mmio_flip_work_func(struct work_struct *w)
 	if (needs_modeset(&crtc_state->base)) {
 		update_scanline_offset(intel_crtc, crtc_state);
 		dev_priv->display.crtc_enable(crtc);
+	} else {
+		intel_pre_plane_update(intel_crtc, work);
 	}
 
 	ret = drm_crtc_vblank_get(crtc);
@@ -12995,6 +12993,8 @@ static void intel_schedule_update(struct drm_crtc *crtc,
 		WARN_ON(nonblock);
 
 		if (work->old_crtc_state->base.active) {
+			intel_pre_plane_update(to_intel_crtc(crtc), work);
+
 			intel_crtc_disable_planes(crtc, work->old_crtc_state->base.plane_mask);
 			dev_priv->display.crtc_disable(crtc);
 			intel_crtc->active = false;
@@ -13089,8 +13089,6 @@ static int intel_atomic_commit(struct drm_device *dev,
 			continue;
 		}
 
-		intel_pre_plane_update(to_intel_crtc_state(old_crtc_state));
-
 		if (!needs_modeset(crtc->state))
 			intel_state->work[i] = NULL;
 
-- 
2.5.5



More information about the Intel-gfx-trybot mailing list