From a4d823ae08d1e1a2c1232ab868ad2e9e52e98c2f Mon Sep 17 00:00:00 2001 From: Abhinav Kumar Date: Fri, 18 Aug 2017 20:45:05 -0700 Subject: drm/msm: clear deep color mode flags when updating modes Currently, deep color mode flags are not being cleared across connect-disconnect of HDMI cable. This leads to stale information being present on the next successful connection. Clear the stale deep color mode flags before updating the modes during a connection event. Change-Id: I90d494a67dfb1c3fd464f1e1ffb24592bd712702 Signed-off-by: Abhinav Kumar --- drivers/gpu/drm/msm/sde_edid_parser.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/gpu/drm/msm/sde_edid_parser.c b/drivers/gpu/drm/msm/sde_edid_parser.c index 68246253bb70..50667c5921a0 100644 --- a/drivers/gpu/drm/msm/sde_edid_parser.c +++ b/drivers/gpu/drm/msm/sde_edid_parser.c @@ -549,6 +549,12 @@ int _sde_edid_update_modes(struct drm_connector *connector, { int rc = 0; struct sde_edid_ctrl *edid_ctrl = (struct sde_edid_ctrl *)(input); + struct drm_display_info *disp_info; + + disp_info = &connector->display_info; + + if (disp_info) + disp_info->edid_hdmi_dc_modes = 0; SDE_EDID_DEBUG("%s +", __func__); if (edid_ctrl->edid) { -- cgit v1.2.3 From 6f89dc25f3d07b7ffe5af04dd8f70ae07cddf1b6 Mon Sep 17 00:00:00 2001 From: Abhinav Kumar Date: Fri, 18 Aug 2017 20:52:29 -0700 Subject: drm/msm: fix hdcp 1x module for repeater test cases Remove the incorrect Ainfo transfer to the sink during the start of repeater test cases for the HDMI HDCP 1x module. This causes incorrect results from sinks which are repeaters. Fix the logic to disable software DDC before going into part3 of HDCP 1x authentication. Change-Id: Iddf1c5804162ecd3919a0d4fedc9102e3b1778ed Signed-off-by: Abhinav Kumar --- drivers/gpu/drm/msm/sde_hdcp_1x.c | 30 +++++++++++++++++++++++------- 1 file changed, 23 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/msm/sde_hdcp_1x.c b/drivers/gpu/drm/msm/sde_hdcp_1x.c index 3aba9e307732..d08cf13c448d 100644 --- a/drivers/gpu/drm/msm/sde_hdcp_1x.c +++ b/drivers/gpu/drm/msm/sde_hdcp_1x.c @@ -751,11 +751,24 @@ error: static void sde_hdcp_1x_enable_sink_irq_hpd(struct sde_hdcp_1x *hdcp) { int rc; + u8 const required_major = 1, required_minor = 2; + u8 sink_major = 0, sink_minor = 0; u8 enable_hpd_irq = 0x1; + u16 version; - if (hdcp->current_tp.ds_type != DS_REPEATER) + if (hdcp->init_data.client_id == HDCP_CLIENT_HDMI) return; + version = *hdcp->init_data.version; + sink_major = (version >> 4) & 0x0f; + sink_minor = version & 0x0f; + + if ((sink_minor < required_minor) || (sink_major < required_major) || + (hdcp->current_tp.ds_type != DS_REPEATER)) { + pr_debug("sink irq hpd not enabled\n"); + return; + } + rc = sde_hdcp_1x_write(hdcp, &hdcp->sink_addr.ainfo, &enable_hpd_irq); if (IS_ERR_VALUE(rc)) SDE_HDCP_DEBUG("error writing ainfo to sink\n"); @@ -1295,6 +1308,11 @@ static void sde_hdcp_1x_auth_work(struct work_struct *work) if (rc) goto end; + +end: + if (rc && !sde_hdcp_1x_state(HDCP_STATE_INACTIVE)) + hdcp->hdcp_state = HDCP_STATE_AUTH_FAIL; + /* * Disabling software DDC before going into part3 to make sure * there is no Arbitration between software and hardware for DDC @@ -1302,9 +1320,6 @@ static void sde_hdcp_1x_auth_work(struct work_struct *work) if (hdcp->init_data.client_id == HDCP_CLIENT_HDMI) DSS_REG_W_ND(io, HDMI_DDC_ARBITRATION, DSS_REG_R(io, HDMI_DDC_ARBITRATION) | (BIT(4))); -end: - if (rc && !sde_hdcp_1x_state(HDCP_STATE_INACTIVE)) - hdcp->hdcp_state = HDCP_STATE_AUTH_FAIL; sde_hdcp_1x_update_auth_status(hdcp); } @@ -1498,6 +1513,10 @@ static int sde_hdcp_1x_isr(void *input) SDE_HDCP_DEBUG("%s: AUTH FAIL, LINK0_STATUS=0x%08x\n", SDE_HDCP_STATE_NAME, link_status); + /* Clear AUTH_FAIL_INFO as well */ + DSS_REG_W(io, isr->int_reg, + (hdcp_int_val | isr->auth_fail_info_ack)); + if (sde_hdcp_1x_state(HDCP_STATE_AUTHENTICATED)) { hdcp->hdcp_state = HDCP_STATE_AUTH_FAIL; sde_hdcp_1x_update_auth_status(hdcp); @@ -1505,9 +1524,6 @@ static int sde_hdcp_1x_isr(void *input) complete_all(&hdcp->r0_checked); } - /* Clear AUTH_FAIL_INFO as well */ - DSS_REG_W(io, isr->int_reg, - (hdcp_int_val | isr->auth_fail_info_ack)); } if (hdcp_int_val & isr->tx_req_int) { -- cgit v1.2.3