[v8,33/35] drm/i915: Fix KBL HDCP2.2 encrypt status signalling

Submitted by Ramalingam C on Nov. 27, 2018, 10:43 a.m.

Details

Message ID 1543315413-24302-34-git-send-email-ramalingam.c@intel.com
State New
Headers show
Series "drm/i915: Implement HDCP2.2" ( rev: 10 ) in Intel GFX

Not browsing as part of any series.

Commit Message

Ramalingam C Nov. 27, 2018, 10:43 a.m.
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@intel.com>
---
 drivers/gpu/drm/i915/intel_hdcp.c | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

Patch hide | download patch | download mbox

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)) |

Comments

On Tue, Nov 27, 2018 at 04:13:31PM +0530, Ramalingam C wrote:
> 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@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)

Is there a Bspec WA number/label so I can more easily find this?
-Daniel

> +{
> +	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
>
On 12/6/2018 7:50 PM, Daniel Vetter wrote:
> On Tue, Nov 27, 2018 at 04:13:31PM +0530, Ramalingam C wrote:
>> 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@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)
> Is there a Bspec WA number/label so I can more easily find this?

Referenced in WAs #0889 and #0890

--Ram

> -Daniel
>
>> +{
>> +	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
>>