media: jpeg: refactor multi-hw judgement
Subsystems (2)
PATCH 1/1 media: jpeg: refactor multi-hw judgement
From: kyrie wu <[email protected]>
some chips have multi-hw, but others have only one, modify the condition of multi-hw judgement
--- drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c | 5 +++-- drivers/media/platform/mtk-jpeg/mtk_jpeg_core.h | 12 ++++++++++++ 2 files changed, 15 insertions(+), 2 deletions(-)
drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c +3 -2
@@ -1695,8 +1695,7 @@ static int mtk_jpeg_probe(struct platform_device *pdev)return -EINVAL ; } - -if (list_empty (&pdev->dev.devres_head)) { +if (!jpeg->variant->hw_arch) {INIT_DELAYED_WORK (&jpeg->job_timeout_work, mtk_jpeg_job_timeout_work);
@@ -1890,6 +1889,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, + .hw_arch = MTK_JPEG_HW_MULTI_CORE, };static const struct mtk_jpeg_variant mtk8195_jpegdec_drvdata = {
@@ -1901,6 +1901,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, + .hw_arch = MTK_JPEG_HW_MULTI_CORE, };#if defined(CONFIG_OF )
drivers/media/platform/mtk-jpeg/mtk_jpeg_core.h +12 -0
@@ -46,6 +46,16 @@ enum mtk_jpeg_ctx_state { MTK_JPEG_SOURCE_CHANGE, }; +/** +* enum mtk_jpeg_hw_arch - arch of the jpeg hw +* @MTK_JPEG_HW_SINGLE_CORE: jpeg hw is single core +* @MTK_JPEG_HW_MULTI_CORE: jpeg hw is mluti-core +*/ +enum mtk_jpeg_hw_arch { +MTK_JPEG_HW_SINGLE_CORE =0 , +MTK_JPEG_HW_MULTI_CORE =1 , +}; +/** * struct mtk_jpeg_variant - mtk jpeg driver variant * @clks: clock names
@@ -60,6 +70,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 +* @hw_arch: mark jpeg hw arch */ struct mtk_jpeg_variant {struct clk_bulk_data *clks;
@@ -74,6 +85,7 @@ struct mtk_jpeg_variant {const struct v4l2_ioctl_ops *ioctl_ops;u32 out_q_default_fourcc;u32 cap_q_default_fourcc; +enum mtk_jpeg_hw_arch hw_arch; };struct mtk_jpeg_src_buf {
Signature · 1 line
2.18.0
AngeloGioacchino Del Regno
maintainerIl 15/12/22 10:30, Irui Wang ha scritto:
Quoted 7 lines
From: kyrie wu <[email protected]>
some chips have multi-hw, but others have only one, modify the condition of multi-hw judgement
Signed-off-by kyrie wu <[email protected]>Signed-off-by irui wang <[email protected]>
Agreed. But this needs a Fixes tag, please add the right one.
Regards,
Angelo
Quoted 5 lines · Irui Wang
From: kyrie wu <[email protected]>
some chips have multi-hw, but others have only one, modify the condition of multi-hw judgement
Quoted 7 lines
Signed-off-by kyrie wu <[email protected]>Signed-off-by irui wang <[email protected]>--- drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c | 5 +++-- drivers/media/platform/mtk-jpeg/mtk_jpeg_core.h | 12 ++++++++++++ 2 files changed, 15 insertions(+), 2 deletions(-)
This may conflict with kernel mainline since mtk-jpeg folder doesn't exist.
Please fix it.
BRs,
Johnson Wang
AngeloGioacchino Del Regno
maintainerIl 15/12/22 11:50, Johnson Wang (王聖鑫) ha scritto:
Quoted 14 lines · Irui Wang
Quoted 5 lines
From: kyrie wu <[email protected]>
some chips have multi-hw, but others have only one, modify the condition of multi-hw judgement
Quoted 7 lines
Signed-off-by kyrie wu <[email protected]>Signed-off-by irui wang <[email protected]>--- drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c | 5 +++-- drivers/media/platform/mtk-jpeg/mtk_jpeg_core.h | 12 ++++++++++++ 2 files changed, 15 insertions(+), 2 deletions(-)
Quoted 6 lines
This may conflict with kernel mainline since mtk-jpeg folder doesn't exist.
Please fix it.BRs,
Johnson Wang
Ouch. I just noticed that the folder is mismatching; this didn't deserve a R-b tag. I'll be more careful next time.
Quoted 6 lines · AngeloGioacchino Del Regno
Il 15/12/22 10:30, Irui Wang ha scritto:
Quoted 5 lines
From: kyrie wu <[email protected]>
some chips have multi-hw, but others have only one, modify the condition of multi-hw judgement
Quoted 7 lines
Quoted 2 lines
Signed-off-by kyrie wu <[email protected]>Signed-off-by irui wang <[email protected]>Agreed. But this needs a Fixes tag, please add the right one.
Regards,
Angelo
Hello Angelo,
Thanks for your kind reply, I would add it in the next version.
Regards,
Kyrie.
Quoted 2 lines
Quoted 21 lines · AngeloGioacchino Del Regno
Il 15/12/22 11:50, Johnson Wang (王聖鑫) ha scritto:
Quoted 20 lines · Irui Wang
Quoted 5 lines
From: kyrie wu <[email protected]>
some chips have multi-hw, but others have only one, modify the condition of multi-hw judgement
Quoted 8 lines
Signed-off-by kyrie wu <[email protected]>Signed-off-by irui wang <[email protected]>--- drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c | 5 +++-- drivers/media/platform/mtk-jpeg/mtk_jpeg_core.h | 12 ++++++++++++ 2 files changed, 15 insertions(+), 2 deletions(-)This may conflict with kernel mainline since mtk-jpeg folder doesn't
exist.
Please fix it.
Quoted 6 lines
Quoted 2 lines
BRs,
Johnson WangOuch. I just noticed that the folder is mismatching; this didn't deserve
a R-b tag. I'll be more careful next time.
I'm terriable sorry for this mistake, and it would be fixed in the coming version.
Thanks.