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

Chris Wilson chris at chris-wilson.co.uk
Fri Oct 28 22:07:00 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 93fc68fc0711..845f6875cf4a 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -14307,6 +14307,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);
 
@@ -15008,7 +15012,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;
@@ -15036,7 +15041,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 411e5f4ca9bd..0a651a2a9052 100644
--- a/drivers/gpu/drm/i915/intel_drv.h
+++ b/drivers/gpu/drm/i915/intel_drv.h
@@ -677,6 +677,8 @@ struct intel_crtc_state {
 
 	/* Gamma mode programmed on the pipe */
 	uint32_t gamma_mode;
+
+	bool vblank_evade;
 };
 
 struct vlv_wm_state {
-- 
2.10.1



More information about the Intel-gfx-trybot mailing list