Enable hardware jpeg encoder for MT8186
Subsystems (4)
v2 cover Enable hardware jpeg encoder for MT8186
From: kyrie wu <[email protected]>
This series adds support for MT8186 hardware jpeg encoding.
This series has been tested with both MT8186.
Encoding worked for this chip.
Patches 1 Adds jpeg encoder dt-bindings for mt8186
Patches 2 set bit mask for jpegenc to support 34bits iova space,
which means iova rangement from 0 to 16GB.
Changes compared with v1:
--rebase on latest media_stage tree
kyrie wu (2):
media: media: jpegenc: add mediatek,mt8186-jpgenc compatible
media: media: jpegenc: set bit mask for jpegenc
.../devicetree/bindings/media/mediatek-jpeg-encoder.yaml | 6 ++++++ drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.c | 3 +++ 2 files changed, 9 insertions(+)
Signature · 7 lines
2.18.0 _______________________________________________ Linux-mediatek mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-mediatek
PATCH v2 1/2 media: media: jpegenc: add mediatek,mt8186-jpgenc compatible
From: kyrie wu <[email protected]>
Add mediatek,mt8186-jpgenc compatible to binding document.
MT8186 iommu support 0~16GB iova. We separate it to four banks:
0~4G; 4G~8G; 8G~12G; 12G~16G.
The "dma-ranges" could be used to adjust the bank we locate. If we don't set this property. The default range always is 0~4G.
--- .../devicetree/bindings/media/mediatek-jpeg-encoder.yaml | 6 ++++++ 1 file changed, 6 insertions(+)
Documentation/devicetree/bindings/media/mediatek-jpeg-encoder.yaml +6 -0
@@ -18,6 +18,7 @@ properties: - enum: - mediatek,mt2701-jpgenc - mediatek,mt8183-jpgenc + - mediatek,mt8186-jpgenc - const: mediatek,mtk-jpgenc reg: maxItems: 1
@@ -42,6 +43,11 @@ properties: 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. + required: - compatible - reg
Signature · 7 lines
2.18.0 _______________________________________________ Linux-mediatek mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-mediatek
Rob Herring
maintainerRe: [V2,1/2] media: media: jpegenc: add mediatek,mt8186-jpgenc compatible
Quoted 7 lines · Irui Wang
From: kyrie wu <[email protected]>
Add mediatek,mt8186-jpgenc compatible to binding document.
MT8186 iommu support 0~16GB iova. We separate it to four banks:
0~4G; 4G~8G; 8G~12G; 12G~16G.
Quoted 8 lines
The "dma-ranges" could be used to adjust the bank we locate. If we don't set this property. The default range always is 0~4G.
Signed-off-by kyrie wu <[email protected]>--- .../devicetree/bindings/media/mediatek-jpeg-encoder.yaml | 6 ++++++ 1 file changed, 6 insertions(+)
Please add Acked-by/Reviewed-by tags when posting new versions. However, there's no need to repost patches *only* to add the tags. The upstream maintainer will do that for acks received on the version they apply.
If a tag was not added on purpose, please state why and what changed.
_______________________________________________
Linux-mediatek mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-mediatek
PATCH v2 2/2 media: media: jpegenc: set bit mask for jpegenc
In reply to Irui WangFrom: kyrie wu <[email protected]>
set jpeg encode DMA bit mask to support 34bits iova space(16GB) that the mt8186 iommu HW support. Whole the iova range separate to 0~4G/4G~8G/8G~12G/12G~16G, regarding which iova range jpgenc actually locate, it depends on the dma-ranges property of vdec dtsi node.
--- drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.c +3 -0
@@ -1369,6 +1369,9 @@ static int mtk_jpeg_probe(struct platform_device *pdev) jpeg->vdev->device_caps =V4L2_CAP_STREAMING |V4L2_CAP_VIDEO_M2M_MPLANE ; +if (of_get_property (pdev->dev.of_node,"dma-ranges" ,NULL )) +dma_set_mask_and_coherent (&pdev->dev,DMA_BIT_MASK (34 )); + ret =video_register_device (jpeg->vdev,VFL_TYPE_VIDEO ,-1 );if (ret) {v4l2_err (&jpeg->v4l2_dev,"Failed to register video device\n" );
Signature · 7 lines
2.18.0 _______________________________________________ Linux-mediatek mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-mediatek