diff mbox

[42/42] drm/i915: return early in __intel_set_mode_setup_plls without modeset

Message ID 1431354318-11995-43-git-send-email-maarten.lankhorst@linux.intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Maarten Lankhorst May 11, 2015, 2:25 p.m. UTC
Don't walk the crtc_state twice if there's no need for it.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
---
 drivers/gpu/drm/i915/intel_display.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 386d9599d918..4c17ab81dcb3 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -11972,6 +11972,7 @@  static int __intel_set_mode_setup_plls(struct drm_atomic_state *state)
 	struct intel_crtc_state *intel_crtc_state;
 	struct drm_crtc *crtc;
 	struct drm_crtc_state *crtc_state;
+	struct intel_shared_dpll_config *shared_dpll;
 	int ret = 0;
 	int i;
 
@@ -11990,13 +11991,13 @@  static int __intel_set_mode_setup_plls(struct drm_atomic_state *state)
 		}
 	}
 
-	if (clear_pipes) {
-		struct intel_shared_dpll_config *shared_dpll =
-			intel_atomic_get_shared_dpll_state(state);
+	if (!clear_pipes)
+		return 0;
 
-		for (i = 0; i < dev_priv->num_shared_dpll; i++)
-			shared_dpll[i].crtc_mask &= ~clear_pipes;
-	}
+	shared_dpll = intel_atomic_get_shared_dpll_state(state);
+
+	for (i = 0; i < dev_priv->num_shared_dpll; i++)
+		shared_dpll[i].crtc_mask &= ~clear_pipes;
 
 	for_each_crtc_in_state(state, crtc, crtc_state, i) {
 		if (!needs_modeset(crtc_state) || !crtc_state->active)