Re: [PATCH] [media] vcodec: fix error return value from mtk_jpeg_clk_init()
On 03/23/2018 04:44 AM, Ryder Lee wrote: > The error return value should be fixed as it may return EPROBE_DEFER. > > Cc: Rick Chang <rick.ch...@mediatek.com> > Cc: Bin Liu <bin@mediatek.com> > Signed-off-by: Ryder Lee <ryder....@mediatek.com> Reviewed-by: Matthias Brugger <matthias@gmail.com> > --- > drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c > b/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c > index 226f908..af17aaa 100644 > --- a/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c > +++ b/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c > @@ -1081,11 +1081,11 @@ static int mtk_jpeg_clk_init(struct mtk_jpeg_dev > *jpeg) > > jpeg->clk_jdec = devm_clk_get(jpeg->dev, "jpgdec"); > if (IS_ERR(jpeg->clk_jdec)) > - return -EINVAL; > + return PTR_ERR(jpeg->clk_jdec); > > jpeg->clk_jdec_smi = devm_clk_get(jpeg->dev, "jpgdec-smi"); > if (IS_ERR(jpeg->clk_jdec_smi)) > - return -EINVAL; > + return PTR_ERR(jpeg->clk_jdec_smi); > > return 0; > } >
Re: [PATCH] media: Convert to using %pOF instead of full_name
On 07/18/2017 11:43 PM, Rob Herring wrote: Now that we have a custom printf format specifier, convert users of full_name to use %pOF instead. This is preparation to remove storing of the full path string for each node. Signed-off-by: Rob Herring <r...@kernel.org> Cc: Kyungmin Park <kyungmin.p...@samsung.com> Cc: Andrzej Hajda <a.ha...@samsung.com> Cc: Mauro Carvalho Chehab <mche...@kernel.org> Cc: "Lad, Prabhakar" <prabhakar.cse...@gmail.com> Cc: Songjun Wu <songjun...@microchip.com> Cc: Sylwester Nawrocki <s.nawro...@samsung.com> Cc: Kukjin Kim <kg...@kernel.org> Cc: Krzysztof Kozlowski <k...@kernel.org> Cc: Javier Martinez Canillas <jav...@osg.samsung.com> Cc: Minghsiu Tsai <minghsiu.t...@mediatek.com> Cc: Houlong Wei <houlong....@mediatek.com> Cc: Andrew-CT Chen <andrew-ct.c...@mediatek.com> Cc: Matthias Brugger <matthias@gmail.com> Cc: Laurent Pinchart <laurent.pinch...@ideasonboard.com> Cc: "Niklas Söderlund" <niklas.soderl...@ragnatech.se> Cc: Guennadi Liakhovetski <g.liakhovet...@gmx.de> Cc: Hyun Kwon <hyun.k...@xilinx.com> Cc: Michal Simek <michal.si...@xilinx.com> Cc: "Sören Brinkmann" <soren.brinkm...@xilinx.com> Cc: linux-media@vger.kernel.org Cc: linux-arm-ker...@lists.infradead.org Cc: linux-samsung-...@vger.kernel.org Cc: linux-media...@lists.infradead.org Cc: linux-renesas-...@vger.kernel.org --- drivers/media/i2c/s5c73m3/s5c73m3-core.c | 3 +- drivers/media/i2c/s5k5baf.c| 7 ++-- drivers/media/platform/am437x/am437x-vpfe.c| 4 +- drivers/media/platform/atmel/atmel-isc.c | 4 +- drivers/media/platform/davinci/vpif_capture.c | 16 drivers/media/platform/exynos4-is/fimc-is.c| 8 ++-- drivers/media/platform/exynos4-is/fimc-lite.c | 3 +- drivers/media/platform/exynos4-is/media-dev.c | 8 ++-- drivers/media/platform/exynos4-is/mipi-csis.c | 4 +- drivers/media/platform/mtk-mdp/mtk_mdp_comp.c | 6 +-- drivers/media/platform/mtk-mdp/mtk_mdp_core.c | 8 ++-- For mediatek parts: Reviewed-by: Matthias Brugger <matthias@gmail.com>
Re: [PATCH v4 3/3] media: mtk-mdp: Fix mdp device tree
On 07/06/17 11:11, Hans Verkuil wrote: On 07/06/17 11:07, Matthias Brugger wrote: On 07/06/17 10:56, Hans Verkuil wrote: On 07/06/17 10:44, Matthias Brugger wrote: Hi Hans, hi Mauro, On 23/05/17 05:24, Minghsiu Tsai wrote: From: Daniel Kurtz <djku...@chromium.org> If the mdp_* nodes are under an mdp sub-node, their corresponding platform device does not automatically get its iommu assigned properly. Fix this by moving the mdp component nodes up a level such that they are siblings of mdp and all other SoC subsystems. This also simplifies the device tree. Although it fixes iommu assignment issue, it also break compatibility with old device tree. So, the patch in driver is needed to iterate over sibling mdp device nodes, not child ones, to keep driver work properly. Signed-off-by: Daniel Kurtz <djku...@chromium.org> Signed-off-by: Minghsiu Tsai <minghsiu.t...@mediatek.com> Signed-off-by: Matthias Brugger <matthias@gmail.com> Are you OK to take this patch, or do you have any further comments? Nope, it's all good. Queued for 4.13. Thanks! I queued the other two in v4.12-next/dts64 Media bindings normally go through the media subsystem, but you've taken that one as well? I need to know, because then I drop it in my tree. My fault, I'll drop it from my tree. After that I only queued patch 2/3. Sorry. Matthias
Re: [PATCH v4 3/3] media: mtk-mdp: Fix mdp device tree
On 07/06/17 10:56, Hans Verkuil wrote: On 07/06/17 10:44, Matthias Brugger wrote: Hi Hans, hi Mauro, On 23/05/17 05:24, Minghsiu Tsai wrote: From: Daniel Kurtz <djku...@chromium.org> If the mdp_* nodes are under an mdp sub-node, their corresponding platform device does not automatically get its iommu assigned properly. Fix this by moving the mdp component nodes up a level such that they are siblings of mdp and all other SoC subsystems. This also simplifies the device tree. Although it fixes iommu assignment issue, it also break compatibility with old device tree. So, the patch in driver is needed to iterate over sibling mdp device nodes, not child ones, to keep driver work properly. Signed-off-by: Daniel Kurtz <djku...@chromium.org> Signed-off-by: Minghsiu Tsai <minghsiu.t...@mediatek.com> Signed-off-by: Matthias Brugger <matthias@gmail.com> Are you OK to take this patch, or do you have any further comments? Nope, it's all good. Queued for 4.13. Thanks! I queued the other two in v4.12-next/dts64 Regards, Matthias Regards, Hans Regards, Matthias --- drivers/media/platform/mtk-mdp/mtk_mdp_core.c | 12 ++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/mtk-mdp/mtk_mdp_core.c b/drivers/media/platform/mtk-mdp/mtk_mdp_core.c index 9e4eb7d..8134755 100644 --- a/drivers/media/platform/mtk-mdp/mtk_mdp_core.c +++ b/drivers/media/platform/mtk-mdp/mtk_mdp_core.c @@ -103,7 +103,7 @@ static int mtk_mdp_probe(struct platform_device *pdev) { struct mtk_mdp_dev *mdp; struct device *dev = >dev; -struct device_node *node; +struct device_node *node, *parent; int i, ret = 0; mdp = devm_kzalloc(dev, sizeof(*mdp), GFP_KERNEL); @@ -117,8 +117,16 @@ static int mtk_mdp_probe(struct platform_device *pdev) mutex_init(>lock); mutex_init(>vpulock); +/* Old dts had the components as child nodes */ +if (of_get_next_child(dev->of_node, NULL)) { +parent = dev->of_node; +dev_warn(dev, "device tree is out of date\n"); +} else { +parent = dev->of_node->parent; +} + /* Iterate over sibling MDP function blocks */ -for_each_child_of_node(dev->of_node, node) { +for_each_child_of_node(parent, node) { const struct of_device_id *of_id; enum mtk_mdp_comp_type comp_type; int comp_id;
Re: [PATCH v4 3/3] media: mtk-mdp: Fix mdp device tree
Hi Hans, hi Mauro, On 23/05/17 05:24, Minghsiu Tsai wrote: From: Daniel Kurtz <djku...@chromium.org> If the mdp_* nodes are under an mdp sub-node, their corresponding platform device does not automatically get its iommu assigned properly. Fix this by moving the mdp component nodes up a level such that they are siblings of mdp and all other SoC subsystems. This also simplifies the device tree. Although it fixes iommu assignment issue, it also break compatibility with old device tree. So, the patch in driver is needed to iterate over sibling mdp device nodes, not child ones, to keep driver work properly. Signed-off-by: Daniel Kurtz <djku...@chromium.org> Signed-off-by: Minghsiu Tsai <minghsiu.t...@mediatek.com> Signed-off-by: Matthias Brugger <matthias@gmail.com> Are you OK to take this patch, or do you have any further comments? Regards, Matthias --- drivers/media/platform/mtk-mdp/mtk_mdp_core.c | 12 ++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/mtk-mdp/mtk_mdp_core.c b/drivers/media/platform/mtk-mdp/mtk_mdp_core.c index 9e4eb7d..8134755 100644 --- a/drivers/media/platform/mtk-mdp/mtk_mdp_core.c +++ b/drivers/media/platform/mtk-mdp/mtk_mdp_core.c @@ -103,7 +103,7 @@ static int mtk_mdp_probe(struct platform_device *pdev) { struct mtk_mdp_dev *mdp; struct device *dev = >dev; - struct device_node *node; + struct device_node *node, *parent; int i, ret = 0; mdp = devm_kzalloc(dev, sizeof(*mdp), GFP_KERNEL); @@ -117,8 +117,16 @@ static int mtk_mdp_probe(struct platform_device *pdev) mutex_init(>lock); mutex_init(>vpulock); + /* Old dts had the components as child nodes */ + if (of_get_next_child(dev->of_node, NULL)) { + parent = dev->of_node; + dev_warn(dev, "device tree is out of date\n"); + } else { + parent = dev->of_node->parent; + } + /* Iterate over sibling MDP function blocks */ - for_each_child_of_node(dev->of_node, node) { + for_each_child_of_node(parent, node) { const struct of_device_id *of_id; enum mtk_mdp_comp_type comp_type; int comp_id;
Re: [PATCH v9 3/4] arm: dts: mt2701: Add node for Mediatek JPEG Decoder
On 10/05/17 13:02, Matthias Brugger wrote: On 14/12/16 09:04, Rick Chang wrote: Signed-off-by: Rick Chang <rick.ch...@mediatek.com> Signed-off-by: Minghsiu Tsai <minghsiu.t...@mediatek.com> --- This patch depends on: CCF "Add clock support for Mediatek MT2701"[1] iommu and smi "Add the dtsi node of iommu and smi for mt2701"[2] [1] http://lists.infradead.org/pipermail/linux-mediatek/2016-October/007271.html [2] https://patchwork.kernel.org/patch/9164013/ Now queued for v4.12-next/dts32 Thanks and sorry for the delay. Matthias I realized that a long time ago I made a mistake when taking: f3cba0f49c7c ("ARM: dts: mt2701: add iommu/smi dtsi node for mt2701") as I forgot to include dt-bindings/memory/mt2701-larb-port.h I fixed this now in v4.12-next/dts32 Sorry for that. Regards, Matthias --- arch/arm/boot/dts/mt2701.dtsi | 14 ++ 1 file changed, 14 insertions(+) diff --git a/arch/arm/boot/dts/mt2701.dtsi b/arch/arm/boot/dts/mt2701.dtsi index 8f13c70..4dd5048 100644 --- a/arch/arm/boot/dts/mt2701.dtsi +++ b/arch/arm/boot/dts/mt2701.dtsi @@ -298,6 +298,20 @@ power-domains = < MT2701_POWER_DOMAIN_ISP>; }; +jpegdec: jpegdec@15004000 { +compatible = "mediatek,mt2701-jpgdec"; +reg = <0 0x15004000 0 0x1000>; +interrupts = ; +clocks = < CLK_IMG_JPGDEC_SMI>, + < CLK_IMG_JPGDEC>; +clock-names = "jpgdec-smi", + "jpgdec"; +power-domains = < MT2701_POWER_DOMAIN_ISP>; +mediatek,larb = <>; +iommus = < MT2701_M4U_PORT_JPGDEC_WDMA>, + < MT2701_M4U_PORT_JPGDEC_BSDMA>; +}; + vdecsys: syscon@1600 { compatible = "mediatek,mt2701-vdecsys", "syscon"; reg = <0 0x1600 0 0x1000>;
Re: [PATCH v3 0/3] Fix mdp device tree
On 22/05/17 11:09, Hans Verkuil wrote: On 05/12/2017 05:22 AM, Minghsiu Tsai wrote: Who should take care of the dtsi changes? I'm not sure who maintains the mdp dts. I will take care of the dtsi patches. The driver change and the dtsi change need to be in sync, so it is probably easiest to merge this via one tree. Here is my Acked-by for these three patches: Acked-by: Hans VerkuilI can take all three, provided I have the Ack of the mdp dts maintainer. Or it can go through him with my Ack. I think we should provide backwards compability instead, as proposed here: http://lists.infradead.org/pipermail/linux-mediatek/2017-May/008811.html If this change is ok for you, please let Minghsiu know so that he can provide a v4. Regards, Matthias Regards, Hans Changes in v3: - Upload patches again because forget to add v2 in title Changes in v2: - Update commit message If the mdp_* nodes are under an mdp sub-node, their corresponding platform device does not automatically get its iommu assigned properly. Fix this by moving the mdp component nodes up a level such that they are siblings of mdp and all other SoC subsystems. This also simplifies the device tree. Although it fixes iommu assignment issue, it also break compatibility with old device tree. So, the patch in driver is needed to iterate over sibling mdp device nodes, not child ones, to keep driver work properly. Daniel Kurtz (2): arm64: dts: mt8173: Fix mdp device tree media: mtk-mdp: Fix mdp device tree Minghsiu Tsai (1): dt-bindings: mt8173: Fix mdp device tree .../devicetree/bindings/media/mediatek-mdp.txt | 12 +- arch/arm64/boot/dts/mediatek/mt8173.dtsi | 126 ++--- drivers/media/platform/mtk-mdp/mtk_mdp_core.c | 2 +- 3 files changed, 64 insertions(+), 76 deletions(-)
Re: [PATCH v3 3/3] media: mtk-mdp: Fix mdp device tree
On 15/05/17 04:31, Minghsiu Tsai wrote: On Fri, 2017-05-12 at 17:05 +0200, Matthias Brugger wrote: On 12/05/17 05:22, Minghsiu Tsai wrote: From: Daniel Kurtz <djku...@chromium.org> If the mdp_* nodes are under an mdp sub-node, their corresponding platform device does not automatically get its iommu assigned properly. Fix this by moving the mdp component nodes up a level such that they are siblings of mdp and all other SoC subsystems. This also simplifies the device tree. Although it fixes iommu assignment issue, it also break compatibility with old device tree. So, the patch in driver is needed to iterate over sibling mdp device nodes, not child ones, to keep driver work properly. Couldn't we preserve backwards compatibility by doing something like this: diff --git a/drivers/media/platform/mtk-mdp/mtk_mdp_core.c b/drivers/media/platform/mtk-mdp/mtk_mdp_core.c index 9e4eb7dcc424..277d8fe6eb76 100644 --- a/drivers/media/platform/mtk-mdp/mtk_mdp_core.c +++ b/drivers/media/platform/mtk-mdp/mtk_mdp_core.c @@ -103,7 +103,7 @@ static int mtk_mdp_probe(struct platform_device *pdev) { struct mtk_mdp_dev *mdp; struct device *dev = >dev; - struct device_node *node; + struct device_node *node, *parent; int i, ret = 0; mdp = devm_kzalloc(dev, sizeof(*mdp), GFP_KERNEL); @@ -117,8 +117,14 @@ static int mtk_mdp_probe(struct platform_device *pdev) mutex_init(>lock); mutex_init(>vpulock); + /* Old dts had the components as child nodes */ + if (of_get_next_child(dev->of_node, NULL)) + parent = dev->of_node; + else + parent = dev->of_node->parent; + /* Iterate over sibling MDP function blocks */ - for_each_child_of_node(dev->of_node, node) { + for_each_child_of_node(parent, node) { const struct of_device_id *of_id; enum mtk_mdp_comp_type comp_type; int comp_id; Maybe even by putting a warning in the if branch to make sure, people are aware of their out-of-date device tree blobs. Regards, Matthias Hi Matthias, It is a good idea to do compatible in such a way and put a warning the device tree is out of date. People can find out cause soon if device tree is old. I modify the code as below: + /* Old dts had the components as child nodes */ + if (of_get_next_child(dev->of_node, NULL)) { + parent = dev->of_node; + dev_warn(dev, "device tree is out of date\n"); + } else { + parent = dev->of_node->parent; + } Will you upload it in a separate patch? If not, I can merge it in my patch series and upload v4. Please integrate it into your patch series. Mauro, are you ok with the dev_warn about the out-of-date device-tree? Regards, Matthias Best Regards, Ming Hsiu Signed-off-by: Daniel Kurtz <djku...@chromium.org> Signed-off-by: Minghsiu Tsai <minghsiu.t...@mediatek.com> --- drivers/media/platform/mtk-mdp/mtk_mdp_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/platform/mtk-mdp/mtk_mdp_core.c b/drivers/media/platform/mtk-mdp/mtk_mdp_core.c index 9e4eb7d..a5ad586 100644 --- a/drivers/media/platform/mtk-mdp/mtk_mdp_core.c +++ b/drivers/media/platform/mtk-mdp/mtk_mdp_core.c @@ -118,7 +118,7 @@ static int mtk_mdp_probe(struct platform_device *pdev) mutex_init(>vpulock); /* Iterate over sibling MDP function blocks */ - for_each_child_of_node(dev->of_node, node) { + for_each_child_of_node(dev->of_node->parent, node) { const struct of_device_id *of_id; enum mtk_mdp_comp_type comp_type; int comp_id;
Re: [PATCH v3 3/3] media: mtk-mdp: Fix mdp device tree
On 12/05/17 05:22, Minghsiu Tsai wrote: From: Daniel KurtzIf the mdp_* nodes are under an mdp sub-node, their corresponding platform device does not automatically get its iommu assigned properly. Fix this by moving the mdp component nodes up a level such that they are siblings of mdp and all other SoC subsystems. This also simplifies the device tree. Although it fixes iommu assignment issue, it also break compatibility with old device tree. So, the patch in driver is needed to iterate over sibling mdp device nodes, not child ones, to keep driver work properly. Couldn't we preserve backwards compatibility by doing something like this: diff --git a/drivers/media/platform/mtk-mdp/mtk_mdp_core.c b/drivers/media/platform/mtk-mdp/mtk_mdp_core.c index 9e4eb7dcc424..277d8fe6eb76 100644 --- a/drivers/media/platform/mtk-mdp/mtk_mdp_core.c +++ b/drivers/media/platform/mtk-mdp/mtk_mdp_core.c @@ -103,7 +103,7 @@ static int mtk_mdp_probe(struct platform_device *pdev) { struct mtk_mdp_dev *mdp; struct device *dev = >dev; - struct device_node *node; + struct device_node *node, *parent; int i, ret = 0; mdp = devm_kzalloc(dev, sizeof(*mdp), GFP_KERNEL); @@ -117,8 +117,14 @@ static int mtk_mdp_probe(struct platform_device *pdev) mutex_init(>lock); mutex_init(>vpulock); + /* Old dts had the components as child nodes */ + if (of_get_next_child(dev->of_node, NULL)) + parent = dev->of_node; + else + parent = dev->of_node->parent; + /* Iterate over sibling MDP function blocks */ - for_each_child_of_node(dev->of_node, node) { + for_each_child_of_node(parent, node) { const struct of_device_id *of_id; enum mtk_mdp_comp_type comp_type; int comp_id; Maybe even by putting a warning in the if branch to make sure, people are aware of their out-of-date device tree blobs. Regards, Matthias Signed-off-by: Daniel Kurtz Signed-off-by: Minghsiu Tsai --- drivers/media/platform/mtk-mdp/mtk_mdp_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/platform/mtk-mdp/mtk_mdp_core.c b/drivers/media/platform/mtk-mdp/mtk_mdp_core.c index 9e4eb7d..a5ad586 100644 --- a/drivers/media/platform/mtk-mdp/mtk_mdp_core.c +++ b/drivers/media/platform/mtk-mdp/mtk_mdp_core.c @@ -118,7 +118,7 @@ static int mtk_mdp_probe(struct platform_device *pdev) mutex_init(>vpulock); /* Iterate over sibling MDP function blocks */ - for_each_child_of_node(dev->of_node, node) { + for_each_child_of_node(dev->of_node->parent, node) { const struct of_device_id *of_id; enum mtk_mdp_comp_type comp_type; int comp_id;
Re: [PATCH v9 3/4] arm: dts: mt2701: Add node for Mediatek JPEG Decoder
On 14/12/16 09:04, Rick Chang wrote: Signed-off-by: Rick ChangSigned-off-by: Minghsiu Tsai --- This patch depends on: CCF "Add clock support for Mediatek MT2701"[1] iommu and smi "Add the dtsi node of iommu and smi for mt2701"[2] [1] http://lists.infradead.org/pipermail/linux-mediatek/2016-October/007271.html [2] https://patchwork.kernel.org/patch/9164013/ Now queued for v4.12-next/dts32 Thanks and sorry for the delay. Matthias --- arch/arm/boot/dts/mt2701.dtsi | 14 ++ 1 file changed, 14 insertions(+) diff --git a/arch/arm/boot/dts/mt2701.dtsi b/arch/arm/boot/dts/mt2701.dtsi index 8f13c70..4dd5048 100644 --- a/arch/arm/boot/dts/mt2701.dtsi +++ b/arch/arm/boot/dts/mt2701.dtsi @@ -298,6 +298,20 @@ power-domains = < MT2701_POWER_DOMAIN_ISP>; }; + jpegdec: jpegdec@15004000 { + compatible = "mediatek,mt2701-jpgdec"; + reg = <0 0x15004000 0 0x1000>; + interrupts = ; + clocks = < CLK_IMG_JPGDEC_SMI>, + < CLK_IMG_JPGDEC>; + clock-names = "jpgdec-smi", + "jpgdec"; + power-domains = < MT2701_POWER_DOMAIN_ISP>; + mediatek,larb = <>; + iommus = < MT2701_M4U_PORT_JPGDEC_WDMA>, +< MT2701_M4U_PORT_JPGDEC_BSDMA>; + }; + vdecsys: syscon@1600 { compatible = "mediatek,mt2701-vdecsys", "syscon"; reg = <0 0x1600 0 0x1000>;
Re: [GIT PULL FOR v4.11] MediaTek JPEG encoder
On 13/02/17 13:00, Mauro Carvalho Chehab wrote: Em Mon, 13 Feb 2017 11:52:07 +0100 Hans Verkuil <hverk...@xs4all.nl> escreveu: Hi Mauro, This adds the MediaTek JPEG encoder to the media subsystem. This patch https://patchwork.linuxtv.org/patch/38645/ needs to go through Matthias Brugger, Why? It seems easier to just merge it via media tree, as it doesn't seem to be dependent of anything else. IMHO, the better would be if Matthias would ack to merge it via the media tree. On the other hand, it is just a documentation path. It wouldn't hurt if merged for 4.11, even if the remaining patches go for 4.12. Sorry for the late answer: I'm fine with merging it through your tree. Any patches on dts/dtsi files should go through mine, but for the bindings it's fine (and make sense) to take them through the driver subsystem maintainers tree. Regards, Matthias so you need to coordinate with him for which kernel this driver will be merged. This pull request is for 4.11, but since it is so late in the cycle I can understand if this slips to 4.12. In any case, this should be coordinated. It is too late for 4.11. We close our merge window by -rc6, in order to give janitors some time to check if everything is ok. Also, unfortunately I won't have any time this week to review this patchset. So, let's not rush it and merge it after 4.11-rc1, for 4.12. Regards, Mauro Regards, Hans The following changes since commit 9eeb0ed0f30938f31a3d9135a88b9502192c18dd: [media] mtk-vcodec: fix build warnings without DEBUG (2017-02-08 12:08:20 -0200) are available in the git repository at: git://linuxtv.org/hverkuil/media_tree.git for-v4.11e for you to fetch changes up to 0f492f30d15aec43248fbdd4d6ceea8f495f4457: vcodec: mediatek: Add Maintainers entry for Mediatek JPEG driver (2017-02-13 11:35:29 +0100) Rick Chang (3): dt-bindings: mediatek: Add a binding for Mediatek JPEG Decoder vcodec: mediatek: Add Mediatek JPEG Decoder Driver vcodec: mediatek: Add Maintainers entry for Mediatek JPEG driver Documentation/devicetree/bindings/media/mediatek-jpeg-decoder.txt | 37 + MAINTAINERS |7 + drivers/media/platform/Kconfig| 15 + drivers/media/platform/Makefile |2 + drivers/media/platform/mtk-jpeg/Makefile |2 + drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c | 1306 + drivers/media/platform/mtk-jpeg/mtk_jpeg_core.h | 139 drivers/media/platform/mtk-jpeg/mtk_jpeg_hw.c | 417 +++ drivers/media/platform/mtk-jpeg/mtk_jpeg_hw.h | 91 +++ drivers/media/platform/mtk-jpeg/mtk_jpeg_parse.c | 160 drivers/media/platform/mtk-jpeg/mtk_jpeg_parse.h | 25 + drivers/media/platform/mtk-jpeg/mtk_jpeg_reg.h| 58 ++ 12 files changed, 2259 insertions(+) create mode 100644 Documentation/devicetree/bindings/media/mediatek-jpeg-decoder.txt create mode 100644 drivers/media/platform/mtk-jpeg/Makefile create mode 100644 drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c create mode 100644 drivers/media/platform/mtk-jpeg/mtk_jpeg_core.h create mode 100644 drivers/media/platform/mtk-jpeg/mtk_jpeg_hw.c create mode 100644 drivers/media/platform/mtk-jpeg/mtk_jpeg_hw.h create mode 100644 drivers/media/platform/mtk-jpeg/mtk_jpeg_parse.c create mode 100644 drivers/media/platform/mtk-jpeg/mtk_jpeg_parse.h create mode 100644 drivers/media/platform/mtk-jpeg/mtk_jpeg_reg.h Thanks, Mauro
Re: [PATCH v6 3/3] arm: dts: mt2701: Add node for Mediatek JPEG Decoder
Hi James, On 10/01/17 02:28, Eddie Huang wrote: Hi Matthias, On Mon, 2017-01-09 at 19:45 +0100, Matthias Brugger wrote: On 09/01/17 12:29, Hans Verkuil wrote: Hi Rick, On 01/06/2017 03:34 AM, Rick Chang wrote: Hi Hans, The dependence on [1] has been merged in 4.10, but [2] has not.Do you have any idea about this patch series? Should we wait for [2] or we could merge the source code and dt-binding first? Looking at [2] I noticed that the last comment was July 4th. What is the reason it hasn't been merged yet? If I know [2] will be merged for 4.11, then I am fine with merging this media patch series. The dependency of this patch on [2] is something Mauro can handle. If [2] is not merged for 4.11, then I think it is better to wait until it is merged. I can't take [2] because there is no scpsys in the dts present. It seems that it got never posted. Rick can you please follow-up with James and provide a patch which adds a scpsys node to the mt2701.dtsi? James sent three MT2701 dts patches [1] two weeks ago, these three patches include scpsys node. Please take a reference. And We will send new MT2701 ionmmu/smi dtsi node patch base on [1] later, thus you can accept and merge to 4.11. Thanks for the clarification. I pulled all this patches into v4.10-next/dts32 Hans will you take v9 of this patch set? Then I'll take the dts patch. Regards, Matthias [1] https://patchwork.kernel.org/patch/9489991/ https://patchwork.kernel.org/patch/9489985/ https://patchwork.kernel.org/patch/9489989/ Thanks, Eddie -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v6 3/3] arm: dts: mt2701: Add node for Mediatek JPEG Decoder
On 09/01/17 19:45, Matthias Brugger wrote: On 09/01/17 12:29, Hans Verkuil wrote: Hi Rick, On 01/06/2017 03:34 AM, Rick Chang wrote: Hi Hans, The dependence on [1] has been merged in 4.10, but [2] has not.Do you have any idea about this patch series? Should we wait for [2] or we could merge the source code and dt-binding first? Looking at [2] I noticed that the last comment was July 4th. What is the reason it hasn't been merged yet? If I know [2] will be merged for 4.11, then I am fine with merging this media patch series. The dependency of this patch on [2] is something Mauro can handle. If [2] is not merged for 4.11, then I think it is better to wait until it is merged. I can't take [2] because there is no scpsys in the dts present. It seems that it got never posted. Rick can you please follow-up with James and provide a patch which adds a scpsys node to the mt2701.dtsi? Ah I forgot, dts patches should go through my tree, so Hans please don't merge this patch. Bindings should go through your branch though. Thanks, Matthias -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v6 3/3] arm: dts: mt2701: Add node for Mediatek JPEG Decoder
On 09/01/17 12:29, Hans Verkuil wrote: Hi Rick, On 01/06/2017 03:34 AM, Rick Chang wrote: Hi Hans, The dependence on [1] has been merged in 4.10, but [2] has not.Do you have any idea about this patch series? Should we wait for [2] or we could merge the source code and dt-binding first? Looking at [2] I noticed that the last comment was July 4th. What is the reason it hasn't been merged yet? If I know [2] will be merged for 4.11, then I am fine with merging this media patch series. The dependency of this patch on [2] is something Mauro can handle. If [2] is not merged for 4.11, then I think it is better to wait until it is merged. I can't take [2] because there is no scpsys in the dts present. It seems that it got never posted. Rick can you please follow-up with James and provide a patch which adds a scpsys node to the mt2701.dtsi? Thanks, Matthias -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] [media] VPU: mediatek: fix dereference of pdev before checking it is null
On 16/11/16 20:16, Colin King wrote: From: Colin Ian King <colin.k...@canonical.com> pdev is dereferenced using platform_get_drvdata before a check to see if it is null, hence there could be a potential null pointer dereference issue. Instead, first check if pdev is null and only then deference pdev when initializing vpu. Found with static analysis by CoverityScan, CID 1357797 Signed-off-by: Colin Ian King <colin.k...@canonical.com> --- Reviewed-by: Matthias Brugger <mbrug...@suse.com> drivers/media/platform/mtk-vpu/mtk_vpu.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/mtk-vpu/mtk_vpu.c b/drivers/media/platform/mtk-vpu/mtk_vpu.c index c9bf58c..41f31b2 100644 --- a/drivers/media/platform/mtk-vpu/mtk_vpu.c +++ b/drivers/media/platform/mtk-vpu/mtk_vpu.c @@ -523,9 +523,9 @@ static int load_requested_vpu(struct mtk_vpu *vpu, int vpu_load_firmware(struct platform_device *pdev) { - struct mtk_vpu *vpu = platform_get_drvdata(pdev); + struct mtk_vpu *vpu; struct device *dev = >dev; - struct vpu_run *run = >run; + struct vpu_run *run; const struct firmware *vpu_fw = NULL; int ret; @@ -533,6 +533,8 @@ int vpu_load_firmware(struct platform_device *pdev) dev_err(dev, "VPU platform device is invalid\n"); return -EINVAL; } + vpu = platform_get_drvdata(pdev); + run = >run; mutex_lock(>vpu_mutex); if (vpu->fw_loaded) { -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v4 1/3] dt-bindings: mediatek: Add a binding for Mediatek JPEG Decoder
On 07/11/16 07:57, Rick Chang wrote: Add a DT binding documentation for Mediatek JPEG Decoder of MT2701 SoC. Signed-off-by: Rick ChangSigned-off-by: Minghsiu Tsai --- .../bindings/media/mediatek-jpeg-codec.txt | 35 ++ 1 file changed, 35 insertions(+) create mode 100644 Documentation/devicetree/bindings/media/mediatek-jpeg-codec.txt diff --git a/Documentation/devicetree/bindings/media/mediatek-jpeg-codec.txt b/Documentation/devicetree/bindings/media/mediatek-jpeg-codec.txt new file mode 100644 index 000..c7dbcc2 --- /dev/null +++ b/Documentation/devicetree/bindings/media/mediatek-jpeg-codec.txt @@ -0,0 +1,35 @@ +* Mediatek JPEG Decoder + +Mediatek JPEG Decoder is the JPEG decode hardware present in Mediatek SoCs + +Required properties: +- compatible : "mediatek,jpgdec" Is this block in all arm SoCs from Mediatek? If not, then I would prefer to use "mediatek,mt-jpgdec" where stands for the oldest model which has this block. In parallel to that the dts should have this compatible plus the one for mt2701, for example: compatible = "mediatek,mt2701-uart", "mediatek,mt6577-uart" Thanks, Matthias -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v4 2/4] dt-bindings: Add a binding for Mediatek MDP
On 22/08/16 03:08, Minghsiu Tsai wrote: On Fri, 2016-08-19 at 09:16 -0500, Rob Herring wrote: On Fri, Aug 19, 2016 at 07:39:25PM +0800, Minghsiu Tsai wrote: Add a DT binding documentation of MDP for the MT8173 SoC from Mediatek Signed-off-by: Minghsiu Tsai--- .../devicetree/bindings/media/mediatek-mdp.txt | 109 1 file changed, 109 insertions(+) create mode 100644 Documentation/devicetree/bindings/media/mediatek-mdp.txt Please add acks when posting new versions. Rob Sorry for my mistake. I will add it in next version. No need to provide a new version just because of this. If the driver will be taken as is, I can fix up the ack when applying. Thanks, Matthias -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v4 9/9] arm64: dts: mediatek: Add Video Decoder for MT8173
On 10/08/16 16:48, Tiffany Lin wrote: Add video decoder node for MT8173 Signed-off-by: Tiffany Lin--- arch/arm64/boot/dts/mediatek/mt8173.dtsi | 44 ++ 1 file changed, 44 insertions(+) diff --git a/arch/arm64/boot/dts/mediatek/mt8173.dtsi b/arch/arm64/boot/dts/mediatek/mt8173.dtsi index 10f638f..2872cd7 100644 --- a/arch/arm64/boot/dts/mediatek/mt8173.dtsi +++ b/arch/arm64/boot/dts/mediatek/mt8173.dtsi @@ -974,6 +974,50 @@ #clock-cells = <1>; }; + vcodec_dec: vcodec@1600 { + compatible = "mediatek,mt8173-vcodec-dec"; + reg = <0 0x1600 0 0x100>, /* VDEC_SYS */ + <0 0x1602 0 0x1000>,/* VDEC_MISC */ + <0 0x16021000 0 0x800>, /* VDEC_LD */ + <0 0x16021800 0 0x800>, /* VDEC_TOP */ + <0 0x16022000 0 0x1000>,/* VDEC_CM */ + <0 0x16023000 0 0x1000>,/* VDEC_AD */ + <0 0x16024000 0 0x1000>,/* VDEC_AV */ + <0 0x16025000 0 0x1000>,/* VDEC_PP */ + <0 0x16026800 0 0x800>, /* VDEC_HWD */ + <0 0x16027000 0 0x800>, /* VDEC_HWQ */ + <0 0x16027800 0 0x800>, /* VDEC_HWB */ + <0 0x16028400 0 0x400>; /* VDEC_HWG */ + interrupts = ; + mediatek,larb = <>; + iommus = < M4U_PORT_HW_VDEC_MC_EXT>, +< M4U_PORT_HW_VDEC_PP_EXT>, +< M4U_PORT_HW_VDEC_AVC_MV_EXT>, +< M4U_PORT_HW_VDEC_PRED_RD_EXT>, +< M4U_PORT_HW_VDEC_PRED_WR_EXT>, +< M4U_PORT_HW_VDEC_UFO_EXT>, +< M4U_PORT_HW_VDEC_VLD_EXT>, +< M4U_PORT_HW_VDEC_VLD2_EXT>; + mediatek,vpu = <>; + power-domains = < MT8173_POWER_DOMAIN_VDEC>; + clocks = < CLK_APMIXED_VCODECPLL>, +< CLK_TOP_UNIVPLL_D2>, +< CLK_TOP_CCI400_SEL>, +< CLK_TOP_VDEC_SEL>, +< CLK_TOP_VCODECPLL>, +< CLK_APMIXED_VENCPLL>, +< CLK_TOP_VENC_LT_SEL>, +< CLK_TOP_VCODECPLL_370P5>; + clock-names = "vcodecpll", + "univpll_d2", + "clk_cci400_sel", + "vdec_sel", + "vdecpll", + "vencpll", + "venc_lt_sel", + "vdec_bus_clk_src"; + }; + Shouldn't we set here: status = "disabled"; To save power on headless systems? Regards, Matthias larb1: larb@1601 { compatible = "mediatek,mt8173-smi-larb"; reg = <0 0x1601 0 0x1000>; -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v2 4/8] dt-bindings: Add a binding for Mediatek Video Encoder
On 14/12/15 09:26, tiffany lin wrote: On Fri, 2015-12-11 at 11:29 -0600, Rob Herring wrote: On Fri, Dec 11, 2015 at 05:55:39PM +0800, Tiffany Lin wrote: Add a DT binding documentation of Video Encoder for the MT8173 SoC from Mediatek. Signed-off-by: Tiffany LinA question and minor issue below, otherwise: Acked-by: Rob Herring --- .../devicetree/bindings/media/mediatek-vcodec.txt | 58 1 file changed, 58 insertions(+) create mode 100644 Documentation/devicetree/bindings/media/mediatek-vcodec.txt diff --git a/Documentation/devicetree/bindings/media/mediatek-vcodec.txt b/Documentation/devicetree/bindings/media/mediatek-vcodec.txt new file mode 100644 index 000..510cd81 --- /dev/null +++ b/Documentation/devicetree/bindings/media/mediatek-vcodec.txt @@ -0,0 +1,58 @@ +Mediatek Video Codec + +Mediatek Video Codec is the video codec hw present in Mediatek SoCs which +supports high resolution encoding functionalities. + +Required properties: +- compatible : "mediatek,mt8173-vcodec-enc" for encoder +- reg : Physical base address of the video codec registers and length of + memory mapped region. +- interrupts : interrupt number to the cpu. +- mediatek,larb : must contain the local arbiters in the current Socs. This looks strange, shouldn't it be "larb" instead of "mediatek,larb". At least the example does not use the mediatek prefix. +- clocks : list of clock specifiers, corresponding to entries in + the clock-names property; +- clock-names: must contain "vencpll", "venc_lt_sel", "vcodecpll_370p5_ck" +- iommus : list of iommus specifiers should be enabled for hw encode. + There are 2 cells needed to enable/disable iommu. + The first one is local arbiter index(larbid), and the other is port + index(portid) within local arbiter. Specifies the larbid and portid + as defined in dt-binding/memory/mt8173-larb-port.h. +- mediatek,vpu : the node of video processor unit Same here. Regards, Matthias + +Example: +vcodec_enc: vcodec@0x18002000 { +compatible = "mediatek,mt8173-vcodec-enc"; +reg = <0 0x18002000 0 0x1000>,/*VENC_SYS*/ + <0 0x19002000 0 0x1000>;/*VENC_LT_SYS*/ +interrupts = , + ; +larb = <>, + <>; +iommus = < M4U_LARB3_ID M4U_PORT_VENC_RCPU>, Is this the same iommu as the VPU? If so, you can't have a mixed number of cells. Yes, its same iommus as the VPU. Now we use two parameters for iommus. We will fix this in next version. + < M4U_LARB3_ID M4U_PORT_VENC_REC>, + < M4U_LARB3_ID M4U_PORT_VENC_BSDMA>, + < M4U_LARB3_ID M4U_PORT_VENC_SV_COMV>, + < M4U_LARB3_ID M4U_PORT_VENC_RD_COMV>, + < M4U_LARB3_ID M4U_PORT_VENC_CUR_LUMA>, + < M4U_LARB3_ID M4U_PORT_VENC_CUR_CHROMA>, + < M4U_LARB3_ID M4U_PORT_VENC_REF_LUMA>, + < M4U_LARB3_ID M4U_PORT_VENC_REF_CHROMA>, + < M4U_LARB3_ID M4U_PORT_VENC_NBM_RDMA>, + < M4U_LARB3_ID M4U_PORT_VENC_NBM_WDMA>, + < M4U_LARB5_ID M4U_PORT_VENC_RCPU_SET2>, + < M4U_LARB5_ID M4U_PORT_VENC_REC_FRM_SET2>, + < M4U_LARB5_ID M4U_PORT_VENC_BSDMA_SET2>, + < M4U_LARB5_ID M4U_PORT_VENC_SV_COMA_SET2>, + < M4U_LARB5_ID M4U_PORT_VENC_RD_COMA_SET2>, + < M4U_LARB5_ID M4U_PORT_VENC_CUR_LUMA_SET2>, + < M4U_LARB5_ID M4U_PORT_VENC_CUR_CHROMA_SET2>, + < M4U_LARB5_ID M4U_PORT_VENC_REF_LUMA_SET2>, + < M4U_LARB5_ID M4U_PORT_VENC_REC_CHROMA_SET2>; +vpu = <>; Need to update the example. Sorry, I didn't get it. Do you means update VPU binding document "media/mediatek-vpu.txt"? +clocks = < CLK_APMIXED_VENCPLL>, + < CLK_TOP_VENC_LT_SEL>, + < CLK_TOP_VCODECPLL_370P5>; +clock-names = "vencpll", + "venc_lt_sel", + "vcodecpll_370p5_ck"; + }; -- 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v2 5/8] arm64: dts: mediatek: Add Video Encoder for MT8173
On Friday 11 Dec 2015 17:55:40 Tiffany Lin wrote: > Add video encoder node for MT8173 > > Signed-off-by: Tiffany Lin> --- > arch/arm64/boot/dts/mediatek/mt8173.dtsi | 47 > ++ 1 file changed, 47 insertions(+) > > diff --git a/arch/arm64/boot/dts/mediatek/mt8173.dtsi > b/arch/arm64/boot/dts/mediatek/mt8173.dtsi index b8c8ff0..a6b0fcf 100644 > --- a/arch/arm64/boot/dts/mediatek/mt8173.dtsi > +++ b/arch/arm64/boot/dts/mediatek/mt8173.dtsi > @@ -545,6 +545,53 @@ > #clock-cells = <1>; > }; > > + larb3: larb@18001000 { > + compatible = "mediatek,mt8173-smi-larb"; > + reg = <0 0x18001000 0 0x1000>; > + mediatek,smi = <_common>; > + power-domains = < MT8173_POWER_DOMAIN_VENC>; > + clocks = < CLK_VENC_CKE1>, > + < CLK_VENC_CKE0>; > + clock-names = "apb", "smi"; > + }; > + > + vcodec_enc: vcodec@18002000 { > + compatible = "mediatek,mt8173-vcodec-enc"; > + reg = <0 0x18002000 0 0x1000>, /* VENC_SYS */ > + <0 0x19002000 0 0x1000>; /* VENC_LT_SYS */ > + interrupts = , > + ; > + larb = <>, > +<>; should be mediatek,larb or just larb for all instances of the larb's. See my other email about the bindings. Regards, Matthias > + iommus = < M4U_LARB3_ID M4U_PORT_VENC_RCPU>, > + < M4U_LARB3_ID M4U_PORT_VENC_REC>, > + < M4U_LARB3_ID M4U_PORT_VENC_BSDMA>, > + < M4U_LARB3_ID M4U_PORT_VENC_SV_COMV>, > + < M4U_LARB3_ID M4U_PORT_VENC_RD_COMV>, > + < M4U_LARB3_ID M4U_PORT_VENC_CUR_LUMA>, > + < M4U_LARB3_ID M4U_PORT_VENC_CUR_CHROMA>, > + < M4U_LARB3_ID M4U_PORT_VENC_REF_LUMA>, > + < M4U_LARB3_ID M4U_PORT_VENC_REF_CHROMA>, > + < M4U_LARB3_ID M4U_PORT_VENC_NBM_RDMA>, > + < M4U_LARB3_ID M4U_PORT_VENC_NBM_WDMA>, > + < M4U_LARB5_ID M4U_PORT_VENC_RCPU_SET2>, > + < M4U_LARB5_ID > M4U_PORT_VENC_REC_FRM_SET2>, > + < M4U_LARB5_ID M4U_PORT_VENC_BSDMA_SET2>, > + < M4U_LARB5_ID > M4U_PORT_VENC_SV_COMA_SET2>, > + < M4U_LARB5_ID > M4U_PORT_VENC_RD_COMA_SET2>, > + < M4U_LARB5_ID > M4U_PORT_VENC_CUR_LUMA_SET2>, > + < M4U_LARB5_ID > M4U_PORT_VENC_CUR_CHROMA_SET2>, > + < M4U_LARB5_ID > M4U_PORT_VENC_REF_LUMA_SET2>, > + < M4U_LARB5_ID > M4U_PORT_VENC_REC_CHROMA_SET2>; > + vpu = <>; > + clocks = < CLK_APMIXED_VENCPLL>, > + < CLK_TOP_VENC_LT_SEL>, > + < CLK_TOP_VCODECPLL_370P5>; > + clock-names = "vencpll", > + "venc_lt_sel", > + "vcodecpll_370p5_ck"; > + }; > + > vencltsys: clock-controller@1900 { > compatible = "mediatek,mt8173-vencltsys", "syscon"; > reg = <0 0x1900 0 0x1000>; -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html