[Intel-gfx] [PATCH v2 1/3] drm/i915: Introduce intel_crtc_planes_update_arm()

Jani Nikula jani.nikula at intel.com
Thu Feb 17 06:15:56 UTC 2022


On Thu, 17 Feb 2022, Ville Syrjala <ville.syrjala at linux.intel.com> wrote:
> From: Ville Syrjälä <ville.syrjala at linux.intel.com>
>
> No reason the high level intel_update_crtc() needs to know
> that there is something magical about the commit order of
> planes between different platforms. So let's hide that
> detail even better.
>
> In order to keep to somewhat consistent naming between
> things we shall call this intel_crtc_planes_update_arm()
> to match the plane->update_arm() vfunc naming convention.
> And let's rename the noarm counterpart to
> intel_crtc_planes_update_noarm() to more clearly associate
> it with the plane->update_noarm() vfunc.
>
> v2: Change the naming convention a bit
>
> Reviewed-by: Jani Nikula <jani.nikula at intel.com> #v1

Holds for v2.

> Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>
> ---
>  .../gpu/drm/i915/display/intel_atomic_plane.c | 23 ++++++++++++++-----
>  .../gpu/drm/i915/display/intel_atomic_plane.h | 10 ++++----
>  drivers/gpu/drm/i915/display/intel_display.c  |  8 ++-----
>  3 files changed, 23 insertions(+), 18 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_atomic_plane.c b/drivers/gpu/drm/i915/display/intel_atomic_plane.c
> index e9893e314037..c53aa6a4c7a0 100644
> --- a/drivers/gpu/drm/i915/display/intel_atomic_plane.c
> +++ b/drivers/gpu/drm/i915/display/intel_atomic_plane.c
> @@ -693,8 +693,8 @@ void intel_plane_disable_arm(struct intel_plane *plane,
>  	plane->disable_arm(plane, crtc_state);
>  }
>  
> -void intel_update_planes_on_crtc(struct intel_atomic_state *state,
> -				 struct intel_crtc *crtc)
> +void intel_crtc_planes_update_noarm(struct intel_atomic_state *state,
> +				    struct intel_crtc *crtc)
>  {
>  	struct intel_crtc_state *new_crtc_state =
>  		intel_atomic_get_new_crtc_state(state, crtc);
> @@ -722,8 +722,8 @@ void intel_update_planes_on_crtc(struct intel_atomic_state *state,
>  	}
>  }
>  
> -void skl_arm_planes_on_crtc(struct intel_atomic_state *state,
> -			    struct intel_crtc *crtc)
> +static void skl_crtc_planes_update_arm(struct intel_atomic_state *state,
> +				       struct intel_crtc *crtc)
>  {
>  	struct intel_crtc_state *old_crtc_state =
>  		intel_atomic_get_old_crtc_state(state, crtc);
> @@ -757,8 +757,8 @@ void skl_arm_planes_on_crtc(struct intel_atomic_state *state,
>  	}
>  }
>  
> -void i9xx_arm_planes_on_crtc(struct intel_atomic_state *state,
> -			     struct intel_crtc *crtc)
> +static void i9xx_crtc_planes_update_arm(struct intel_atomic_state *state,
> +					struct intel_crtc *crtc)
>  {
>  	struct intel_crtc_state *new_crtc_state =
>  		intel_atomic_get_new_crtc_state(state, crtc);
> @@ -783,6 +783,17 @@ void i9xx_arm_planes_on_crtc(struct intel_atomic_state *state,
>  	}
>  }
>  
> +void intel_crtc_planes_update_arm(struct intel_atomic_state *state,
> +				  struct intel_crtc *crtc)
> +{
> +	struct drm_i915_private *i915 = to_i915(state->base.dev);
> +
> +	if (DISPLAY_VER(i915) >= 9)
> +		skl_crtc_planes_update_arm(state, crtc);
> +	else
> +		i9xx_crtc_planes_update_arm(state, crtc);
> +}
> +
>  int intel_atomic_plane_check_clipping(struct intel_plane_state *plane_state,
>  				      struct intel_crtc_state *crtc_state,
>  				      int min_scale, int max_scale,
> diff --git a/drivers/gpu/drm/i915/display/intel_atomic_plane.h b/drivers/gpu/drm/i915/display/intel_atomic_plane.h
> index 9822b921279c..f4763a53541e 100644
> --- a/drivers/gpu/drm/i915/display/intel_atomic_plane.h
> +++ b/drivers/gpu/drm/i915/display/intel_atomic_plane.h
> @@ -44,12 +44,10 @@ void intel_plane_free(struct intel_plane *plane);
>  struct drm_plane_state *intel_plane_duplicate_state(struct drm_plane *plane);
>  void intel_plane_destroy_state(struct drm_plane *plane,
>  			       struct drm_plane_state *state);
> -void intel_update_planes_on_crtc(struct intel_atomic_state *state,
> -				 struct intel_crtc *crtc);
> -void skl_arm_planes_on_crtc(struct intel_atomic_state *state,
> -			    struct intel_crtc *crtc);
> -void i9xx_arm_planes_on_crtc(struct intel_atomic_state *state,
> -			     struct intel_crtc *crtc);
> +void intel_crtc_planes_update_noarm(struct intel_atomic_state *state,
> +				    struct intel_crtc *crtc);
> +void intel_crtc_planes_update_arm(struct intel_atomic_state *state,
> +				  struct intel_crtc *crtc);
>  int intel_plane_atomic_check_with_state(const struct intel_crtc_state *old_crtc_state,
>  					struct intel_crtc_state *crtc_state,
>  					const struct intel_plane_state *old_plane_state,
> diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
> index 59961621fe4a..740620ef07ad 100644
> --- a/drivers/gpu/drm/i915/display/intel_display.c
> +++ b/drivers/gpu/drm/i915/display/intel_display.c
> @@ -7954,7 +7954,6 @@ static void intel_enable_crtc(struct intel_atomic_state *state,
>  static void intel_update_crtc(struct intel_atomic_state *state,
>  			      struct intel_crtc *crtc)
>  {
> -	struct drm_i915_private *dev_priv = to_i915(state->base.dev);
>  	const struct intel_crtc_state *old_crtc_state =
>  		intel_atomic_get_old_crtc_state(state, crtc);
>  	struct intel_crtc_state *new_crtc_state =
> @@ -7975,17 +7974,14 @@ static void intel_update_crtc(struct intel_atomic_state *state,
>  
>  	intel_fbc_update(state, crtc);
>  
> -	intel_update_planes_on_crtc(state, crtc);
> +	intel_crtc_planes_update_noarm(state, crtc);
>  
>  	/* Perform vblank evasion around commit operation */
>  	intel_pipe_update_start(new_crtc_state);
>  
>  	commit_pipe_pre_planes(state, crtc);
>  
> -	if (DISPLAY_VER(dev_priv) >= 9)
> -		skl_arm_planes_on_crtc(state, crtc);
> -	else
> -		i9xx_arm_planes_on_crtc(state, crtc);
> +	intel_crtc_planes_update_arm(state, crtc);
>  
>  	commit_pipe_post_planes(state, crtc);

-- 
Jani Nikula, Intel Open Source Graphics Center


More information about the Intel-gfx mailing list