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

Chris Wilson chris at chris-wilson.co.uk
Thu Sep 15 15:26:37 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 bb8af140c670..ee5da86a8878 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -14165,6 +14165,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);
 
@@ -14863,7 +14867,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;
@@ -14891,7 +14896,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 d81335bcfe97..db36ecc5a838 100644
--- a/drivers/gpu/drm/i915/intel_drv.h
+++ b/drivers/gpu/drm/i915/intel_drv.h
@@ -668,6 +668,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