Enable jpeg enc & dec multi-hardwares for MT8195
Subsystems (4)
PATCH v14 2/15 mtk-jpegenc: export jpeg encoder functions
In reply to Irui WangFrom: kyrie wu <[email protected]>
mtk jpeg encoder is built as a module, export some functions to make them visible by other modules.
--- drivers/media/platform/mediatek/jpeg/mtk_jpeg_enc_hw.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/media/platform/mediatek/jpeg/mtk_jpeg_enc_hw.c +7 -0
@@ -36,12 +36,14 @@ void mtk_jpeg_enc_reset(void __iomem *base)writel (JPEG_ENC_RESET_BIT , base +JPEG_ENC_RSTB );writel (0 , base +JPEG_ENC_CODEC_SEL ); } +EXPORT_SYMBOL_GPL (mtk_jpeg_enc_reset);u32 mtk_jpeg_enc_get_file_size (void __iomem *base) {return readl (base +JPEG_ENC_DMA_ADDR0 ) -readl (base +JPEG_ENC_DST_ADDR0 ); } +EXPORT_SYMBOL_GPL (mtk_jpeg_enc_get_file_size);void mtk_jpeg_enc_start (void __iomem *base) {
@@ -51,6 +53,7 @@ void mtk_jpeg_enc_start(void __iomem *base) value |=JPEG_ENC_CTRL_INT_EN_BIT |JPEG_ENC_CTRL_ENABLE_BIT ;writel (value, base +JPEG_ENC_CTRL ); } +EXPORT_SYMBOL_GPL (mtk_jpeg_enc_start);void mtk_jpeg_set_enc_src (struct mtk_jpeg_ctx *ctx,void __iomem *base,struct vb2_buffer *src_buf)
@@ -67,6 +70,7 @@ void mtk_jpeg_set_enc_src(struct mtk_jpeg_ctx *ctx, void __iomem *base,writel (dma_addr, base +JPEG_ENC_SRC_CHROMA_ADDR ); } } +EXPORT_SYMBOL_GPL (mtk_jpeg_set_enc_src);void mtk_jpeg_set_enc_dst (struct mtk_jpeg_ctx *ctx,void __iomem *base,struct vb2_buffer *dst_buf)
@@ -86,6 +90,7 @@ void mtk_jpeg_set_enc_dst(struct mtk_jpeg_ctx *ctx, void __iomem *base,writel (dma_addr & ~0xf , base +JPEG_ENC_DST_ADDR0 );writel ((dma_addr + size) & ~0xf , base +JPEG_ENC_STALL_ADDR0 ); } +EXPORT_SYMBOL_GPL (mtk_jpeg_set_enc_dst);void mtk_jpeg_set_enc_params (struct mtk_jpeg_ctx *ctx,void __iomem *base) {
@@ -152,3 +157,5 @@ void mtk_jpeg_set_enc_params(struct mtk_jpeg_ctx *ctx, void __iomem *base)writel (ctx->restart_interval, base +JPEG_ENC_RST_MCU_NUM ); } +EXPORT_SYMBOL_GPL (mtk_jpeg_set_enc_params); +
Signature · 1 line
2.18.0
PATCH v14 1/15 dt-bindings: mediatek: Add mediatek, mt8195-jpgenc compatible
In reply to Irui WangFrom: kyrie wu <[email protected]>
Add mediatek,mt8195-jpgenc compatible to binding document.
--- .../media/mediatek,mt8195-jpegenc.yaml | 147 ++++++++++++++++++ 1 file changed, 147 insertions(+) create mode 100644 Documentation/devicetree/bindings/media/mediatek,mt8195-jpegenc.yaml
Documentation/devicetree/bindings/media/mediatek,mt8195-jpegenc.yaml new file +147 -0
@@ -0,0 +1,147 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/media/mediatek,mt8195-jpegenc.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: MediaTek JPEG Encoder Device Tree Bindings + +maintainers: + - kyrie wu <[email protected]> + +description: + MediaTek JPEG Encoder is the JPEG encode hardware present in MediaTek SoCs + +properties: + compatible: + items: + - const: mediatek,mt8195-jpgenc + + power-domains: + maxItems: 1 + + iommus: + maxItems: 4 + description: + Points to the respective IOMMU block with master port as argument, see + Documentation/devicetree/bindings/iommu/mediatek,iommu.yaml for details. + Ports are according to the HW. + dma-ranges: + maxItems: 1 + description: | + Describes the physical address space of IOMMU maps to memory. + + "#address-cells": + const: 2 + + "#size-cells": + const: 2 + + ranges: true + +# Required child node: +patternProperties: + "^jpgenc@[0-9a-f]+$": + type: object + description: + The jpeg encoder hardware device node which should be added as subnodes to + the main jpeg node. + + properties: + compatible: + const: mediatek,mt8195-jpgenc-hw + + reg: + maxItems: 1 + + iommus: + minItems: 1 + maxItems: 32 + description: + List of the hardware port in respective IOMMU block for current Socs. + Refer to bindings/iommu/mediatek,iommu.yaml. + + interrupts: + maxItems: 1 + + clocks: + maxItems: 1 + + clock-names: + items: + - const: jpgenc + + power-domains: + maxItems: 1 + + required: + - compatible + - reg + - iommus + - interrupts + - clocks + - clock-names + - power-domains + + additionalProperties: false + +required: + - compatible + - power-domains + - iommus + - dma-ranges + - ranges + +additionalProperties: false + +examples: + - | + #include <dt-bindings/interrupt-controller/arm-gic.h> + #include <dt-bindings/memory/mt8195-memory-port.h> + #include <dt-bindings/interrupt-controller/irq.h> + #include <dt-bindings/clock/mt8195-clk.h> + #include <dt-bindings/power/mt8195-power.h> + + soc { + #address-cells = <2>; + #size-cells = <2>; + + jpgenc_master { + compatible = "mediatek,mt8195-jpgenc"; + power-domains = <&spm MT8195_POWER_DOMAIN_VENC_CORE1>; + iommus = <&iommu_vpp M4U_PORT_L20_JPGENC_Y_RDMA>, + <&iommu_vpp M4U_PORT_L20_JPGENC_C_RDMA>, + <&iommu_vpp M4U_PORT_L20_JPGENC_Q_TABLE>, + <&iommu_vpp M4U_PORT_L20_JPGENC_BSDMA>; + dma-ranges = <0x1 0x0 0x0 0x40000000 0x0 0xfff00000>; + #address-cells = <2>; + #size-cells = <2>; + ranges; + + jpgenc@1a030000 { + compatible = "mediatek,mt8195-jpgenc-hw"; + reg = <0 0x1a030000 0 0x10000>; + iommus = <&iommu_vdo M4U_PORT_L19_JPGENC_Y_RDMA>, + <&iommu_vdo M4U_PORT_L19_JPGENC_C_RDMA>, + <&iommu_vdo M4U_PORT_L19_JPGENC_Q_TABLE>, + <&iommu_vdo M4U_PORT_L19_JPGENC_BSDMA>; + interrupts = <GIC_SPI 342 IRQ_TYPE_LEVEL_HIGH 0>; + clocks = <&vencsys CLK_VENC_JPGENC>; + clock-names = "jpgenc"; + power-domains = <&spm MT8195_POWER_DOMAIN_VENC>; + }; + + jpgenc@1b030000 { + compatible = "mediatek,mt8195-jpgenc-hw"; + reg = <0 0x1b030000 0 0x10000>; + iommus = <&iommu_vpp M4U_PORT_L20_JPGENC_Y_RDMA>, + <&iommu_vpp M4U_PORT_L20_JPGENC_C_RDMA>, + <&iommu_vpp M4U_PORT_L20_JPGENC_Q_TABLE>, + <&iommu_vpp M4U_PORT_L20_JPGENC_BSDMA>; + interrupts = <GIC_SPI 347 IRQ_TYPE_LEVEL_HIGH 0>; + clocks = <&vencsys_core1 CLK_VENC_CORE1_JPGENC>; + clock-names = "jpgenc"; + power-domains = <&spm MT8195_POWER_DOMAIN_VENC_CORE1>; + }; + }; + };
Signature · 1 line
2.18.0
v14 cover Enable jpeg enc & dec multi-hardwares for MT8195
From: kyrie wu <[email protected]>
This series adds support for multi hardwares jpeg enc & dec, by first adding use of_platform_populate to manage each hardware information:interrupt, clock, register bases and power. Secondly add jpeg enc & dec work queue to deal with the encoding or decoding requests of multi-hardwares at the same time. Lastly, add output picture reorder function interface to eliminate the out of order images.
This series has been tested with MT8195 Gstreamer. Encoding and decoding worked for this chip.
Patches 1 Adds jpeg encoder dt-bindings for mt8195
Patches 2 jpeg encoder builds two module for using Multi-HW, export some functions to make them visible by other modules.
Patches 3 use devm_of_platform_populate to manage multi-hardware.
Patch 4 add jpeg encoding timeout function to judge hardware timeout.
Patch 5 add encoding work queue to deal with multi-hardware encoding at the same time.
Patch 6 add output picture reorder function to order images.
Patch 7 add stop cmd function to deal with EOS operation.
Patch 8 Adds jpeg decoder dt-bindings for mt8195
Patches 9 jpeg decoder builds three module for using Multi-HW, export some functions to make them visible by other modules.
Patch 10 use of_platform_populate to manage multi-hardware.
Patch 11 add jpeg decoding timeout function to judge hardware timeout.
Patch 12 add decoding work queue to deal with multi-hardware decoding at the same time.
Patch 13 add output picture reorder function to order images.
Patch 14 refactor jpegdec func interface for HW working.
Patch 15 add stop cmd function to deal with EOS operation.
---
This series patches dependent on:media_stage tree:
[1]
https://git.linuxtv.org/media_stage.git/commit/?id=b3627647f9ea7473d10fb08a95fd7c4133a17ca4
patch1 new jpegdec dt-bindings included files
[2] MM IOMMU binding:
https://patchwork.kernel.org/project/linux-mediatek/patch/[email protected]/
[3] MT8195 power domain:
https://patchwork.kernel.org/project/linux-mediatek/list/?series=580579
Changes compared with v13:
- some modifications for patch v13's review comments.
- fix kernel robot check errors.
- fix kernel-doc check warns.
- fix sparse check warns.
- combine jpeg encoder series with decoder series into one single series.
Changes compared with v12:
- some modifications for patch v12's review comments.
Changes compared with v11:
- some modifications for patch v11's review comments.
- fix yaml file check errors.
Changes compared with v10:
- some modifications for patch v10's review comments.
- fix Gstreamer test errors.
Changes compared with v9:
- some modifications for patch v9's review comments.
Changes compared with v8:
- some modifications for patch v8's review comments.
- add stop cmd function.
Changes compared with v7:
- some modifications for patch v6's review comments.
Changes compared with v6:
- new yaml file for mt8195 jpeg encoder.
- some modifications for patch v5's review comments.
Changes compared with v5:
- use of_platform_populate to replace component framework to manage multi-hardware in patch 2.
Changes compared with v4:
- No change compaered with v4
Changes compared with v3:
- Structure patches for consistency, non-backward compatible and do not break any existing functionality
Changes compared with v2:
- Split the last two patches into several patches
to enhance readability
- Correct some syntax errors
- Explain why the component framework is used
Changes compared with v1:
- Add jpeg encoder dt-bindings for MT8195
- Use component framework to manage jpegenc HW
- Add jpegenc output pic reorder function interface
kyrie wu (15):
dt-bindings: mediatek: Add mediatek, mt8195-jpgenc compatible
mtk-jpegenc: export jpeg encoder functions
mtk-jpegenc: support jpegenc multi-hardware
mtk-jpegenc: add jpegenc timeout func interface
mtk-jpegenc: add jpeg encode worker interface
mtk-jpegenc: add output pic reorder interface
mtk-jpegenc: add stop cmd interface for jpgenc
dt-bindings: mediatek: Add mediatek,mt8195-jpgdec compatible
media: mtk-jpegdec: export jpeg decoder functions
media: mtk-jpegdec: support jpegdec multi-hardware
media: mtk-jpegdec: add jpegdec timeout func interface
media: mtk-jpegdec: add jpeg decode worker interface
media: mtk-jpegdec: add output pic reorder interface
media: mtk-jpegdec: refactor jpegdec func interface
mtk-jpegdec: add stop cmd interface for jpgdec
.../media/mediatek,mt8195-jpegdec.yaml | 169 ++++++ .../media/mediatek,mt8195-jpegenc.yaml | 147 ++++++ drivers/media/platform/mediatek/jpeg/Makefile | 14 +- .../platform/mediatek/jpeg/mtk_jpeg_core.c | 490 ++++++++++++++++-- .../platform/mediatek/jpeg/mtk_jpeg_core.h | 169 +++++- .../platform/mediatek/jpeg/mtk_jpeg_dec_hw.c | 315 ++++++++++- .../platform/mediatek/jpeg/mtk_jpeg_dec_hw.h | 6 +- .../platform/mediatek/jpeg/mtk_jpeg_dec_reg.h | 1 + .../platform/mediatek/jpeg/mtk_jpeg_enc_hw.c | 255 +++++++++ 9 files changed, 1483 insertions(+), 83 deletions(-) create mode 100644 Documentation/devicetree/bindings/media/mediatek,mt8195-jpegdec.yaml create mode 100644 Documentation/devicetree/bindings/media/mediatek,mt8195-jpegenc.yaml
Signature · 1 line
2.18.0
PATCH v14 3/15 mtk-jpegenc: support jpegenc multi-hardware
From: kyrie wu <[email protected]>
support jpeg encode multi-hardware includes HW0 and HW1.
--- drivers/media/platform/mediatek/jpeg/Makefile | 11 +- .../platform/mediatek/jpeg/mtk_jpeg_core.c | 69 ++++---- .../platform/mediatek/jpeg/mtk_jpeg_core.h | 42 +++++ .../platform/mediatek/jpeg/mtk_jpeg_enc_hw.c | 160 ++++++++++++++++++ 4 files changed, 248 insertions(+), 34 deletions(-)
drivers/media/platform/mediatek/jpeg/Makefile +7 -4
@@ -1,6 +1,9 @@ # SPDX-License-Identifier: GPL-2.0-only -mtk_jpeg-objs := mtk_jpeg_core.o \ +obj-$(CONFIG_VIDEO_MEDIATEK_JPEG) += mtk_jpeg.o \ + mtk-jpeg-enc-hw.o + +mtk_jpeg-y := mtk_jpeg_core.o \ mtk_jpeg_dec_hw.o \ - mtk_jpeg_dec_parse.o \ - mtk_jpeg_enc_hw.o -obj-$(CONFIG_VIDEO_MEDIATEK_JPEG) += mtk_jpeg.o + mtk_jpeg_dec_parse.o + +mtk-jpeg-enc-hw-y := mtk_jpeg_enc_hw.o
drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.c +39 -30
115 lines not on this page · raw message
drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.h +42 -0
66 lines not on this page · raw message
drivers/media/platform/mediatek/jpeg/mtk_jpeg_enc_hw.c +160 -0
180 lines not on this page · raw message
Signature · 1 line
2.18.0
PATCH v14 4/15 mtk-jpegenc: add jpegenc timeout func interface
In reply to Irui WangFrom: kyrie wu <[email protected]>
Generalizes jpegenc timeout func interfaces to handle HW timeout.
--- .../platform/mediatek/jpeg/mtk_jpeg_core.h | 10 ++++++++ .../platform/mediatek/jpeg/mtk_jpeg_enc_hw.c | 25 +++++++++++++++++++ 2 files changed, 35 insertions(+)
drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.h +10 -0
@@ -75,6 +75,12 @@ struct mtk_jpeg_variant {u32 cap_q_default_fourcc; }; +struct mtk_jpeg_hw_param { +struct vb2_v4l2_buffer *src_buffer; +struct vb2_v4l2_buffer *dst_buffer; +struct mtk_jpeg_ctx *curr_ctx; +}; +enum mtk_jpegenc_hw_id {MTK_JPEGENC_HW0 ,MTK_JPEGENC_HW1 ,
@@ -99,6 +105,8 @@ struct mtk_jpegenc_clk {* @master_dev: mtk_jpeg_dev device * @venc_clk: jpeg encode clock * @jpegenc_irq: jpeg encode irq num +* @job_timeout_work: encode timeout workqueue +* @hw_param: jpeg encode hw parameters */ struct mtk_jpegenc_comp_dev {struct device *dev;
@@ -107,6 +115,8 @@ struct mtk_jpegenc_comp_dev {struct mtk_jpeg_dev *master_dev;struct mtk_jpegenc_clk venc_clk;int jpegenc_irq; +struct delayed_work job_timeout_work; +struct mtk_jpeg_hw_param hw_param; };/**
drivers/media/platform/mediatek/jpeg/mtk_jpeg_enc_hw.c +25 -0
@@ -185,6 +185,26 @@ void mtk_jpeg_set_enc_params(struct mtk_jpeg_ctx *ctx, void __iomem *base) }EXPORT_SYMBOL_GPL (mtk_jpeg_set_enc_params); +static void mtk_jpegenc_timeout_work (struct work_struct *work) +{ +struct delayed_work *dly_work =to_delayed_work (work); +struct mtk_jpegenc_comp_dev *cjpeg = +container_of (dly_work, + struct mtk_jpegenc_comp_dev, + job_timeout_work); +enum vb2_buffer_state buf_state =VB2_BUF_STATE_ERROR ; +struct vb2_v4l2_buffer *src_buf, *dst_buf; + + src_buf = cjpeg->hw_param.src_buffer; + dst_buf = cjpeg->hw_param.dst_buffer; +v4l2_m2m_buf_copy_metadata (src_buf, dst_buf, true); + +mtk_jpeg_enc_reset (cjpeg->reg_base); +clk_disable_unprepare (cjpeg->venc_clk.clks->clk); +pm_runtime_put (cjpeg->dev); +v4l2_m2m_buf_done (src_buf, buf_state); +} +static irqreturn_t mtk_jpegenc_hw_irq_handler (int irq,void *priv) {struct vb2_v4l2_buffer *src_buf, *dst_buf;
@@ -196,6 +216,8 @@ static irqreturn_t mtk_jpegenc_hw_irq_handler(int irq, void *priv)struct mtk_jpegenc_comp_dev *jpeg = priv;struct mtk_jpeg_dev *master_jpeg = jpeg->master_dev; +cancel_delayed_work (&jpeg->job_timeout_work); + irq_status =readl (jpeg->reg_base +JPEG_ENC_INT_STS ) &JPEG_ENC_INT_STATUS_MASK_ALLIRQ ;if (irq_status)
@@ -276,6 +298,9 @@ static int mtk_jpegenc_hw_probe(struct platform_device *pdev) master_dev->enc_hw_dev[i] =NULL ; } +INIT_DELAYED_WORK (&dev->job_timeout_work, + mtk_jpegenc_timeout_work); + jpegenc_clk = &dev->venc_clk; jpegenc_clk->clk_num = devm_clk_bulk_get_all(&pdev->dev,
Signature · 1 line
2.18.0
PATCH v14 5/15 mtk-jpegenc: add jpeg encode worker interface
In reply to Irui WangFrom: kyrie wu <[email protected]>
Add jpeg encoding worker to ensure that two HWs
run in parallel in MT8195.
--- .../platform/mediatek/jpeg/mtk_jpeg_core.c | 183 +++++++++++++++++- .../platform/mediatek/jpeg/mtk_jpeg_core.h | 20 ++ .../platform/mediatek/jpeg/mtk_jpeg_enc_hw.c | 42 ++-- 3 files changed, 232 insertions(+), 13 deletions(-)
drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.c +182 -1
@@ -104,11 +104,20 @@ static struct mtk_jpeg_fmt mtk_jpeg_dec_formats[] = {#define MTK_JPEG_ENC_NUM_FORMATS ARRAY_SIZE(mtk_jpeg_enc_formats)#define MTK_JPEG_DEC_NUM_FORMATS ARRAY_SIZE(mtk_jpeg_dec_formats) +#define MTK_JPEG_MAX_RETRY_TIME 5000 + +enum { +MTK_JPEG_BUF_FLAGS_INIT =0 , +MTK_JPEG_BUF_FLAGS_LAST_FRAME =1 , +};struct mtk_jpeg_src_buf { +u32 frame_num;struct vb2_v4l2_buffer b;struct list_head list;struct mtk_jpeg_dec_param dec_param; + +struct mtk_jpeg_ctx *curr_ctx; };static int debug;
@@ -907,6 +916,148 @@ static int mtk_jpeg_set_dec_dst(struct mtk_jpeg_ctx *ctx,return 0 ; } +static int mtk_jpegenc_get_hw (struct mtk_jpeg_ctx *ctx) +{ +struct mtk_jpegenc_comp_dev *comp_jpeg; +struct mtk_jpeg_dev *jpeg = ctx->jpeg; +unsigned long flags; +int hw_id =-1 ; +int i; + +spin_lock_irqsave (&jpeg->hw_lock, flags); +for (i =0 ; i <MTK_JPEGENC_HW_MAX ; i++) { + comp_jpeg = jpeg->enc_hw_dev[i]; +if (comp_jpeg->hw_state ==MTK_JPEG_HW_IDLE ) { + hw_id = i; + comp_jpeg->hw_state =MTK_JPEG_HW_BUSY ; +break ; + } + } +spin_unlock_irqrestore (&jpeg->hw_lock, flags); + +return hw_id; +} + +static int mtk_jpegenc_set_hw_param (struct mtk_jpeg_ctx *ctx, +int hw_id, +struct vb2_v4l2_buffer *src_buf, +struct vb2_v4l2_buffer *dst_buf) +{ +struct mtk_jpegenc_comp_dev *jpeg = ctx->jpeg->enc_hw_dev[hw_id]; + + jpeg->hw_param.curr_ctx = ctx; + jpeg->hw_param.src_buffer = src_buf; + jpeg->hw_param.dst_buffer = dst_buf; + +return 0 ; +} + +static int mtk_jpegenc_put_hw (struct mtk_jpeg_dev *jpeg,int hw_id) +{ +unsigned long flags; + +spin_lock_irqsave (&jpeg->hw_lock, flags); + jpeg->enc_hw_dev[hw_id]->hw_state =MTK_JPEG_HW_IDLE ; +spin_unlock_irqrestore (&jpeg->hw_lock, flags); + +return 0 ; +} + +static void mtk_jpegenc_worker (struct work_struct *work) +{ +struct mtk_jpegenc_comp_dev *comp_jpeg[MTK_JPEGENC_HW_MAX ]; +enum vb2_buffer_state buf_state =VB2_BUF_STATE_ERROR ; +struct mtk_jpeg_src_buf *jpeg_dst_buf; +struct vb2_v4l2_buffer *src_buf, *dst_buf; +int ret, i, hw_id =0 ; +unsigned long flags; + +struct mtk_jpeg_ctx *ctx =container_of (work, + struct mtk_jpeg_ctx, + jpeg_work); +struct mtk_jpeg_dev *jpeg = ctx->jpeg; + +for (i =0 ; i <MTK_JPEGENC_HW_MAX ; i++) + comp_jpeg[i] = jpeg->enc_hw_dev[i]; + i =0 ; + +retry_select: + hw_id =mtk_jpegenc_get_hw (ctx); +if (hw_id <0 ) { + ret =wait_event_interruptible (jpeg->enc_hw_wq, +atomic_read (&jpeg->enchw_rdy) >0 ); +if (ret !=0 || (i++ >MTK_JPEG_MAX_RETRY_TIME )) { +dev_err (jpeg->dev,"%s : %d, all HW are busy\n" , + __func__, __LINE__); +v4l2_m2m_job_finish (jpeg->m2m_dev, ctx->fh.m2m_ctx); +return ; + } + + goto retry_select; + } + +atomic_dec (&jpeg->enchw_rdy); + src_buf =v4l2_m2m_next_src_buf (ctx->fh.m2m_ctx); +if (!src_buf) + goto getbuf_fail; + + dst_buf =v4l2_m2m_next_dst_buf (ctx->fh.m2m_ctx); +if (!dst_buf) + goto getbuf_fail; + +v4l2_m2m_src_buf_remove (ctx->fh.m2m_ctx); +v4l2_m2m_dst_buf_remove (ctx->fh.m2m_ctx); + +v4l2_m2m_buf_copy_metadata (src_buf, dst_buf, true); + +mtk_jpegenc_set_hw_param (ctx, hw_id, src_buf, dst_buf); + ret =pm_runtime_get_sync (comp_jpeg[hw_id]->dev); +if (ret <0 ) { +dev_err (jpeg->dev,"%s : %d, pm_runtime_get_sync fail !!!\n" , + __func__, __LINE__); + goto enc_end; + } + + ret =clk_prepare_enable (comp_jpeg[hw_id]->venc_clk.clks->clk); +if (ret) { +dev_err (jpeg->dev,"%s : %d, jpegenc clk_prepare_enable fail\n" , + __func__, __LINE__); + goto enc_end; + } + +schedule_delayed_work (&comp_jpeg[hw_id]->job_timeout_work, +msecs_to_jiffies (MTK_JPEG_HW_TIMEOUT_MSEC )); + +spin_lock_irqsave (&comp_jpeg[hw_id]->hw_lock, flags); + jpeg_dst_buf =mtk_jpeg_vb2_to_srcbuf (&dst_buf->vb2_buf); + jpeg_dst_buf->curr_ctx = ctx; + jpeg_dst_buf->frame_num = ctx->total_frame_num; + ctx->total_frame_num++; +mtk_jpeg_enc_reset (comp_jpeg[hw_id]->reg_base); +mtk_jpeg_set_enc_dst (ctx, + comp_jpeg[hw_id]->reg_base, + &dst_buf->vb2_buf); +mtk_jpeg_set_enc_src (ctx, + comp_jpeg[hw_id]->reg_base, + &src_buf->vb2_buf); +mtk_jpeg_set_enc_params (ctx, comp_jpeg[hw_id]->reg_base); +mtk_jpeg_enc_start (comp_jpeg[hw_id]->reg_base); +v4l2_m2m_job_finish (jpeg->m2m_dev, ctx->fh.m2m_ctx); +spin_unlock_irqrestore (&comp_jpeg[hw_id]->hw_lock, flags); + +return ; + +enc_end: +v4l2_m2m_src_buf_remove (ctx->fh.m2m_ctx); +v4l2_m2m_dst_buf_remove (ctx->fh.m2m_ctx); +v4l2_m2m_buf_done (src_buf, buf_state); +v4l2_m2m_buf_done (dst_buf, buf_state); +getbuf_fail: +atomic_inc (&jpeg->enchw_rdy); +mtk_jpegenc_put_hw (jpeg, hw_id); +v4l2_m2m_job_finish (jpeg->m2m_dev, ctx->fh.m2m_ctx); +} +static void mtk_jpeg_enc_device_run (void *priv) {struct mtk_jpeg_ctx *ctx = priv;
@@ -924,7 +1075,7 @@ static void mtk_jpeg_enc_device_run(void *priv) goto enc_end;schedule_delayed_work (&jpeg->job_timeout_work, -msecs_to_jiffies (MTK_JPEG_HW_TIMEOUT_MSEC )); +msecs_to_jiffies (MTK_JPEG_HW_TIMEOUT_MSEC ));spin_lock_irqsave (&jpeg->hw_lock, flags);
@@ -949,6 +1100,14 @@ static void mtk_jpeg_enc_device_run(void *priv)v4l2_m2m_job_finish (jpeg->m2m_dev, ctx->fh.m2m_ctx); } +static void mtk_jpeg_multicore_enc_device_run (void *priv) +{ +struct mtk_jpeg_ctx *ctx = priv; +struct mtk_jpeg_dev *jpeg = ctx->jpeg; + +queue_work (jpeg->workqueue, &ctx->jpeg_work); +} +static void mtk_jpeg_dec_device_run (void *priv) {struct mtk_jpeg_ctx *ctx = priv;
@@ -1011,6 +1170,10 @@ static const struct v4l2_m2m_ops mtk_jpeg_enc_m2m_ops = { .device_run = mtk_jpeg_enc_device_run, }; +static const struct v4l2_m2m_ops mtk_jpeg_multicore_enc_m2m_ops = { + .device_run = mtk_jpeg_multicore_enc_device_run, +}; +static const struct v4l2_m2m_ops mtk_jpeg_dec_m2m_ops = { .device_run = mtk_jpeg_dec_device_run, .job_ready = mtk_jpeg_dec_job_ready,
@@ -1211,6 +1374,9 @@ static int mtk_jpeg_open(struct file *file) goto free; } +if (jpeg->is_jpgenc_multihw) +INIT_WORK (&ctx->jpeg_work, mtk_jpegenc_worker); +v4l2_fh_init (&ctx->fh, vfd); file->private_data = &ctx->fh;v4l2_fh_add (&ctx->fh);
@@ -1504,6 +1670,17 @@ static const struct mtk_jpeg_variant mtk_jpeg_drvdata = { .cap_q_default_fourcc = V4L2_PIX_FMT_JPEG, }; +static struct mtk_jpeg_variant mtk8195_jpegenc_drvdata = { + .formats = mtk_jpeg_enc_formats, + .num_formats =MTK_JPEG_ENC_NUM_FORMATS , + .qops = &mtk_jpeg_enc_qops, + .m2m_ops = &mtk_jpeg_multicore_enc_m2m_ops, + .dev_name ="mtk-jpeg-enc" , + .ioctl_ops = &mtk_jpeg_enc_ioctl_ops, + .out_q_default_fourcc =V4L2_PIX_FMT_YUYV , + .cap_q_default_fourcc =V4L2_PIX_FMT_JPEG , +}; + #if defined(CONFIG_OF) static const struct of_device_id mtk_jpeg_match[] = { {
@@ -1518,6 +1695,10 @@ static const struct of_device_id mtk_jpeg_match[] = { .compatible = "mediatek,mtk-jpgenc", .data = &mtk_jpeg_drvdata, }, + { + .compatible = "mediatek,mt8195-jpgenc", + .data = &mtk8195_jpegenc_drvdata, + }, {}, };
drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.h +20 -0
@@ -75,6 +75,11 @@ struct mtk_jpeg_variant {u32 cap_q_default_fourcc; }; +enum mtk_jpeg_hw_state { +MTK_JPEG_HW_IDLE =0 , +MTK_JPEG_HW_BUSY =1 , +}; +struct mtk_jpeg_hw_param {struct vb2_v4l2_buffer *src_buffer;struct vb2_v4l2_buffer *dst_buffer;
@@ -107,6 +112,9 @@ struct mtk_jpegenc_clk {* @jpegenc_irq: jpeg encode irq num * @job_timeout_work: encode timeout workqueue * @hw_param: jpeg encode hw parameters +* @hw_rdy: record hw ready +* @hw_state: record hw state +* @hw_lock: spinlock protecting the hw device resource */ struct mtk_jpegenc_comp_dev {struct device *dev;
@@ -117,6 +125,9 @@ struct mtk_jpegenc_comp_dev {int jpegenc_irq;struct delayed_work job_timeout_work;struct mtk_jpeg_hw_param hw_param; +enum mtk_jpeg_hw_state hw_state; +/* spinlock protecting the hw device resource */ +spinlock_t hw_lock; };/**
@@ -135,6 +146,8 @@ struct mtk_jpegenc_comp_dev {* @reg_encbase: jpg encode register base addr * @enc_hw_dev: jpg encode hardware device * @is_jpgenc_multihw: the flag of multi-hw core +* @enc_hw_wq: jpg encode wait queue +* @enchw_rdy: jpg encode hw ready flag */ struct mtk_jpeg_dev {struct mutex lock;
@@ -152,6 +165,8 @@ struct mtk_jpeg_dev {void __iomem *reg_encbase[MTK_JPEGENC_HW_MAX ];struct mtk_jpegenc_comp_dev *enc_hw_dev[MTK_JPEGENC_HW_MAX ];bool is_jpgenc_multihw; +wait_queue_head_t enc_hw_wq; +atomic_t enchw_rdy; };/**
@@ -199,6 +214,8 @@ struct mtk_jpeg_q_data {* @enc_quality: jpeg encoder quality * @restart_interval: jpeg encoder restart interval * @ctrl_hdl: controls handler +* @jpeg_work: jpeg encoder workqueue +* @total_frame_num: encoded frame number */ struct mtk_jpeg_ctx {struct mtk_jpeg_dev *jpeg;
@@ -210,6 +227,9 @@ struct mtk_jpeg_ctx {u8 enc_quality;u8 restart_interval;struct v4l2_ctrl_handler ctrl_hdl; + +struct work_struct jpeg_work; + u32 total_frame_num; };#endif /* _MTK_JPEG_CORE_H */
drivers/media/platform/mediatek/jpeg/mtk_jpeg_enc_hw.c +30 -12
80 lines not on this page · raw message
Signature · 1 line
2.18.0
PATCH v14 6/15 mtk-jpegenc: add output pic reorder interface
In reply to Irui WangFrom: kyrie wu <[email protected]>
There are two HWs in mt8195. Since the two HWs run in parallel, it is necessary to reorder the output images to ensure that the order is consistent with the input images.
--- .../platform/mediatek/jpeg/mtk_jpeg_core.c | 11 +---- .../platform/mediatek/jpeg/mtk_jpeg_core.h | 43 ++++++++++++----- .../platform/mediatek/jpeg/mtk_jpeg_dec_hw.c | 1 + .../platform/mediatek/jpeg/mtk_jpeg_dec_hw.h | 3 +- .../platform/mediatek/jpeg/mtk_jpeg_enc_hw.c | 47 ++++++++++++++++++- 5 files changed, 81 insertions(+), 24 deletions(-)
drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.c +2 -9
@@ -111,15 +111,6 @@ enum { MTK_JPEG_BUF_FLAGS_LAST_FRAME = 1, }; -struct mtk_jpeg_src_buf { -u32 frame_num; -struct vb2_v4l2_buffer b; -struct list_head list; -struct mtk_jpeg_dec_param dec_param; - -struct mtk_jpeg_ctx *curr_ctx; -}; -static int debug;module_param (debug, int,0644 );
@@ -1377,6 +1368,8 @@ static int mtk_jpeg_open(struct file *file)if (jpeg->is_jpgenc_multihw)INIT_WORK (&ctx->jpeg_work, mtk_jpegenc_worker); +INIT_LIST_HEAD (&ctx->dst_done_queue); +spin_lock_init (&ctx->done_queue_lock);v4l2_fh_init (&ctx->fh, vfd); file->private_data = &ctx->fh;v4l2_fh_add (&ctx->fh);
drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.h +30 -13
69 lines not on this page · raw message
drivers/media/platform/mediatek/jpeg/mtk_jpeg_dec_hw.c +1 -0
@@ -9,6 +9,7 @@#include <linux/kernel.h> #include <media/videobuf2-core.h> +#include "mtk_jpeg_core.h" #include "mtk_jpeg_dec_hw.h" #define MTK_JPEG_DUNUM_MASK (val) (((val) - 1) & 0x3)
drivers/media/platform/mediatek/jpeg/mtk_jpeg_dec_hw.h +2 -1
@@ -11,9 +11,10 @@#include <media/videobuf2-core.h> -#include "mtk_jpeg_core.h" #include "mtk_jpeg_dec_reg.h" +#define MTK_JPEG_COMP_MAX 3 +enum {MTK_JPEG_DEC_RESULT_EOF_DONE =0 ,MTK_JPEG_DEC_RESULT_PAUSE =1 ,
drivers/media/platform/mediatek/jpeg/mtk_jpeg_enc_hw.c +46 -1
65 lines not on this page · raw message
Signature · 1 line
2.18.0
PATCH v14 9/15 media: mtk-jpegdec: export jpeg decoder functions
In reply to Irui WangFrom: kyrie wu <[email protected]>
mtk jpeg decoder is built as a module, export some functions to make them visible by other modules.
--- drivers/media/platform/mediatek/jpeg/mtk_jpeg_dec_hw.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/media/platform/mediatek/jpeg/mtk_jpeg_dec_hw.c +6 -0
@@ -189,6 +189,7 @@ int mtk_jpeg_dec_fill_param(struct mtk_jpeg_dec_param *param)return 0 ; } +EXPORT_SYMBOL_GPL (mtk_jpeg_dec_fill_param);u32 mtk_jpeg_dec_get_int_status (void __iomem *base) {
@@ -200,6 +201,7 @@ u32 mtk_jpeg_dec_get_int_status(void __iomem *base)return ret; } +EXPORT_SYMBOL_GPL (mtk_jpeg_dec_get_int_status);u32 mtk_jpeg_dec_enum_result (u32 irq_result) {
@@ -216,11 +218,13 @@ u32 mtk_jpeg_dec_enum_result(u32 irq_result)return MTK_JPEG_DEC_RESULT_ERROR_UNKNOWN ; } +EXPORT_SYMBOL_GPL (mtk_jpeg_dec_enum_result);void mtk_jpeg_dec_start (void __iomem *base) {writel (0 , base +JPGDEC_REG_TRIG ); } +EXPORT_SYMBOL_GPL (mtk_jpeg_dec_start);static void mtk_jpeg_dec_soft_reset (void __iomem *base) {
@@ -240,6 +244,7 @@ void mtk_jpeg_dec_reset(void __iomem *base)mtk_jpeg_dec_soft_reset (base);mtk_jpeg_dec_hard_reset (base); } +EXPORT_SYMBOL_GPL (mtk_jpeg_dec_reset);static void mtk_jpeg_dec_set_brz_factor (void __iomem *base,u8 yscale_w,u8 yscale_h,u8 uvscale_w,u8 uvscale_h)
@@ -408,3 +413,4 @@ void mtk_jpeg_dec_set_config(void __iomem *base, config->dma_last_mcu);mtk_jpeg_dec_set_pause_mcu_idx (base, config->total_mcu); } +EXPORT_SYMBOL_GPL (mtk_jpeg_dec_set_config);
Signature · 1 line
2.18.0
PATCH v14 8/15 dt-bindings: mediatek: Add mediatek,mt8195-jpgdec compatible
In reply to Irui WangFrom: kyrie wu <[email protected]>
Add mediatek,mt8195-jpgdec compatible to binding document.
--- .../media/mediatek,mt8195-jpegdec.yaml | 169 ++++++++++++++++++ 1 file changed, 169 insertions(+) create mode 100644 Documentation/devicetree/bindings/media/mediatek,mt8195-jpegdec.yaml
Documentation/devicetree/bindings/media/mediatek,mt8195-jpegdec.yaml new file +169 -0
@@ -0,0 +1,169 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/media/mediatek,mt8195-jpegdec.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: MediaTek JPEG Encoder Device Tree Bindings + +maintainers: + - kyrie wu <[email protected]> + +description: + MediaTek JPEG Decoder is the JPEG decode hardware present in MediaTek SoCs + +properties: + compatible: + items: + - const: mediatek,mt8195-jpgdec + + power-domains: + maxItems: 1 + + iommus: + maxItems: 6 + description: + Points to the respective IOMMU block with master port as argument, see + Documentation/devicetree/bindings/iommu/mediatek,iommu.yaml for details. + Ports are according to the HW. + + dma-ranges: + maxItems: 1 + description: | + Describes the physical address space of IOMMU maps to memory. + + "#address-cells": + const: 2 + + "#size-cells": + const: 2 + + ranges: true + +# Required child node: +patternProperties: + "^jpgdec@[0-9a-f]+$": + type: object + description: + The jpeg decoder hardware device node which should be added as subnodes to + the main jpeg node. + + properties: + compatible: + const: mediatek,mt8195-jpgdec-hw + + reg: + maxItems: 1 + + iommus: + minItems: 1 + maxItems: 32 + description: + List of the hardware port in respective IOMMU block for current Socs. + Refer to bindings/iommu/mediatek,iommu.yaml. + + interrupts: + maxItems: 1 + + clocks: + maxItems: 1 + + clock-names: + items: + - const: jpgdec + + power-domains: + maxItems: 1 + + required: + - compatible + - reg + - iommus + - interrupts + - clocks + - clock-names + - power-domains + + additionalProperties: false + +required: + - compatible + - power-domains + - iommus + - dma-ranges + - ranges + +additionalProperties: false + +examples: + - | + #include <dt-bindings/interrupt-controller/arm-gic.h> + #include <dt-bindings/memory/mt8195-memory-port.h> + #include <dt-bindings/interrupt-controller/irq.h> + #include <dt-bindings/clock/mt8195-clk.h> + #include <dt-bindings/power/mt8195-power.h> + + soc { + #address-cells = <2>; + #size-cells = <2>; + + jpgdec_master { + compatible = "mediatek,mt8195-jpgdec"; + power-domains = <&spm MT8195_POWER_DOMAIN_VDEC1>; + iommus = <&iommu_vpp M4U_PORT_L19_JPGDEC_WDMA0>, + <&iommu_vpp M4U_PORT_L19_JPGDEC_BSDMA0>, + <&iommu_vpp M4U_PORT_L19_JPGDEC_WDMA1>, + <&iommu_vpp M4U_PORT_L19_JPGDEC_BSDMA1>, + <&iommu_vpp M4U_PORT_L19_JPGDEC_BUFF_OFFSET1>, + <&iommu_vpp M4U_PORT_L19_JPGDEC_BUFF_OFFSET0>; + dma-ranges = <0x1 0x0 0x0 0x40000000 0x0 0xfff00000>; + #address-cells = <2>; + #size-cells = <2>; + ranges; + + jpgdec@1a040000 { + compatible = "mediatek,mt8195-jpgdec-hw"; + reg = <0 0x1a040000 0 0x10000>;/* JPGDEC_C0 */ + iommus = <&iommu_vdo M4U_PORT_L19_JPGDEC_WDMA0>, + <&iommu_vdo M4U_PORT_L19_JPGDEC_BSDMA0>, + <&iommu_vdo M4U_PORT_L19_JPGDEC_WDMA1>, + <&iommu_vdo M4U_PORT_L19_JPGDEC_BSDMA1>, + <&iommu_vdo M4U_PORT_L19_JPGDEC_BUFF_OFFSET1>, + <&iommu_vdo M4U_PORT_L19_JPGDEC_BUFF_OFFSET0>; + interrupts = <GIC_SPI 343 IRQ_TYPE_LEVEL_HIGH 0>; + clocks = <&vencsys CLK_VENC_JPGDEC>; + clock-names = "jpgdec"; + power-domains = <&spm MT8195_POWER_DOMAIN_VDEC0>; + }; + + jpgdec@1a050000 { + compatible = "mediatek,mt8195-jpgdec-hw"; + reg = <0 0x1a050000 0 0x10000>;/* JPGDEC_C1 */ + iommus = <&iommu_vdo M4U_PORT_L19_JPGDEC_WDMA0>, + <&iommu_vdo M4U_PORT_L19_JPGDEC_BSDMA0>, + <&iommu_vdo M4U_PORT_L19_JPGDEC_WDMA1>, + <&iommu_vdo M4U_PORT_L19_JPGDEC_BSDMA1>, + <&iommu_vdo M4U_PORT_L19_JPGDEC_BUFF_OFFSET1>, + <&iommu_vdo M4U_PORT_L19_JPGDEC_BUFF_OFFSET0>; + interrupts = <GIC_SPI 344 IRQ_TYPE_LEVEL_HIGH 0>; + clocks = <&vencsys CLK_VENC_JPGDEC_C1>; + clock-names = "jpgdec"; + power-domains = <&spm MT8195_POWER_DOMAIN_VDEC1>; + }; + + jpgdec@1b040000 { + compatible = "mediatek,mt8195-jpgdec-hw"; + reg = <0 0x1b040000 0 0x10000>;/* JPGDEC_C2 */ + iommus = <&iommu_vpp M4U_PORT_L20_JPGDEC_WDMA0>, + <&iommu_vpp M4U_PORT_L20_JPGDEC_BSDMA0>, + <&iommu_vpp M4U_PORT_L20_JPGDEC_WDMA1>, + <&iommu_vpp M4U_PORT_L20_JPGDEC_BSDMA1>, + <&iommu_vpp M4U_PORT_L20_JPGDEC_BUFF_OFFSET1>, + <&iommu_vpp M4U_PORT_L20_JPGDEC_BUFF_OFFSET0>; + interrupts = <GIC_SPI 348 IRQ_TYPE_LEVEL_HIGH 0>; + clocks = <&vencsys_core1 CLK_VENC_CORE1_JPGDEC>; + clock-names = "jpgdec"; + power-domains = <&spm MT8195_POWER_DOMAIN_VDEC2>; + }; + }; + };
Signature · 1 line
2.18.0
PATCH v14 7/15 mtk-jpegenc: add stop cmd interface for jpgenc
In reply to Irui WangFrom: kyrie wu <[email protected]>
Add stop cmd interface for jpgenc to stop stream
--- drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.c +4 -0
@@ -613,6 +613,9 @@ static const struct v4l2_ioctl_ops mtk_jpeg_enc_ioctl_ops = { .vidioc_streamoff = v4l2_m2m_ioctl_streamoff, .vidioc_unsubscribe_event = v4l2_event_unsubscribe, + + .vidioc_encoder_cmd = v4l2_m2m_ioctl_encoder_cmd, + .vidioc_try_encoder_cmd = v4l2_m2m_ioctl_try_encoder_cmd, };static const struct v4l2_ioctl_ops mtk_jpeg_dec_ioctl_ops = {
@@ -1391,6 +1394,7 @@ static int mtk_jpeg_open(struct file *file) }else {v4l2_ctrl_handler_init (&ctx->ctrl_hdl,0 ); } +mtk_jpeg_set_default_params (ctx);mutex_unlock (&jpeg->lock);return 0 ;
Signature · 1 line
2.18.0
AngeloGioacchino Del Regno
maintainerIl 15/09/22 08:43, Irui Wang ha scritto:
Quoted 10 lines
From: kyrie wu <[email protected]>
This series adds support for multi hardwares jpeg enc & dec, by first adding use
of_platform_populateto manage each hardware information:interrupt, clock, register bases and power. Secondly add jpeg enc & dec work queue to deal with the encoding or decoding requests of multi-hardwares at the same time. Lastly, add output picture reorder function interface to eliminate the out of order images.
Quoted 3 lines
This series has been tested with MT8195 Gstreamer. Encoding and decoding worked for this chip.
Hello Irui,
I may have lost some piece of conversation on v13, but as far as I can see, both series, jpeg ENC+DEC were picked by Hans [1].
If you have further improvements to that, you should make new commits and not a new version for the series. Please look at Hans' media tree at [1].
Regards,
Angelo
[1]: https://git.linuxtv.org/hverkuil/media_tree.git/log/?h=for-v6.1n
Quoted 10 lines · Irui Wang
From: kyrie wu <[email protected]>
This series adds support for multi hardwares jpeg enc & dec, by first adding use
of_platform_populateto manage each hardware information:interrupt, clock, register bases and power. Secondly add jpeg enc & dec work queue to deal with the encoding or decoding requests of multi-hardwares at the same time. Lastly, add output picture reorder function interface to eliminate the out of order images.
Quoted 2 lines
This series has been tested with MT8195 Gstreamer. Encoding and decoding worked for this chip.
Hi Hans,
I'm terrible sorry for that I didn't notice you picked all patches series includes jpeg enc + dec.
Please overlook the V14 and I will send a new series to fix kernel-doc warns.
Thanks.
Regards,
Kyrie.
Quoted 32 lines
Patches 1 Adds jpeg encoder dt-bindings for mt8195
Patches 2 jpeg encoder builds two module for using Multi-HW, export some functions to make them visible by other modules.
Patches 3 use
devm_of_platform_populateto manage multi-hardware.Patch 4 add jpeg encoding timeout function to judge hardware timeout.
Patch 5 add encoding work queue to deal with multi-hardware encoding at the same time.
Patch 6 add output picture reorder function to order images.
Patch 7 add stop cmd function to deal with EOS operation.
Patch 8 Adds jpeg decoder dt-bindings for mt8195
Patches 9 jpeg decoder builds three module for using Multi-HW, export some functions to make them visible by other modules.
Patch 10 use
of_platform_populateto manage multi-hardware.Patch 11 add jpeg decoding timeout function to judge hardware timeout.
Patch 12 add decoding work queue to deal with multi-hardware decoding at the same time.
Patch 13 add output picture reorder function to order images.
Quoted 9 lines
Patch 14 refactor jpegdec func interface for HW working.
Patch 15 add stop cmd function to deal with EOS operation.
---
This series patches dependent on:media_stagetree:
[1]
https://git.linuxtv.org/media_stage.git/commit/?id=b3627647f9ea7473d10fb08a95fd7c4133a17ca4
Quoted 4 lines
patch1 new jpegdec dt-bindings included files
[2] MM IOMMU binding:
https://patchwork.kernel.org/project/linux-mediatek/patch/[email protected]/
Quoted 3 lines
[3] MT8195 power domain:
https://patchwork.kernel.org/project/linux-mediatek/list/?series=580579
Quoted 89 lines
Changes compared with v13:
- some modifications for patch v13's review comments.
- fix kernel robot check errors.
- fix kernel-doc check warns.
- fix sparse check warns.
- combine jpeg encoder series with decoder series into one single series.Changes compared with v12:
- some modifications for patch v12's review comments.Changes compared with v11:
- some modifications for patch v11's review comments.
- fix yaml file check errors.Changes compared with v10:
- some modifications for patch v10's review comments.
- fix Gstreamer test errors.Changes compared with v9:
- some modifications for patch v9's review comments.Changes compared with v8:
- some modifications for patch v8's review comments.
- add stop cmd function.Changes compared with v7:
- some modifications for patch v6's review comments.Changes compared with v6:
- new yaml file for mt8195 jpeg encoder.
- some modifications for patch v5's review comments.Changes compared with v5:
- useof_platform_populateto replace component framework to manage multi-hardware in patch 2.Changes compared with v4:
- No change compaered with v4Changes compared with v3:
- Structure patches for consistency, non-backward compatible and do not break any existing functionalityChanges compared with v2:
- Split the last two patches into several patches
to enhance readability
- Correct some syntax errors
- Explain why the component framework is usedChanges compared with v1:
- Add jpeg encoder dt-bindings for MT8195
- Use component framework to manage jpegenc HW
- Add jpegenc output pic reorder function interfacekyrie wu (15):
dt-bindings: mediatek: Add mediatek, mt8195-jpgenc compatible
mtk-jpegenc: export jpeg encoder functions
mtk-jpegenc: support jpegenc multi-hardware
mtk-jpegenc: add jpegenc timeout func interface
mtk-jpegenc: add jpeg encode worker interface
mtk-jpegenc: add output pic reorder interface
mtk-jpegenc: add stop cmd interface for jpgenc
dt-bindings: mediatek: Add mediatek,mt8195-jpgdec compatible
media: mtk-jpegdec: export jpeg decoder functions
media: mtk-jpegdec: support jpegdec multi-hardware
media: mtk-jpegdec: add jpegdec timeout func interface
media: mtk-jpegdec: add jpeg decode worker interface
media: mtk-jpegdec: add output pic reorder interface
media: mtk-jpegdec: refactor jpegdec func interface
mtk-jpegdec: add stop cmd interface for jpgdec.../media/mediatek,mt8195-jpegdec.yaml | 169 ++++++ .../media/mediatek,mt8195-jpegenc.yaml | 147 ++++++ drivers/media/platform/mediatek/jpeg/Makefile | 14 +- .../platform/mediatek/jpeg/mtk_jpeg_core.c | 490 ++++++++++++++++-- .../platform/mediatek/jpeg/mtk_jpeg_core.h | 169 +++++- .../platform/mediatek/jpeg/mtk_jpeg_dec_hw.c | 315 ++++++++++- .../platform/mediatek/jpeg/mtk_jpeg_dec_hw.h | 6 +- .../platform/mediatek/jpeg/mtk_jpeg_dec_reg.h | 1 + .../platform/mediatek/jpeg/mtk_jpeg_enc_hw.c | 255 +++++++++ 9 files changed, 1483 insertions(+), 83 deletions(-) create mode 100644 Documentation/devicetree/bindings/media/mediatek,mt8195-jpegdec.yaml create mode 100644
Documentation/devicetree/bindings/media/mediatek,mt8195-jpegenc.yaml
Hi Irui,
Quoted 14 lines · kyrie.wu
Quoted 10 lines · Irui Wang
From: kyrie wu <[email protected]>
This series adds support for multi hardwares jpeg enc & dec, by first adding use
of_platform_populateto manage each hardware information:interrupt, clock, register bases and power. Secondly add jpeg enc & dec work queue to deal with the encoding or decoding requests of multi-hardwares at the same time. Lastly, add output picture reorder function interface to eliminate the out of order images.Quoted 2 lines
This series has been tested with MT8195 Gstreamer. Encoding and decoding worked for this chip.
Quoted 6 lines
Hi Hans,
I'm terrible sorry for that I didn't notice you picked all patches series includes jpeg enc + dec.
Please overlook the V14 and I will send a new series to fix kernel-doc warns.
No, I didn't pick it up. The branch Angelo pointed to is just the branch I used to compile test your series, I haven't posted a PR for it.
Next week I'll try again with v14 to check if it passes all my compile tests, and if OK, then I'll post a PR.
Patches are picked up if I post a PR and they are marked as 'Under Review' in patchwork. When Mauro merges them in our tree, then the state goes to 'Accepted'.
Regards,
Hans
Quoted 146 lines
Thanks.
Regards,
Kyrie.Quoted 32 lines
Patches 1 Adds jpeg encoder dt-bindings for mt8195
Patches 2 jpeg encoder builds two module for using Multi-HW, export some functions to make them visible by other modules.
Patches 3 use
devm_of_platform_populateto manage multi-hardware.Patch 4 add jpeg encoding timeout function to judge hardware timeout.
Patch 5 add encoding work queue to deal with multi-hardware encoding at the same time.
Patch 6 add output picture reorder function to order images.
Patch 7 add stop cmd function to deal with EOS operation.
Patch 8 Adds jpeg decoder dt-bindings for mt8195
Patches 9 jpeg decoder builds three module for using Multi-HW, export some functions to make them visible by other modules.
Patch 10 use
of_platform_populateto manage multi-hardware.Patch 11 add jpeg decoding timeout function to judge hardware timeout.
Patch 12 add decoding work queue to deal with multi-hardware decoding at the same time.
Patch 13 add output picture reorder function to order images.
Quoted 9 lines
Patch 14 refactor jpegdec func interface for HW working.
Patch 15 add stop cmd function to deal with EOS operation.
---
This series patches dependent on:media_stagetree:
[1]https://git.linuxtv.org/media_stage.git/commit/?id=b3627647f9ea7473d10fb08a95fd7c4133a17ca4
Quoted 4 lines
patch1 new jpegdec dt-bindings included files
[2] MM IOMMU binding:https://patchwork.kernel.org/project/linux-mediatek/patch/[email protected]/
Quoted 3 lines
[3] MT8195 power domain:
https://patchwork.kernel.org/project/linux-mediatek/list/?series=580579
Quoted 89 lines
Changes compared with v13:
- some modifications for patch v13's review comments.
- fix kernel robot check errors.
- fix kernel-doc check warns.
- fix sparse check warns.
- combine jpeg encoder series with decoder series into one single series.Changes compared with v12:
- some modifications for patch v12's review comments.Changes compared with v11:
- some modifications for patch v11's review comments.
- fix yaml file check errors.Changes compared with v10:
- some modifications for patch v10's review comments.
- fix Gstreamer test errors.Changes compared with v9:
- some modifications for patch v9's review comments.Changes compared with v8:
- some modifications for patch v8's review comments.
- add stop cmd function.Changes compared with v7:
- some modifications for patch v6's review comments.Changes compared with v6:
- new yaml file for mt8195 jpeg encoder.
- some modifications for patch v5's review comments.Changes compared with v5:
- useof_platform_populateto replace component framework to manage multi-hardware in patch 2.Changes compared with v4:
- No change compaered with v4Changes compared with v3:
- Structure patches for consistency, non-backward compatible and do not break any existing functionalityChanges compared with v2:
- Split the last two patches into several patches
to enhance readability
- Correct some syntax errors
- Explain why the component framework is usedChanges compared with v1:
- Add jpeg encoder dt-bindings for MT8195
- Use component framework to manage jpegenc HW
- Add jpegenc output pic reorder function interfacekyrie wu (15):
dt-bindings: mediatek: Add mediatek, mt8195-jpgenc compatible
mtk-jpegenc: export jpeg encoder functions
mtk-jpegenc: support jpegenc multi-hardware
mtk-jpegenc: add jpegenc timeout func interface
mtk-jpegenc: add jpeg encode worker interface
mtk-jpegenc: add output pic reorder interface
mtk-jpegenc: add stop cmd interface for jpgenc
dt-bindings: mediatek: Add mediatek,mt8195-jpgdec compatible
media: mtk-jpegdec: export jpeg decoder functions
media: mtk-jpegdec: support jpegdec multi-hardware
media: mtk-jpegdec: add jpegdec timeout func interface
media: mtk-jpegdec: add jpeg decode worker interface
media: mtk-jpegdec: add output pic reorder interface
media: mtk-jpegdec: refactor jpegdec func interface
mtk-jpegdec: add stop cmd interface for jpgdec.../media/mediatek,mt8195-jpegdec.yaml | 169 ++++++ .../media/mediatek,mt8195-jpegenc.yaml | 147 ++++++ drivers/media/platform/mediatek/jpeg/Makefile | 14 +- .../platform/mediatek/jpeg/mtk_jpeg_core.c | 490 ++++++++++++++++-- .../platform/mediatek/jpeg/mtk_jpeg_core.h | 169 +++++- .../platform/mediatek/jpeg/mtk_jpeg_dec_hw.c | 315 ++++++++++- .../platform/mediatek/jpeg/mtk_jpeg_dec_hw.h | 6 +- .../platform/mediatek/jpeg/mtk_jpeg_dec_reg.h | 1 + .../platform/mediatek/jpeg/mtk_jpeg_enc_hw.c | 255 +++++++++ 9 files changed, 1483 insertions(+), 83 deletions(-)create mode 100644
Documentation/devicetree/bindings/media/mediatek,mt8195-jpegdec.yaml
create mode 100644Documentation/devicetree/bindings/media/mediatek,mt8195-jpegenc.yaml
AngeloGioacchino Del Regno
maintainerIl 15/09/22 09:41, Hans Verkuil ha scritto:
Quoted 24 lines
Hi Irui,
Quoted 14 lines · kyrie.wu
Quoted 10 lines · Irui Wang
From: kyrie wu <[email protected]>
This series adds support for multi hardwares jpeg enc & dec, by first adding use
of_platform_populateto manage each hardware information:interrupt, clock, register bases and power. Secondly add jpeg enc & dec work queue to deal with the encoding or decoding requests of multi-hardwares at the same time. Lastly, add output picture reorder function interface to eliminate the out of order images.Quoted 2 lines
This series has been tested with MT8195 Gstreamer. Encoding and decoding worked for this chip.
Quoted 6 lines
Hi Hans,
I'm terrible sorry for that I didn't notice you picked all patches series includes jpeg enc + dec.
Please overlook the V14 and I will send a new series to fix kernel-doc warns.
Quoted 6 lines
No, I didn't pick it up. The branch Angelo pointed to is just the branch I used to compile test your series, I haven't posted a PR for it.
Next week I'll try again with v14 to check if it passes all my compile tests, and if OK, then I'll post a PR.
Patches are picked up if I post a PR and they are marked as 'Under Review' in patchwork. When Mauro merges them in our tree, then the state goes to 'Accepted'.
Sorry for the confusion.
Regards,
Angelo
Quoted 150 lines
Regards,
Hans
Quoted 146 lines
Thanks.
Regards,
Kyrie.Quoted 32 lines
Patches 1 Adds jpeg encoder dt-bindings for mt8195
Patches 2 jpeg encoder builds two module for using Multi-HW, export some functions to make them visible by other modules.
Patches 3 use
devm_of_platform_populateto manage multi-hardware.Patch 4 add jpeg encoding timeout function to judge hardware timeout.
Patch 5 add encoding work queue to deal with multi-hardware encoding at the same time.
Patch 6 add output picture reorder function to order images.
Patch 7 add stop cmd function to deal with EOS operation.
Patch 8 Adds jpeg decoder dt-bindings for mt8195
Patches 9 jpeg decoder builds three module for using Multi-HW, export some functions to make them visible by other modules.
Patch 10 use
of_platform_populateto manage multi-hardware.Patch 11 add jpeg decoding timeout function to judge hardware timeout.
Patch 12 add decoding work queue to deal with multi-hardware decoding at the same time.
Patch 13 add output picture reorder function to order images.
Quoted 9 lines
Patch 14 refactor jpegdec func interface for HW working.
Patch 15 add stop cmd function to deal with EOS operation.
---
This series patches dependent on:media_stagetree:
[1]https://git.linuxtv.org/media_stage.git/commit/?id=b3627647f9ea7473d10fb08a95fd7c4133a17ca4
Quoted 4 lines
patch1 new jpegdec dt-bindings included files
[2] MM IOMMU binding:https://patchwork.kernel.org/project/linux-mediatek/patch/[email protected]/
Quoted 3 lines
[3] MT8195 power domain:
https://patchwork.kernel.org/project/linux-mediatek/list/?series=580579
Quoted 89 lines
Changes compared with v13:
- some modifications for patch v13's review comments.
- fix kernel robot check errors.
- fix kernel-doc check warns.
- fix sparse check warns.
- combine jpeg encoder series with decoder series into one single series.Changes compared with v12:
- some modifications for patch v12's review comments.Changes compared with v11:
- some modifications for patch v11's review comments.
- fix yaml file check errors.Changes compared with v10:
- some modifications for patch v10's review comments.
- fix Gstreamer test errors.Changes compared with v9:
- some modifications for patch v9's review comments.Changes compared with v8:
- some modifications for patch v8's review comments.
- add stop cmd function.Changes compared with v7:
- some modifications for patch v6's review comments.Changes compared with v6:
- new yaml file for mt8195 jpeg encoder.
- some modifications for patch v5's review comments.Changes compared with v5:
- useof_platform_populateto replace component framework to manage multi-hardware in patch 2.Changes compared with v4:
- No change compaered with v4Changes compared with v3:
- Structure patches for consistency, non-backward compatible and do not break any existing functionalityChanges compared with v2:
- Split the last two patches into several patches
to enhance readability
- Correct some syntax errors
- Explain why the component framework is usedChanges compared with v1:
- Add jpeg encoder dt-bindings for MT8195
- Use component framework to manage jpegenc HW
- Add jpegenc output pic reorder function interfacekyrie wu (15):
dt-bindings: mediatek: Add mediatek, mt8195-jpgenc compatible
mtk-jpegenc: export jpeg encoder functions
mtk-jpegenc: support jpegenc multi-hardware
mtk-jpegenc: add jpegenc timeout func interface
mtk-jpegenc: add jpeg encode worker interface
mtk-jpegenc: add output pic reorder interface
mtk-jpegenc: add stop cmd interface for jpgenc
dt-bindings: mediatek: Add mediatek,mt8195-jpgdec compatible
media: mtk-jpegdec: export jpeg decoder functions
media: mtk-jpegdec: support jpegdec multi-hardware
media: mtk-jpegdec: add jpegdec timeout func interface
media: mtk-jpegdec: add jpeg decode worker interface
media: mtk-jpegdec: add output pic reorder interface
media: mtk-jpegdec: refactor jpegdec func interface
mtk-jpegdec: add stop cmd interface for jpgdec.../media/mediatek,mt8195-jpegdec.yaml | 169 ++++++ .../media/mediatek,mt8195-jpegenc.yaml | 147 ++++++
drivers/media/platform/mediatek/jpeg/Makefile| 14 +- .../platform/mediatek/jpeg/mtk_jpeg_core.c | 490
++++++++++++++++--
.../platform/mediatek/jpeg/mtk_jpeg_core.h | 169 +++++- .../platform/mediatek/jpeg/mtk_jpeg_dec_hw.c | 315 ++++++++++- .../platform/mediatek/jpeg/mtk_jpeg_dec_hw.h | 6 +-.../platform/mediatek/jpeg/mtk_jpeg_dec_reg.h| 1 + .../platform/mediatek/jpeg/mtk_jpeg_enc_hw.c | 255 +++++++++9 files changed, 1483 insertions(+), 83 deletions(-)create mode 100644
Documentation/devicetree/bindings/media/mediatek,mt8195-jpegdec.yamlcreate mode 100644Documentation/devicetree/bindings/media/mediatek,mt8195-jpegenc.yaml
Hi Irui,
Something went wrong here: patches 10-15 never made it to the mailinglist.
Can you repost?
Hans
Quoted 145 lines · Irui Wang
From: kyrie wu <[email protected]>
This series adds support for multi hardwares jpeg enc & dec, by first adding use
of_platform_populateto manage each hardware information:interrupt, clock, register bases and power. Secondly add jpeg enc & dec work queue to deal with the encoding or decoding requests of multi-hardwares at the same time. Lastly, add output picture reorder function interface to eliminate the out of order images.This series has been tested with MT8195 Gstreamer. Encoding and decoding worked for this chip.
Patches 1 Adds jpeg encoder dt-bindings for mt8195
Patches 2 jpeg encoder builds two module for using Multi-HW, export some functions to make them visible by other modules.
Patches 3 use
devm_of_platform_populateto manage multi-hardware.Patch 4 add jpeg encoding timeout function to judge hardware timeout.
Patch 5 add encoding work queue to deal with multi-hardware encoding at the same time.
Patch 6 add output picture reorder function to order images.
Patch 7 add stop cmd function to deal with EOS operation.
Patch 8 Adds jpeg decoder dt-bindings for mt8195
Patches 9 jpeg decoder builds three module for using Multi-HW, export some functions to make them visible by other modules.
Patch 10 use
of_platform_populateto manage multi-hardware.Patch 11 add jpeg decoding timeout function to judge hardware timeout.
Patch 12 add decoding work queue to deal with multi-hardware decoding at the same time.
Patch 13 add output picture reorder function to order images.
Patch 14 refactor jpegdec func interface for HW working.
Patch 15 add stop cmd function to deal with EOS operation.
---
This series patches dependent on:media_stagetree:
[1]
https://git.linuxtv.org/media_stage.git/commit/?id=b3627647f9ea7473d10fb08a95fd7c4133a17ca4patch1 new jpegdec dt-bindings included files
[2] MM IOMMU binding:
https://patchwork.kernel.org/project/linux-mediatek/patch/[email protected]/[3] MT8195 power domain:
https://patchwork.kernel.org/project/linux-mediatek/list/?series=580579Changes compared with v13:
- some modifications for patch v13's review comments.
- fix kernel robot check errors.
- fix kernel-doc check warns.
- fix sparse check warns.
- combine jpeg encoder series with decoder series into one single series.Changes compared with v12:
- some modifications for patch v12's review comments.Changes compared with v11:
- some modifications for patch v11's review comments.
- fix yaml file check errors.Changes compared with v10:
- some modifications for patch v10's review comments.
- fix Gstreamer test errors.Changes compared with v9:
- some modifications for patch v9's review comments.Changes compared with v8:
- some modifications for patch v8's review comments.
- add stop cmd function.Changes compared with v7:
- some modifications for patch v6's review comments.Changes compared with v6:
- new yaml file for mt8195 jpeg encoder.
- some modifications for patch v5's review comments.Changes compared with v5:
- useof_platform_populateto replace component framework to manage multi-hardware in patch 2.Changes compared with v4:
- No change compaered with v4Changes compared with v3:
- Structure patches for consistency, non-backward compatible and do not break any existing functionalityChanges compared with v2:
- Split the last two patches into several patches
to enhance readability
- Correct some syntax errors
- Explain why the component framework is usedChanges compared with v1:
- Add jpeg encoder dt-bindings for MT8195
- Use component framework to manage jpegenc HW
- Add jpegenc output pic reorder function interfacekyrie wu (15):
dt-bindings: mediatek: Add mediatek, mt8195-jpgenc compatible
mtk-jpegenc: export jpeg encoder functions
mtk-jpegenc: support jpegenc multi-hardware
mtk-jpegenc: add jpegenc timeout func interface
mtk-jpegenc: add jpeg encode worker interface
mtk-jpegenc: add output pic reorder interface
mtk-jpegenc: add stop cmd interface for jpgenc
dt-bindings: mediatek: Add mediatek,mt8195-jpgdec compatible
media: mtk-jpegdec: export jpeg decoder functions
media: mtk-jpegdec: support jpegdec multi-hardware
media: mtk-jpegdec: add jpegdec timeout func interface
media: mtk-jpegdec: add jpeg decode worker interface
media: mtk-jpegdec: add output pic reorder interface
media: mtk-jpegdec: refactor jpegdec func interface
mtk-jpegdec: add stop cmd interface for jpgdec.../media/mediatek,mt8195-jpegdec.yaml | 169 ++++++ .../media/mediatek,mt8195-jpegenc.yaml | 147 ++++++ drivers/media/platform/mediatek/jpeg/Makefile | 14 +- .../platform/mediatek/jpeg/mtk_jpeg_core.c | 490 ++++++++++++++++-- .../platform/mediatek/jpeg/mtk_jpeg_core.h | 169 +++++- .../platform/mediatek/jpeg/mtk_jpeg_dec_hw.c | 315 ++++++++++- .../platform/mediatek/jpeg/mtk_jpeg_dec_hw.h | 6 +- .../platform/mediatek/jpeg/mtk_jpeg_dec_reg.h | 1 + .../platform/mediatek/jpeg/mtk_jpeg_enc_hw.c | 255 +++++++++ 9 files changed, 1483 insertions(+), 83 deletions(-) create mode 100644 Documentation/devicetree/bindings/media/mediatek,mt8195-jpegdec.yaml create mode 100644 Documentation/devicetree/bindings/media/mediatek,mt8195-jpegenc.yaml
Re: [V14,08/15] dt-bindings: mediatek: Add mediatek,mt8195-jpgdec compatible
In reply to Irui WangQuoted 3 lines · Irui Wang
From: kyrie wu <[email protected]>
Add mediatek,mt8195-jpgdec compatible to binding document.
Use scripts/get_maintainers.pl to CC all maintainers and relevant mailing lists.
Quoted 22 lines
Signed-off-by kyrie wu <[email protected]>Signed-off-by irui wang <[email protected]>Reviewed-by Rob Herring <[email protected]>--- .../media/mediatek,mt8195-jpegdec.yaml | 169 ++++++++++++++++++ 1 file changed, 169 insertions(+) create mode 100644 Documentation/devicetree/bindings/media/mediatek,mt8195-jpegdec.yamlDocumentation/devicetree/bindings/media/mediatek,mt8195-jpegdec.yaml new file +7
-0@@ -0,0 +1,169 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/media/mediatek,mt8195-jpegdec.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: MediaTek JPEG Encoder Device Tree Bindings
Documentation/devicetree/bindings/media/mediatek,mt8195-jpegdec.yaml line 17
Quoted 10 lines
Documentation/devicetree/bindings/media/mediatek,mt8195-jpegdec.yaml new file +10
-0+ +maintainers: + - kyrie wu <[email protected]> + +description: + MediaTek JPEG Decoder is the JPEG decode hardware present in MediaTek SoCs + +properties: + compatible: + items:
You do not have more than one item. Skip items.
Quoted 83 lines
Documentation/devicetree/bindings/media/mediatek,mt8195-jpegdec.yaml new file +83
-0+ - const: mediatek,mt8195-jpgdec + + power-domains: + maxItems: 1 + + iommus: + maxItems: 6 + description: + Points to the respective IOMMU block with master port as argument, see + Documentation/devicetree/bindings/iommu/mediatek,iommu.yaml for details. + Ports are according to the HW. + + dma-ranges: + maxItems: 1 + description: | + Describes the physical address space of IOMMU maps to memory. + + "#address-cells": + const: 2 + + "#size-cells": + const: 2 + + ranges: true + +# Required child node: +patternProperties: + "^jpgdec@[0-9a-f]+$": + type: object + description: + The jpeg decoder hardware device node which should be added as subnodes to + the main jpeg node. + + properties: + compatible: + const: mediatek,mt8195-jpgdec-hw + + reg: + maxItems: 1 + + iommus: + minItems: 1 + maxItems: 32 + description: + List of the hardware port in respective IOMMU block for current Socs. + Refer to bindings/iommu/mediatek,iommu.yaml. + + interrupts: + maxItems: 1 + + clocks: + maxItems: 1 + + clock-names: + items: + - const: jpgdec + + power-domains: + maxItems: 1 + + required: + - compatible + - reg + - iommus + - interrupts + - clocks + - clock-names + - power-domains + + additionalProperties: false + +required: + - compatible + - power-domains + - iommus + - dma-ranges + - ranges + +additionalProperties: false + +examples: + - | + #include <dt-bindings/interrupt-controller/arm-gic.h>
Documentation/devicetree/bindings/media/mediatek,mt8195-jpegdec.yaml line 110
Quoted 10 lines
Documentation/devicetree/bindings/media/mediatek,mt8195-jpegdec.yaml new file +10
-0+ #include <dt-bindings/memory/mt8195-memory-port.h> + #include <dt-bindings/interrupt-controller/irq.h> + #include <dt-bindings/clock/mt8195-clk.h> + #include <dt-bindings/power/mt8195-power.h> + + soc { + #address-cells = <2>; + #size-cells = <2>; + + jpgdec_master {
No underscores in node names.
Node names should be generic.
https://devicetree-specification.readthedocs.io/en/latest/chapter2-devicetree-basics.html#generic-names-recommendation
Documentation/devicetree/bindings/media/mediatek,mt8195-jpegdec.yaml line 122
Quoted 12 lines
Documentation/devicetree/bindings/media/mediatek,mt8195-jpegdec.yaml new file +12
-0+ compatible = "mediatek,mt8195-jpgdec"; + power-domains = <&spm MT8195_POWER_DOMAIN_VDEC1>; + iommus = <&iommu_vpp M4U_PORT_L19_JPGDEC_WDMA0>, + <&iommu_vpp M4U_PORT_L19_JPGDEC_BSDMA0>, + <&iommu_vpp M4U_PORT_L19_JPGDEC_WDMA1>, + <&iommu_vpp M4U_PORT_L19_JPGDEC_BSDMA1>, + <&iommu_vpp M4U_PORT_L19_JPGDEC_BUFF_OFFSET1>, + <&iommu_vpp M4U_PORT_L19_JPGDEC_BUFF_OFFSET0>; + dma-ranges = <0x1 0x0 0x0 0x40000000 0x0 0xfff00000>; + #address-cells = <2>; + #size-cells = <2>; + ranges;
Mess up indentation.
Best regards,
Krzysztof
Re: [V14,08/15] dt-bindings: mediatek: Add mediatek,mt8195-jpgdec compatible
Quoted 40 lines · Krzysztof Kozlowski
Quoted 3 lines · Irui Wang
From: kyrie wu <[email protected]>
Add mediatek,mt8195-jpgdec compatible to binding document.
Use
scripts/get_maintainers.plto CC all maintainers and relevant mailing lists.Quoted 32 lines
Signed-off-by kyrie wu <[email protected]>Signed-off-by irui wang <[email protected]>Reviewed-by Rob Herring <[email protected]>--- .../media/mediatek,mt8195-jpegdec.yaml | 169 ++++++++++++++++++ 1 file changed, 169 insertions(+) create mode 100644
Documentation/devicetree/bindings/media/mediatek,mt8195-jpegdec.yamldiff --git a/Documentation/devicetree/bindings/media/mediatek,mt8195-
jpegdec.yamlb/Documentation/devicetree/bindings/media/mediatek,mt8195-jpegdec.yaml
new file mode 100644
index 000000000000..9135cf889d1eDocumentation/devicetree/bindings/media/mediatek,mt8195- new file +0
-0
jpegdec.yamlDocumentation/devicetree/bindings/media/mediatek,mt8195- new file +4
-0@@ -0,0 +1,169 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id:
Quoted 15 lines
Documentation/devicetree/bindings/media/mediatek,mt8195-
Quoted 13 lines
Documentation/devicetree/bindings/media/mediatek,mt8195- new file +8
-0+ +title: MediaTek JPEG Encoder Device Tree Bindings + +maintainers: + - kyrie wu <[email protected]> + +description: + MediaTek JPEG Decoder is the JPEG decode hardware present inMediaTek SoCs
Documentation/devicetree/bindings/media/mediatek,mt8195- new file +4
-0+ +properties: + compatible: + items:You do not have more than one item. Skip items.
Hello Krzysztof,
The device node has the compatible of "mediatek,mt8195-jpgdec", if skip this item, it may case dt-binding checking error. For another, we may extend this items in the future.
Quoted 102 lines
Quoted 89 lines
Documentation/devicetree/bindings/media/mediatek,mt8195- new file +9
-0+ - const: mediatek,mt8195-jpgdec + + power-domains: + maxItems: 1 + + iommus: + maxItems: 6 + description: + Points to the respective IOMMU block with master port asargument, see
+Documentation/devicetree/bindings/iommu/mediatek,iommu.yaml
for details.Documentation/devicetree/bindings/media/mediatek,mt8195- new file +6
-0+ Ports are according to the HW. + + dma-ranges: + maxItems: 1 + description: | + Describes the physical address space of IOMMU maps tomemory.
Documentation/devicetree/bindings/media/mediatek,mt8195- new file +15
-0+ + "#address-cells": + const: 2 + + "#size-cells": + const: 2 + + ranges: true + +# Required child node: +patternProperties: + "^jpgdec@[0-9a-f]+$": + type: object + description: + The jpeg decoder hardware device node which should be addedas subnodes to
Documentation/devicetree/bindings/media/mediatek,mt8195- new file +14
-0+ the main jpeg node. + + properties: + compatible: + const: mediatek,mt8195-jpgdec-hw + + reg: + maxItems: 1 + + iommus: + minItems: 1 + maxItems: 32 + description: + List of the hardware port in respective IOMMU block forcurrent Socs.
Documentation/devicetree/bindings/media/mediatek,mt8195- new file +38
-0+ Refer to bindings/iommu/mediatek,iommu.yaml. + + interrupts: + maxItems: 1 + + clocks: + maxItems: 1 + + clock-names: + items: + - const: jpgdec + + power-domains: + maxItems: 1 + + required: + - compatible + - reg + - iommus + - interrupts + - clocks + - clock-names + - power-domains + + additionalProperties: false + +required: + - compatible + - power-domains + - iommus + - dma-ranges + - ranges + +additionalProperties: false + +examples: + - | + #include <dt-bindings/interrupt-controller/arm-gic.h>Documentation/devicetree/bindings/media/mediatek,mt8195-
Quoted 10 lines
Documentation/devicetree/bindings/media/mediatek,mt8195- new file +10
-0+ #include <dt-bindings/memory/mt8195-memory-port.h> + #include <dt-bindings/interrupt-controller/irq.h> + #include <dt-bindings/clock/mt8195-clk.h> + #include <dt-bindings/power/mt8195-power.h> + + soc { + #address-cells = <2>; + #size-cells = <2>; + + jpgdec_master {No underscores in node names.
Quoted 2 lines
Node names should be generic.
Quoted 1 line
Thanks for your kindly reminding, I will fix it in the next version.
Thanks.
Regards,
Kyrie.
Quoted 23 lines
Quoted 13 lines
Documentation/devicetree/bindings/media/mediatek,mt8195- new file +7
-0+ compatible = "mediatek,mt8195-jpgdec"; + power-domains = <&spm MT8195_POWER_DOMAIN_VDEC1>; + iommus = <&iommu_vpp M4U_PORT_L19_JPGDEC_WDMA0>, + <&iommu_vpp M4U_PORT_L19_JPGDEC_BSDMA0>, + <&iommu_vpp M4U_PORT_L19_JPGDEC_WDMA1>, + <&iommu_vpp M4U_PORT_L19_JPGDEC_BSDMA1>, + <&iommu_vpp
M4U_PORT_L19_JPGDEC_BUFF_OFFSET1>,
+ <&iommu_vppM4U_PORT_L19_JPGDEC_BUFF_OFFSET0>;
+ dma-ranges = <0x10x00x00x400000000x00xfff00000>;Documentation/devicetree/bindings/media/mediatek,mt8195-
Quoted 3 lines
Documentation/devicetree/bindings/media/mediatek,mt8195- new file +3
-0+ #address-cells = <2>; + #size-cells = <2>; + ranges;Mess up indentation.
Best regards,
Krzysztof
Re: [V14,08/15] dt-bindings: mediatek: Add mediatek,mt8195-jpgdec compatible
Quoted 57 lines · kyrie.wu
Quoted 40 lines · Krzysztof Kozlowski
Quoted 3 lines · Irui Wang
From: kyrie wu <[email protected]>
Add mediatek,mt8195-jpgdec compatible to binding document.
Use
scripts/get_maintainers.plto CC all maintainers and relevant mailing lists.Quoted 32 lines
Signed-off-by kyrie wu <[email protected]>Signed-off-by irui wang <[email protected]>Reviewed-by Rob Herring <[email protected]>--- .../media/mediatek,mt8195-jpegdec.yaml | 169 ++++++++++++++++++ 1 file changed, 169 insertions(+) create mode 100644
Documentation/devicetree/bindings/media/mediatek,mt8195-jpegdec.yamldiff --git a/Documentation/devicetree/bindings/media/mediatek,mt8195-
jpegdec.yamlb/Documentation/devicetree/bindings/media/mediatek,mt8195-jpegdec.yaml
new file mode 100644
index 000000000000..9135cf889d1eDocumentation/devicetree/bindings/media/mediatek,mt8195- new file +0
-0
jpegdec.yamlDocumentation/devicetree/bindings/media/mediatek,mt8195- new file +4
-0@@ -0,0 +1,169 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id:Quoted 15 lines
Documentation/devicetree/bindings/media/mediatek,mt8195-
Quoted 13 lines
Documentation/devicetree/bindings/media/mediatek,mt8195- new file +8
-0+ +title: MediaTek JPEG Encoder Device Tree Bindings + +maintainers: + - kyrie wu <[email protected]> + +description: + MediaTek JPEG Decoder is the JPEG decode hardware present inMediaTek SoCs
Documentation/devicetree/bindings/media/mediatek,mt8195- new file +4
-0+ +properties: + compatible: + items:You do not have more than one item. Skip items.
Quoted 4 lines
Hello Krzysztof,
The device node has the compatible of "mediatek,mt8195-jpgdec", if skip this item, it may case dt-binding checking error.
No, this won't happen if you use correct syntax.
Quoted 1 line
For another, we may extend this items in the future.
Not really, that would be change of ABI. If you have already list of devices, include them now.
Best regards,
Krzysztof
Quoted 8 lines · Hans Verkuil
Hi Irui,
Something went wrong here: patches 10-15 never made it to the mailinglist.
Can you repost?
Hans
Hi Hans,
I'm sorry for this mistake. I will resend the series patches.
Thanks.
Regards,
Kyrie.
Quoted 51 lines · Irui Wang
Quoted 49 lines
From: kyrie wu <[email protected]>
This series adds support for multi hardwares jpeg enc & dec, by first adding use
of_platform_populateto manage each hardware information:interrupt, clock, register bases and power. Secondly add jpeg enc & dec work queue to deal with the encoding or decoding requests of multi-hardwares at the same time. Lastly, add output picture reorder function interface to eliminate the out of order images.This series has been tested with MT8195 Gstreamer. Encoding and decoding worked for this chip.
Patches 1 Adds jpeg encoder dt-bindings for mt8195
Patches 2 jpeg encoder builds two module for using Multi-HW, export some functions to make them visible by other modules.
Patches 3 use
devm_of_platform_populateto manage multi-hardware.Patch 4 add jpeg encoding timeout function to judge hardware timeout.
Patch 5 add encoding work queue to deal with multi-hardware encoding
at the same time.Patch 6 add output picture reorder function to order images.
Patch 7 add stop cmd function to deal with EOS operation.
Patch 8 Adds jpeg decoder dt-bindings for mt8195
Patches 9 jpeg decoder builds three module for using Multi-HW, export some functions to make them visible by other modules.
Patch 10 use
of_platform_populateto manage multi-hardware.Patch 11 add jpeg decoding timeout function to judge hardware timeout.
Patch 12 add decoding work queue to deal with multi-hardware decoding
at the same time.Patch 13 add output picture reorder function to order images.
Patch 14 refactor jpegdec func interface for HW working.
Quoted 7 lines
Quoted 7 lines
Patch 15 add stop cmd function to deal with EOS operation.
---
This series patches dependent on:media_stagetree:
[1]
Quoted 5 lines
Quoted 5 lines
patch1 new jpegdec dt-bindings included files
[2] MM IOMMU binding:
Quoted 4 lines
Quoted 4 lines
[3] MT8195 power domain:
Quoted 94 lines
Quoted 92 lines
Changes compared with v13:
- some modifications for patch v13's review comments.
- fix kernel robot check errors.
- fix kernel-doc check warns.
- fix sparse check warns.
- combine jpeg encoder series with decoder series into one single series.Changes compared with v12:
- some modifications for patch v12's review comments.Changes compared with v11:
- some modifications for patch v11's review comments.
- fix yaml file check errors.Changes compared with v10:
- some modifications for patch v10's review comments.
- fix Gstreamer test errors.Changes compared with v9:
- some modifications for patch v9's review comments.Changes compared with v8:
- some modifications for patch v8's review comments.
- add stop cmd function.Changes compared with v7:
- some modifications for patch v6's review comments.Changes compared with v6:
- new yaml file for mt8195 jpeg encoder.
- some modifications for patch v5's review comments.Changes compared with v5:
- useof_platform_populateto replace component framework to manage multi-hardware in patch 2.Changes compared with v4:
- No change compaered with v4Changes compared with v3:
- Structure patches for consistency, non-backward compatible and do not break any existing functionalityChanges compared with v2:
- Split the last two patches into several patches
to enhance readability
- Correct some syntax errors
- Explain why the component framework is usedChanges compared with v1:
- Add jpeg encoder dt-bindings for MT8195
- Use component framework to manage jpegenc HW
- Add jpegenc output pic reorder function interfacekyrie wu (15):
dt-bindings: mediatek: Add mediatek, mt8195-jpgenc compatible
mtk-jpegenc: export jpeg encoder functions
mtk-jpegenc: support jpegenc multi-hardware
mtk-jpegenc: add jpegenc timeout func interface
mtk-jpegenc: add jpeg encode worker interface
mtk-jpegenc: add output pic reorder interface
mtk-jpegenc: add stop cmd interface for jpgenc
dt-bindings: mediatek: Add mediatek,mt8195-jpgdec compatible
media: mtk-jpegdec: export jpeg decoder functions
media: mtk-jpegdec: support jpegdec multi-hardware
media: mtk-jpegdec: add jpegdec timeout func interface
media: mtk-jpegdec: add jpeg decode worker interface
media: mtk-jpegdec: add output pic reorder interface
media: mtk-jpegdec: refactor jpegdec func interface
mtk-jpegdec: add stop cmd interface for jpgdec.../media/mediatek,mt8195-jpegdec.yaml | 169 ++++++ .../media/mediatek,mt8195-jpegenc.yaml | 147 ++++++ drivers/media/platform/mediatek/jpeg/Makefile | 14 +- .../platform/mediatek/jpeg/mtk_jpeg_core.c | 490 ++++++++++++++++-- .../platform/mediatek/jpeg/mtk_jpeg_core.h | 169 +++++- .../platform/mediatek/jpeg/mtk_jpeg_dec_hw.c | 315 ++++++++++- .../platform/mediatek/jpeg/mtk_jpeg_dec_hw.h | 6 +- .../platform/mediatek/jpeg/mtk_jpeg_dec_reg.h | 1 + .../platform/mediatek/jpeg/mtk_jpeg_enc_hw.c | 255 +++++++++ 9 files changed, 1483 insertions(+), 83 deletions(-) create mode 100644 Documentation/devicetree/bindings/media/mediatek,mt8195- jpegdec.yaml create mode 100644
Documentation/devicetree/bindings/media/mediatek,mt8195-jpegenc.yaml
Re: [V14,08/15] dt-bindings: mediatek: Add mediatek,mt8195-jpgdec compatible
In reply to Krzysztof KozlowskiQuoted 22 lines · Krzysztof Kozlowski
Quoted 21 lines · kyrie.wu
Quoted 20 lines · Krzysztof Kozlowski
Quoted 3 lines · Irui Wang
From: kyrie wu <[email protected]>
Add mediatek,mt8195-jpgdec compatible to binding document.
Use
scripts/get_maintainers.plto CC all maintainers and relevant mailing lists.Quoted 12 lines
Signed-off-by kyrie wu <[email protected]>Signed-off-by irui wang <[email protected]>Reviewed-by Rob Herring <[email protected]>--- .../media/mediatek,mt8195-jpegdec.yaml | 169 ++++++++++++++++++ 1 file changed, 169 insertions(+) create mode 100644
Documentation/devicetree/bindings/media/mediatek,mt8195-jpegdec.yaml
Quoted 16 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
diff --git a/Documentation/devicetree/bindings/media/mediatek,mt8195-
jpegdec.yamlb/Documentation/devicetree/bindings/media/mediatek,mt8195-jpegdec.yaml
new file mode 100644
index 000000000000..9135cf889d1e
---/dev/nullQuoted 8 lines
Quoted 8 lines
Documentation/devicetree/bindings/media/mediatek,mt8195-jpegdec.yaml line 4
Quoted 8 lines
+++ b/Documentation/devicetree/bindings/media/mediatek,mt8195-
jpegdec.yamlDocumentation/devicetree/bindings/media/mediatek,mt8195-jpegdec.yaml new file +4
-0@@ -0,0 +1,169 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id:
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Review line 5
Quoted 3 lines
(quoted diff) +1
-0+$schema:
Quoted 17 lines
Quoted 17 lines
Quoted 16 lines
Quoted 10 lines
Documentation/devicetree/bindings/media/mediatek,mt8195-jpegdec.yaml new file +8
-0+ +title: MediaTek JPEG Encoder Device Tree Bindings + +maintainers: + - kyrie wu <[email protected]> + +description: + MediaTek JPEG Decoder is the JPEG decode hardware present inMediaTek SoCs
Documentation/devicetree/bindings/media/mediatek,mt8195-jpegdec.yaml line 17
Quoted 4 lines
Documentation/devicetree/bindings/media/mediatek,mt8195-jpegdec.yaml new file +4
-0+ +properties: + compatible: + items:You do not have more than one item. Skip items.
Quoted 6 lines
Quoted 4 lines
Hello Krzysztof,
The device node has the compatible of "mediatek,mt8195-jpgdec", if skip this item, it may case dt-binding checking error.
No, this won't happen if you use correct syntax.
Hello Krzysztof,
Thanks for your guidance, I have fix those issue according your suggestion. and it would be updated in the next version.
Regards,
Kyrie.
Quoted 10 lines
Quoted 2 lines
For another, we may extend this items in the future.
Not really, that would be change of ABI. If you have already list of devices, include them now.
Best regards,
Krzysztof