All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ander Conselvan De Oliveira <conselvan2@gmail.com>
To: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH v2.1 03/12] drm/i915: Convert connector checking to atomic, v2.
Date: Fri, 31 Jul 2015 12:37:00 +0300	[thread overview]
Message-ID: <1438335420.2676.5.camel@gmail.com> (raw)
In-Reply-To: <55BA1F57.4000406@linux.intel.com>

On Thu, 2015-07-30 at 14:57 +0200, Maarten Lankhorst wrote:
> Right now dpms callbacks can still fiddle with the connector state,
> but it can only turn connectors off.
> 
> This is remediated by only checking crtc->state->active when the
> connector is active, and ignore crtc->state->active when the
> connector is off.
> 
> connectors_active is no longer checked, and will be removed later
> in this series together with dpms.
> 
> Another check for !encoder->crtc is performed by check_encoder_state
> too, so it can be removed.
> 
> Changes since v1:
> - Add commit message.
> - rename state to old_state.
> - Move deletion of mst_port check to mst patch.

I didn't see the respin of that patch, so this one didn't apply cleanly for me. I had to edit the
mst patch first.

Reviewed-by: Ander Conselvan de Oliveira <conselvan2@gmail.com>

> 
> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> ---
>  drivers/gpu/drm/i915/intel_display.c | 66 +++++++++++++++++-------------------
>  1 file changed, 32 insertions(+), 34 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index 77b4da7e698c..876071ad4681 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -6360,38 +6360,33 @@ static void intel_encoder_dpms(struct intel_encoder *encoder, int mode)
>   * internal consistency). */
>  static void intel_connector_check_state(struct intel_connector *connector)
>  {
> -	if (connector->get_hw_state(connector)) {
> -		struct intel_encoder *encoder = connector->encoder;
> -		struct drm_crtc *crtc;
> -		bool encoder_enabled;
> -		enum pipe pipe;
> +	struct drm_crtc *crtc = connector->base.state->crtc;
>  
> -		DRM_DEBUG_KMS("[CONNECTOR:%d:%s]\n",
> -			      connector->base.base.id,
> -			      connector->base.name);
> +	DRM_DEBUG_KMS("[CONNECTOR:%d:%s]\n",
> +		      connector->base.base.id,
> +		      connector->base.name);
>  
> -		I915_STATE_WARN(connector->base.dpms == DRM_MODE_DPMS_OFF,
> -		     "wrong connector dpms state\n");
> -		I915_STATE_WARN(connector->base.encoder != &encoder->base,
> -		     "active connector not linked to encoder\n");
> +	if (connector->get_hw_state(connector)) {
> +		struct drm_encoder *encoder = &connector->encoder->base;
> +		struct drm_connector_state *conn_state = connector->base.state;
>  
> -		if (encoder) {
> -			I915_STATE_WARN(!encoder->connectors_active,
> -			     "encoder->connectors_active not set\n");
> +		I915_STATE_WARN(!crtc,
> +			 "connector enabled without attached crtc\n");
>  
> -			encoder_enabled = encoder->get_hw_state(encoder, &pipe);
> -			I915_STATE_WARN(!encoder_enabled, "encoder not enabled\n");
> -			if (I915_STATE_WARN_ON(!encoder->base.crtc))
> -				return;
> +		if (!crtc)
> +			return;
>  
> -			crtc = encoder->base.crtc;
> +		I915_STATE_WARN(!crtc->state->active,
> +		      "connector is active, but attached crtc isn't\n");
>  
> -			I915_STATE_WARN(!crtc->state->enable,
> -					"crtc not enabled\n");
> -			I915_STATE_WARN(!to_intel_crtc(crtc)->active, "crtc not active\n");
> -			I915_STATE_WARN(pipe != to_intel_crtc(crtc)->pipe,
> -			     "encoder active on the wrong pipe\n");
> -		}
> +		I915_STATE_WARN(conn_state->best_encoder != encoder,
> +			"atomic encoder doesn't match attached encoder\n");
> +
> +		I915_STATE_WARN(conn_state->crtc != encoder->crtc,
> +			"attached encoder crtc differs from connector crtc\n");
> +	} else {
> +		I915_STATE_WARN(!crtc && connector->base.state->best_encoder,
> +			"best encoder set without crtc!\n");
>  	}
>  }
>  
> @@ -12699,20 +12694,23 @@ static void check_wm_state(struct drm_device *dev)
>  }
>  
>  static void
> -check_connector_state(struct drm_device *dev)
> +check_connector_state(struct drm_device *dev,
> +		      struct drm_atomic_state *old_state)
>  {
> -	struct intel_connector *connector;
> +	struct drm_connector_state *old_conn_state;
> +	struct drm_connector *connector;
> +	int i;
>  
> -	for_each_intel_connector(dev, connector) {
> -		struct drm_encoder *encoder = connector->base.encoder;
> -		struct drm_connector_state *state = connector->base.state;
> +	for_each_connector_in_state(old_state, connector, old_conn_state, i) {
> +		struct drm_encoder *encoder = connector->encoder;
> +		struct drm_connector_state *state = connector->state;
>  
>  		/* This also checks the encoder/connector hw state with the
>  		 * ->get_hw_state callbacks. */
> -		intel_connector_check_state(connector);
> +		intel_connector_check_state(to_intel_connector(connector));
>  
>  		I915_STATE_WARN(state->best_encoder != encoder,
> -		     "connector's staged encoder doesn't match current encoder\n");
> +		     "connector's atomic encoder doesn't match legacy encoder\n");
>  	}
>  }
>  
> @@ -12903,7 +12901,7 @@ intel_modeset_check_state(struct drm_device *dev,
>  			  struct drm_atomic_state *old_state)
>  {
>  	check_wm_state(dev);
> -	check_connector_state(dev);
> +	check_connector_state(dev, old_state);
>  	check_encoder_state(dev);
>  	check_crtc_state(dev);
>  	check_shared_dpll_state(dev);
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2015-07-31  9:37 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-27 12:35 [PATCH v2 00/12] DPMS updates and atomic state checking Maarten Lankhorst
2015-07-27 12:35 ` [PATCH v2 01/12] drm/i915: Make the force_thru workaround atomic Maarten Lankhorst
2015-07-27 14:04   ` Daniel Vetter
2015-07-28  7:57     ` Maarten Lankhorst
2015-07-28  8:25       ` Daniel Vetter
2015-07-28  9:04         ` [PATCH v2.1 01/12] drm/i915: Make the force_thru workaround atomic, v2 Maarten Lankhorst
2015-07-27 12:35 ` [PATCH v2 02/12] drm/i915: Update atomic state when removing mst connector Maarten Lankhorst
2015-07-28 12:13   ` Ander Conselvan De Oliveira
2015-08-03  8:10     ` [PATCH v2.1 2.7/12] drm/i915: Update atomic state when removing mst connector, v2 Maarten Lankhorst
2015-08-06  5:34   ` [PATCH v2 02/12] drm/i915: Update atomic state when removing mst connector Sivakumar Thulasimani
2015-08-06  7:28     ` Maarten Lankhorst
2015-07-27 12:35 ` [PATCH v2 03/12] drm/i915: Convert connector checking to atomic Maarten Lankhorst
2015-07-28 13:13   ` Ander Conselvan De Oliveira
2015-07-28 15:51     ` Maarten Lankhorst
2015-07-30 12:57     ` [PATCH v2.1 2.5/12] drm/i915: Validate the state after an atomic modeset, only, and pass the state Maarten Lankhorst
2015-07-31  9:32       ` Ander Conselvan De Oliveira
2015-07-30 12:57     ` [PATCH v2.1 03/12] drm/i915: Convert connector checking to atomic, v2 Maarten Lankhorst
2015-07-31  9:37       ` Ander Conselvan De Oliveira [this message]
2015-07-27 12:35 ` [PATCH v2 04/12] drm/i915: Remove some unneeded checks from check_crtc_state Maarten Lankhorst
2015-07-28 13:29   ` Ander Conselvan De Oliveira
2015-07-27 12:35 ` [PATCH v2 05/12] drm/i915: Remove connectors_active from state checking Maarten Lankhorst
2015-07-28 13:48   ` Ander Conselvan De Oliveira
2015-07-27 12:35 ` [PATCH v2 06/12] drm/i915: Make crtc checking use the atomic state Maarten Lankhorst
2015-07-29 11:49   ` Ander Conselvan De Oliveira
2015-07-29 12:04     ` Daniel Vetter
2015-07-29 12:31       ` Ander Conselvan De Oliveira
2015-07-29 12:44         ` Maarten Lankhorst
2015-07-30 12:59         ` [PATCH v2.1 06/12] drm/i915: Make crtc checking use the atomic state, v2 Maarten Lankhorst
2015-07-27 12:35 ` [PATCH v2 07/12] drm/i915: Get rid of dpms handling Maarten Lankhorst
2015-07-31  9:40   ` Ander Conselvan De Oliveira
2015-07-27 12:35 ` [PATCH v2 08/12] drm/i915: Remove connectors_active from sanitization Maarten Lankhorst
2015-07-29 13:09   ` Ander Conselvan De Oliveira
2015-07-30  7:11     ` Maarten Lankhorst
2015-07-30 13:00     ` [PATCH v2.1 08/12] drm/i915: Remove connectors_active from sanitization, v2 Maarten Lankhorst
2015-07-27 12:35 ` [PATCH v2 09/12] drm/i915: Remove connectors_active from intel_dp.c Maarten Lankhorst
2015-07-29 13:26   ` Ander Conselvan De Oliveira
2015-07-30  6:54     ` Maarten Lankhorst
2015-07-30  9:16       ` Ander Conselvan De Oliveira
2015-07-30 13:01         ` [PATCH v2.1 09/12] drm/i915: Remove connectors_active from intel_dp.c, v2 Maarten Lankhorst
2015-07-27 12:35 ` [PATCH v2 10/12] drm/i915: Remove connectors_active Maarten Lankhorst
2015-07-31  9:41   ` Ander Conselvan De Oliveira
2015-07-27 12:35 ` [PATCH v2 11/12] drm/i915: Only update mode related state if a modeset happened Maarten Lankhorst
2015-07-30 12:19   ` Ander Conselvan De Oliveira
2015-07-27 12:35 ` [PATCH v2 12/12] drm/i915: Handle return value in intel_pin_and_fence_fb_obj, v2 Maarten Lankhorst
2015-07-28  8:39   ` shuang.he

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=1438335420.2676.5.camel@gmail.com \
    --to=conselvan2@gmail.com \
    --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 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.