diff options
author | Ajay Singh Parmar <aparmar@codeaurora.org> | 2016-10-23 23:49:40 -0700 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2016-10-27 15:17:57 -0700 |
commit | dc10995a1b0c5ee71ae0221d72018eeac72bf30a (patch) | |
tree | 9df41dc69e7fa92728276bc2899c8f68e953620d /drivers/misc/hdcp.c | |
parent | 01cb3026c647fecaf22449ed25548c590cd5c1c8 (diff) |
msm: mdss: hdcp2p2: optimize aux message read and write
hdcp 2.2 message has multiple parts with different addresses.
Currently, each address is read/written as a separate aux
transactions. As, for a particular message, all parts are
read/written contiguously, make single aux transaction instead
of multiple transactions to avoid unnecessary aux delays.
Change-Id: I284bc56aa94eef127c2bdd0f80aab7b0cf080342
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
Diffstat (limited to 'drivers/misc/hdcp.c')
-rw-r--r-- | drivers/misc/hdcp.c | 53 |
1 files changed, 30 insertions, 23 deletions
diff --git a/drivers/misc/hdcp.c b/drivers/misc/hdcp.c index 8b7c16e9175d..69ec7127102c 100644 --- a/drivers/misc/hdcp.c +++ b/drivers/misc/hdcp.c @@ -160,43 +160,46 @@ static const struct hdcp_msg_data hdcp_msg_lookup[HDCP2P2_MAX_MESSAGES] = { [AKE_INIT_MESSAGE_ID] = { 2, - { {0x69000, 8}, {0x69008, 3} }, + { {"rtx", 0x69000, 8}, {"TxCaps", 0x69008, 3} }, 0 }, [AKE_SEND_CERT_MESSAGE_ID] = { 3, - { {0x6900B, 522}, {0x69215, 8}, {0x6921D, 3} }, + { {"cert-rx", 0x6900B, 522}, {"rrx", 0x69215, 8}, + {"RxCaps", 0x6921D, 3} }, 0 }, [AKE_NO_STORED_KM_MESSAGE_ID] = { 1, - { {0x69220, 128} }, + { {"Ekpub_km", 0x69220, 128} }, 0 }, [AKE_STORED_KM_MESSAGE_ID] = { 2, - { {0x692A0, 16}, {0x692B0, 16} }, + { {"Ekh_km", 0x692A0, 16}, {"m", 0x692B0, 16} }, 0 }, [AKE_SEND_H_PRIME_MESSAGE_ID] = { 1, - { {0x692C0, 32} }, + { {"H'", 0x692C0, 32} }, (1 << 1) }, [AKE_SEND_PAIRING_INFO_MESSAGE_ID] = { 1, - { {0x692E0, 16} }, + { {"Ekh_km", 0x692E0, 16} }, (1 << 2) }, [LC_INIT_MESSAGE_ID] = { 1, - { {0x692F0, 8} }, + { {"rn", 0x692F0, 8} }, 0 }, [LC_SEND_L_PRIME_MESSAGE_ID] = { 1, - { {0x692F8, 32} }, + { {"L'", 0x692F8, 32} }, 0 }, [SKE_SEND_EKS_MESSAGE_ID] = { 2, - { {0x69318, 16}, {0x69328, 8} }, + { {"Edkey_ks", 0x69318, 16}, {"riv", 0x69328, 8} }, 0 }, [REPEATER_AUTH_SEND_RECEIVERID_LIST_MESSAGE_ID] = { 4, - { {0x69330, 2}, {0x69332, 3}, {0x69335, 16}, {0x69345, 155} }, + { {"RxInfo", 0x69330, 2}, {"seq_num_V", 0x69332, 3}, + {"V'", 0x69335, 16}, {"ridlist", 0x69345, 155} }, (1 << 0) }, [REPEATER_AUTH_SEND_ACK_MESSAGE_ID] = { 1, - { {0x693E0, 16} }, + { {"V", 0x693E0, 16} }, 0 }, [REPEATER_AUTH_STREAM_MANAGE_MESSAGE_ID] = { 3, - { {0x693F0, 3}, {0x693F3, 2}, {0x693F5, 126} }, + { {"seq_num_M", 0x693F0, 3}, {"k", 0x693F3, 2}, + {"streamID_Type", 0x693F5, 126} }, 0 }, [REPEATER_AUTH_STREAM_READY_MESSAGE_ID] = { 1, - { {0x69473, 32} }, + { {"M'", 0x69473, 32} }, 0 } }; @@ -648,11 +651,12 @@ static void hdcp_lib_wakeup_client(struct hdcp_lib_handle *handle, rx_status = data->message_data->rx_status; pr_debug("rxstatus 0x%x\n", rx_status); - pr_debug("%6s | %4s\n", "offset", "len"); + pr_debug("%10s | %6s | %4s\n", "name", "offset", "len"); for (i = 0; i < msg_num; i++) - pr_debug("%6x | %4d\n", - msg[i].offset, msg[i].length); + pr_debug("%10s | %6x | %4d\n", + msg[i].name, msg[i].offset, + msg[i].length); } } else { pr_debug("lib->client: %s\n", @@ -667,6 +671,7 @@ static void hdcp_lib_wakeup_client(struct hdcp_lib_handle *handle, static inline void hdcp_lib_send_message(struct hdcp_lib_handle *handle) { + char msg_name[50]; struct hdmi_hdcp_wakeup_data cdata = { HDMI_HDCP_WKUP_CMD_SEND_MESSAGE }; @@ -676,6 +681,13 @@ static inline void hdcp_lib_send_message(struct hdcp_lib_handle *handle) cdata.send_msg_len = handle->msglen; cdata.timeout = handle->hdcp_timeout; + snprintf(msg_name, sizeof(msg_name), "%s: ", + hdcp_lib_message_name((int)cdata.send_msg_buf[0])); + + print_hex_dump(KERN_DEBUG, msg_name, + DUMP_PREFIX_NONE, 16, 1, cdata.send_msg_buf, + cdata.send_msg_len, false); + hdcp_lib_wakeup_client(handle, &cdata); } @@ -2016,13 +2028,8 @@ static void hdcp_lib_msg_recvd(struct hdcp_lib_handle *handle) handle->hdcp_timeout = rsp_buf->timeout; handle->msglen = rsp_buf->msglen; - if (!atomic_read(&handle->hdcp_off)) { - cdata.cmd = HDMI_HDCP_WKUP_CMD_SEND_MESSAGE; - cdata.send_msg_buf = handle->listener_buf; - cdata.send_msg_len = handle->msglen; - cdata.timeout = handle->hdcp_timeout; - } - + if (!atomic_read(&handle->hdcp_off)) + hdcp_lib_send_message(handle); exit: kzfree(msg); |