Prefer the register read specific wait function over i915 wait_for().
Note that there's a slight functional change: both HDCP_STATUS_R0_READY
and HDCP_STATUS_ENC need to be set instead of just one or the
other. This is likely the intention, though, as this was fixed for HDMI
in commit 3ffaf56e912e ("drm/i915: HDCP: fix Ri prime check done during
link check").
Cc: Suraj Kandpal <[email protected]>
Signed-off-by: Jani Nikula <[email protected]>
---
drivers/gpu/drm/i915/display/intel_hdcp.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/i915/display/intel_hdcp.c
b/drivers/gpu/drm/i915/display/intel_hdcp.c
index 619ccfc33000..c480a75b5fb9 100644
--- a/drivers/gpu/drm/i915/display/intel_hdcp.c
+++ b/drivers/gpu/drm/i915/display/intel_hdcp.c
@@ -903,8 +903,9 @@ static int intel_hdcp_auth(struct intel_connector
*connector)
HDCP_CONF_AUTH_AND_ENC);
/* Wait for R0 ready */
- if (wait_for(intel_de_read(display, HDCP_STATUS(display,
cpu_transcoder, port)) &
- (HDCP_STATUS_R0_READY | HDCP_STATUS_ENC), 1)) {
+ ret = intel_de_wait_for_set(display, HDCP_STATUS(display,
cpu_transcoder, port),
+ HDCP_STATUS_R0_READY | HDCP_STATUS_ENC, 1);
+ if (ret) {
drm_err(display->drm, "Timed out waiting for R0 ready\n");
return -ETIMEDOUT;
}
@@ -936,8 +937,9 @@ static int intel_hdcp_auth(struct intel_connector
*connector)
ri.reg);
/* Wait for Ri prime match */
- if (!wait_for(intel_de_read(display, HDCP_STATUS(display,
cpu_transcoder, port)) &
- (HDCP_STATUS_RI_MATCH | HDCP_STATUS_ENC), 1))
+ ret = intel_de_wait_for_set(display, HDCP_STATUS(display,
cpu_transcoder, port),
+ HDCP_STATUS_RI_MATCH |
HDCP_STATUS_ENC, 1);
+ if (!ret)
break;
}
--
2.39.5