Re: [PATCH v3 28/48] drm/i915: Move intel_modeset_all_pipes()

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

 




> -----Original Message-----
> From: Intel-gfx <intel-gfx-bounces@xxxxxxxxxxxxxxxxxxxxx> On Behalf Of Matt
> Roper
> Sent: Friday, May 7, 2021 7:28 PM
> To: intel-gfx@xxxxxxxxxxxxxxxxxxxxx
> Subject:  [PATCH v3 28/48] drm/i915: Move
> intel_modeset_all_pipes()
> 
> From: Ville Syrjälä <ville.syrjala@xxxxxxxxxxxxxxx>
> 
> Move intel_modeset_all_pipes() to a central place so that we can use it
> elsewhere as well. No functional changes.
> 
> Cc: Stanislav Lisovskiy <stanislav.lisovskiy@xxxxxxxxx>
> Signed-off-by: Ville Syrjälä <ville.syrjala@xxxxxxxxxxxxxxx>
> Signed-off-by: Clinton Taylor <Clinton.A.Taylor@xxxxxxxxx>
> Signed-off-by: Matt Roper <matthew.d.roper@xxxxxxxxx>
Reviewed-by: Anusha Srivatsa <anusha.srivatsa@xxxxxxxxx>

> ---
>  drivers/gpu/drm/i915/display/intel_cdclk.c   | 38 --------------------
>  drivers/gpu/drm/i915/display/intel_display.c | 38 ++++++++++++++++++++
> drivers/gpu/drm/i915/display/intel_display.h |  1 +
>  3 files changed, 39 insertions(+), 38 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_cdclk.c
> b/drivers/gpu/drm/i915/display/intel_cdclk.c
> index d40126061038..c9f1484f3811 100644
> --- a/drivers/gpu/drm/i915/display/intel_cdclk.c
> +++ b/drivers/gpu/drm/i915/display/intel_cdclk.c
> @@ -2375,44 +2375,6 @@ static int bxt_modeset_calc_cdclk(struct
> intel_cdclk_state *cdclk_state)
>  	return 0;
>  }
> 
> -static int intel_modeset_all_pipes(struct intel_atomic_state *state) -{
> -	struct drm_i915_private *dev_priv = to_i915(state->base.dev);
> -	struct intel_crtc *crtc;
> -
> -	/*
> -	 * Add all pipes to the state, and force
> -	 * a modeset on all the active ones.
> -	 */
> -	for_each_intel_crtc(&dev_priv->drm, crtc) {
> -		struct intel_crtc_state *crtc_state;
> -		int ret;
> -
> -		crtc_state = intel_atomic_get_crtc_state(&state->base, crtc);
> -		if (IS_ERR(crtc_state))
> -			return PTR_ERR(crtc_state);
> -
> -		if (!crtc_state->hw.active ||
> -		    drm_atomic_crtc_needs_modeset(&crtc_state->uapi))
> -			continue;
> -
> -		crtc_state->uapi.mode_changed = true;
> -
> -		ret = drm_atomic_add_affected_connectors(&state->base,
> -							 &crtc->base);
> -		if (ret)
> -			return ret;
> -
> -		ret = intel_atomic_add_affected_planes(state, crtc);
> -		if (ret)
> -			return ret;
> -
> -		crtc_state->update_planes |= crtc_state->active_planes;
> -	}
> -
> -	return 0;
> -}
> -
>  static int fixed_modeset_calc_cdclk(struct intel_cdclk_state *cdclk_state)  {
>  	int min_cdclk;
> diff --git a/drivers/gpu/drm/i915/display/intel_display.c
> b/drivers/gpu/drm/i915/display/intel_display.c
> index fa57c301f96a..611ff1d9a482 100644
> --- a/drivers/gpu/drm/i915/display/intel_display.c
> +++ b/drivers/gpu/drm/i915/display/intel_display.c
> @@ -9064,6 +9064,44 @@ intel_modeset_verify_disabled(struct
> drm_i915_private *dev_priv,
>  	verify_disabled_dpll_state(dev_priv);
>  }
> 
> +int intel_modeset_all_pipes(struct intel_atomic_state *state) {
> +	struct drm_i915_private *dev_priv = to_i915(state->base.dev);
> +	struct intel_crtc *crtc;
> +
> +	/*
> +	 * Add all pipes to the state, and force
> +	 * a modeset on all the active ones.
> +	 */
> +	for_each_intel_crtc(&dev_priv->drm, crtc) {
> +		struct intel_crtc_state *crtc_state;
> +		int ret;
> +
> +		crtc_state = intel_atomic_get_crtc_state(&state->base, crtc);
> +		if (IS_ERR(crtc_state))
> +			return PTR_ERR(crtc_state);
> +
> +		if (!crtc_state->hw.active ||
> +		    drm_atomic_crtc_needs_modeset(&crtc_state->uapi))
> +			continue;
> +
> +		crtc_state->uapi.mode_changed = true;
> +
> +		ret = drm_atomic_add_affected_connectors(&state->base,
> +							 &crtc->base);
> +		if (ret)
> +			return ret;
> +
> +		ret = intel_atomic_add_affected_planes(state, crtc);
> +		if (ret)
> +			return ret;
> +
> +		crtc_state->update_planes |= crtc_state->active_planes;
> +	}
> +
> +	return 0;
> +}
> +
>  static void
>  intel_crtc_update_active_timings(const struct intel_crtc_state *crtc_state)  {
> diff --git a/drivers/gpu/drm/i915/display/intel_display.h
> b/drivers/gpu/drm/i915/display/intel_display.h
> index bd69affc791c..c9dbaf074d77 100644
> --- a/drivers/gpu/drm/i915/display/intel_display.h
> +++ b/drivers/gpu/drm/i915/display/intel_display.h
> @@ -646,6 +646,7 @@ void intel_modeset_driver_remove_noirq(struct
> drm_i915_private *i915);  void intel_modeset_driver_remove_nogem(struct
> drm_i915_private *i915);  void intel_display_resume(struct drm_device
> *dev);  void intel_init_pch_refclk(struct drm_i915_private *dev_priv);
> +int intel_modeset_all_pipes(struct intel_atomic_state *state);
> 
>  /* modesetting asserts */
>  void assert_panel_unlocked(struct drm_i915_private *dev_priv,
> --
> 2.25.4
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux