public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/i915: Update atomic state when removing mst connector.
Date: Tue, 21 Jul 2015 11:09:11 +0200	[thread overview]
Message-ID: <20150721090911.GD16722@phenom.ffwll.local> (raw)
In-Reply-To: <1437465375-29209-1-git-send-email-maarten.lankhorst@linux.intel.com>

On Tue, Jul 21, 2015 at 09:56:15AM +0200, Maarten Lankhorst wrote:
> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> ---
>  drivers/gpu/drm/i915/intel_dp_mst.c | 44 ++++++++++++++++++++++++++++++++++++-
>  1 file changed, 43 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_dp_mst.c b/drivers/gpu/drm/i915/intel_dp_mst.c
> index edd8fa41e85e..fb4f2715c96f 100644
> --- a/drivers/gpu/drm/i915/intel_dp_mst.c
> +++ b/drivers/gpu/drm/i915/intel_dp_mst.c
> @@ -449,6 +449,48 @@ static struct drm_connector *intel_dp_add_mst_connector(struct drm_dp_mst_topolo
>  	return connector;
>  }
>  
> +static void intel_dp_unbind_mst_connector(struct drm_device *dev,
> +				  struct drm_connector *connector)
> +{
> +	struct drm_atomic_state *state;
> +	struct drm_connector_state *conn_state;
> +	struct drm_crtc *crtc = connector->state->crtc;
> +	int ret;
> +
> +	if (!crtc)
> +		return;
> +
> +	state = drm_atomic_state_alloc(dev);
> +	if (!state)
> +		return;
> +
> +	state->acquire_ctx = dev->mode_config.acquire_ctx;
> +
> +	conn_state = drm_atomic_get_connector_state(state, connector);
> +	ret = PTR_ERR_OR_ZERO(conn_state);
> +	if (!ret)
> +		ret = drm_atomic_set_crtc_for_connector(conn_state, NULL);
> +
> +	if (!ret)
> +		ret = drm_atomic_add_affected_connectors(state, crtc);
> +
> +	if (!ret && !drm_atomic_connectors_for_crtc(state, crtc)) {
> +		struct drm_crtc_state *crtc_state =
> +			drm_atomic_get_existing_crtc_state(state, crtc);
> +
> +		crtc_state->active = false;

The connector will completely disappear, and we don't support cloning.
Which means there's still going to be state check failures. I think we
need a
		crtc_state->enable = false;

here, plus cleaning out the connector_state->crtc link.
-Daniel

> +		ret = drm_atomic_set_mode_for_crtc(crtc_state, NULL);
> +	}
> +
> +	if (!ret)
> +		ret = drm_atomic_commit(state);
> +
> +	if (ret)
> +		drm_atomic_state_free(state);
> +
> +	I915_STATE_WARN_ON(ret);
> +}
> +
>  static void intel_dp_destroy_mst_connector(struct drm_dp_mst_topology_mgr *mgr,
>  					   struct drm_connector *connector)
>  {
> @@ -456,7 +498,7 @@ static void intel_dp_destroy_mst_connector(struct drm_dp_mst_topology_mgr *mgr,
>  	struct drm_device *dev = connector->dev;
>  
>  	drm_modeset_lock_all(dev);
> -	drm_atomic_helper_connector_dpms(connector, DRM_MODE_DPMS_OFF);
> +	intel_dp_unbind_mst_connector(dev, connector);
>  	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

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2015-07-21  9:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-21  7:56 [PATCH] drm/i915: Update atomic state when removing mst connector Maarten Lankhorst
2015-07-21  9:09 ` Daniel Vetter [this message]
2015-07-21  9:23   ` Maarten Lankhorst

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=20150721090911.GD16722@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=maarten.lankhorst@linux.intel.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox