[PATCH v9 37/39] drm/i915: Fix KBL HDCP2.2 encrypt status signalling

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>
---
 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 42327ed30903..2b9e1b6d0b1e 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"
@@ -20,6 +21,27 @@
 #define ENCRYPT_STATUS_CHANGE_TIMEOUT_MS	50
 #define HDCP2_LC_RETRY_CNT			3
 
+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)
 {
@@ -1382,6 +1404,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

_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux