From nobody Thu Apr 2 15:37:27 2026 Received: from mailgw01.mediatek.com (unknown [60.244.123.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6F16534A79A; Sat, 28 Mar 2026 05:16:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=60.244.123.138 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774675014; cv=none; b=OmzaFOHl/Js4ArCaTfR8z+ZD7PefxxtxUYspzBLzxnpyaa+40pHhcnLu9f1yTf/w4i6A6veQUfy8Q386nEsDExOidINnSnzwOI8uvR3uRFdSccV4GZhRAS3D3fD0VWWapRnIkIdMPgDpT3CW/XWZWJvL+Lf2kMR+85Y/6YRZKJM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774675014; c=relaxed/simple; bh=qj3/SBNT4NTwaP/sKaZGZ2fLwhndnVa55md+IZ0B9LM=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=k02MmoW6rmtwfIn5SlZ+m7KRRcw7cdljfjhrDkM7ZZqsr44aVn30uqzS3Du2n6Q+vLCdH60bTfMN/JSigZbS95WZmeURJqFZThliBRr6Kkc+QcXPsv2HYzeUYsx3SslgO3rUgWFD+JLbk4R1Tzo9Oqf/BXh1yzt1Px0HZZl8Zm0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=mediatek.com; spf=pass smtp.mailfrom=mediatek.com; dkim=pass (1024-bit key) header.d=mediatek.com header.i=@mediatek.com header.b=AQIS3HGW; arc=none smtp.client-ip=60.244.123.138 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=mediatek.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=mediatek.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=mediatek.com header.i=@mediatek.com header.b="AQIS3HGW" X-UUID: 50b124702a6511f1ae70033691e9ac7d-20260328 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=Y8DpaSc1WPAjTrsmRWTAxjOgRGI49+21nGlzJkD+N60=; b=AQIS3HGWjSj7E6g1p3IAfVNpip9NXLVUHDUmHFOmxA6RCm/qNvoU+4GZ4+/5aNVfIdp8ojznlmSno1cmNhnWYr/7gPnXmaTixKr5m3uaIiFQK6TCDEZ4toyEopFekPAxMoqZ3cerLxrRCeD1Lt/qkZ3MLbJB2egeNkTosD83L74=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.3.12,REQID:7e3704e2-f0ce-49d6-96db-68213e27e6d6,IP:0,U RL:0,TC:0,Content:0,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION: release,TS:0 X-CID-META: VersionHash:e7bac3a,CLOUDID:ffee3e3f-41ee-42eb-90dd-1068410e1f48,B ulkID:nil,BulkQuantity:0,Recheck:0,SF:81|82|102|836|888|898,TC:-5,Content: 0|15|50,EDM:-3,IP:nil,URL:0,File:130,RT:0,Bulk:nil,QS:nil,BEC:-1,COL:0,OSI :0,OSA:0,AV:0,LES:1,SPR:NO,DKR:0,DKP:0,BRR:0,BRE:0,ARC:0 X-CID-BVR: 2,SSN|SDN X-CID-BAS: 2,SSN|SDN,0,_ X-CID-FACTOR: TF_CID_SPAM_SNR X-CID-RHF: D41D8CD98F00B204E9800998ECF8427E X-UUID: 50b124702a6511f1ae70033691e9ac7d-20260328 Received: from mtkmbs14n2.mediatek.inc [(172.21.101.76)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 206028516; Sat, 28 Mar 2026 13:16:45 +0800 Received: from mtkmbs13n1.mediatek.inc (172.21.101.193) by mtkmbs11n1.mediatek.inc (172.21.101.185) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.29; Sat, 28 Mar 2026 13:16:44 +0800 Received: from mhfsdcap04.gcn.mediatek.inc (10.17.3.154) by mtkmbs13n1.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.2562.29 via Frontend Transport; Sat, 28 Mar 2026 13:16:43 +0800 From: Yunfei Dong To: =?UTF-8?q?N=C3=ADcolas=20F=20=2E=20R=20=2E=20A=20=2E=20Prado?= , Sebastian Fricke , Nicolas Dufresne , Hans Verkuil , AngeloGioacchino Del Regno , Benjamin Gaignard , Nathan Hebert , Daniel Almeida CC: Hsin-Yi Wang , Fritz Koenig , Daniel Vetter , Steve Cho , Yunfei Dong , , , , , , Subject: [PATCH v4 10/14] media: mediatek: vcodec: send share memory address to vcp Date: Sat, 28 Mar 2026 13:16:20 +0800 Message-ID: <20260328051630.7937-11-yunfei.dong@mediatek.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20260328051630.7937-1-yunfei.dong@mediatek.com> References: <20260328051630.7937-1-yunfei.dong@mediatek.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-MTK: N Content-Type: text/plain; charset="utf-8" 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: Yunfei Dong --- drivers/media/platform/mediatek/vcodec/decoder/vdec_ipi_msg.h | 2 ++ drivers/media/platform/mediatek/vcodec/decoder/vdec_vpu_if.c | 2 ++ 2 files changed, 4 insertions(+) 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 47070be2a991..097561a1efdc 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; }; =20 /** 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 cdb673e6b477..3a10b32be094 100644 --- a/drivers/media/platform/mediatek/vcodec/decoder/vdec_vpu_if.c +++ b/drivers/media/platform/mediatek/vcodec/decoder/vdec_vpu_if.c @@ -236,6 +236,8 @@ int vpu_dec_init(struct vdec_vpu_inst *vpu) msg.msg_id =3D AP_IPIMSG_DEC_INIT; msg.ap_inst_addr =3D (unsigned long)vpu; msg.codec_type =3D vpu->codec_type; + if (mtk_vcodec_fw_get_type(vpu->ctx->dev->fw_handler) =3D=3D VCP) + msg.shared_iova =3D vpu->ctx->dev->fw_handler->vcp->iova_addr; =20 mtk_vdec_debug(vpu->ctx, "vdec_inst=3D%p", vpu); =20 --=20 2.45.2