From 6173ee2886ca46e00ba3d8f0b4a9a1cd6f8a76ce Mon Sep 17 00:00:00 2001
From: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Date: Wed, 23 Sep 2015 16:29:39 +0200
Subject: [PATCH] drm/i915: Only call commit_planes when there are things to commit.
Mime-version: 1.0
Content-type: text/plain; charset=UTF-8
Content-transfer-encoding: 8bit
Git-commit: 6173ee2886ca46e00ba3d8f0b4a9a1cd6f8a76ce
Patch-mainline: 4.5-rc1
References: bsc#1004048

The atomic helpers set planes_changed on a crtc_state if there is
any plane_state bound to that crtc. If there's none and there is
no pipe update required the crtc has nothing to update, so vblank
evasion can be skipped.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Acked-by: Takashi Iwai <tiwai@suse.de>

---
 drivers/gpu/drm/i915/intel_display.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -13258,7 +13258,8 @@ static int intel_atomic_commit(struct dr
 		if (!modeset)
 			intel_pre_plane_update(intel_crtc);
 
-		if (crtc->state->active)
+		if (crtc->state->active &&
+		    (crtc->state->planes_changed || update_pipe))
 			drm_atomic_helper_commit_planes_on_crtc(crtc_state);
 
 		if (put_domains)
