From: "CK Hu (胡俊光)" <ck.hu@mediatek.com>
To: "Mac Shen (沈俊)" <Mac.Shen@mediatek.com>,
"chunkuang.hu@kernel.org" <chunkuang.hu@kernel.org>,
"Jitao Shi (石记涛)" <jitao.shi@mediatek.com>,
"daniel@ffwll.ch" <daniel@ffwll.ch>,
"p.zabel@pengutronix.de" <p.zabel@pengutronix.de>,
"airlied@gmail.com" <airlied@gmail.com>,
"matthias.bgg@gmail.com" <matthias.bgg@gmail.com>,
"angelogioacchino.delregno@collabora.com"
<angelogioacchino.delregno@collabora.com>
Cc: "dri-devel@lists.freedesktop.org"
<dri-devel@lists.freedesktop.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-mediatek@lists.infradead.org"
<linux-mediatek@lists.infradead.org>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
"Shuijing Li (李水静)" <Shuijing.Li@mediatek.com>
Subject: Re: [PATCH] drm/mediatek/dp: Add the HDCP feature for DisplayPort
Date: Fri, 1 Dec 2023 08:52:43 +0000 [thread overview]
Message-ID: <cfa0f0daeaaf1d8909ad505cf7e36314d8a5367a.camel@mediatek.com> (raw)
In-Reply-To: <20231124085346.26602-1-mac.shen@mediatek.com>
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]
> +static int dp_tee_op_send(struct dp_tee_private *dp_tee_priv, u8
> *buf, size_t len, u32 cmd_id)
> +{
> + int rc;
> + u8 *temp_buf;
> + struct tee_ioctl_invoke_arg transceive_args;
> + struct tee_param command_params[4];
> + struct tee_shm *shm = dp_tee_priv->shm;
> +
> + if (len > MAX_COMMAND_SIZE) {
> + TLCERR("%s: len=%zd exceeds MAX_COMMAND_SIZE supported
> by dp TA\n", __func__, len);
> + return -EIO;
> + }
> +
> + memset(&transceive_args, 0, sizeof(transceive_args));
> + memset(command_params, 0, sizeof(command_params));
> + dp_tee_priv->resp_len = 0;
> +
> + /* Invoke FTPM_OPTEE_TA_SUBMIT_COMMAND function of dp TA */
> + transceive_args = (struct tee_ioctl_invoke_arg) {
> + .func = cmd_id,
> + .session = dp_tee_priv->session,
> + .num_params = 4,
> + };
> +
> + /* Fill FTPM_OPTEE_TA_SUBMIT_COMMAND parameters */
> + command_params[0] = (struct tee_param) {
> + .attr = TEE_IOCTL_PARAM_ATTR_TYPE_MEMREF_INPUT,
> + .u.memref = {
> + .shm = shm,
> + .size = len,
> + .shm_offs = 0,
> + },
> + };
> +
> + temp_buf = tee_shm_get_va(shm, 0);
> + if (IS_ERR(temp_buf)) {
> + TLCERR("%s: tee_shm_get_va failed for transmit\n",
> __func__);
> + return PTR_ERR(temp_buf);
> + }
> +
> + memcpy(temp_buf, buf, len);
temp_buf is equal to buf, so drop temp_buf.
Regards,
CK
> +
> + command_params[1] = (struct tee_param) {
> + .attr = TEE_IOCTL_PARAM_ATTR_TYPE_MEMREF_INOUT,
> + .u.memref = {
> + .shm = shm,
> + .size = MAX_RESPONSE_SIZE,
> + .shm_offs = MAX_COMMAND_SIZE,
> + },
> + };
> +
> + rc = tee_client_invoke_func(dp_tee_priv->ctx, &transceive_args,
> + command_params);
> + if (rc < 0 || transceive_args.ret != 0) {
> + TLCERR("%s: invoke error: 0x%x\n", __func__,
> transceive_args.ret);
> + return (rc < 0) ? rc : transceive_args.ret;
> + }
> +
> + temp_buf = tee_shm_get_va(shm,
> command_params[1].u.memref.shm_offs);
> + if (IS_ERR(temp_buf)) {
> + TLCERR("%s: tee_shm_get_va failed for receive\n",
> __func__);
> + return PTR_ERR(temp_buf);
> + }
> +
> + /* Sanity checks look good, cache the response */
> + memcpy(dp_tee_priv->resp_buf, temp_buf, MAX_RESPONSE_SIZE / 2);
> + dp_tee_priv->resp_len = MAX_RESPONSE_SIZE / 2;
> +
> + return 0;
> +}
> +
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2023-12-01 9:04 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-24 8:53 [PATCH] drm/mediatek/dp: Add the HDCP feature for DisplayPort mac.shen
2023-11-25 15:17 ` kernel test robot
2023-11-25 16:48 ` kernel test robot
2023-12-01 1:46 ` CK Hu (胡俊光)
2023-12-01 1:59 ` CK Hu (胡俊光)
2023-12-01 2:56 ` CK Hu (胡俊光)
2023-12-01 8:27 ` CK Hu (胡俊光)
2023-12-01 8:52 ` CK Hu (胡俊光) [this message]
2023-12-19 1:59 ` CK Hu (胡俊光)
2024-01-04 6:00 ` CK Hu (胡俊光)
2024-01-04 6:14 ` CK Hu (胡俊光)
2024-01-04 6:46 ` CK Hu (胡俊光)
2024-01-04 7:42 ` CK Hu (胡俊光)
2024-01-04 8:01 ` CK Hu (胡俊光)
2024-01-04 8:56 ` CK Hu (胡俊光)
2024-01-04 9:10 ` CK Hu (胡俊光)
2024-01-04 9:43 ` CK Hu (胡俊光)
2024-01-05 6:10 ` CK Hu (胡俊光)
2024-01-08 6:00 ` CK Hu (胡俊光)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=cfa0f0daeaaf1d8909ad505cf7e36314d8a5367a.camel@mediatek.com \
--to=ck.hu@mediatek.com \
--cc=Mac.Shen@mediatek.com \
--cc=Shuijing.Li@mediatek.com \
--cc=airlied@gmail.com \
--cc=angelogioacchino.delregno@collabora.com \
--cc=chunkuang.hu@kernel.org \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=jitao.shi@mediatek.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=matthias.bgg@gmail.com \
--cc=p.zabel@pengutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox