]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
media: mediatek: vcodec: remove vsi operation in common interface
authorYunfei Dong <yunfei.dong@mediatek.com>
Sat, 8 Mar 2025 07:47:55 +0000 (15:47 +0800)
committerHans Verkuil <hverkuil@xs4all.nl>
Fri, 11 Apr 2025 11:21:12 +0000 (13:21 +0200)
Extend the VSI (video shared information) struct to allow sending slice
parameters to SCP, as the parameters have changed on MT8188 architecture.
Remove VSI related information from the common interface to ensure that
the interface is usable by architectures with and without the extended
parameters. The new VSI extensions will be introduced in later patches.

Signed-off-by: Yunfei Dong <yunfei.dong@mediatek.com>
Reviewed-by: Chen-Yu Tsai <wenst@chromium.org>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_h264_req_multi_if.c

index 1ed0ccec56655e3a0a47c51aec1c4d094606eae1..ab192ce0b8517673748b55e9c62672ad11b17306 100644 (file)
@@ -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_param)
 {
-       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;
@@ -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->src_buf_req = src_buf_info->m2m_buf.vb.vb2_buf.req_obj.req;
        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) {