Re: [PATCH 1/4] drm/i915: Change use get_new_plane_state instead of existing plane state

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Apr 09, 2018 at 02:46:53PM +0200, Maarten Lankhorst wrote:
> The get_existing macros are deprecated and should be replaced by
> get_old/new_state for clarity.
> 
> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@xxxxxxxxxxxxxxx>
> ---
>  drivers/gpu/drm/i915/intel_atomic.c |  5 +++--
>  drivers/gpu/drm/i915/intel_drv.h    | 11 -----------
>  drivers/gpu/drm/i915/intel_pm.c     |  2 +-
>  3 files changed, 4 insertions(+), 14 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_atomic.c b/drivers/gpu/drm/i915/intel_atomic.c
> index bb8c1687823e..40285d1b91b7 100644
> --- a/drivers/gpu/drm/i915/intel_atomic.c
> +++ b/drivers/gpu/drm/i915/intel_atomic.c
> @@ -227,6 +227,7 @@ int intel_atomic_setup_scalers(struct drm_i915_private *dev_priv,
>  	struct intel_crtc_scaler_state *scaler_state =
>  		&crtc_state->scaler_state;
>  	struct drm_atomic_state *drm_state = crtc_state->base.state;
> +	struct intel_atomic_state *intel_state = to_intel_atomic_state(drm_state);
>  	int num_scalers_need;
>  	int i, j;
>  
> @@ -304,8 +305,8 @@ int intel_atomic_setup_scalers(struct drm_i915_private *dev_priv,
>  				continue;
>  			}
>  
> -			plane_state = intel_atomic_get_existing_plane_state(drm_state,
> -									    intel_plane);
> +			plane_state = intel_atomic_get_new_plane_state(intel_state,
> +								       intel_plane);
>  			scaler_id = &plane_state->scaler_id;
>  		}
>  
> diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
> index b2e0fa04ef5b..e545aa673bd9 100644
> --- a/drivers/gpu/drm/i915/intel_drv.h
> +++ b/drivers/gpu/drm/i915/intel_drv.h
> @@ -2109,17 +2109,6 @@ intel_atomic_get_existing_crtc_state(struct drm_atomic_state *state,
>  		return NULL;
>  }
>  
> -static inline struct intel_plane_state *
> -intel_atomic_get_existing_plane_state(struct drm_atomic_state *state,
> -				      struct intel_plane *plane)
> -{
> -	struct drm_plane_state *plane_state;
> -
> -	plane_state = drm_atomic_get_existing_plane_state(state, &plane->base);
> -
> -	return to_intel_plane_state(plane_state);
> -}
> -
>  int intel_atomic_setup_scalers(struct drm_i915_private *dev_priv,
>  			       struct intel_crtc *intel_crtc,
>  			       struct intel_crtc_state *crtc_state);
> diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
> index 007a12ebe725..fb24b44ec37f 100644
> --- a/drivers/gpu/drm/i915/intel_pm.c
> +++ b/drivers/gpu/drm/i915/intel_pm.c
> @@ -5037,7 +5037,7 @@ skl_ddb_add_affected_planes(struct intel_crtc_state *cstate)
>  	struct drm_plane *plane;
>  	enum pipe pipe = intel_crtc->pipe;
>  
> -	WARN_ON(!drm_atomic_get_existing_crtc_state(state, crtc));
> +	WARN_ON(!drm_atomic_get_new_crtc_state(state, crtc));

This assert seems rather pointless since we got the drm_atomic_state via
cstate->base.state.

Anyways, patch is
Reviewed-by: Ville Syrjälä <ville.syrjala@xxxxxxxxxxxxxxx>

>  
>  	drm_for_each_plane_mask(plane, dev, cstate->base.plane_mask) {
>  		enum plane_id plane_id = to_intel_plane(plane)->id;
> -- 
> 2.16.3
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux