[v2,09/12] drm/i915: Remove connectors_active from intel_dp.c.
diff mbox

Message ID 1438000541-3219-10-git-send-email-maarten.lankhorst@linux.intel.com
State New
Headers show

Commit Message

Maarten Lankhorst July 27, 2015, 12:35 p.m. UTC
Now that everything's atomic, checking encoder->base.crtc is enough.

Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
---
 drivers/gpu/drm/i915/intel_dp.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

Comments

Ander Conselvan de Oliveira July 29, 2015, 1:26 p.m. UTC | #1
On Mon, 2015-07-27 at 14:35 +0200, Maarten Lankhorst wrote:
> Now that everything's atomic, checking encoder->base.crtc is enough.

Don't you need to check encoder->base.crtc->state->active too?

> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> ---
>  drivers/gpu/drm/i915/intel_dp.c | 7 ++-----
>  1 file changed, 2 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
> index cea7d1785d13..dccd9a0e2526 100644
> --- a/drivers/gpu/drm/i915/intel_dp.c
> +++ b/drivers/gpu/drm/i915/intel_dp.c
> @@ -2624,7 +2624,7 @@ static void vlv_steal_power_sequencer(struct drm_device *dev,
>  		DRM_DEBUG_KMS("stealing pipe %c power sequencer from port %c\n",
>  			      pipe_name(pipe), port_name(port));
>  
> -		WARN(encoder->connectors_active,
> +		WARN(encoder->base.crtc,
>  		     "stealing pipe %c power sequencer from active eDP port %c\n",
>  		     pipe_name(pipe), port_name(port));
>  
> @@ -4240,10 +4240,7 @@ intel_dp_check_link_status(struct intel_dp *intel_dp)
>  
>  	WARN_ON(!drm_modeset_is_locked(&dev->mode_config.connection_mutex));
>  
> -	if (!intel_encoder->connectors_active)
> -		return;
> -
> -	if (WARN_ON(!intel_encoder->base.crtc))
> +	if (!intel_encoder->base.crtc)
>  		return;
>  
>  	if (!to_intel_crtc(intel_encoder->base.crtc)->active)
Maarten Lankhorst July 30, 2015, 6:54 a.m. UTC | #2
Op 29-07-15 om 15:26 schreef Ander Conselvan De Oliveira:
> On Mon, 2015-07-27 at 14:35 +0200, Maarten Lankhorst wrote:
>> Now that everything's atomic, checking encoder->base.crtc is enough.
> Don't you need to check encoder->base.crtc->state->active too?
Not sure, I think stealing a encoder being bound to any crtc is probably good enough reason to warn.
We probably don't hold the right lock to dereference crtc->state.

~Maarten
Ander Conselvan de Oliveira July 30, 2015, 9:16 a.m. UTC | #3
On Thu, 2015-07-30 at 08:54 +0200, Maarten Lankhorst wrote:
> Op 29-07-15 om 15:26 schreef Ander Conselvan De Oliveira:
> > On Mon, 2015-07-27 at 14:35 +0200, Maarten Lankhorst wrote:
> > > Now that everything's atomic, checking encoder->base.crtc is enough.
> > Don't you need to check encoder->base.crtc->state->active too?
> Not sure, I think stealing a encoder being bound to any crtc is probably good enough reason to 
> warn.
> We probably don't hold the right lock to dereference crtc->state.

Fair enough. Add that to the commit message and you can add

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

Patch
diff mbox

diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index cea7d1785d13..dccd9a0e2526 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -2624,7 +2624,7 @@  static void vlv_steal_power_sequencer(struct drm_device *dev,
 		DRM_DEBUG_KMS("stealing pipe %c power sequencer from port %c\n",
 			      pipe_name(pipe), port_name(port));
 
-		WARN(encoder->connectors_active,
+		WARN(encoder->base.crtc,
 		     "stealing pipe %c power sequencer from active eDP port %c\n",
 		     pipe_name(pipe), port_name(port));
 
@@ -4240,10 +4240,7 @@  intel_dp_check_link_status(struct intel_dp *intel_dp)
 
 	WARN_ON(!drm_modeset_is_locked(&dev->mode_config.connection_mutex));
 
-	if (!intel_encoder->connectors_active)
-		return;
-
-	if (WARN_ON(!intel_encoder->base.crtc))
+	if (!intel_encoder->base.crtc)
 		return;
 
 	if (!to_intel_crtc(intel_encoder->base.crtc)->active)