Skip to content

Commit 7412826

Browse files
ramalingamcdanvet
authored andcommitted
drm/i915: Fix KBL HDCP2.2 encrypt status signalling
HDCP transmitter is supposed to indicate the HDCP encryption status of the link through enc_en signals in a window of time called "window of opportunity" defined by HDCP HDMI spec. But on KBL this timing of signalling has an issue. To fix the issue this WA of resetting the signalling is required. v2: WA is moved into the toggle_signalling [Daniel] v3: Commit msg is rewritten with more information v4: Reviewed-by Daniel. Signed-off-by: Ramalingam C <[email protected]> Reviewed-by: Daniel Vetter <[email protected]> Signed-off-by: Daniel Vetter <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent cf9cb35 commit 7412826

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

drivers/gpu/drm/i915/intel_hdmi.c

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1083,10 +1083,44 @@ int intel_hdmi_hdcp_read_v_prime_part(struct intel_digital_port *intel_dig_port,
10831083
return ret;
10841084
}
10851085

1086+
static int kbl_repositioning_enc_en_signal(struct intel_connector *connector)
1087+
{
1088+
struct drm_i915_private *dev_priv = to_i915(connector->base.dev);
1089+
struct intel_digital_port *intel_dig_port = conn_to_dig_port(connector);
1090+
struct drm_crtc *crtc = connector->base.state->crtc;
1091+
struct intel_crtc *intel_crtc = container_of(crtc,
1092+
struct intel_crtc, base);
1093+
u32 scanline;
1094+
int ret;
1095+
1096+
for (;;) {
1097+
scanline = I915_READ(PIPEDSL(intel_crtc->pipe));
1098+
if (scanline > 100 && scanline < 200)
1099+
break;
1100+
usleep_range(25, 50);
1101+
}
1102+
1103+
ret = intel_ddi_toggle_hdcp_signalling(&intel_dig_port->base, false);
1104+
if (ret) {
1105+
DRM_ERROR("Disable HDCP signalling failed (%d)\n", ret);
1106+
return ret;
1107+
}
1108+
ret = intel_ddi_toggle_hdcp_signalling(&intel_dig_port->base, true);
1109+
if (ret) {
1110+
DRM_ERROR("Enable HDCP signalling failed (%d)\n", ret);
1111+
return ret;
1112+
}
1113+
1114+
return 0;
1115+
}
1116+
10861117
static
10871118
int intel_hdmi_hdcp_toggle_signalling(struct intel_digital_port *intel_dig_port,
10881119
bool enable)
10891120
{
1121+
struct intel_hdmi *hdmi = &intel_dig_port->hdmi;
1122+
struct intel_connector *connector = hdmi->attached_connector;
1123+
struct drm_i915_private *dev_priv = to_i915(connector->base.dev);
10901124
int ret;
10911125

10921126
if (!enable)
@@ -1098,6 +1132,14 @@ int intel_hdmi_hdcp_toggle_signalling(struct intel_digital_port *intel_dig_port,
10981132
enable ? "Enable" : "Disable", ret);
10991133
return ret;
11001134
}
1135+
1136+
/*
1137+
* WA: To fix incorrect positioning of the window of
1138+
* opportunity and enc_en signalling in KABYLAKE.
1139+
*/
1140+
if (IS_KABYLAKE(dev_priv) && enable)
1141+
return kbl_repositioning_enc_en_signal(connector);
1142+
11011143
return 0;
11021144
}
11031145

0 commit comments

Comments
 (0)