diff mbox

[v2,05/12] drm/i915: Remove connectors_active from state checking.

Message ID 1438000541-3219-6-git-send-email-maarten.lankhorst@linux.intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Maarten Lankhorst July 27, 2015, 12:35 p.m. UTC
Connectors are updated atomically now, so the only interaction
with the encoder is through base.crtc.

If it's NULL the encoder's not part of any crtc, and if it's
not NULL then active should be equal to crtc_state->active.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
---
 drivers/gpu/drm/i915/intel_display.c | 21 ++++++++++-----------
 1 file changed, 10 insertions(+), 11 deletions(-)

Comments

Ander Conselvan de Oliveira July 28, 2015, 1:48 p.m. UTC | #1
Reviewed-by: Ander Conselvan de Oliveira <conselvan2@gmail.com>

On Mon, 2015-07-27 at 14:35 +0200, Maarten Lankhorst wrote:
> Connectors are updated atomically now, so the only interaction
> with the encoder is through base.crtc.
> 
> If it's NULL the encoder's not part of any crtc, and if it's
> not NULL then active should be equal to crtc_state->active.
> 
> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> ---
>  drivers/gpu/drm/i915/intel_display.c | 21 ++++++++++-----------
>  1 file changed, 10 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_display.c 
> b/drivers/gpu/drm/i915/intel_display.c
> index 59eb6db10740..fbb257d4728c 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -12728,9 +12728,6 @@ check_encoder_state(struct drm_device *dev)
>  			      encoder->base.base.id,
>  			      encoder->base.name);
>  
> -		I915_STATE_WARN(encoder->connectors_active && 
> !encoder->base.crtc,
> -		     "encoder's active_connectors set, but no 
> crtc\n");
> -
>  		for_each_intel_connector(dev, connector) {
>  			if (connector->base.encoder != &encoder
> ->base)
>  				continue;
> @@ -12750,18 +12747,20 @@ check_encoder_state(struct drm_device *dev)
>  		I915_STATE_WARN(active && !encoder->base.crtc,
>  		     "active encoder with no crtc\n");
>  
> -		I915_STATE_WARN(encoder->connectors_active != 
> active,
> -		     "encoder's computed active state doesn't match 
> tracked active state "
> -		     "(expected %i, found %i)\n", active, encoder
> ->connectors_active);
> -
>  		active = encoder->get_hw_state(encoder, &pipe);
> -		I915_STATE_WARN(active != encoder
> ->connectors_active,
> +
> +		if (!encoder->base.crtc) {
> +			I915_STATE_WARN(active,
> +			     "encoder detached but not turned 
> off.\n");
> +
> +			continue;
> +		}
> +
> +		I915_STATE_WARN(active != encoder->base.crtc->state
> ->active,
>  		     "encoder's hw state doesn't match sw tracking "
>  		     "(expected %i, found %i)\n",
> -		     encoder->connectors_active, active);
> +		     encoder->base.crtc->state->active, active);
>  
> -		if (!encoder->base.crtc)
> -			continue;
>  
>  		tracked_pipe = to_intel_crtc(encoder->base.crtc)
> ->pipe;
>  		I915_STATE_WARN(active && pipe != tracked_pipe,
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 59eb6db10740..fbb257d4728c 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -12728,9 +12728,6 @@  check_encoder_state(struct drm_device *dev)
 			      encoder->base.base.id,
 			      encoder->base.name);
 
-		I915_STATE_WARN(encoder->connectors_active && !encoder->base.crtc,
-		     "encoder's active_connectors set, but no crtc\n");
-
 		for_each_intel_connector(dev, connector) {
 			if (connector->base.encoder != &encoder->base)
 				continue;
@@ -12750,18 +12747,20 @@  check_encoder_state(struct drm_device *dev)
 		I915_STATE_WARN(active && !encoder->base.crtc,
 		     "active encoder with no crtc\n");
 
-		I915_STATE_WARN(encoder->connectors_active != active,
-		     "encoder's computed active state doesn't match tracked active state "
-		     "(expected %i, found %i)\n", active, encoder->connectors_active);
-
 		active = encoder->get_hw_state(encoder, &pipe);
-		I915_STATE_WARN(active != encoder->connectors_active,
+
+		if (!encoder->base.crtc) {
+			I915_STATE_WARN(active,
+			     "encoder detached but not turned off.\n");
+
+			continue;
+		}
+
+		I915_STATE_WARN(active != encoder->base.crtc->state->active,
 		     "encoder's hw state doesn't match sw tracking "
 		     "(expected %i, found %i)\n",
-		     encoder->connectors_active, active);
+		     encoder->base.crtc->state->active, active);
 
-		if (!encoder->base.crtc)
-			continue;
 
 		tracked_pipe = to_intel_crtc(encoder->base.crtc)->pipe;
 		I915_STATE_WARN(active && pipe != tracked_pipe,