[Intel-gfx] [PATCH 6/6] drm/i915: calculate pfit changes in set_config

Ander Conselvan de Oliveira conselvan2 at gmail.com
Thu Oct 30 16:40:08 CET 2014


On 10/23/2014 09:50 PM, Jesse Barnes wrote:
> This should allow us to avoid mode sets for some panel fitter config
> changes.
> 
> Signed-off-by: Jesse Barnes <jbarnes at virtuousgeek.org>
> ---
>   drivers/gpu/drm/i915/intel_display.c | 48 ++++++++++++++++++++++++++++++++++++
>   1 file changed, 48 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index 10468a7..84331a3 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -11420,6 +11420,50 @@ static void disable_crtc_nofb(struct intel_crtc *crtc)
>   	crtc->new_config = NULL;
>   }
>   
> +/* Do we need a mode set due to pfit changes? */
> +static bool intel_pfit_changed(struct drm_device *dev,
> +			       struct intel_crtc_config *new_config,
> +			       struct intel_crtc_config *cur_config)
> +{
> +	bool ret = false;
> +
> +	if (HAS_DDI(dev) || HAS_PCH_SPLIT(dev)) {
> +		/*
> +		 * On PCH platforms we can disable pfit w/o a pipe shutdown,
> +		 * otherwise we'll need a mode set.
> +		 */
> +		if (new_config->pch_pfit.enabled &&
> +		    cur_config->pch_pfit.enabled)
> +			ret = false;
> +		else if (new_config->pch_pfit.enabled &&
> +			 !cur_config->pch_pfit.enabled)
> +			ret = true;
> +		else if (!new_config->pch_pfit.enabled &&
> +			 cur_config->pch_pfit.enabled)
> +			ret = false;
> +		else if (!new_config->pch_pfit.enabled &&
> +			 !cur_config->pch_pfit.enabled)
> +			ret = false;
> +	} else {
> +		bool new_enabled, old_enabled;
> +
> +		new_enabled = !!(new_config->gmch_pfit.control & PFIT_ENABLE);
> +		old_enabled = !!(cur_config->gmch_pfit.control & PFIT_ENABLE);
> +
> +		/* 9xx only needs a shutdown to disable pfit */
> +		if (new_enabled && old_enabled)
> +			ret = false;
> +		else if (new_enabled && !old_enabled)
> +			ret = false;
> +		else if (!new_enabled && old_enabled)
> +			ret = true;
> +		else if (!new_enabled && !old_enabled)
> +			ret = false;
> +	}
> +
> +	return ret;
> +}
> +
>   static int intel_crtc_set_config(struct drm_mode_set *set)
>   {
>   	struct drm_device *dev;
> @@ -11486,6 +11530,10 @@ static int intel_crtc_set_config(struct drm_mode_set *set)
>   	    to_intel_crtc(set->crtc)->config.has_infoframe)
>   		config->mode_changed = true;
>   
> +	if (intel_pfit_changed(dev, to_intel_crtc(set->crtc)->new_config,
> +			       &to_intel_crtc(set->crtc)->config))
> +		config->mode_changed = true;
> +
>   	intel_update_pipe_size(to_intel_crtc(set->crtc));

The big comment in intel_update_pipe_size() becomes obsolete with this
patch. It should probably just be removed.

With the comments I made addressed, this series is

Reviewed-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira at intel.com>











More information about the Intel-gfx mailing list