From nobody Wed Nov 27 06:44:30 2024 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 218D1231CA6; Mon, 14 Oct 2024 07:33:19 +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=1728891203; cv=none; b=KCwYiTHiMrwHJcnPhw1tPFwTih1Gl4z3zBH4TOzBW9/8vnZ/q919V1+4NSMkKy75BFIQsMTXyHSJ33Y4FsOYbR1WPTNsGtI7h3TEHkR3KK6jaycG2SvUfLV21Rh6JVXBmhwaNdUvF6u/uHnl/dcUY+dMzG6YtQAO/zpkUmxh668= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728891203; c=relaxed/simple; bh=Bg6y3QiHr3lu/LmTuzp8iUyuVv7qJCdjuf4FPfyOLbk=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=lUWTmCCxxvazNAaLldJeeRtzuPrZtc/OlcBNO6tOTfPb3dnAeiHXONmYZW/vkrgufX/+Dt6LNquym1sb6wnlHsq/P7g7l639vEREvnZm9s1ovXx0AWK47NPIi+nJPo8ptZXzV3/4T5cV8r5pmRTAReqbl1X/qXpjFxAVLtGque0= 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=Vf57hruw; 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="Vf57hruw" X-UUID: 93c0a92489fe11ef88ecadb115cee93b-20241014 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=ov16ZM53mRuDaJHl1pyn/DVxtQkrwl3v1MRkNhTGYmk=; b=Vf57hruwCC1TPcU48rhWuYQkdhxqtKTgFCaVOML0UsU422VNCdN0FL5v0PWxKngYKZKj8cq0OyKhTM0iQbW7XFaf3pvdIURtB6hPR3AA1CVaD66cYHNvT8408bk+HbDxgd3Bs8Q0KRQxaEXarrTBBylJ4+BEWSOnXid0mpYjInA=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.41,REQID:461323d3-d330-4470-8901-839b5ca23033,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:6dc6a47,CLOUDID:e4913641-8751-41b2-98dd-475503d45150,B ulkID:nil,BulkQuantity:0,Recheck:0,SF:102,TC:nil,Content:0,EDM:-3,IP:nil,U RL:0,File:nil,RT:nil,Bulk:nil,QS:nil,BEC:nil,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: 0 X-CID-BAS: 0,_,0,_ X-CID-FACTOR: TF_CID_SPAM_SNR X-UUID: 93c0a92489fe11ef88ecadb115cee93b-20241014 Received: from mtkmbs09n2.mediatek.inc [(172.21.101.94)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1112539264; Mon, 14 Oct 2024 15:33:16 +0800 Received: from mtkmbs11n2.mediatek.inc (172.21.101.187) by MTKMBS09N2.mediatek.inc (172.21.101.94) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.26; Mon, 14 Oct 2024 00:33:15 -0700 Received: from mhfsdcap04.gcn.mediatek.inc (10.17.3.154) by mtkmbs11n2.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.1118.26 via Frontend Transport; Mon, 14 Oct 2024 15:33:14 +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 4/6] media: mediatek: vcodec: rename vsi to extend vsi Date: Mon, 14 Oct 2024 15:33:08 +0800 Message-ID: <20241014073314.18409-5-yunfei.dong@mediatek.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20241014073314.18409-1-yunfei.dong@mediatek.com> References: <20241014073314.18409-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" Rename vsi struct to extend vsi to support extend architecture. Signed-off-by: Yunfei Dong --- .../decoder/vdec/vdec_h264_req_multi_if.c | 167 +++++++++--------- 1 file changed, 85 insertions(+), 82 deletions(-) diff --git a/drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_h264_= req_multi_if.c b/drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_h= 264_req_multi_if.c index 02ad579bfe8e..ba7fd3200d98 100644 --- a/drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_h264_req_mul= ti_if.c +++ b/drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_h264_req_mul= ti_if.c @@ -48,7 +48,7 @@ struct vdec_h264_slice_lat_dec_param { }; =20 /** - * struct vdec_h264_slice_info - decode information + * struct vdec_h264_slice_info_ex - extend decode information * * @wdma_end_addr_offset: offset from buffer start * @nal_info: nal info of current picture @@ -57,7 +57,7 @@ struct vdec_h264_slice_lat_dec_param { * @crc: Used to check whether hardware's status is right * @reserved: reserved */ -struct vdec_h264_slice_info { +struct vdec_h264_slice_info_ex { u64 wdma_end_addr_offset; u16 nal_info; u16 timeout; @@ -92,7 +92,7 @@ struct vdec_h264_slice_fb { }; =20 /** - * struct vdec_h264_slice_vsi - shared memory for decode information excha= nge + * struct vdec_h264_slice_vsi_ex - extend shared memory for decode informa= tion exchange * between SCP and Host. * * @bs: input buffer info @@ -108,7 +108,7 @@ struct vdec_h264_slice_fb { * @dec: decode information (AP-R, VPU-W) * @h264_slice_params: decode parameters for hw used */ -struct vdec_h264_slice_vsi { +struct vdec_h264_slice_vsi_ex { /* LAT dec addr */ struct vdec_h264_slice_mem bs; struct vdec_h264_slice_fb fb; @@ -120,7 +120,7 @@ struct vdec_h264_slice_vsi { struct vdec_h264_slice_mem slice_bc; =20 struct vdec_h264_slice_mem mv_buf_dma[H264_MAX_MV_NUM]; - struct vdec_h264_slice_info dec; + struct vdec_h264_slice_info_ex dec; struct vdec_h264_slice_lat_dec_param h264_slice_params; }; =20 @@ -152,10 +152,10 @@ struct vdec_h264_slice_share_info { * @pred_buf: HW working prediction buffer * @mv_buf: HW working motion vector buffer * @vpu: VPU instance - * @vsi: vsi used for lat - * @vsi_core: vsi used for core + * @vsi_ex: extend vsi used for lat + * @vsi_core_ex: extend vsi used for core * - * @vsi_ctx: Local VSI data for this decoding context + * @vsi_ctx_ex: Local extend vsi data for this decoding context * @h264_slice_param: the parameters that hardware use to decode * * @resolution_changed:resolution changed @@ -172,10 +172,10 @@ struct vdec_h264_slice_inst { struct mtk_vcodec_mem pred_buf; struct mtk_vcodec_mem mv_buf[H264_MAX_MV_NUM]; struct vdec_vpu_inst vpu; - struct vdec_h264_slice_vsi *vsi; - struct vdec_h264_slice_vsi *vsi_core; + struct vdec_h264_slice_vsi_ex *vsi_ex; + struct vdec_h264_slice_vsi_ex *vsi_core_ex; =20 - struct vdec_h264_slice_vsi vsi_ctx; + struct vdec_h264_slice_vsi_ex vsi_ctx_ex; struct vdec_h264_slice_lat_dec_param h264_slice_param; =20 unsigned int resolution_changed; @@ -412,28 +412,28 @@ static void vdec_h264_slice_setup_lat_buffer(struct v= dec_h264_slice_inst *inst, struct mtk_vcodec_mem *mem; int i; =20 - inst->vsi->bs.dma_addr =3D (u64)bs->dma_addr; - inst->vsi->bs.size =3D bs->size; + inst->vsi_ex->bs.dma_addr =3D (u64)bs->dma_addr; + inst->vsi_ex->bs.size =3D bs->size; =20 for (i =3D 0; i < H264_MAX_MV_NUM; i++) { mem =3D &inst->mv_buf[i]; - inst->vsi->mv_buf_dma[i].dma_addr =3D mem->dma_addr; - inst->vsi->mv_buf_dma[i].size =3D mem->size; + inst->vsi_ex->mv_buf_dma[i].dma_addr =3D mem->dma_addr; + inst->vsi_ex->mv_buf_dma[i].size =3D mem->size; } - inst->vsi->ube.dma_addr =3D lat_buf->ctx->msg_queue.wdma_addr.dma_addr; - inst->vsi->ube.size =3D lat_buf->ctx->msg_queue.wdma_addr.size; + inst->vsi_ex->ube.dma_addr =3D lat_buf->ctx->msg_queue.wdma_addr.dma_addr; + inst->vsi_ex->ube.size =3D lat_buf->ctx->msg_queue.wdma_addr.size; =20 - inst->vsi->row_info.dma_addr =3D 0; - inst->vsi->row_info.size =3D 0; + inst->vsi_ex->row_info.dma_addr =3D 0; + inst->vsi_ex->row_info.size =3D 0; =20 - inst->vsi->err_map.dma_addr =3D lat_buf->wdma_err_addr.dma_addr; - inst->vsi->err_map.size =3D lat_buf->wdma_err_addr.size; + inst->vsi_ex->err_map.dma_addr =3D lat_buf->wdma_err_addr.dma_addr; + inst->vsi_ex->err_map.size =3D lat_buf->wdma_err_addr.size; =20 - inst->vsi->slice_bc.dma_addr =3D lat_buf->slice_bc_addr.dma_addr; - inst->vsi->slice_bc.size =3D lat_buf->slice_bc_addr.size; + inst->vsi_ex->slice_bc.dma_addr =3D lat_buf->slice_bc_addr.dma_addr; + inst->vsi_ex->slice_bc.size =3D lat_buf->slice_bc_addr.size; =20 - inst->vsi->trans.dma_addr_end =3D inst->ctx->msg_queue.wdma_rptr_addr; - inst->vsi->trans.dma_addr =3D inst->ctx->msg_queue.wdma_wptr_addr; + inst->vsi_ex->trans.dma_addr_end =3D inst->ctx->msg_queue.wdma_rptr_addr; + inst->vsi_ex->trans.dma_addr =3D inst->ctx->msg_queue.wdma_wptr_addr; } =20 static int vdec_h264_slice_setup_core_buffer(struct vdec_h264_slice_inst *= inst, @@ -462,33 +462,33 @@ static int vdec_h264_slice_setup_core_buffer(struct v= dec_h264_slice_inst *inst, =20 mtk_vdec_debug(ctx, "[h264-core] y/c addr =3D 0x%llx 0x%llx", y_fb_dma, c= _fb_dma); =20 - inst->vsi_core->fb.y.dma_addr =3D y_fb_dma; - inst->vsi_core->fb.y.size =3D ctx->picinfo.fb_sz[0]; - inst->vsi_core->fb.c.dma_addr =3D c_fb_dma; - inst->vsi_core->fb.c.size =3D ctx->picinfo.fb_sz[1]; + inst->vsi_core_ex->fb.y.dma_addr =3D y_fb_dma; + inst->vsi_core_ex->fb.y.size =3D ctx->picinfo.fb_sz[0]; + inst->vsi_core_ex->fb.c.dma_addr =3D c_fb_dma; + inst->vsi_core_ex->fb.c.size =3D ctx->picinfo.fb_sz[1]; =20 - inst->vsi_core->dec.vdec_fb_va =3D (unsigned long)fb; - inst->vsi_core->dec.nal_info =3D share_info->nal_info; + inst->vsi_core_ex->dec.vdec_fb_va =3D (unsigned long)fb; + inst->vsi_core_ex->dec.nal_info =3D share_info->nal_info; =20 - inst->vsi_core->ube.dma_addr =3D lat_buf->ctx->msg_queue.wdma_addr.dma_ad= dr; - inst->vsi_core->ube.size =3D lat_buf->ctx->msg_queue.wdma_addr.size; + inst->vsi_core_ex->ube.dma_addr =3D lat_buf->ctx->msg_queue.wdma_addr.dma= _addr; + inst->vsi_core_ex->ube.size =3D lat_buf->ctx->msg_queue.wdma_addr.size; =20 - inst->vsi_core->err_map.dma_addr =3D lat_buf->wdma_err_addr.dma_addr; - inst->vsi_core->err_map.size =3D lat_buf->wdma_err_addr.size; + inst->vsi_core_ex->err_map.dma_addr =3D lat_buf->wdma_err_addr.dma_addr; + inst->vsi_core_ex->err_map.size =3D lat_buf->wdma_err_addr.size; =20 - inst->vsi_core->slice_bc.dma_addr =3D lat_buf->slice_bc_addr.dma_addr; - inst->vsi_core->slice_bc.size =3D lat_buf->slice_bc_addr.size; + inst->vsi_core_ex->slice_bc.dma_addr =3D lat_buf->slice_bc_addr.dma_addr; + inst->vsi_core_ex->slice_bc.size =3D lat_buf->slice_bc_addr.size; =20 - inst->vsi_core->row_info.dma_addr =3D 0; - inst->vsi_core->row_info.size =3D 0; + inst->vsi_core_ex->row_info.dma_addr =3D 0; + inst->vsi_core_ex->row_info.size =3D 0; =20 - inst->vsi_core->trans.dma_addr =3D share_info->trans_start; - inst->vsi_core->trans.dma_addr_end =3D share_info->trans_end; + inst->vsi_core_ex->trans.dma_addr =3D share_info->trans_start; + inst->vsi_core_ex->trans.dma_addr_end =3D share_info->trans_end; =20 for (i =3D 0; i < H264_MAX_MV_NUM; i++) { mem =3D &inst->mv_buf[i]; - inst->vsi_core->mv_buf_dma[i].dma_addr =3D mem->dma_addr; - inst->vsi_core->mv_buf_dma[i].size =3D mem->size; + inst->vsi_core_ex->mv_buf_dma[i].dma_addr =3D mem->dma_addr; + inst->vsi_core_ex->mv_buf_dma[i].size =3D mem->size; } =20 vb2_v4l2 =3D v4l2_m2m_next_dst_buf(ctx->m2m_ctx); @@ -520,10 +520,10 @@ static int vdec_h264_slice_init(struct mtk_vcodec_dec= _ctx *ctx) goto error_free_inst; } =20 - vsi_size =3D round_up(sizeof(struct vdec_h264_slice_vsi), VCODEC_DEC_ALIG= NED_64); - inst->vsi =3D inst->vpu.vsi; - inst->vsi_core =3D - (struct vdec_h264_slice_vsi *)(((char *)inst->vpu.vsi) + vsi_size); + vsi_size =3D round_up(sizeof(struct vdec_h264_slice_vsi_ex), VCODEC_DEC_A= LIGNED_64); + inst->vsi_ex =3D inst->vpu.vsi; + inst->vsi_core_ex =3D + (struct vdec_h264_slice_vsi_ex *)(((char *)inst->vpu.vsi) + vsi_size); inst->resolution_changed =3D true; inst->realloc_mv_buf =3D true; =20 @@ -564,14 +564,14 @@ static int vdec_h264_slice_core_decode(struct vdec_la= t_buf *lat_buf) struct vdec_vpu_inst *vpu =3D &inst->vpu; =20 mtk_vdec_debug(ctx, "[h264-core] vdec_h264 core decode"); - memcpy(&inst->vsi_core->h264_slice_params, &share_info->h264_slice_params, + memcpy(&inst->vsi_core_ex->h264_slice_params, &share_info->h264_slice_par= ams, sizeof(share_info->h264_slice_params)); =20 err =3D vdec_h264_slice_setup_core_buffer(inst, share_info, lat_buf); if (err) goto vdec_dec_end; =20 - vdec_h264_slice_fill_decode_reflist(inst, &inst->vsi_core->h264_slice_par= ams, + vdec_h264_slice_fill_decode_reflist(inst, &inst->vsi_core_ex->h264_slice_= params, share_info); err =3D vpu_dec_core(vpu); if (err) { @@ -584,15 +584,15 @@ static int vdec_h264_slice_core_decode(struct vdec_la= t_buf *lat_buf) WAIT_INTR_TIMEOUT_MS, MTK_VDEC_CORE); if (timeout) mtk_vdec_err(ctx, "core decode timeout: pic_%d", ctx->decoded_frame_cnt); - inst->vsi_core->dec.timeout =3D !!timeout; + inst->vsi_core_ex->dec.timeout =3D !!timeout; =20 vpu_dec_core_end(vpu); mtk_vdec_debug(ctx, "pic[%d] crc: 0x%x 0x%x 0x%x 0x%x 0x%x 0x%x 0x%x 0x%x= ", ctx->decoded_frame_cnt, - inst->vsi_core->dec.crc[0], inst->vsi_core->dec.crc[1], - inst->vsi_core->dec.crc[2], inst->vsi_core->dec.crc[3], - inst->vsi_core->dec.crc[4], inst->vsi_core->dec.crc[5], - inst->vsi_core->dec.crc[6], inst->vsi_core->dec.crc[7]); + inst->vsi_core_ex->dec.crc[0], inst->vsi_core_ex->dec.crc[1], + inst->vsi_core_ex->dec.crc[2], inst->vsi_core_ex->dec.crc[3], + inst->vsi_core_ex->dec.crc[4], inst->vsi_core_ex->dec.crc[5], + inst->vsi_core_ex->dec.crc[6], inst->vsi_core_ex->dec.crc[7]); =20 vdec_dec_end: vdec_msg_queue_update_ube_rptr(&lat_buf->ctx->msg_queue, share_info->tran= s_end); @@ -662,7 +662,7 @@ static int vdec_h264_slice_lat_decode(void *h_vdec, str= uct mtk_vcodec_mem *bs, v4l2_m2m_buf_copy_metadata(&src_buf_info->m2m_buf.vb, &lat_buf->ts_info, = true); =20 err =3D vdec_h264_slice_fill_decode_parameters(inst, share_info, - &inst->vsi->h264_slice_params); + &inst->vsi_ex->h264_slice_params); if (err) goto err_free_fb_out; =20 @@ -683,12 +683,13 @@ static int vdec_h264_slice_lat_decode(void *h_vdec, s= truct mtk_vcodec_mem *bs, =20 vdec_h264_slice_setup_lat_buffer(inst, bs, lat_buf); mtk_vdec_debug(inst->ctx, "lat:trans(0x%llx 0x%lx) err:0x%llx", - inst->vsi->ube.dma_addr, (unsigned long)inst->vsi->ube.size, - inst->vsi->err_map.dma_addr); + inst->vsi_ex->ube.dma_addr, (unsigned long)inst->vsi_ex->ube.size, + inst->vsi_ex->err_map.dma_addr); =20 mtk_vdec_debug(inst->ctx, "slice(0x%llx 0x%lx) rprt((0x%llx 0x%llx))", - inst->vsi->slice_bc.dma_addr, (unsigned long)inst->vsi->slice_bc.= size, - inst->vsi->trans.dma_addr, inst->vsi->trans.dma_addr_end); + inst->vsi_ex->slice_bc.dma_addr, (unsigned long)inst->vsi_ex->sli= ce_bc.size, + inst->vsi_ex->trans.dma_addr, inst->vsi_ex->trans.dma_addr_end); + err =3D vpu_dec_start(vpu, data, 2); if (err) { mtk_vdec_debug(inst->ctx, "lat decode err: %d", err); @@ -696,13 +697,13 @@ static int vdec_h264_slice_lat_decode(void *h_vdec, s= truct mtk_vcodec_mem *bs, } =20 share_info->trans_end =3D inst->ctx->msg_queue.wdma_addr.dma_addr + - inst->vsi->dec.wdma_end_addr_offset; + inst->vsi_ex->dec.wdma_end_addr_offset; =20 share_info->trans_start =3D inst->ctx->msg_queue.wdma_wptr_addr; - share_info->nal_info =3D inst->vsi->dec.nal_info; + share_info->nal_info =3D inst->vsi_ex->dec.nal_info; =20 if (IS_VDEC_INNER_RACING(inst->ctx->dev->dec_capability)) { - memcpy(&share_info->h264_slice_params, &inst->vsi->h264_slice_params, + memcpy(&share_info->h264_slice_params, &inst->vsi_ex->h264_slice_params, sizeof(share_info->h264_slice_params)); vdec_msg_queue_qbuf(&inst->ctx->msg_queue.core_ctx, lat_buf); } @@ -712,7 +713,7 @@ static int vdec_h264_slice_lat_decode(void *h_vdec, str= uct mtk_vcodec_mem *bs, WAIT_INTR_TIMEOUT_MS, MTK_VDEC_LAT0); if (timeout) mtk_vdec_err(inst->ctx, "lat decode timeout: pic_%d", inst->slice_dec_nu= m); - inst->vsi->dec.timeout =3D !!timeout; + inst->vsi_ex->dec.timeout =3D !!timeout; =20 err =3D vpu_dec_end(vpu); if (err =3D=3D SLICE_HEADER_FULL || err =3D=3D TRANS_BUFFER_FULL) { @@ -724,16 +725,18 @@ static int vdec_h264_slice_lat_decode(void *h_vdec, s= truct mtk_vcodec_mem *bs, } =20 share_info->trans_end =3D inst->ctx->msg_queue.wdma_addr.dma_addr + - inst->vsi->dec.wdma_end_addr_offset; + inst->vsi_ex->dec.wdma_end_addr_offset; + vdec_msg_queue_update_ube_wptr(&lat_buf->ctx->msg_queue, share_info->tran= s_end); =20 if (!IS_VDEC_INNER_RACING(inst->ctx->dev->dec_capability)) { - memcpy(&share_info->h264_slice_params, &inst->vsi->h264_slice_params, + memcpy(&share_info->h264_slice_params, &inst->vsi_ex->h264_slice_params, sizeof(share_info->h264_slice_params)); vdec_msg_queue_qbuf(&inst->ctx->msg_queue.core_ctx, lat_buf); } mtk_vdec_debug(inst->ctx, "dec num: %d lat crc: 0x%x 0x%x 0x%x", inst->sl= ice_dec_num, - inst->vsi->dec.crc[0], inst->vsi->dec.crc[1], inst->vsi->dec.crc[= 2]); + inst->vsi_ex->dec.crc[0], inst->vsi_ex->dec.crc[1], + inst->vsi_ex->dec.crc[2]); =20 inst->slice_dec_num++; return 0; @@ -774,11 +777,11 @@ static int vdec_h264_slice_single_decode(void *h_vdec= , struct mtk_vcodec_mem *bs mtk_vdec_debug(inst->ctx, "[h264-dec] [%d] y_dma=3D%llx c_dma=3D%llx", inst->ctx->decoded_frame_cnt, y_fb_dma, c_fb_dma); =20 - inst->vsi_ctx.bs.dma_addr =3D (u64)bs->dma_addr; - inst->vsi_ctx.bs.size =3D bs->size; - inst->vsi_ctx.fb.y.dma_addr =3D y_fb_dma; - inst->vsi_ctx.fb.c.dma_addr =3D c_fb_dma; - inst->vsi_ctx.dec.vdec_fb_va =3D (u64)(uintptr_t)fb; + inst->vsi_ctx_ex.bs.dma_addr =3D (u64)bs->dma_addr; + inst->vsi_ctx_ex.bs.size =3D bs->size; + inst->vsi_ctx_ex.fb.y.dma_addr =3D y_fb_dma; + inst->vsi_ctx_ex.fb.c.dma_addr =3D c_fb_dma; + inst->vsi_ctx_ex.dec.vdec_fb_va =3D (u64)(uintptr_t)fb; =20 v4l2_m2m_buf_copy_metadata(&src_buf_info->m2m_buf.vb, &dst_buf_info->m2m_buf.vb, true); @@ -786,8 +789,8 @@ static int vdec_h264_slice_single_decode(void *h_vdec, = struct mtk_vcodec_mem *bs if (err) goto err_free_fb_out; =20 - memcpy(&inst->vsi_ctx.h264_slice_params, &inst->h264_slice_param, - sizeof(inst->vsi_ctx.h264_slice_params)); + memcpy(&inst->vsi_ctx_ex.h264_slice_params, &inst->h264_slice_param, + sizeof(inst->vsi_ctx_ex.h264_slice_params)); =20 buf =3D (unsigned char *)bs->va; nal_start_idx =3D mtk_vdec_h264_find_start_code(buf, bs->size); @@ -795,7 +798,7 @@ static int vdec_h264_slice_single_decode(void *h_vdec, = struct mtk_vcodec_mem *bs err =3D -EINVAL; goto err_free_fb_out; } - inst->vsi_ctx.dec.nal_info =3D buf[nal_start_idx]; + inst->vsi_ctx_ex.dec.nal_info =3D buf[nal_start_idx]; =20 *res_chg =3D inst->resolution_changed; if (inst->resolution_changed) { @@ -810,11 +813,11 @@ static int vdec_h264_slice_single_decode(void *h_vdec= , struct mtk_vcodec_mem *bs =20 for (i =3D 0; i < H264_MAX_MV_NUM; i++) { mem =3D &inst->mv_buf[i]; - inst->vsi_ctx.mv_buf_dma[i].dma_addr =3D mem->dma_addr; + inst->vsi_ctx_ex.mv_buf_dma[i].dma_addr =3D mem->dma_addr; } } =20 - memcpy(inst->vpu.vsi, &inst->vsi_ctx, sizeof(inst->vsi_ctx)); + memcpy(inst->vpu.vsi, &inst->vsi_ctx_ex, sizeof(inst->vsi_ctx_ex)); err =3D vpu_dec_start(vpu, data, 2); if (err) goto err_free_fb_out; @@ -825,18 +828,18 @@ static int vdec_h264_slice_single_decode(void *h_vdec= , struct mtk_vcodec_mem *bs if (err) mtk_vdec_err(inst->ctx, "decode timeout: pic_%d", inst->ctx->decoded_fra= me_cnt); =20 - inst->vsi->dec.timeout =3D !!err; + inst->vsi_ex->dec.timeout =3D !!err; err =3D vpu_dec_end(vpu); if (err) goto err_free_fb_out; =20 - memcpy(&inst->vsi_ctx, inst->vpu.vsi, sizeof(inst->vsi_ctx)); + memcpy(&inst->vsi_ctx_ex, inst->vpu.vsi, sizeof(inst->vsi_ctx_ex)); mtk_vdec_debug(inst->ctx, "pic[%d] crc: 0x%x 0x%x 0x%x 0x%x 0x%x 0x%x 0x%= x 0x%x", inst->ctx->decoded_frame_cnt, - inst->vsi_ctx.dec.crc[0], inst->vsi_ctx.dec.crc[1], - inst->vsi_ctx.dec.crc[2], inst->vsi_ctx.dec.crc[3], - inst->vsi_ctx.dec.crc[4], inst->vsi_ctx.dec.crc[5], - inst->vsi_ctx.dec.crc[6], inst->vsi_ctx.dec.crc[7]); + inst->vsi_ctx_ex.dec.crc[0], inst->vsi_ctx_ex.dec.crc[1], + inst->vsi_ctx_ex.dec.crc[2], inst->vsi_ctx_ex.dec.crc[3], + inst->vsi_ctx_ex.dec.crc[4], inst->vsi_ctx_ex.dec.crc[5], + inst->vsi_ctx_ex.dec.crc[6], inst->vsi_ctx_ex.dec.crc[7]); =20 inst->ctx->decoded_frame_cnt++; return 0; --=20 2.46.0