From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sivakumar Thulasimani Subject: Re: [PATCH v3.1 2/3] drm/i915: Update atomic state when removing mst connector, v3. Date: Thu, 06 Aug 2015 18:00:09 +0530 Message-ID: <55C35351.8030702@intel.com> References: <1438771031-23227-4-git-send-email-maarten.lankhorst@linux.intel.com> <1438861657-14109-1-git-send-email-maarten.lankhorst@linux.intel.com> <1438861657-14109-2-git-send-email-maarten.lankhorst@linux.intel.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0058977208==" Return-path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by gabe.freedesktop.org (Postfix) with ESMTP id 7AFE26E76E for ; Thu, 6 Aug 2015 05:30:11 -0700 (PDT) In-Reply-To: <1438861657-14109-2-git-send-email-maarten.lankhorst@linux.intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" To: Maarten Lankhorst , intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org This is a multi-part message in MIME format. --===============0058977208== Content-Type: multipart/alternative; boundary="------------060201080009030705060806" This is a multi-part message in MIME format. --------------060201080009030705060806 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit thanks for the change :) Reviewed-by: Sivakumar Thulasimani On 8/6/2015 5:17 PM, Maarten Lankhorst wrote: > 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 > Cc: Sivakumar Thulasimani > --- > 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); -- regards, Sivakumar --------------060201080009030705060806 Content-Type: text/html; charset=windows-1252 Content-Transfer-Encoding: 7bit

thanks for the change :)


Reviewed-by: Sivakumar Thulasimani <sivakumar.thulasimani@intel.com>


On 8/6/2015 5:17 PM, Maarten Lankhorst wrote:
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);

-- 
regards,
Sivakumar
--------------060201080009030705060806-- --===============0058977208== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KSW50ZWwtZ2Z4 IG1haWxpbmcgbGlzdApJbnRlbC1nZnhAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHA6Ly9saXN0 cy5mcmVlZGVza3RvcC5vcmcvbWFpbG1hbi9saXN0aW5mby9pbnRlbC1nZngK --===============0058977208==--