[PATCH 3/6] drm/i915/display: use wakelock in register waiting functions
Gustavo Sousa
gustavo.sousa at intel.com
Tue Feb 20 16:46:17 UTC 2024
Quoting Luca Coelho (2024-02-07 07:30:04-03:00)
>Add the wakelock functonality to the functions that help wait for
>register bits to be set.
Same comment goes here and for the next patch regarding the splitting of
the patches.
>
>Signed-off-by: Luca Coelho <luciano.coelho at intel.com>
>---
> drivers/gpu/drm/i915/display/intel_de.h | 42 ++++++++++++++++++++++---
> 1 file changed, 37 insertions(+), 5 deletions(-)
>
>diff --git a/drivers/gpu/drm/i915/display/intel_de.h b/drivers/gpu/drm/i915/display/intel_de.h
>index 0bf73b1e1cfe..d8941995808c 100644
>--- a/drivers/gpu/drm/i915/display/intel_de.h
>+++ b/drivers/gpu/drm/i915/display/intel_de.h
>@@ -121,7 +121,15 @@ static inline int
> intel_de_wait_for_register_fw(struct drm_i915_private *i915, i915_reg_t reg,
> u32 mask, u32 value, unsigned int timeout)
> {
>- return intel_wait_for_register_fw(&i915->uncore, reg, mask, value, timeout);
>+ int ret;
>+
>+ intel_dmc_wl_get(i915, reg);
>+
>+ ret = intel_wait_for_register_fw(&i915->uncore, reg, mask, value, timeout);
>+
>+ intel_dmc_wl_put(i915, reg);
>+
>+ return ret;
> }
>
> static inline int
>@@ -130,22 +138,46 @@ __intel_de_wait_for_register(struct drm_i915_private *i915, i915_reg_t reg,
> unsigned int fast_timeout_us,
> unsigned int slow_timeout_ms, u32 *out_value)
> {
>- return __intel_wait_for_register(&i915->uncore, reg, mask, value,
>- fast_timeout_us, slow_timeout_ms, out_value);
>+ int ret;
>+
>+ intel_dmc_wl_get(i915, reg);
>+
>+ ret = __intel_wait_for_register(&i915->uncore, reg, mask, value,
>+ fast_timeout_us, slow_timeout_ms, out_value);
>+
>+ intel_dmc_wl_put(i915, reg);
>+
>+ return ret;
> }
>
> static inline int
> intel_de_wait_for_set(struct drm_i915_private *i915, i915_reg_t reg,
> u32 mask, unsigned int timeout)
> {
>- return intel_de_wait_for_register(i915, reg, mask, mask, timeout);
>+ int ret;
>+
>+ intel_dmc_wl_get(i915, reg);
>+
>+ ret = intel_de_wait_for_register(i915, reg, mask, mask, timeout);
The wakelock is already grabbed by intel_de_wait_for_register(), we
could skip it here.
>+
>+ intel_dmc_wl_put(i915, reg);
>+
>+ return ret;
> }
>
> static inline int
> intel_de_wait_for_clear(struct drm_i915_private *i915, i915_reg_t reg,
> u32 mask, unsigned int timeout)
> {
>- return intel_de_wait_for_register(i915, reg, mask, 0, timeout);
>+ int ret;
>+
>+ intel_dmc_wl_get(i915, reg);
>+
>+ ret = intel_de_wait_for_register(i915, reg, mask, 0, timeout);
The wakelock is already grabbed by intel_de_wait_for_register(), we
could skip it here.
--
Gustavo Sousa
>+
>+ intel_dmc_wl_put(i915, reg);
>+
>+ return ret;
> }
>
> /*
>--
>2.39.2
>
More information about the Intel-xe
mailing list