[Intel-gfx] [PATCH v8 33/35] drm/i915: Fix KBL HDCP2.2 encrypt status signalling

Ramalingam C ramalingam.c at intel.com
Tue Nov 27 10:43:31 UTC 2018


Implement the required WA sequence for KBL to fix the
incorrect positioning of the window of oppurtunity and enc_en
signalling.

Signed-off-by: Ramalingam C <ramalingam.c at intel.com>
---
 drivers/gpu/drm/i915/intel_hdcp.c | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/drivers/gpu/drm/i915/intel_hdcp.c b/drivers/gpu/drm/i915/intel_hdcp.c
index 9f4056e156ec..654a076c58e4 100644
--- a/drivers/gpu/drm/i915/intel_hdcp.c
+++ b/drivers/gpu/drm/i915/intel_hdcp.c
@@ -12,6 +12,7 @@
 #include <linux/i2c.h>
 #include <linux/random.h>
 #include <linux/component.h>
+#include <linux/delay.h>
 
 #include "intel_drv.h"
 #include "i915_reg.h"
@@ -24,6 +25,27 @@
 	__p == PORT_A ? MEI_DDI_A : (enum mei_hdcp_ddi)__p;\
 })
 
+static void kbl_repositioning_enc_en_signal(struct intel_connector *connector)
+{
+	struct drm_i915_private *dev_priv = to_i915(connector->base.dev);
+	struct intel_digital_port *intel_dig_port = conn_to_dig_port(connector);
+	struct intel_hdcp *hdcp = &connector->hdcp;
+	struct drm_crtc *crtc = connector->base.state->crtc;
+	struct intel_crtc *intel_crtc = container_of(crtc,
+						     struct intel_crtc, base);
+	u32 scanline;
+
+	for (;;) {
+		scanline = I915_READ(PIPEDSL(intel_crtc->pipe));
+		if (scanline > 100 && scanline < 200)
+			break;
+		usleep_range(25, 50);
+	}
+
+	hdcp->shim->toggle_signalling(intel_dig_port, false);
+	hdcp->shim->toggle_signalling(intel_dig_port, true);
+}
+
 static
 bool intel_hdcp_is_ksv_valid(u8 *ksv)
 {
@@ -1527,6 +1549,13 @@ static int hdcp2_enable_encryption(struct intel_connector *connector)
 	}
 
 	if (I915_READ(HDCP2_STATUS_DDI(port)) & LINK_AUTH_STATUS) {
+		/*
+		 * WA: To fix incorrect positioning of the window of
+		 * opportunity and enc_en signalling in KABYLAKE.
+		 */
+		if (IS_KABYLAKE(dev_priv) && hdcp->shim->toggle_signalling)
+			kbl_repositioning_enc_en_signal(connector);
+
 		/* Link is Authenticated. Now set for Encryption */
 		I915_WRITE(HDCP2_CTL_DDI(port),
 			   I915_READ(HDCP2_CTL_DDI(port)) |
-- 
2.7.4



More information about the Intel-gfx mailing list