Skip to content

Commit

Permalink
media: mtk-jpeg: Fixes jpeghw multi-core judgement
Browse files Browse the repository at this point in the history
[ Upstream commit 75c38ca ]

some chips have multi-hw, but others have only one,
modify the condition of multi-hw judgement

Fixes: 934e8bc ("mtk-jpegenc: support jpegenc multi-hardware")
Signed-off-by: kyrie wu <kyrie.wu@mediatek.com>
Signed-off-by: irui wang <irui.wang@mediatek.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
kyriewu-hw authored and gregkh committed May 11, 2023
1 parent e909451 commit 8746b36
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 4 additions & 1 deletion drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1692,7 +1692,7 @@ static int mtk_jpeg_probe(struct platform_device *pdev)
return -EINVAL;
}

if (list_empty(&pdev->dev.devres_head)) {
if (!jpeg->variant->multi_core) {
INIT_DELAYED_WORK(&jpeg->job_timeout_work,
mtk_jpeg_job_timeout_work);

Expand Down Expand Up @@ -1874,6 +1874,7 @@ static const struct mtk_jpeg_variant mtk_jpeg_drvdata = {
.ioctl_ops = &mtk_jpeg_enc_ioctl_ops,
.out_q_default_fourcc = V4L2_PIX_FMT_YUYV,
.cap_q_default_fourcc = V4L2_PIX_FMT_JPEG,
.multi_core = false,
};

static struct mtk_jpeg_variant mtk8195_jpegenc_drvdata = {
Expand All @@ -1885,6 +1886,7 @@ static struct mtk_jpeg_variant mtk8195_jpegenc_drvdata = {
.ioctl_ops = &mtk_jpeg_enc_ioctl_ops,
.out_q_default_fourcc = V4L2_PIX_FMT_YUYV,
.cap_q_default_fourcc = V4L2_PIX_FMT_JPEG,
.multi_core = true,
};

static const struct mtk_jpeg_variant mtk8195_jpegdec_drvdata = {
Expand All @@ -1896,6 +1898,7 @@ static const struct mtk_jpeg_variant mtk8195_jpegdec_drvdata = {
.ioctl_ops = &mtk_jpeg_dec_ioctl_ops,
.out_q_default_fourcc = V4L2_PIX_FMT_JPEG,
.cap_q_default_fourcc = V4L2_PIX_FMT_YUV420M,
.multi_core = true,
};

#if defined(CONFIG_OF)
Expand Down
2 changes: 2 additions & 0 deletions drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ enum mtk_jpeg_ctx_state {
* @ioctl_ops: the callback of jpeg v4l2_ioctl_ops
* @out_q_default_fourcc: output queue default fourcc
* @cap_q_default_fourcc: capture queue default fourcc
* @multi_core: mark jpeg hw is multi_core or not
*/
struct mtk_jpeg_variant {
struct clk_bulk_data *clks;
Expand All @@ -74,6 +75,7 @@ struct mtk_jpeg_variant {
const struct v4l2_ioctl_ops *ioctl_ops;
u32 out_q_default_fourcc;
u32 cap_q_default_fourcc;
bool multi_core;
};

struct mtk_jpeg_src_buf {
Expand Down

0 comments on commit 8746b36

Please sign in to comment.