All of lore.kernel.org
 help / color / mirror / Atom feed
From: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
To: intel-gfx@lists.freedesktop.org
Subject: [PATCH v3.1 2/3] drm/i915: Update atomic state when removing mst connector, v3.
Date: Thu,  6 Aug 2015 13:47:36 +0200	[thread overview]
Message-ID: <1438861657-14109-2-git-send-email-maarten.lankhorst@linux.intel.com> (raw)
In-Reply-To: <1438861657-14109-1-git-send-email-maarten.lankhorst@linux.intel.com>

Fully remove the MST connector from the atomic state, and remove the
early returns in check_*_state for MST connectors.

With atomic the state can be made consistent all the time.

Thanks to Sivakumar Thulasimani for the idea of using
drm_atomic_helper_set_config.

Changes since v1:
- Remove the MST check in intel_connector_check_state too.
Changes since v2:
- Use drm_atomic_helper_set_config.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Sivakumar Thulasimani <sivakumar.thulasimani@intel.com>
---
 drivers/gpu/drm/i915/intel_display.c | 11 -----------
 drivers/gpu/drm/i915/intel_dp_mst.c  | 13 ++++++++++++-
 2 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 5e40b7e7013a..77b4da7e698c 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -6370,10 +6370,6 @@ static void intel_connector_check_state(struct intel_connector *connector)
 			      connector->base.base.id,
 			      connector->base.name);
 
-		/* there is no real hw state for MST connectors */
-		if (connector->mst_port)
-			return;
-
 		I915_STATE_WARN(connector->base.dpms == DRM_MODE_DPMS_OFF,
 		     "wrong connector dpms state\n");
 		I915_STATE_WARN(connector->base.encoder != &encoder->base,
@@ -12749,13 +12745,6 @@ check_encoder_state(struct drm_device *dev)
 					encoder->base.crtc,
 			     "connector's crtc doesn't match encoder crtc\n");
 		}
-		/*
-		 * for MST connectors if we unplug the connector is gone
-		 * away but the encoder is still connected to a crtc
-		 * until a modeset happens in response to the hotplug.
-		 */
-		if (!enabled && encoder->base.encoder_type == DRM_MODE_ENCODER_DPMST)
-			continue;
 
 		I915_STATE_WARN(!!encoder->base.crtc != enabled,
 		     "encoder's enabled state mismatch "
diff --git a/drivers/gpu/drm/i915/intel_dp_mst.c b/drivers/gpu/drm/i915/intel_dp_mst.c
index ff01569158ea..91ad17110c2f 100644
--- a/drivers/gpu/drm/i915/intel_dp_mst.c
+++ b/drivers/gpu/drm/i915/intel_dp_mst.c
@@ -467,9 +467,20 @@ static void intel_dp_destroy_mst_connector(struct drm_dp_mst_topology_mgr *mgr,
 {
 	struct intel_connector *intel_connector = to_intel_connector(connector);
 	struct drm_device *dev = connector->dev;
+
 	/* need to nuke the connector */
 	drm_modeset_lock_all(dev);
-	intel_connector_dpms(connector, DRM_MODE_DPMS_OFF);
+	if (connector->state->crtc) {
+		struct drm_mode_set set;
+		int ret;
+
+		memset(&set, 0, sizeof(set));
+		set.crtc = connector->state->crtc,
+
+		ret = drm_atomic_helper_set_config(&set);
+
+		WARN(ret, "Disabling mst crtc failed with %i\n", ret);
+	}
 	drm_modeset_unlock_all(dev);
 
 	intel_connector->unregister(intel_connector);
-- 
2.1.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2015-08-06 11:47 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-05 10:36 [PATCH v3 00/13] DPMS updates and atomic state checking Maarten Lankhorst
2015-08-05 10:36 ` [PATCH v3 01/13] drm/i915: Make the force_thru workaround atomic, v2 Maarten Lankhorst
2015-08-05 14:03   ` Daniel Vetter
2015-08-05 10:37 ` [PATCH v3 02/13] drm/i915: Validate the state after an atomic modeset only, and pass the state Maarten Lankhorst
2015-08-05 10:37 ` [PATCH v3 03/13] drm/i915: Update atomic state when removing mst connector Maarten Lankhorst
2015-08-06 11:47   ` [PATCH v3.1 1/3] drm/i915: Fix broken mst get_hw_state Maarten Lankhorst
2015-08-06 11:47     ` Maarten Lankhorst [this message]
2015-08-06 12:30       ` [PATCH v3.1 2/3] drm/i915: Update atomic state when removing mst connector, v3 Sivakumar Thulasimani
2015-08-06 11:47     ` [PATCH v3.1 3/3] drm/i915: Don't try to remove MST cleanly when force removed Maarten Lankhorst
2015-08-06 13:01       ` Daniel Vetter
2015-08-06 13:51         ` Maarten Lankhorst
2015-08-06 15:45           ` Daniel Vetter
2015-08-06 12:59     ` [PATCH v3.1 1/3] drm/i915: Fix broken mst get_hw_state Daniel Vetter
2015-08-06 13:37       ` Maarten Lankhorst
2015-08-06 15:58         ` Daniel Vetter
2015-08-05 10:37 ` [PATCH v3 04/13] drm/i915: Convert connector checking to atomic, v2 Maarten Lankhorst
2015-08-06 11:49   ` [PATCH v3.1 04/13] drm/i915: Convert connector checking to atomic, v3 Maarten Lankhorst
2015-08-05 10:37 ` [PATCH v3 05/13] drm/i915: Remove some unneeded checks from check_crtc_state Maarten Lankhorst
2015-08-05 10:37 ` [PATCH v3 06/13] drm/i915: Remove connectors_active from state checking Maarten Lankhorst
2015-08-05 10:37 ` [PATCH v3 07/13] drm/i915: Make crtc checking use the atomic state, v2 Maarten Lankhorst
2015-08-05 10:37 ` [PATCH v3 08/13] drm/i915: Get rid of dpms handling Maarten Lankhorst
2015-08-05 10:37 ` [PATCH v3 09/13] drm/i915: Remove connectors_active from sanitization, v2 Maarten Lankhorst
2015-08-05 10:37 ` [PATCH v3 10/13] drm/i915: Remove connectors_active from intel_dp.c, v2 Maarten Lankhorst
2015-08-05 10:37 ` [PATCH v3 11/13] drm/i915: Remove connectors_active Maarten Lankhorst
2015-08-05 10:37 ` [PATCH v3 12/13] drm/i915: Only update mode related state if a modeset happened Maarten Lankhorst
2015-08-06 13:12   ` Daniel Vetter
2015-08-06 14:06     ` Maarten Lankhorst
2015-08-06 16:01       ` Daniel Vetter
2015-08-05 10:37 ` [PATCH v3 13/13] drm/i915: Handle return value in intel_pin_and_fence_fb_obj, v2 Maarten Lankhorst
2015-08-11 22:17   ` shuang.he
2015-08-06 13:13 ` [PATCH v3 00/13] DPMS updates and atomic state checking Daniel Vetter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1438861657-14109-2-git-send-email-maarten.lankhorst@linux.intel.com \
    --to=maarten.lankhorst@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.