media: meson: vdec: add g12a platform

Add support for the G12A platform by:
- adding the G12A codec support, here MPEG1 & MPEG2
- getting the new hevcf clock for the upcoming HEVC/VP9 decoding support

Signed-off-by: Maxime Jourdan <mjourdan@baylibre.com>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
This commit is contained in:
Maxime Jourdan 2019-12-05 16:34:07 +01:00 committed by Mauro Carvalho Chehab
parent 70ae805a0b
commit 8299c65339
4 changed files with 44 additions and 2 deletions

View File

@ -958,6 +958,8 @@ static const struct of_device_id vdec_dt_match[] = {
.data = &vdec_platform_gxm },
{ .compatible = "amlogic,gxl-vdec",
.data = &vdec_platform_gxl },
{ .compatible = "amlogic,g12a-vdec",
.data = &vdec_platform_g12a },
{}
};
MODULE_DEVICE_TABLE(of, vdec_dt_match);
@ -1005,6 +1007,15 @@ static int vdec_probe(struct platform_device *pdev)
if (IS_ERR(core->canvas))
return PTR_ERR(core->canvas);
of_id = of_match_node(vdec_dt_match, dev->of_node);
core->platform = of_id->data;
if (core->platform->revision == VDEC_REVISION_G12A) {
core->vdec_hevcf_clk = devm_clk_get(dev, "vdec_hevcf");
if (IS_ERR(core->vdec_hevcf_clk))
return -EPROBE_DEFER;
}
core->dos_parser_clk = devm_clk_get(dev, "dos_parser");
if (IS_ERR(core->dos_parser_clk))
return -EPROBE_DEFER;
@ -1047,8 +1058,6 @@ static int vdec_probe(struct platform_device *pdev)
goto err_vdev_release;
}
of_id = of_match_node(vdec_dt_match, dev->of_node);
core->platform = of_id->data;
core->vdev_dec = vdev;
core->dev_dec = dev;
mutex_init(&core->lock);

View File

@ -74,6 +74,7 @@ struct amvdec_core {
struct clk *dos_clk;
struct clk *vdec_1_clk;
struct clk *vdec_hevc_clk;
struct clk *vdec_hevcf_clk;
struct reset_control *esparser_reset;

View File

@ -82,6 +82,30 @@ static const struct amvdec_format vdec_formats_gxm[] = {
},
};
static const struct amvdec_format vdec_formats_g12a[] = {
{
.pixfmt = V4L2_PIX_FMT_MPEG1,
.min_buffers = 8,
.max_buffers = 8,
.max_width = 1920,
.max_height = 1080,
.vdec_ops = &vdec_1_ops,
.codec_ops = &codec_mpeg12_ops,
.firmware_path = "meson/vdec/gxl_mpeg12.bin",
.pixfmts_cap = { V4L2_PIX_FMT_NV12M, V4L2_PIX_FMT_YUV420M, 0 },
}, {
.pixfmt = V4L2_PIX_FMT_MPEG2,
.min_buffers = 8,
.max_buffers = 8,
.max_width = 1920,
.max_height = 1080,
.vdec_ops = &vdec_1_ops,
.codec_ops = &codec_mpeg12_ops,
.firmware_path = "meson/vdec/gxl_mpeg12.bin",
.pixfmts_cap = { V4L2_PIX_FMT_NV12M, V4L2_PIX_FMT_YUV420M, 0 },
},
};
const struct vdec_platform vdec_platform_gxbb = {
.formats = vdec_formats_gxbb,
.num_formats = ARRAY_SIZE(vdec_formats_gxbb),
@ -99,3 +123,9 @@ const struct vdec_platform vdec_platform_gxm = {
.num_formats = ARRAY_SIZE(vdec_formats_gxm),
.revision = VDEC_REVISION_GXM,
};
const struct vdec_platform vdec_platform_g12a = {
.formats = vdec_formats_g12a,
.num_formats = ARRAY_SIZE(vdec_formats_g12a),
.revision = VDEC_REVISION_G12A,
};

View File

@ -15,6 +15,7 @@ enum vdec_revision {
VDEC_REVISION_GXBB,
VDEC_REVISION_GXL,
VDEC_REVISION_GXM,
VDEC_REVISION_G12A,
};
struct vdec_platform {
@ -26,5 +27,6 @@ struct vdec_platform {
extern const struct vdec_platform vdec_platform_gxbb;
extern const struct vdec_platform vdec_platform_gxm;
extern const struct vdec_platform vdec_platform_gxl;
extern const struct vdec_platform vdec_platform_g12a;
#endif