[PATCH 29/29] drm/i915: No vblank evasion for the cursor

Chris Wilson chris at chris-wilson.co.uk
Thu Sep 15 08:25:45 UTC 2016


The cursor is fully double buffered so can be updated asynchronously
with respect to the vblank. If that is the only operation on the CRTC,
we can avoid all the evasion overhead.

Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
---
 drivers/gpu/drm/i915/intel_display.c | 10 ++++++++--
 drivers/gpu/drm/i915/intel_drv.h     |  2 ++
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index d712d39ff8dd..0482384a7d40 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -14164,6 +14164,10 @@ static int intel_atomic_commit_prepare_planes(struct drm_atomic_state *state)
 		ret = intel_prepare_plane_fb(plane, plane_state);
 		if (ret)
 			goto err;
+
+		if (plane->type != DRM_PLANE_TYPE_CURSOR && plane_state->crtc)
+			intel_atomic_get_crtc_state(state,
+						    to_intel_crtc(plane_state->crtc))->vblank_evade = true;
 	}
 	mutex_unlock(&state->dev->struct_mutex);
 
@@ -14862,7 +14866,8 @@ static void intel_begin_crtc_commit(struct drm_crtc *crtc,
 	enum pipe pipe = intel_crtc->pipe;
 
 	/* Perform vblank evasion around commit operation */
-	intel_pipe_update_start(intel_crtc);
+	if (to_intel_crtc_state(crtc->state)->vblank_evade)
+		intel_pipe_update_start(intel_crtc);
 
 	if (modeset)
 		return;
@@ -14890,7 +14895,8 @@ static void intel_finish_crtc_commit(struct drm_crtc *crtc,
 	struct drm_pending_vblank_event *event;
 
 	event = fetch_and_zero(&state->crtcs[drm_crtc_index(crtc)].event);
-	intel_pipe_update_end(intel_crtc, NULL, event);
+	if (to_intel_crtc_state(crtc->state)->vblank_evade)
+		intel_pipe_update_end(intel_crtc, NULL, event);
 }
 
 /**
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
index e714477d45b2..9bf58850a0a9 100644
--- a/drivers/gpu/drm/i915/intel_drv.h
+++ b/drivers/gpu/drm/i915/intel_drv.h
@@ -664,6 +664,8 @@ struct intel_crtc_state {
 
 	/* Gamma mode programmed on the pipe */
 	uint32_t gamma_mode;
+
+	bool vblank_evade;
 };
 
 struct vlv_wm_state {
-- 
2.9.3



More information about the Intel-gfx-trybot mailing list