From: Kyrie Wu <kyrie.wu@mediatek.com>
To: Tiffany Lin <tiffany.lin@mediatek.com>,
Andrew-CT Chen <andrew-ct.chen@mediatek.com>,
Yunfei Dong <yunfei.dong@mediatek.com>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Matthias Brugger <matthias.bgg@gmail.com>,
AngeloGioacchino Del Regno
<angelogioacchino.delregno@collabora.com>,
Kyrie Wu <kyrie.wu@mediatek.com>,
Nicolas Dufresne <nicolas.dufresne@collabora.com>,
Ricardo Ribalda <ribalda@chromium.org>,
Kees Cook <kees@kernel.org>,
Hans Verkuil <hverkuil+cisco@kernel.org>,
Fei Shao <fshao@chromium.org>,
Haoxiang Li <haoxiang_li2024@163.com>,
Chen-Yu Tsai <wenst@chromium.org>,
Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>,
Tomasz Figa <tfiga@chromium.org>,
Philipp Zabel <p.zabel@pengutronix.de>,
Benjamin Gaignard <benjamin.gaignard@collabora.com>,
Qianfeng Rong <rongqianfeng@vivo.com>,
Irui Wang <irui.wang@mediatek.com>,
Jacopo Mondi <jacopo.mondi@ideasonboard.com>,
Fan Wu <fanwu01@zju.edu.cn>, <linux-media@vger.kernel.org>,
<devicetree@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<linux-arm-kernel@lists.infradead.org>,
<linux-mediatek@lists.infradead.org>
Cc: Sakari Ailus <sakari.ailus@linux.intel.com>
Subject: [PATCH v9 07/14] media: mediatek: vcodec: send share memory address to vcp
Date: Tue, 17 Nov 2026 11:29:43 +0800 [thread overview]
Message-ID: <20261117032950.1425556-8-kyrie.wu@mediatek.com> (raw)
In-Reply-To: <20261117032950.1425556-1-kyrie.wu@mediatek.com>
The share memory is allocated in kernel for vcp architecture, it's
different with vpu which share memors is reserved in vpu micro
processor. Need to send share memory address to vcp.
Signed-off-by: Kyrie Wu <kyrie.wu@mediatek.com>
---
.../platform/mediatek/vcodec/decoder/vdec_ipi_msg.h | 2 ++
.../media/platform/mediatek/vcodec/decoder/vdec_vpu_if.c | 9 ++++++++-
2 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/drivers/media/platform/mediatek/vcodec/decoder/vdec_ipi_msg.h b/drivers/media/platform/mediatek/vcodec/decoder/vdec_ipi_msg.h
index c2c2a3a63..8b771d470 100644
--- a/drivers/media/platform/mediatek/vcodec/decoder/vdec_ipi_msg.h
+++ b/drivers/media/platform/mediatek/vcodec/decoder/vdec_ipi_msg.h
@@ -67,11 +67,13 @@ struct vdec_vpu_ipi_ack {
* @msg_id : AP_IPIMSG_DEC_INIT
* @codec_type : codec fourcc
* @ap_inst_addr : AP video decoder instance address
+ * @shared_iova : reserved share memory address
*/
struct vdec_ap_ipi_init {
uint32_t msg_id;
u32 codec_type;
uint64_t ap_inst_addr;
+ u64 shared_iova;
};
/**
diff --git a/drivers/media/platform/mediatek/vcodec/decoder/vdec_vpu_if.c b/drivers/media/platform/mediatek/vcodec/decoder/vdec_vpu_if.c
index cdb673e6b..50f1e1613 100644
--- a/drivers/media/platform/mediatek/vcodec/decoder/vdec_vpu_if.c
+++ b/drivers/media/platform/mediatek/vcodec/decoder/vdec_vpu_if.c
@@ -4,6 +4,8 @@
* Author: PC Chen <pc.chen@mediatek.com>
*/
+#include <linux/stddef.h>
+
#include "mtk_vcodec_dec_drv.h"
#include "vdec_drv_if.h"
#include "vdec_ipi_msg.h"
@@ -210,6 +212,7 @@ static int vcodec_send_ap_ipi(struct vdec_vpu_inst *vpu, unsigned int msg_id)
int vpu_dec_init(struct vdec_vpu_inst *vpu)
{
struct vdec_ap_ipi_init msg = { };
+ size_t msg_size = offsetof(struct vdec_ap_ipi_init, shared_iova);
int err;
init_waitqueue_head(&vpu->wq);
@@ -236,10 +239,14 @@ int vpu_dec_init(struct vdec_vpu_inst *vpu)
msg.msg_id = AP_IPIMSG_DEC_INIT;
msg.ap_inst_addr = (unsigned long)vpu;
msg.codec_type = vpu->codec_type;
+ if (mtk_vcodec_fw_get_type(vpu->ctx->dev->fw_handler) == VCP) {
+ msg.shared_iova = vpu->ctx->dev->fw_handler->vcp->iova_addr;
+ msg_size = sizeof(msg);
+ }
mtk_vdec_debug(vpu->ctx, "vdec_inst=%p", vpu);
- err = vcodec_vpu_send_msg(vpu, (void *)&msg, sizeof(msg));
+ err = vcodec_vpu_send_msg(vpu, (void *)&msg, msg_size);
if (IS_ERR_OR_NULL(vpu->vsi)) {
mtk_vdec_err(vpu->ctx, "invalid vdec vsi, status=%d", err);
--
2.51.0.windows.2
next prev parent reply other threads:[~2026-11-17 3:30 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-17 3:29 [PATCH v9 00/14] media: mediatek: vcodec: support video decoder in mt8196 Kyrie Wu
2026-11-17 3:29 ` [PATCH v9 01/14] media: mediatek: vcodec: support vcp architecture Kyrie Wu
2026-11-17 3:29 ` [PATCH v9 02/14] media: mediatek: vcodec: add driver to support vcp Kyrie Wu
2026-11-17 3:29 ` [PATCH v9 03/14] media: mediatek: vcodec: add driver to support vcp encoder Kyrie Wu
2026-11-17 3:29 ` [PATCH v9 04/14] media: mediatek: vcodec: get different firmware ipi id Kyrie Wu
2026-11-17 3:29 ` [PATCH v9 05/14] media: mediatek: vcodec: get share memory address Kyrie Wu
2026-11-17 3:29 ` [PATCH v9 06/14] media: mediatek: vcodec: add debug information Kyrie Wu
2026-11-17 3:29 ` Kyrie Wu [this message]
2026-11-17 3:29 ` [PATCH v9 08/14] media: dt-bindings: mediatek,vcodec-subdev-decoder: Add MT8196 Kyrie Wu
2026-11-17 3:29 ` [PATCH v9 09/14] media: mediatek: vcodec: add decoder compatible to support mt8196 Kyrie Wu
2026-11-17 3:29 ` [PATCH v9 10/14] media: mediatek: vcodec: define MT8196 vcodec levels Kyrie Wu
2026-11-17 3:29 ` [PATCH v9 11/14] media: mediatek: vcodec: support 36bit iova address Kyrie Wu
2026-11-17 3:29 ` [PATCH v9 12/14] media: mediatek: vcodec: clean xpc status Kyrie Wu
2026-11-17 3:29 ` [PATCH v9 13/14] media: mediatek: decoder: fill av1 buffer size with picinfo Kyrie Wu
2026-11-17 3:29 ` [PATCH v9 14/14] media: mediatek: decoder: support av1 extend vsi Kyrie Wu
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=20261117032950.1425556-8-kyrie.wu@mediatek.com \
--to=kyrie.wu@mediatek.com \
--cc=andrew-ct.chen@mediatek.com \
--cc=angelogioacchino.delregno@collabora.com \
--cc=benjamin.gaignard@collabora.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=fanwu01@zju.edu.cn \
--cc=fshao@chromium.org \
--cc=haoxiang_li2024@163.com \
--cc=hverkuil+cisco@kernel.org \
--cc=irui.wang@mediatek.com \
--cc=jacopo.mondi@ideasonboard.com \
--cc=kees@kernel.org \
--cc=krzk+dt@kernel.org \
--cc=laurent.pinchart+renesas@ideasonboard.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=matthias.bgg@gmail.com \
--cc=mchehab@kernel.org \
--cc=nicolas.dufresne@collabora.com \
--cc=p.zabel@pengutronix.de \
--cc=ribalda@chromium.org \
--cc=robh@kernel.org \
--cc=rongqianfeng@vivo.com \
--cc=sakari.ailus@linux.intel.com \
--cc=tfiga@chromium.org \
--cc=tiffany.lin@mediatek.com \
--cc=wenst@chromium.org \
--cc=yunfei.dong@mediatek.com \
/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
all inboxes | Powered by JetHome®