diff mbox

[73/81] drm/i915: Use new_crtc when checking if CRTC is in use

Message ID 1355329008-31459-74-git-send-email-ville.syrjala@linux.intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Ville Syrjälä Dec. 12, 2012, 4:16 p.m. UTC
From: Ville Syrjälä <ville.syrjala@linux.intel.com>

The atomic check() hook is interested in the staged new configuration,
so it must use the intel_encoder::new_crtc pointer when checking if
a CRTC is in use or not.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/intel_atomic.c |   16 ++++++++++++++--
 1 files changed, 14 insertions(+), 2 deletions(-)
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/intel_atomic.c b/drivers/gpu/drm/i915/intel_atomic.c
index 3f093d6..ec79354 100644
--- a/drivers/gpu/drm/i915/intel_atomic.c
+++ b/drivers/gpu/drm/i915/intel_atomic.c
@@ -150,6 +150,18 @@  static void update_encoders_bitmask(struct intel_crtc *intel_crtc,
 	}
 }
 
+static bool intel_crtc_in_use(struct intel_crtc *intel_crtc)
+{
+	struct drm_device *dev = intel_crtc->base.dev;
+	struct intel_encoder *intel_encoder;
+
+	list_for_each_entry(intel_encoder, &dev->mode_config.encoder_list, base.head)
+		if (intel_encoder->new_crtc == intel_crtc)
+			return true;
+
+	return false;
+}
+
 static bool intel_encoder_in_use(struct intel_encoder *intel_encoder)
 {
 	struct drm_device *dev = intel_encoder->base.dev;
@@ -1246,12 +1258,12 @@  static int check_crtc(struct intel_crtc_state *s)
 	if (crtc->enabled) {
 		if (!fb)
 			return -EINVAL;
-		if (!drm_helper_crtc_in_use(crtc))
+		if (!intel_crtc_in_use(intel_crtc))
 			return -EINVAL;
 	} else {
 		if (fb)
 			return -EINVAL;
-		if (drm_helper_crtc_in_use(crtc))
+		if (intel_crtc_in_use(intel_crtc))
 			return -EINVAL;
 	}