> Subject: [PATCH 14/16] drm/i915/de: Replace
> __intel_de_wait_for_register_nowl() with intel_de_wait_fw_us_atomic()
> 
> From: Ville Syrjälä <[email protected]>
> 
> Nuke the remaining _nowl() stuff from the wakelock code in the form of
> __intel_de_wait_for_register_nowl(), and replace it with
> intel_de_wait_fw_us_atomic() that uses the low level _fw() register accessors
> on line with the rest of the code.
> 
> No change in behaviour since wakelocks are only supported on xe, and xe
> doesn't have uncore.lock nor unclaimed register detection stuff.
> 
> Signed-off-by: Ville Syrjälä <[email protected]>

LGTM,
Reviewed-by: Suraj Kandpal <[email protected]>

> ---
>  drivers/gpu/drm/i915/display/intel_de.h     | 19 +++++++++----------
>  drivers/gpu/drm/i915/display/intel_dmc_wl.c | 14 +++++++-------
>  2 files changed, 16 insertions(+), 17 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_de.h
> b/drivers/gpu/drm/i915/display/intel_de.h
> index 655867ea76b8..a7ce3b875e06 100644
> --- a/drivers/gpu/drm/i915/display/intel_de.h
> +++ b/drivers/gpu/drm/i915/display/intel_de.h
> @@ -97,16 +97,6 @@ intel_de_rmw(struct intel_display *display, i915_reg_t
> reg, u32 clear, u32 set)
>       return val;
>  }
> 
> -static inline int
> -__intel_de_wait_for_register_atomic_nowl(struct intel_display *display,
> -                                      i915_reg_t reg,
> -                                      u32 mask, u32 value,
> -                                      unsigned int fast_timeout_us)
> -{
> -     return __intel_wait_for_register(__to_uncore(display), reg, mask,
> -                                      value, fast_timeout_us, 0, NULL);
> -}
> -
>  static inline int
>  intel_de_wait_us(struct intel_display *display, i915_reg_t reg,
>                u32 mask, u32 value, unsigned int timeout_us, @@ -150,6
> +140,15 @@ intel_de_wait_fw_ms(struct intel_display *display, i915_reg_t
> reg,
>                                           value, 2, timeout_ms, out_value);  }
> 
> +static inline int
> +intel_de_wait_fw_us_atomic(struct intel_display *display, i915_reg_t reg,
> +                        u32 mask, u32 value, unsigned int timeout_us,
> +                        u32 *out_value)
> +{
> +     return __intel_wait_for_register_fw(__to_uncore(display), reg, mask,
> +                                         value, timeout_us, 0, out_value); }
> +
>  static inline int
>  intel_de_wait_for_set_us(struct intel_display *display, i915_reg_t reg,
>                        u32 mask, unsigned int timeout_us)
> diff --git a/drivers/gpu/drm/i915/display/intel_dmc_wl.c
> b/drivers/gpu/drm/i915/display/intel_dmc_wl.c
> index 869beb6f280d..73a3101514f3 100644
> --- a/drivers/gpu/drm/i915/display/intel_dmc_wl.c
> +++ b/drivers/gpu/drm/i915/display/intel_dmc_wl.c
> @@ -181,9 +181,9 @@ static void intel_dmc_wl_work(struct work_struct
> *work)
> 
>       intel_de_rmw_fw(display, DMC_WAKELOCK1_CTL,
> DMC_WAKELOCK_CTL_REQ, 0);
> 
> -     if (__intel_de_wait_for_register_atomic_nowl(display,
> DMC_WAKELOCK1_CTL,
> -
> DMC_WAKELOCK_CTL_ACK, 0,
> -
> DMC_WAKELOCK_CTL_TIMEOUT_US)) {
> +     if (intel_de_wait_fw_us_atomic(display, DMC_WAKELOCK1_CTL,
> +                                    DMC_WAKELOCK_CTL_ACK, 0,
> +                                    DMC_WAKELOCK_CTL_TIMEOUT_US,
> NULL)) {
>               WARN_RATELIMIT(1, "DMC wakelock release timed out");
>               goto out_unlock;
>       }
> @@ -213,10 +213,10 @@ static void __intel_dmc_wl_take(struct
> intel_display *display)
>        * We need to use the atomic variant of the waiting routine
>        * because the DMC wakelock is also taken in atomic context.
>        */
> -     if (__intel_de_wait_for_register_atomic_nowl(display,
> DMC_WAKELOCK1_CTL,
> -
> DMC_WAKELOCK_CTL_ACK,
> -
> DMC_WAKELOCK_CTL_ACK,
> -
> DMC_WAKELOCK_CTL_TIMEOUT_US)) {
> +     if (intel_de_wait_fw_us_atomic(display, DMC_WAKELOCK1_CTL,
> +                                    DMC_WAKELOCK_CTL_ACK,
> +                                    DMC_WAKELOCK_CTL_ACK,
> +                                    DMC_WAKELOCK_CTL_TIMEOUT_US,
> NULL)) {
>               WARN_RATELIMIT(1, "DMC wakelock ack timed out");
>               return;
>       }
> --
> 2.49.1

Reply via email to