[Intel-gfx] [PATCH 48/58] drm/i915: use staged outuput config in tv->mode_fixup

Jesse Barnes jbarnes at virtuousgeek.org
Wed Sep 5 20:02:15 CEST 2012


On Sun, 19 Aug 2012 21:13:05 +0200
Daniel Vetter <daniel.vetter at ffwll.ch> wrote:

> The "is this encoder cloned" check will be reused by the lvds encoder,
> hence exract it.
> 
> v2: Be a bit more careful about that we need to check the new, staged
> ouput configuration in the check_non_cloned helper ...
> 
> Signed-off-by: Daniel Vetter <daniel.vetter at ffwll.ch>
> ---
>  drivers/gpu/drm/i915/intel_display.c | 22 ++++++++++++++++++++++
>  drivers/gpu/drm/i915/intel_drv.h     |  1 +
>  drivers/gpu/drm/i915/intel_tv.c      |  7 ++-----
>  3 files changed, 25 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index c7bd573..c59569e 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -6563,6 +6563,28 @@ static struct drm_crtc_helper_funcs intel_helper_funcs = {
>  	.disable = intel_crtc_disable,
>  };
>  
> +bool intel_encoder_check_non_cloned(struct intel_encoder *encoder)
> +{
> +	struct intel_encoder *other_encoder;
> +	struct drm_crtc *crtc = &encoder->new_crtc->base;
> +
> +	if (WARN_ON(!crtc))
> +		return true;
> +
> +	list_for_each_entry(other_encoder,
> +			    &crtc->dev->mode_config.encoder_list,
> +			    base.head) {
> +
> +		if (&other_encoder->new_crtc->base != crtc ||
> +		    encoder == other_encoder)
> +			continue;
> +		else
> +			return false;
> +	}
> +
> +	return true;
> +}

encoder_is_cloned() would make the callers more readable and avoid the
double negative...

Otherwise,
Reviewed-by: Jesse Barnes <jbarnes at virtuousgeek.org>
-- 
Jesse Barnes, Intel Open Source Technology Center



More information about the Intel-gfx mailing list