diff options
author | Ramalingam C <ramalingam.c@intel.com> | 2018-02-05 18:32:02 +0100 |
---|---|---|
committer | Sean Paul <seanpaul@chromium.org> | 2018-02-05 18:59:07 +0100 |
commit | f622a71d39069e3a0485da436e29ab18eac00b59 (patch) | |
tree | b6a4ba46da3aceb4f78a6455a8a3c8b9b95bc357 /drivers/gpu/drm/i915/intel_hdcp.c | |
parent | drm/i915: Connector info in HDCP debug msgs (diff) | |
download | linux-f622a71d39069e3a0485da436e29ab18eac00b59.tar.xz linux-f622a71d39069e3a0485da436e29ab18eac00b59.zip |
drm/i915: Retry HDCP bksv read
HDCP specification says that when bksv is identified as invalid
(not with 20 1s), bksv should be re-read and verified.
This patch adds the above mentioned re-read for bksv.
v2:
Rephrased the commit msg [Seanpaul]
v3:
do-while to for-loop [Seanpaul]
v4:
retry only if bksv is invalid and no error msg on each attempt
[Seanpaul]
v5:
Correcting the return value [Seanpaul].
Signed-off-by: Ramalingam C <ramalingam.c@intel.com>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Link: https://patchwork.freedesktop.org/patch/msgid/1517851922-30547-1-git-send-email-ramalingam.c@intel.com
Diffstat (limited to 'drivers/gpu/drm/i915/intel_hdcp.c')
-rw-r--r-- | drivers/gpu/drm/i915/intel_hdcp.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/drivers/gpu/drm/i915/intel_hdcp.c b/drivers/gpu/drm/i915/intel_hdcp.c index cfd13ee8c534..d7ddd6b28cd7 100644 --- a/drivers/gpu/drm/i915/intel_hdcp.c +++ b/drivers/gpu/drm/i915/intel_hdcp.c @@ -397,7 +397,7 @@ static int intel_hdcp_auth(struct intel_digital_port *intel_dig_port, struct drm_i915_private *dev_priv; enum port port; unsigned long r0_prime_gen_start; - int ret, i; + int ret, i, tries = 2; union { u32 reg[2]; u8 shim[DRM_HDCP_AN_LEN]; @@ -438,11 +438,19 @@ static int intel_hdcp_auth(struct intel_digital_port *intel_dig_port, r0_prime_gen_start = jiffies; memset(&bksv, 0, sizeof(bksv)); - ret = shim->read_bksv(intel_dig_port, bksv.shim); - if (ret) - return ret; - else if (!intel_hdcp_is_ksv_valid(bksv.shim)) + + /* HDCP spec states that we must retry the bksv if it is invalid */ + for (i = 0; i < tries; i++) { + ret = shim->read_bksv(intel_dig_port, bksv.shim); + if (ret) + return ret; + if (intel_hdcp_is_ksv_valid(bksv.shim)) + break; + } + if (i == tries) { + DRM_ERROR("HDCP failed, Bksv is invalid\n"); return -ENODEV; + } I915_WRITE(PORT_HDCP_BKSVLO(port), bksv.reg[0]); I915_WRITE(PORT_HDCP_BKSVHI(port), bksv.reg[1]); |