[Intel-gfx] [PATCH 3/2] drm/i915: Factor out intel_crtc_has_encoders()

Daniel Vetter daniel at ffwll.ch
Tue Sep 1 03:03:05 PDT 2015


On Thu, Aug 27, 2015 at 10:29:13AM +0300, Jani Nikula wrote:
> On Wed, 26 Aug 2015, ville.syrjala at linux.intel.com wrote:
> > From: Ville Syrjälä <ville.syrjala at linux.intel.com>
> >
> > Make the code mode readable by pulling the "does this crtc have any
> > encoders?" deduction into a separate function.
> >
> > Cc: Maarten Lankhorst <maarten.lankhorst at linux.intel.com>
> > Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>
> 
> Reviewed-by: Jani Nikula <jani.nikula at intel.com>

Both applied to dinq, thanks.
-Daniel

> 
> 
> > ---
> >  drivers/gpu/drm/i915/intel_display.c | 22 +++++++++++++---------
> >  1 file changed, 13 insertions(+), 9 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> > index 9e92915..ac2c2f1 100644
> > --- a/drivers/gpu/drm/i915/intel_display.c
> > +++ b/drivers/gpu/drm/i915/intel_display.c
> > @@ -14855,13 +14855,22 @@ intel_check_plane_mapping(struct intel_crtc *crtc)
> >  	return true;
> >  }
> >  
> > +static bool intel_crtc_has_encoders(struct intel_crtc *crtc)
> > +{
> > +	struct drm_device *dev = crtc->base.dev;
> > +	struct intel_encoder *encoder;
> > +
> > +	for_each_encoder_on_crtc(dev, &crtc->base, encoder)
> > +		return true;
> > +
> > +	return false;
> > +}
> > +
> >  static void intel_sanitize_crtc(struct intel_crtc *crtc)
> >  {
> >  	struct drm_device *dev = crtc->base.dev;
> >  	struct drm_i915_private *dev_priv = dev->dev_private;
> > -	struct intel_encoder *encoder;
> >  	u32 reg;
> > -	bool enable;
> >  
> >  	/* Clear any frame start delays used for debugging left by the BIOS */
> >  	reg = PIPECONF(crtc->config->cpu_transcoder);
> > @@ -14905,16 +14914,11 @@ static void intel_sanitize_crtc(struct intel_crtc *crtc)
> >  
> >  	/* Adjust the state of the output pipe according to whether we
> >  	 * have active connectors/encoders. */
> > -	enable = false;
> > -	for_each_encoder_on_crtc(dev, &crtc->base, encoder) {
> > -		enable = true;
> > -		break;
> > -	}
> > -
> > -	if (!enable)
> > +	if (!intel_crtc_has_encoders(crtc))
> >  		intel_crtc_disable_noatomic(&crtc->base);
> >  
> >  	if (crtc->active != crtc->base.state->active) {
> > +		struct intel_encoder *encoder;
> >  
> >  		/* This can happen either due to bugs in the get_hw_state
> >  		 * functions or because of calls to intel_crtc_disable_noatomic,
> > -- 
> > 2.4.6
> >
> > _______________________________________________
> > Intel-gfx mailing list
> > Intel-gfx at lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/intel-gfx
> 
> -- 
> Jani Nikula, Intel Open Source Technology Center
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch


More information about the Intel-gfx mailing list