[Intel-gfx] [PATCH 4/4] drm/i915: Nuke force_min_cdclk_changed

Lisovskiy, Stanislav stanislav.lisovskiy at intel.com
Wed Sep 16 07:46:46 UTC 2020


On Tue, Jul 14, 2020 at 06:26:26PM +0300, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrjala at linux.intel.com>
> 
> Since we now have proper old and new cdclk state we no longer
> need to keep this flag to indicate that the force min cdclk has
> changed. Instead just check if the old vs. new value are different.
> 
> Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>
> ---
>  drivers/gpu/drm/i915/display/intel_audio.c   | 5 -----
>  drivers/gpu/drm/i915/display/intel_cdclk.c   | 2 +-
>  drivers/gpu/drm/i915/display/intel_cdclk.h   | 1 -
>  drivers/gpu/drm/i915/display/intel_display.c | 7 +++++--
>  4 files changed, 6 insertions(+), 9 deletions(-)

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

> 
> diff --git a/drivers/gpu/drm/i915/display/intel_audio.c b/drivers/gpu/drm/i915/display/intel_audio.c
> index ad4aa66fd676..f7de55707746 100644
> --- a/drivers/gpu/drm/i915/display/intel_audio.c
> +++ b/drivers/gpu/drm/i915/display/intel_audio.c
> @@ -958,13 +958,8 @@ static int glk_force_audio_cdclk_commit(struct intel_atomic_state *state,
>  	if (IS_ERR(cdclk_state))
>  		return PTR_ERR(cdclk_state);
>  
> -	cdclk_state->force_min_cdclk_changed = true;
>  	cdclk_state->force_min_cdclk = enable ? 2 * 96000 : 0;
>  
> -	ret = intel_atomic_lock_global_state(&cdclk_state->base);
> -	if (ret)
> -		return ret;
> -
>  	return drm_atomic_commit(&state->base);
>  }
>  
> diff --git a/drivers/gpu/drm/i915/display/intel_cdclk.c b/drivers/gpu/drm/i915/display/intel_cdclk.c
> index 9d6cacbdb691..268a7211dd6c 100644
> --- a/drivers/gpu/drm/i915/display/intel_cdclk.c
> +++ b/drivers/gpu/drm/i915/display/intel_cdclk.c
> @@ -2426,7 +2426,6 @@ static struct intel_global_state *intel_cdclk_duplicate_state(struct intel_globa
>  	if (!cdclk_state)
>  		return NULL;
>  
> -	cdclk_state->force_min_cdclk_changed = false;
>  	cdclk_state->pipe = INVALID_PIPE;
>  
>  	return &cdclk_state->base;
> @@ -2501,6 +2500,7 @@ int intel_modeset_calc_cdclk(struct intel_atomic_state *state)
>  		if (ret)
>  			return ret;
>  	} else if (old_cdclk_state->active_pipes != new_cdclk_state->active_pipes ||
> +		   old_cdclk_state->force_min_cdclk != new_cdclk_state->force_min_cdclk ||
>  		   intel_cdclk_changed(&old_cdclk_state->logical,
>  				       &new_cdclk_state->logical)) {
>  		ret = intel_atomic_lock_global_state(&new_cdclk_state->base);
> diff --git a/drivers/gpu/drm/i915/display/intel_cdclk.h b/drivers/gpu/drm/i915/display/intel_cdclk.h
> index 6b31fde4be16..b34eb00fb327 100644
> --- a/drivers/gpu/drm/i915/display/intel_cdclk.h
> +++ b/drivers/gpu/drm/i915/display/intel_cdclk.h
> @@ -49,7 +49,6 @@ struct intel_cdclk_state {
>  
>  	/* forced minimum cdclk for glk+ audio w/a */
>  	int force_min_cdclk;
> -	bool force_min_cdclk_changed;
>  
>  	/* bitmask of active pipes */
>  	u8 active_pipes;
> diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
> index 729ec6e0d43a..f571ded3cba8 100644
> --- a/drivers/gpu/drm/i915/display/intel_display.c
> +++ b/drivers/gpu/drm/i915/display/intel_display.c
> @@ -14736,7 +14736,8 @@ static int intel_atomic_check_cdclk(struct intel_atomic_state *state,
>  				    bool *need_cdclk_calc)
>  {
>  	struct drm_i915_private *dev_priv = to_i915(state->base.dev);
> -	struct intel_cdclk_state *new_cdclk_state;
> +	const struct intel_cdclk_state *old_cdclk_state;
> +	const struct intel_cdclk_state *new_cdclk_state;
>  	struct intel_plane_state *plane_state;
>  	struct intel_bw_state *new_bw_state;
>  	struct intel_plane *plane;
> @@ -14755,9 +14756,11 @@ static int intel_atomic_check_cdclk(struct intel_atomic_state *state,
>  			return ret;
>  	}
>  
> +	old_cdclk_state = intel_atomic_get_old_cdclk_state(state);
>  	new_cdclk_state = intel_atomic_get_new_cdclk_state(state);
>  
> -	if (new_cdclk_state && new_cdclk_state->force_min_cdclk_changed)
> +	if (new_cdclk_state &&
> +	    old_cdclk_state->force_min_cdclk != new_cdclk_state->force_min_cdclk)
>  		*need_cdclk_calc = true;
>  
>  	ret = dev_priv->display.bw_calc_min_cdclk(state);
> -- 
> 2.26.2
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx


More information about the Intel-gfx mailing list