diff mbox

[1/3] drm/i915: Broadwell modeset global pipes to atomic

Message ID 1434454295-7647-2-git-send-email-mika.kahola@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Mika Kahola June 16, 2015, 11:31 a.m. UTC
Convert 'broadwell_modeset_global_pipes()' into atomic
mode setting.

Signed-off-by: Mika Kahola <mika.kahola@intel.com>
---
 drivers/gpu/drm/i915/intel_display.c | 24 ++++++++++++++++++------
 1 file changed, 18 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 3f48917..953eda7 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -9683,6 +9683,10 @@  static int broadwell_modeset_global_pipes(struct drm_atomic_state *state)
 	struct drm_crtc_state *crtc_state;
 	int max_pixclk = ilk_max_pixel_rate(dev_priv);
 	int cdclk, i;
+	int ret = 0;
+
+	if (max_pixclk < 0)
+		return max_pixclk;
 
 	cdclk = broadwell_calc_cdclk(dev_priv, max_pixclk);
 
@@ -9697,14 +9701,22 @@  static int broadwell_modeset_global_pipes(struct drm_atomic_state *state)
 		crtc_state = drm_atomic_get_crtc_state(state, crtc);
 		if (IS_ERR(crtc_state))
 			return PTR_ERR(crtc_state);
-	}
 
-	/* disable/enable all currently active pipes while we change cdclk */
-	for_each_crtc_in_state(state, crtc, crtc_state, i)
-		if (crtc_state->enable)
-			crtc_state->mode_changed = true;
+		if (!crtc_state->active || needs_modeset(crtc_state))
+			continue;
 
-	return 0;
+		crtc_state->mode_changed = true;
+
+		ret = drm_atomic_add_affected_connectors(state, crtc);
+		if (ret)
+			break;
+
+		ret = drm_atomic_add_affected_planes(state, crtc);
+		if (ret)
+			break;
+	}
+
+	return ret;
 }
 
 static void broadwell_modeset_global_resources(struct drm_atomic_state *state)