diff mbox series

[3/4] drm/i915/display: Remove useless call intel_dp_mst_encoder_cleanup()

Message ID 20200117015837.402239-3-jose.souza@intel.com (mailing list archive)
State New, archived
Headers show
Series [1/4] drm/mst: Don't do atomic checks over disabled managers | expand

Commit Message

Souza, Jose Jan. 17, 2020, 1:58 a.m. UTC
This is a eDP function and it will always returns true for non-eDP
ports.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
---
 drivers/gpu/drm/i915/display/intel_dp.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Ville Syrjälä Jan. 30, 2020, 5:16 p.m. UTC | #1
On Thu, Jan 16, 2020 at 05:58:36PM -0800, José Roberto de Souza wrote:
> This is a eDP function and it will always returns true for non-eDP
> ports.
> 
> Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
> ---
>  drivers/gpu/drm/i915/display/intel_dp.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
> index 4074d83b1a5f..a50b5b6dd009 100644
> --- a/drivers/gpu/drm/i915/display/intel_dp.c
> +++ b/drivers/gpu/drm/i915/display/intel_dp.c
> @@ -7537,7 +7537,6 @@ intel_dp_init_connector(struct intel_digital_port *intel_dig_port,
>  
>  	if (!intel_edp_init_connector(intel_dp, intel_connector)) {
>  		intel_dp_aux_fini(intel_dp);
> -		intel_dp_mst_encoder_cleanup(intel_dig_port);

This makes the unwind look incomplete to the causual reader. The cleanup
function does both anyway so cross checking is harder if they're not
consistent. So not sure I like it. Hmm. The ordering of these two also
looks off here.

Maybe nicer to just move the whole onion to the end of function
(we alredy have one layer there)?

>  		goto fail;
>  	}
>  
> -- 
> 2.25.0
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Souza, Jose Jan. 31, 2020, 12:14 a.m. UTC | #2
On Thu, 2020-01-30 at 19:16 +0200, Ville Syrjälä wrote:
> On Thu, Jan 16, 2020 at 05:58:36PM -0800, José Roberto de Souza
> wrote:
> > This is a eDP function and it will always returns true for non-eDP
> > ports.
> > 
> > Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
> > ---
> >  drivers/gpu/drm/i915/display/intel_dp.c | 1 -
> >  1 file changed, 1 deletion(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/display/intel_dp.c
> > b/drivers/gpu/drm/i915/display/intel_dp.c
> > index 4074d83b1a5f..a50b5b6dd009 100644
> > --- a/drivers/gpu/drm/i915/display/intel_dp.c
> > +++ b/drivers/gpu/drm/i915/display/intel_dp.c
> > @@ -7537,7 +7537,6 @@ intel_dp_init_connector(struct
> > intel_digital_port *intel_dig_port,
> >  
> >  	if (!intel_edp_init_connector(intel_dp, intel_connector)) {
> >  		intel_dp_aux_fini(intel_dp);
> > -		intel_dp_mst_encoder_cleanup(intel_dig_port);
> 
> This makes the unwind look incomplete to the causual reader. The
> cleanup
> function does both anyway so cross checking is harder if they're not
> consistent. So not sure I like it. Hmm. The ordering of these two
> also
> looks off here.
> 
> Maybe nicer to just move the whole onion to the end of function
> (we alredy have one layer there)?

If I need to rework the 4/4 patch I will do that, otherwise I will just
ignore this patch.

Please check my answer to your comment.

> 
> >  		goto fail;
> >  	}
> >  
> > -- 
> > 2.25.0
> > 
> > _______________________________________________
> > Intel-gfx mailing list
> > Intel-gfx@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Stanislav Lisovskiy Feb. 11, 2020, 10:53 a.m. UTC | #3
On Thu, 2020-01-16 at 17:58 -0800, José Roberto de Souza wrote:
> This is a eDP function and it will always returns true for non-eDP
> ports.
> 
> Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
> ---
>  drivers/gpu/drm/i915/display/intel_dp.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_dp.c
> b/drivers/gpu/drm/i915/display/intel_dp.c
> index 4074d83b1a5f..a50b5b6dd009 100644
> --- a/drivers/gpu/drm/i915/display/intel_dp.c
> +++ b/drivers/gpu/drm/i915/display/intel_dp.c
> @@ -7537,7 +7537,6 @@ intel_dp_init_connector(struct
> intel_digital_port *intel_dig_port,
>  
>  	if (!intel_edp_init_connector(intel_dp, intel_connector)) {
>  		intel_dp_aux_fini(intel_dp);
> -		intel_dp_mst_encoder_cleanup(intel_dig_port);
>  		goto fail;
>  	}
>  


Change looks fine for me(anyway better than now). 

But:

This whole thing looks kind of confusing to me. Why we are even calling
intel_edp_init_connector for
non-eDP ports, just to immediately get true returned? So returning
success means either success or that this is non-eDP..

This confuses the caller, that we have actually successfully
initialized eDP, while actually this also means here that it is not
eDP.

Why we can't just do it like:

if (intel_dp_is_edp(intel_dp)) {
	if (!intel_edp_init_connector(intel_dp, intel_connector)) {
		intel_dp_aux_fini(intel_dp);
  		goto fail;
	}
}

it looks much more understandable and less confusing, i.e eDP functions
are only called for eDP and no return value hacks are needed.

Reviewed-by: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>

Stan
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
index 4074d83b1a5f..a50b5b6dd009 100644
--- a/drivers/gpu/drm/i915/display/intel_dp.c
+++ b/drivers/gpu/drm/i915/display/intel_dp.c
@@ -7537,7 +7537,6 @@  intel_dp_init_connector(struct intel_digital_port *intel_dig_port,
 
 	if (!intel_edp_init_connector(intel_dp, intel_connector)) {
 		intel_dp_aux_fini(intel_dp);
-		intel_dp_mst_encoder_cleanup(intel_dig_port);
 		goto fail;
 	}