<pre>
Hi, Mac:
On Fri, 2023-11-24 at 16:53 +0800, mac.shen wrote:
> Add tee client application, HDCP 1.x and 2.x authentication for
> DisplayPort
> to support the HDCP feature.
>
> Signed-off-by: mac.shen <mac.shen@mediatek.com>
> ---
[snip]
> +
> +int tee_hdcp_enable_encrypt(struct mtk_hdcp_info *hdcp_info, bool
> enable, u8 version)
> +{
> +int rc;
> +struct dp_tee_private *dp_tee_priv = hdcp_info->g_dp_tee_priv;
> +struct tci_t *tci = (struct tci_t *)dp_tee_priv->shm->kaddr;
> +u8 *share_buffer = (u8 *)dp_tee_priv->shm->kaddr;
> +
> +/* Copy parameters */
> +memset(tci, 0, TCI_LENGTH);
You don't need to clear this structure. The field you do not write in
this command would not be access in tee. So it's not necessary to clear
the field that does not write in this command.
> +tci->command_id = CMD_ENABLE_ENCRYPT;
> +if (enable)
> +tci->cmd_body.cmd_hdcp_write_val.type =
> TYPE_HDCP_ENABLE_ENCRYPT;
> +else
> +tci->cmd_body.cmd_hdcp_write_val.type =
> TYPE_HDCP_DISABLE_ENCRYPT;
> +
> +/* Set HDCP version supportted by device */
> +tci->cmd_body.cmd_hdcp_write_val.len = 1;
> +memset(share_buffer + TCI_LENGTH, version, 1);
It's weird that some data in the range of share_buffer + 0 ~
share_buffer + TCI_LENGTH - 1, and some data is after share_buffer +
TCI_LENGTH. Do not separate them and code would be more clear.
Regards,
CK
> +
> +rc = dp_tee_op_send(dp_tee_priv, (u8 *)tci, TCI_LENGTH + 1,
> CMD_ENABLE_ENCRYPT);
> +if (rc != 0) {
> +TLCERR("tee_op_send failed, error=%x\n", rc);
> +return rc;
> +}
> +
> +return rc;
> +}
> +
</pre><!--type:text--><!--{--><pre>************* MEDIATEK Confidentiality Notice ********************
The information contained in this e-mail message (including any
attachments) may be confidential, proprietary, privileged, or otherwise
exempt from disclosure under applicable laws. It is intended to be
conveyed only to the designated recipient(s). Any use, dissemination,
distribution, printing, retaining or copying of this e-mail (including its
attachments) by unintended recipient(s) is strictly prohibited and may
be unlawful. If you are not an intended recipient of this e-mail, or believe
that you have received this e-mail in error, please notify the sender
immediately (by replying to this e-mail), delete any and all copies of
this e-mail (including any attachments) from your system, and do not
disclose the content of this e-mail to any other person. Thank you!
</pre><!--}-->