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

Chris Wilson chris at chris-wilson.co.uk
Fri Sep 16 13:47:44 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 9ee125f1a616..5878bbb38daf 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -14190,6 +14190,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);
 
@@ -14888,7 +14892,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;
@@ -14916,7 +14921,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