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 13/15] drm/i915: Convert intel_dp_mst to use atomic state
Date: Thu, 18 Aug 2016 15:54:22 +0200	[thread overview]
Message-ID: <20160818135422.GO6232@phenom.ffwll.local> (raw)
In-Reply-To: <1470755054-32699-14-git-send-email-maarten.lankhorst@linux.intel.com>

On Tue, Aug 09, 2016 at 05:04:12PM +0200, Maarten Lankhorst wrote:
> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> ---
>  drivers/gpu/drm/i915/intel_dp_mst.c | 48 ++++++++++++++-----------------------
>  1 file changed, 18 insertions(+), 30 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_dp_mst.c b/drivers/gpu/drm/i915/intel_dp_mst.c
> index 1fb741a02813..b2f0ef5db64b 100644
> --- a/drivers/gpu/drm/i915/intel_dp_mst.c
> +++ b/drivers/gpu/drm/i915/intel_dp_mst.c
> @@ -82,11 +82,13 @@ static void intel_mst_disable_dp(struct intel_encoder *encoder,
>  	struct intel_dp_mst_encoder *intel_mst = enc_to_mst(&encoder->base);
>  	struct intel_digital_port *intel_dig_port = intel_mst->primary;
>  	struct intel_dp *intel_dp = &intel_dig_port->dp;
> +	struct intel_connector *connector =
> +		to_intel_connector(old_conn_state->connector);
>  	int ret;
>  
>  	DRM_DEBUG_KMS("%d\n", intel_dp->active_mst_links);
>  
> -	drm_dp_mst_reset_vcpi_slots(&intel_dp->mst_mgr, intel_mst->connector->port);
> +	drm_dp_mst_reset_vcpi_slots(&intel_dp->mst_mgr, connector->port);
>  
>  	ret = drm_dp_update_payload_part1(&intel_dp->mst_mgr);
>  	if (ret) {
> @@ -101,6 +103,8 @@ static void intel_mst_post_disable_dp(struct intel_encoder *encoder,
>  	struct intel_dp_mst_encoder *intel_mst = enc_to_mst(&encoder->base);
>  	struct intel_digital_port *intel_dig_port = intel_mst->primary;
>  	struct intel_dp *intel_dp = &intel_dig_port->dp;
> +	struct intel_connector *connector =
> +		to_intel_connector(old_conn_state->connector);
>  
>  	DRM_DEBUG_KMS("%d\n", intel_dp->active_mst_links);
>  
> @@ -109,7 +113,7 @@ static void intel_mst_post_disable_dp(struct intel_encoder *encoder,
>  	/* and this can also fail */
>  	drm_dp_update_payload_part2(&intel_dp->mst_mgr);
>  
> -	drm_dp_mst_deallocate_vcpi(&intel_dp->mst_mgr, intel_mst->connector->port);
> +	drm_dp_mst_deallocate_vcpi(&intel_dp->mst_mgr, connector->port);
>  
>  	intel_dp->active_mst_links--;
>  
> @@ -129,43 +133,29 @@ static void intel_mst_pre_enable_dp(struct intel_encoder *encoder,
>  	struct intel_dp_mst_encoder *intel_mst = enc_to_mst(&encoder->base);
>  	struct intel_digital_port *intel_dig_port = intel_mst->primary;
>  	struct intel_dp *intel_dp = &intel_dig_port->dp;
> -	struct drm_device *dev = encoder->base.dev;
> -	struct drm_i915_private *dev_priv = to_i915(dev);
> +	struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
>  	enum port port = intel_dig_port->port;
> +	struct intel_connector *connector =
> +		to_intel_connector(conn_state->connector);
>  	int ret;
>  	uint32_t temp;
> -	struct intel_connector *found = NULL, *connector;
>  	int slots;
> -	struct drm_crtc *crtc = encoder->base.crtc;
> -	struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
> -
> -	for_each_intel_connector(dev, connector) {
> -		if (connector->base.state->best_encoder == &encoder->base) {
> -			found = connector;
> -			break;
> -		}
> -	}
> -
> -	if (!found) {
> -		DRM_ERROR("can't find connector\n");
> -		return;
> -	}
>  
>  	/* MST encoders are bound to a crtc, not to a connector,
>  	 * force the mapping here for get_hw_state.
>  	 */
> -	found->encoder = encoder;
> +	connector->encoder = encoder;
>  
>  	DRM_DEBUG_KMS("%d\n", intel_dp->active_mst_links);
>  
> -	intel_mst->connector = found;
> +	intel_mst->connector = connector;

The intel_mst->connector link is also only needed for get_hw_state. Would
be good to move them together. Same with the clearing in post_disable,
which is also missing the clearing of intel_connector->encoder. Follow-up
patch perhaps.

With that bikeshed addressed:

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>


>  
>  	if (intel_dp->active_mst_links == 0) {
> -		intel_ddi_clk_select(&intel_dig_port->base, intel_crtc->config);
> +		intel_ddi_clk_select(&intel_dig_port->base, pipe_config);
>  
>  		intel_prepare_dp_ddi_buffers(&intel_dig_port->base);
>  
> -		intel_dp_set_link_params(intel_dp, intel_crtc->config);
> +		intel_dp_set_link_params(intel_dp, pipe_config);
>  
>  		intel_ddi_init_dp_buf_reg(&intel_dig_port->base);
>  
> @@ -176,8 +166,8 @@ static void intel_mst_pre_enable_dp(struct intel_encoder *encoder,
>  	}
>  
>  	ret = drm_dp_mst_allocate_vcpi(&intel_dp->mst_mgr,
> -				       intel_mst->connector->port,
> -				       intel_crtc->config->pbn, &slots);
> +				       connector->port,
> +				       pipe_config->pbn, &slots);
>  	if (ret == false) {
>  		DRM_ERROR("failed to allocate vcpi\n");
>  		return;
> @@ -198,8 +188,7 @@ static void intel_mst_enable_dp(struct intel_encoder *encoder,
>  	struct intel_dp_mst_encoder *intel_mst = enc_to_mst(&encoder->base);
>  	struct intel_digital_port *intel_dig_port = intel_mst->primary;
>  	struct intel_dp *intel_dp = &intel_dig_port->dp;
> -	struct drm_device *dev = intel_dig_port->base.base.dev;
> -	struct drm_i915_private *dev_priv = to_i915(dev);
> +	struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
>  	enum port port = intel_dig_port->port;
>  	int ret;
>  
> @@ -232,9 +221,8 @@ static void intel_dp_mst_enc_get_config(struct intel_encoder *encoder,
>  {
>  	struct intel_dp_mst_encoder *intel_mst = enc_to_mst(&encoder->base);
>  	struct intel_digital_port *intel_dig_port = intel_mst->primary;
> -	struct intel_crtc *crtc = to_intel_crtc(encoder->base.crtc);
> -	struct drm_device *dev = encoder->base.dev;
> -	struct drm_i915_private *dev_priv = to_i915(dev);
> +	struct intel_crtc *crtc = to_intel_crtc(pipe_config->base.crtc);
> +	struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
>  	enum transcoder cpu_transcoder = pipe_config->cpu_transcoder;
>  	u32 temp, flags = 0;
>  
> -- 
> 2.7.4
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://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
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2016-08-18 13:54 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-09 15:03 [PATCH 00/15] drm/i915: Use connector atomic state in encoders Maarten Lankhorst
2016-08-09 15:04 ` [PATCH 01/15] drm/i915: handle DP_MST correctly in bxt_get_dpll Maarten Lankhorst
2016-08-18 13:17   ` Daniel Vetter
2016-08-09 15:04 ` [PATCH 02/15] drm/i915: Pass atomic state to crtc enable/disable functions Maarten Lankhorst
2016-08-18 13:19   ` Daniel Vetter
2016-08-09 15:04 ` [PATCH 03/15] drm/i915: Remove unused mode_set hook from encoder Maarten Lankhorst
2016-08-18 13:20   ` Daniel Vetter
2016-08-09 15:04 ` [PATCH 04/15] drm/i915: Walk over encoders in crtc enable/disable using atomic state Maarten Lankhorst
2016-08-22 14:28   ` Daniel Vetter
2016-08-09 15:04 ` [PATCH 05/15] drm/i915: Pass crtc_state and connector_state to encoder functions Maarten Lankhorst
2016-08-18 13:30   ` Daniel Vetter
2016-08-22  8:06     ` Maarten Lankhorst
2016-08-22 14:32       ` Daniel Vetter
2016-08-23  8:18         ` Maarten Lankhorst
2016-08-23  8:33           ` Daniel Vetter
2016-08-23 11:48         ` Daniel Vetter
2016-08-09 15:04 ` [PATCH 06/15] drm/i915: Make encoder->compute_config take the connector state Maarten Lankhorst
2016-08-18 13:31   ` Daniel Vetter
2016-08-09 15:04 ` [PATCH 07/15] drm/i915: Remove unused loop from intel_dp_mst_compute_config Maarten Lankhorst
2016-08-18 13:34   ` Daniel Vetter
2016-08-22 12:43     ` Maarten Lankhorst
2016-08-22 14:33       ` Daniel Vetter
2016-08-09 15:04 ` [PATCH 08/15] drm/i915: Convert intel_crt to use atomic state Maarten Lankhorst
2016-08-18 13:35   ` Daniel Vetter
2016-08-09 15:04 ` [PATCH 09/15] drm/i915: Convert intel_dvo " Maarten Lankhorst
2016-08-18 13:36   ` Daniel Vetter
2016-08-09 15:04 ` [PATCH 10/15] drm/i915: Convert intel_dsi " Maarten Lankhorst
2016-08-18 13:43   ` Daniel Vetter
2016-08-09 15:04 ` [PATCH 11/15] drm/i915: Convert intel_sdvo " Maarten Lankhorst
2016-08-18 13:44   ` Daniel Vetter
2016-08-09 15:04 ` [PATCH 12/15] drm/i915: Convert intel_lvds " Maarten Lankhorst
2016-08-18 13:47   ` Daniel Vetter
2016-08-09 15:04 ` [PATCH 13/15] drm/i915: Convert intel_dp_mst " Maarten Lankhorst
2016-08-18 13:54   ` Daniel Vetter [this message]
2016-08-09 15:04 ` [PATCH 14/15] drm/i915: Convert intel_dp " Maarten Lankhorst
2016-08-18 14:01   ` Daniel Vetter
2016-08-09 15:04 ` [PATCH 15/15] drm/i915: Use more atomic state in intel_color.c Maarten Lankhorst
2016-08-18 14:02   ` Daniel Vetter
2016-08-09 15:55 ` ✗ Ro.CI.BAT: failure for drm/i915: Use connector atomic state in encoders Patchwork
2016-08-10  7:53 ` Patchwork
2016-08-18 14:04 ` [PATCH 00/15] " Daniel Vetter
2016-08-22  8:12   ` Maarten Lankhorst
  -- strict thread matches above, loose matches on Subject: below --
2016-07-07 11:55 [PATCH 01/15] drm/i915: handle DP_MST correctly in bxt_get_dpll Maarten Lankhorst
2016-07-07 11:55 ` [PATCH 13/15] drm/i915: Convert intel_dp_mst to use atomic state 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=20160818135422.GO6232@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