drivers/misc: dont send content stream type for HDMI sinks

Remove sending the content stream type message for HDMI sinks.
This message is applicable only for DP receivers.

Sending this message for HDMI sinks is a write to unknown
space which causes undefined behavior on some sinks.

Change-Id: Id4894021528c17ebaeb5818a2bdcf7ae9c91c070
Signed-off-by: Abhinav Kumar <abhinavk@codeaurora.org>
This commit is contained in:
Abhinav Kumar 2017-10-05 19:14:01 -07:00
parent aefaae06af
commit d0c6369c9d

View file

@ -116,7 +116,7 @@
#define HDCP_CREATE_DEVICE_ID(x) (HDCP_DEVICE_ID | (x)) #define HDCP_CREATE_DEVICE_ID(x) (HDCP_DEVICE_ID | (x))
#define HDCP_TXMTR_HDMI HDCP_CREATE_DEVICE_ID(1) #define HDCP_TXMTR_HDMI HDCP_CREATE_DEVICE_ID(1)
#define HDCP_TXMTR_DP HDCP_CREATE_DEVICE_ID(2)
#define HDCP_TXMTR_SERVICE_ID 0x0001000 #define HDCP_TXMTR_SERVICE_ID 0x0001000
#define SERVICE_CREATE_CMD(x) (HDCP_TXMTR_SERVICE_ID | x) #define SERVICE_CREATE_CMD(x) (HDCP_TXMTR_SERVICE_ID | x)
@ -639,7 +639,8 @@ static int hdcp_lib_get_next_message(struct hdcp_lib_handle *handle,
case LC_SEND_L_PRIME_MESSAGE_ID: case LC_SEND_L_PRIME_MESSAGE_ID:
return SKE_SEND_EKS_MESSAGE_ID; return SKE_SEND_EKS_MESSAGE_ID;
case SKE_SEND_EKS_MESSAGE_ID: case SKE_SEND_EKS_MESSAGE_ID:
if (!handle->repeater_flag) if (!handle->repeater_flag &&
handle->device_type == HDCP_TXMTR_DP)
return SKE_SEND_TYPE_ID; return SKE_SEND_TYPE_ID;
case SKE_SEND_TYPE_ID: case SKE_SEND_TYPE_ID:
case REPEATER_AUTH_STREAM_READY_MESSAGE_ID: case REPEATER_AUTH_STREAM_READY_MESSAGE_ID:
@ -1778,6 +1779,19 @@ exit:
return rc; return rc;
} }
static void hdcp_lib_prep_type_id(struct hdcp_lib_handle *handle,
struct hdmi_hdcp_wakeup_data *cdata)
{
memset(handle->listener_buf, 0, MAX_TX_MESSAGE_SIZE);
handle->listener_buf[0] = SKE_SEND_TYPE_ID;
handle->msglen = 2;
cdata->cmd = HDMI_HDCP_WKUP_CMD_SEND_MESSAGE;
cdata->send_msg_buf = handle->listener_buf;
cdata->send_msg_len = handle->msglen;
handle->last_msg = hdcp_lib_get_next_message(handle,
cdata);
}
static void hdcp_lib_msg_sent(struct hdcp_lib_handle *handle) static void hdcp_lib_msg_sent(struct hdcp_lib_handle *handle)
{ {
struct hdmi_hdcp_wakeup_data cdata = { HDMI_HDCP_WKUP_CMD_INVALID }; struct hdmi_hdcp_wakeup_data cdata = { HDMI_HDCP_WKUP_CMD_INVALID };
@ -1802,18 +1816,29 @@ static void hdcp_lib_msg_sent(struct hdcp_lib_handle *handle)
cdata.cmd = HDMI_HDCP_WKUP_CMD_LINK_POLL; cdata.cmd = HDMI_HDCP_WKUP_CMD_LINK_POLL;
break; break;
case SKE_SEND_EKS_MESSAGE_ID: case SKE_SEND_EKS_MESSAGE_ID:
/*
* a) if its a repeater irrespective of device type we
* start CMD_LINK_POLL to trigger repeater auth
* b) if its not a repeater and device is DP we
* first send the SKE_SEND_TYPE_ID and upon success
* enable encryption
* c) if its not a repeater and device is HDMI we
* dont send SKE_SEND_TYPE_ID and enable encryption
* and start part III of authentication
*/
if (handle->repeater_flag) { if (handle->repeater_flag) {
/* poll for link check */ /* poll for link check */
cdata.cmd = HDMI_HDCP_WKUP_CMD_LINK_POLL; cdata.cmd = HDMI_HDCP_WKUP_CMD_LINK_POLL;
} else { } else if (handle->device_type == HDCP_TXMTR_DP) {
memset(handle->listener_buf, 0, MAX_TX_MESSAGE_SIZE); hdcp_lib_prep_type_id(handle, &cdata);
handle->listener_buf[0] = SKE_SEND_TYPE_ID; } else if (handle->device_type == HDCP_TXMTR_HDMI) {
handle->msglen = 2; if (!hdcp_lib_enable_encryption(handle)) {
cdata.cmd = HDMI_HDCP_WKUP_CMD_SEND_MESSAGE; handle->authenticated = true;
cdata.send_msg_buf = handle->listener_buf; cdata.cmd = HDMI_HDCP_WKUP_CMD_STATUS_SUCCESS;
cdata.send_msg_len = handle->msglen; hdcp_lib_wakeup_client(handle, &cdata);
handle->last_msg = hdcp_lib_get_next_message(handle, }
&cdata); /* poll for link check */
cdata.cmd = HDMI_HDCP_WKUP_CMD_LINK_POLL;
} }
break; break;
case REPEATER_AUTH_SEND_ACK_MESSAGE_ID: case REPEATER_AUTH_SEND_ACK_MESSAGE_ID: