Commit 2077759b authored by Yunfei Dong's avatar Yunfei Dong Committed by Mauro Carvalho Chehab
Browse files

media: mediatek: vcodec: Using firmware type to separate different firmware architecture



MT8173 platform use vpu firmware, mt8183/mt8192 will use scp
firmware instead, using chip name is not reasonable to separate
different firmware architecture. Using firmware type is much better.

Signed-off-by: default avatarYunfei Dong <yunfei.dong@mediatek.com>
Reviewed-by: default avatarTzung-Bi <Shih&lt;tzungbi@google.com>
Reviewed-by: default avatarAngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Tested-by: default avatarNícolas F. R. A. Prado <nfraprado@collabora.com>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@kernel.org>
parent 7c6785d2
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -613,7 +613,6 @@ static struct vb2_ops mtk_vdec_frame_vb2_ops = {
};

const struct mtk_vcodec_dec_pdata mtk_vdec_8173_pdata = {
	.chip = MTK_MT8173,
	.init_vdec_params = mtk_init_vdec_params,
	.ctrls_setup = mtk_vcodec_dec_ctrls_setup,
	.vdec_vb2_ops = &mtk_vdec_frame_vb2_ops,
+0 −2
Original line number Diff line number Diff line
@@ -343,7 +343,6 @@ static struct vb2_ops mtk_vdec_request_vb2_ops = {
};

const struct mtk_vcodec_dec_pdata mtk_vdec_8183_pdata = {
	.chip = MTK_MT8183,
	.init_vdec_params = mtk_init_vdec_params,
	.ctrls_setup = mtk_vcodec_dec_ctrls_setup,
	.vdec_vb2_ops = &mtk_vdec_request_vb2_ops,
@@ -362,7 +361,6 @@ const struct mtk_vcodec_dec_pdata mtk_vdec_8183_pdata = {

/* This platform data is used for one lat and one core architecture. */
const struct mtk_vcodec_dec_pdata mtk_lat_sig_core_pdata = {
	.chip = MTK_MT8192,
	.init_vdec_params = mtk_init_vdec_params,
	.ctrls_setup = mtk_vcodec_dec_ctrls_setup,
	.vdec_vb2_ops = &mtk_vdec_request_vb2_ops,
+0 −13
Original line number Diff line number Diff line
@@ -332,13 +332,6 @@ struct mtk_vcodec_ctx {
	struct vdec_msg_queue msg_queue;
};

enum mtk_chip {
	MTK_MT8173,
	MTK_MT8183,
	MTK_MT8192,
	MTK_MT8195,
};

/*
 * enum mtk_vdec_hw_arch - Used to separate different hardware architecture
 */
@@ -364,7 +357,6 @@ enum mtk_vdec_hw_arch {
 * @vdec_framesizes: supported video decoder frame sizes
 * @num_framesizes: count of video decoder frame sizes
 *
 * @chip: chip this decoder is compatible with
 * @hw_arch: hardware arch is used to separate pure_sin_core and lat_sin_core
 *
 * @is_subdev_supported: whether support parent-node architecture(subdev)
@@ -387,7 +379,6 @@ struct mtk_vcodec_dec_pdata {
	const struct mtk_codec_framesizes *vdec_framesizes;
	const int num_framesizes;

	enum mtk_chip chip;
	enum mtk_vdec_hw_arch hw_arch;

	bool is_subdev_supported;
@@ -397,8 +388,6 @@ struct mtk_vcodec_dec_pdata {
/**
 * struct mtk_vcodec_enc_pdata - compatible data for each IC
 *
 * @chip: chip this encoder is compatible with
 *
 * @uses_ext: whether the encoder uses the extended firmware messaging format
 * @min_bitrate: minimum supported encoding bitrate
 * @max_bitrate: maximum supported encoding bitrate
@@ -409,8 +398,6 @@ struct mtk_vcodec_dec_pdata {
 * @core_id: stand for h264 or vp8 encode index
 */
struct mtk_vcodec_enc_pdata {
	enum mtk_chip chip;

	bool uses_ext;
	unsigned long min_bitrate;
	unsigned long max_bitrate;
+0 −5
Original line number Diff line number Diff line
@@ -376,7 +376,6 @@ static int mtk_vcodec_probe(struct platform_device *pdev)
}

static const struct mtk_vcodec_enc_pdata mt8173_avc_pdata = {
	.chip = MTK_MT8173,
	.capture_formats = mtk_video_formats_capture_h264,
	.num_capture_formats = ARRAY_SIZE(mtk_video_formats_capture_h264),
	.output_formats = mtk_video_formats_output,
@@ -387,7 +386,6 @@ static const struct mtk_vcodec_enc_pdata mt8173_avc_pdata = {
};

static const struct mtk_vcodec_enc_pdata mt8173_vp8_pdata = {
	.chip = MTK_MT8173,
	.capture_formats = mtk_video_formats_capture_vp8,
	.num_capture_formats = ARRAY_SIZE(mtk_video_formats_capture_vp8),
	.output_formats = mtk_video_formats_output,
@@ -398,7 +396,6 @@ static const struct mtk_vcodec_enc_pdata mt8173_vp8_pdata = {
};

static const struct mtk_vcodec_enc_pdata mt8183_pdata = {
	.chip = MTK_MT8183,
	.uses_ext = true,
	.capture_formats = mtk_video_formats_capture_h264,
	.num_capture_formats = ARRAY_SIZE(mtk_video_formats_capture_h264),
@@ -410,7 +407,6 @@ static const struct mtk_vcodec_enc_pdata mt8183_pdata = {
};

static const struct mtk_vcodec_enc_pdata mt8192_pdata = {
	.chip = MTK_MT8192,
	.uses_ext = true,
	.capture_formats = mtk_video_formats_capture_h264,
	.num_capture_formats = ARRAY_SIZE(mtk_video_formats_capture_h264),
@@ -422,7 +418,6 @@ static const struct mtk_vcodec_enc_pdata mt8192_pdata = {
};

static const struct mtk_vcodec_enc_pdata mt8195_pdata = {
	.chip = MTK_MT8195,
	.uses_ext = true,
	.capture_formats = mtk_video_formats_capture_h264,
	.num_capture_formats = ARRAY_SIZE(mtk_video_formats_capture_h264),
+6 −0
Original line number Diff line number Diff line
@@ -65,3 +65,9 @@ int mtk_vcodec_fw_ipi_send(struct mtk_vcodec_fw *fw, int id, void *buf,
	return fw->ops->ipi_send(fw, id, buf, len, wait);
}
EXPORT_SYMBOL_GPL(mtk_vcodec_fw_ipi_send);

int mtk_vcodec_fw_get_type(struct mtk_vcodec_fw *fw)
{
	return fw->type;
}
EXPORT_SYMBOL_GPL(mtk_vcodec_fw_get_type);
Loading