summaryrefslogtreecommitdiffstats
path: root/drivers/media/platform/mediatek/jpeg
diff options
context:
space:
mode:
authorkyrie wu <kyrie.wu@mediatek.com>2023-03-10 06:23:52 +0000
committerMauro Carvalho Chehab <mchehab@kernel.org>2023-04-10 13:10:26 +0100
commitd40e95274925f48f9c973b49c297d7cf5ad27c76 (patch)
tree074576b7b3fed5436c7b8578459d794d7115128a /drivers/media/platform/mediatek/jpeg
parent86379bd9d399e2c5fd638a869af223d4910725c3 (diff)
downloadlinux-stable-d40e95274925f48f9c973b49c297d7cf5ad27c76.tar.gz
linux-stable-d40e95274925f48f9c973b49c297d7cf5ad27c76.tar.bz2
linux-stable-d40e95274925f48f9c973b49c297d7cf5ad27c76.zip
media: mtk-jpeg: reconstructs the initialization mode of worker
exclude is_jpgenc_multihw or is_jpgdec_multihw for judgment, and re-initialize jpeg worker. Signed-off-by: kyrie wu <kyrie.wu@mediatek.com> Signed-off-by: irui wang <irui.wang@mediatek.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Diffstat (limited to 'drivers/media/platform/mediatek/jpeg')
-rw-r--r--drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.c9
-rw-r--r--drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.h2
2 files changed, 5 insertions, 6 deletions
diff --git a/drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.c b/drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.c
index 6431aa4667c1..65f92c86f1b0 100644
--- a/drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.c
+++ b/drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.c
@@ -1575,12 +1575,7 @@ static int mtk_jpeg_open(struct file *file)
goto free;
}
- if (jpeg->is_jpgenc_multihw)
- INIT_WORK(&ctx->jpeg_work, mtk_jpegenc_worker);
-
- if (jpeg->is_jpgdec_multihw)
- INIT_WORK(&ctx->jpeg_work, mtk_jpegdec_worker);
-
+ INIT_WORK(&ctx->jpeg_work, jpeg->variant->jpeg_worker);
INIT_LIST_HEAD(&ctx->dst_done_queue);
spin_lock_init(&ctx->done_queue_lock);
v4l2_fh_init(&ctx->fh, vfd);
@@ -1902,6 +1897,7 @@ static struct mtk_jpeg_variant mtk8195_jpegenc_drvdata = {
.out_q_default_fourcc = V4L2_PIX_FMT_YUYV,
.cap_q_default_fourcc = V4L2_PIX_FMT_JPEG,
.multi_core = true,
+ .jpeg_worker = mtk_jpegenc_worker,
};
static const struct mtk_jpeg_variant mtk8195_jpegdec_drvdata = {
@@ -1914,6 +1910,7 @@ static const struct mtk_jpeg_variant mtk8195_jpegdec_drvdata = {
.out_q_default_fourcc = V4L2_PIX_FMT_JPEG,
.cap_q_default_fourcc = V4L2_PIX_FMT_YUV420M,
.multi_core = true,
+ .jpeg_worker = mtk_jpegdec_worker,
};
static const struct of_device_id mtk_jpeg_match[] = {
diff --git a/drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.h b/drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.h
index f87358cc9f47..e118a0175f75 100644
--- a/drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.h
+++ b/drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.h
@@ -61,6 +61,7 @@ enum mtk_jpeg_ctx_state {
* @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
+ * @jpeg_worker: jpeg dec or enc worker
*/
struct mtk_jpeg_variant {
struct clk_bulk_data *clks;
@@ -76,6 +77,7 @@ struct mtk_jpeg_variant {
u32 out_q_default_fourcc;
u32 cap_q_default_fourcc;
bool multi_core;
+ void (*jpeg_worker)(struct work_struct *work);
};
struct mtk_jpeg_src_buf {