Skip to content

Commit d7659d9

Browse files
committed
drm/i915/de: Replace __intel_de_wait_for_register_nowl() with intel_de_wait_fw_us_atomic()
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 in 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ä <ville.syrjala@linux.intel.com> Link: https://patch.msgid.link/20251110172756.2132-15-ville.syrjala@linux.intel.com Reviewed-by: Suraj Kandpal <suraj.kandpal@intel.com> Acked-by: Jani Nikula <jani.nikula@intel.com>
1 parent 431fba4 commit d7659d9

2 files changed

Lines changed: 16 additions & 17 deletions

File tree

drivers/gpu/drm/i915/display/intel_de.h

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -97,16 +97,6 @@ intel_de_rmw(struct intel_display *display, i915_reg_t reg, u32 clear, u32 set)
9797
return val;
9898
}
9999

100-
static inline int
101-
__intel_de_wait_for_register_atomic_nowl(struct intel_display *display,
102-
i915_reg_t reg,
103-
u32 mask, u32 value,
104-
unsigned int fast_timeout_us)
105-
{
106-
return __intel_wait_for_register(__to_uncore(display), reg, mask,
107-
value, fast_timeout_us, 0, NULL);
108-
}
109-
110100
static inline int
111101
intel_de_wait_us(struct intel_display *display, i915_reg_t reg,
112102
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,
150140
value, 2, timeout_ms, out_value);
151141
}
152142

143+
static inline int
144+
intel_de_wait_fw_us_atomic(struct intel_display *display, i915_reg_t reg,
145+
u32 mask, u32 value, unsigned int timeout_us,
146+
u32 *out_value)
147+
{
148+
return __intel_wait_for_register_fw(__to_uncore(display), reg, mask,
149+
value, timeout_us, 0, out_value);
150+
}
151+
153152
static inline int
154153
intel_de_wait_for_set_us(struct intel_display *display, i915_reg_t reg,
155154
u32 mask, unsigned int timeout_us)

drivers/gpu/drm/i915/display/intel_dmc_wl.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -181,9 +181,9 @@ static void intel_dmc_wl_work(struct work_struct *work)
181181

182182
intel_de_rmw_fw(display, DMC_WAKELOCK1_CTL, DMC_WAKELOCK_CTL_REQ, 0);
183183

184-
if (__intel_de_wait_for_register_atomic_nowl(display, DMC_WAKELOCK1_CTL,
185-
DMC_WAKELOCK_CTL_ACK, 0,
186-
DMC_WAKELOCK_CTL_TIMEOUT_US)) {
184+
if (intel_de_wait_fw_us_atomic(display, DMC_WAKELOCK1_CTL,
185+
DMC_WAKELOCK_CTL_ACK, 0,
186+
DMC_WAKELOCK_CTL_TIMEOUT_US, NULL)) {
187187
WARN_RATELIMIT(1, "DMC wakelock release timed out");
188188
goto out_unlock;
189189
}
@@ -213,10 +213,10 @@ static void __intel_dmc_wl_take(struct intel_display *display)
213213
* We need to use the atomic variant of the waiting routine
214214
* because the DMC wakelock is also taken in atomic context.
215215
*/
216-
if (__intel_de_wait_for_register_atomic_nowl(display, DMC_WAKELOCK1_CTL,
217-
DMC_WAKELOCK_CTL_ACK,
218-
DMC_WAKELOCK_CTL_ACK,
219-
DMC_WAKELOCK_CTL_TIMEOUT_US)) {
216+
if (intel_de_wait_fw_us_atomic(display, DMC_WAKELOCK1_CTL,
217+
DMC_WAKELOCK_CTL_ACK,
218+
DMC_WAKELOCK_CTL_ACK,
219+
DMC_WAKELOCK_CTL_TIMEOUT_US, NULL)) {
220220
WARN_RATELIMIT(1, "DMC wakelock ack timed out");
221221
return;
222222
}

0 commit comments

Comments
 (0)