From: Chen-Yu Tsai <wenst@chromium.org>
To: Yunfei Dong <yunfei.dong@mediatek.com>
Cc: "Nícolas F . R . A . Prado" <nfraprado@collabora.com>,
"Sebastian Fricke" <sebastian.fricke@collabora.com>,
"Nicolas Dufresne" <nicolas.dufresne@collabora.com>,
"Hans Verkuil" <hverkuil-cisco@xs4all.nl>,
"AngeloGioacchino Del Regno"
<angelogioacchino.delregno@collabora.com>,
"Benjamin Gaignard" <benjamin.gaignard@collabora.com>,
"Nathan Hebert" <nhebert@chromium.org>,
"Daniel Almeida" <daniel.almeida@collabora.com>,
"Hsin-Yi Wang" <hsinyi@chromium.org>,
"Fritz Koenig" <frkoenig@chromium.org>,
"Daniel Vetter" <daniel@ffwll.ch>,
"Steve Cho" <stevecho@chromium.org>,
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,
Project_Global_Chrome_Upstream_Group@mediatek.com
Subject: Re: [PATCH v2 1/4] media: mediatek: vcodec: remove vsi operation in common interface
Date: Tue, 22 Oct 2024 11:58:26 +0800 [thread overview]
Message-ID: <CAGXv+5GMisONhxu5nnRdLvkav4ttwtrupft26-J01P8ACDx=9A@mail.gmail.com> (raw)
In-Reply-To: <20241016034927.8181-2-yunfei.dong@mediatek.com>
On Wed, Oct 16, 2024 at 11:49 AM Yunfei Dong <yunfei.dong@mediatek.com> wrote:
>
> Remove vsi related operation in common interface to make sure the
> interface can be called by different architecture at the same time.
Nit: it would be nice to provide more context here. You could mention
that a new extended interface with a different shared memory layout (vsi)
will be introduced in later patches.
> Signed-off-by: Yunfei Dong <yunfei.dong@mediatek.com>
> ---
> .../decoder/vdec/vdec_h264_req_multi_if.c | 19 ++++++++++---------
> 1 file changed, 10 insertions(+), 9 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_h264_req_multi_if.c
> index 732d78f63e5a..57c85af5ffb4 100644
> --- a/drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_h264_req_multi_if.c
> +++ b/drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_h264_req_multi_if.c
> @@ -171,9 +171,9 @@ struct vdec_h264_slice_inst {
> };
>
> static int vdec_h264_slice_fill_decode_parameters(struct vdec_h264_slice_inst *inst,
> - struct vdec_h264_slice_share_info *share_info)
> + struct vdec_h264_slice_share_info *share_info,
> + struct vdec_h264_slice_lat_dec_param *slice_data)
Nit: you could just name this new parameter |slice_param| and avoid the
changes in the next bit.
> {
> - struct vdec_h264_slice_lat_dec_param *slice_param = &inst->vsi->h264_slice_params;
> const struct v4l2_ctrl_h264_decode_params *dec_params;
> const struct v4l2_ctrl_h264_scaling_matrix *src_matrix;
> const struct v4l2_ctrl_h264_sps *sps;
> @@ -203,9 +203,9 @@ static int vdec_h264_slice_fill_decode_parameters(struct vdec_h264_slice_inst *i
> return -EINVAL;
> }
>
> - mtk_vdec_h264_copy_sps_params(&slice_param->sps, sps);
> - mtk_vdec_h264_copy_pps_params(&slice_param->pps, pps);
> - mtk_vdec_h264_copy_scaling_matrix(&slice_param->scaling_matrix, src_matrix);
> + mtk_vdec_h264_copy_sps_params(&slice_data->sps, sps);
> + mtk_vdec_h264_copy_pps_params(&slice_data->pps, pps);
> + mtk_vdec_h264_copy_scaling_matrix(&slice_data->scaling_matrix, src_matrix);
>
> memcpy(&share_info->sps, sps, sizeof(*sps));
> memcpy(&share_info->dec_params, dec_params, sizeof(*dec_params));
> @@ -266,9 +266,6 @@ static int get_vdec_sig_decode_parameters(struct vdec_h264_slice_inst *inst)
> mtk_vdec_h264_get_ref_list(b0_reflist, v4l2_b0_reflist, reflist_builder.num_valid);
> mtk_vdec_h264_get_ref_list(b1_reflist, v4l2_b1_reflist, reflist_builder.num_valid);
>
> - memcpy(&inst->vsi_ctx.h264_slice_params, slice_param,
> - sizeof(inst->vsi_ctx.h264_slice_params));
> -
> return 0;
> }
>
> @@ -608,7 +605,8 @@ static int vdec_h264_slice_lat_decode(void *h_vdec, struct mtk_vcodec_mem *bs,
> lat_buf->vb2_v4l2_src = &src_buf_info->m2m_buf.vb;
> v4l2_m2m_buf_copy_metadata(&src_buf_info->m2m_buf.vb, &lat_buf->ts_info, true);
>
> - err = vdec_h264_slice_fill_decode_parameters(inst, share_info);
> + err = vdec_h264_slice_fill_decode_parameters(inst, share_info,
> + &inst->vsi->h264_slice_params);
> if (err)
> goto err_free_fb_out;
>
> @@ -749,6 +747,9 @@ static int vdec_h264_slice_single_decode(void *h_vdec, struct mtk_vcodec_mem *bs
> if (err)
> goto err_free_fb_out;
>
> + memcpy(&inst->vsi_ctx.h264_slice_params, &inst->h264_slice_param,
> + sizeof(inst->vsi_ctx.h264_slice_params));
> +
> buf = (unsigned char *)bs->va;
> nal_start_idx = mtk_vdec_h264_find_start_code(buf, bs->size);
> if (nal_start_idx < 0) {
Code wise this patch seems fine.
Reviewed-by: Chen-Yu Tsai <wenst@chromium.org>
next prev parent reply other threads:[~2024-10-22 3:58 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-16 3:49 [PATCH v2 0/6] media: mediatek: vcodec: support h264 extend vsi Yunfei Dong
2024-10-16 3:49 ` [PATCH v2 1/4] media: mediatek: vcodec: remove vsi operation in common interface Yunfei Dong
2024-10-22 3:58 ` Chen-Yu Tsai [this message]
2024-10-16 3:49 ` [PATCH v2 2/4] media: mediatek: vcodec: support extend h264 video shared information Yunfei Dong
2024-10-22 7:08 ` Chen-Yu Tsai
2024-10-16 3:49 ` [PATCH v2 3/4] media: mediatek: vcodec: support extend h264 driver Yunfei Dong
2024-10-16 3:49 ` [PATCH v2 4/4] media: mediatek: vcodec: remove parse nal info in kernel Yunfei Dong
2024-10-22 7:10 ` Chen-Yu Tsai
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='CAGXv+5GMisONhxu5nnRdLvkav4ttwtrupft26-J01P8ACDx=9A@mail.gmail.com' \
--to=wenst@chromium.org \
--cc=Project_Global_Chrome_Upstream_Group@mediatek.com \
--cc=angelogioacchino.delregno@collabora.com \
--cc=benjamin.gaignard@collabora.com \
--cc=daniel.almeida@collabora.com \
--cc=daniel@ffwll.ch \
--cc=devicetree@vger.kernel.org \
--cc=frkoenig@chromium.org \
--cc=hsinyi@chromium.org \
--cc=hverkuil-cisco@xs4all.nl \
--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=nfraprado@collabora.com \
--cc=nhebert@chromium.org \
--cc=nicolas.dufresne@collabora.com \
--cc=sebastian.fricke@collabora.com \
--cc=stevecho@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;
as well as URLs for NNTP newsgroup(s).