Re: [PATCH 1/5] drm/panel: Add support for the EDT ETM0700G0BDH6

2017-11-24 Thread Fabio Estevam
Hi Jan,

On Thu, Nov 23, 2017 at 1:18 PM, Türk, Jan  wrote:
> Hi Fabio,
>
> I've used git send-email and tested the patches by checkpatch.pl before 
> without any problems.
> So it might have been touched by the mail server, so can you send me your 
> checkpatch.pl log (directly)?

Take a look at your patch here: https://patchwork.kernel.org/patch/10072765/

Click in the "patch" link and download it. You will notice that all
tabs have been converted into spaces.

checkpatch will warn about it.
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH 1/5] drm/panel: Add support for the EDT ETM0700G0BDH6

2017-11-23 Thread Fabio Estevam
Hi Jan,

On Thu, Nov 23, 2017 at 10:55 AM, Jan Tuerk <jan.tu...@emtrion.com> wrote:
> The Emerging Display Technology ETM0700G0BDH6 is exactly
> the same display as the ETM0700G0DH6, exept the pixelclock
> polarity. Therefore re-use the ETM0700G0DH6 modes. It is
> used by default on emtrion Avari based development kits.
>
> Signed-off-by: Jan Tuerk <jan.tu...@emtrion.com>

Please run ./scripts/checkpatch.pl on your patch. Currently it gives:
total: 18 errors, 13 warnings, 39 lines checked

Please fix and resend. Also, you could try git send-email in the next time.

Regards,

Fabio Estevam
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 3/7] drm/rockchip: dsi: Remove unnecessary platform_get_resource() error check

2017-12-18 Thread Fabio Estevam
From: Fabio Estevam <fabio.este...@nxp.com>

devm_ioremap_resource() already checks if the resource is NULL, so
remove the unnecessary platform_get_resource() error check.

Cc: Heiko Stübner <he...@sntech.de>
Signed-off-by: Fabio Estevam <fabio.este...@nxp.com>
---
 drivers/gpu/drm/rockchip/dw-mipi-dsi.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/gpu/drm/rockchip/dw-mipi-dsi.c 
b/drivers/gpu/drm/rockchip/dw-mipi-dsi.c
index b1fe063..591953c 100644
--- a/drivers/gpu/drm/rockchip/dw-mipi-dsi.c
+++ b/drivers/gpu/drm/rockchip/dw-mipi-dsi.c
@@ -1202,9 +1202,6 @@ static int dw_mipi_dsi_bind(struct device *dev, struct 
device *master,
return ret;
 
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-   if (!res)
-   return -ENODEV;
-
dsi->base = devm_ioremap_resource(dev, res);
if (IS_ERR(dsi->base))
return PTR_ERR(dsi->base);
-- 
2.7.4

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 1/7] drm/bridge/synopsys: dsi: Remove unnecessary platform_get_resource() error check

2017-12-18 Thread Fabio Estevam
From: Fabio Estevam <fabio.este...@nxp.com>

devm_ioremap_resource() already checks if the resource is NULL, so
remove the unnecessary platform_get_resource() error check.

Cc: Archit Taneja <arch...@codeaurora.org>
Signed-off-by: Fabio Estevam <fabio.este...@nxp.com>
---
 drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c 
b/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c
index d9cca4f..5db4cbb 100644
--- a/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c
+++ b/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c
@@ -860,9 +860,6 @@ __dw_mipi_dsi_probe(struct platform_device *pdev,
 
if (!plat_data->base) {
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-   if (!res)
-   return ERR_PTR(-ENODEV);
-
dsi->base = devm_ioremap_resource(dev, res);
if (IS_ERR(dsi->base))
return ERR_PTR(-ENODEV);
-- 
2.7.4

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 4/7] drm/rockchip: inno_hdmi: Remove unnecessary platform_get_resource() error check

2017-12-18 Thread Fabio Estevam
From: Fabio Estevam <fabio.este...@nxp.com>

devm_ioremap_resource() already checks if the resource is NULL, so
remove the unnecessary platform_get_resource() error check.

Cc: Heiko Stübner <he...@sntech.de>
Signed-off-by: Fabio Estevam <fabio.este...@nxp.com>
---
 drivers/gpu/drm/rockchip/inno_hdmi.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/gpu/drm/rockchip/inno_hdmi.c 
b/drivers/gpu/drm/rockchip/inno_hdmi.c
index fab30927..f6ad487 100644
--- a/drivers/gpu/drm/rockchip/inno_hdmi.c
+++ b/drivers/gpu/drm/rockchip/inno_hdmi.c
@@ -831,9 +831,6 @@ static int inno_hdmi_bind(struct device *dev, struct device 
*master,
hdmi->drm_dev = drm;
 
iores = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-   if (!iores)
-   return -ENXIO;
-
hdmi->regs = devm_ioremap_resource(dev, iores);
if (IS_ERR(hdmi->regs))
return PTR_ERR(hdmi->regs);
-- 
2.7.4

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 2/7] drm/exynos: decon5433: Remove unnecessary platform_get_resource() error check

2017-12-18 Thread Fabio Estevam
From: Fabio Estevam <fabio.este...@nxp.com>

devm_ioremap_resource() already checks if the resource is NULL, so
remove the unnecessary platform_get_resource() error check.

Cc: Inki Dae <inki@samsung.com>
Signed-off-by: Fabio Estevam <fabio.este...@nxp.com>
---
 drivers/gpu/drm/exynos/exynos5433_drm_decon.c | 5 -
 1 file changed, 5 deletions(-)

diff --git a/drivers/gpu/drm/exynos/exynos5433_drm_decon.c 
b/drivers/gpu/drm/exynos/exynos5433_drm_decon.c
index 6be5b53..1d509a8 100644
--- a/drivers/gpu/drm/exynos/exynos5433_drm_decon.c
+++ b/drivers/gpu/drm/exynos/exynos5433_drm_decon.c
@@ -744,11 +744,6 @@ static int exynos5433_decon_probe(struct platform_device 
*pdev)
}
 
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-   if (!res) {
-   dev_err(dev, "cannot find IO resource\n");
-   return -ENXIO;
-   }
-
ctx->addr = devm_ioremap_resource(dev, res);
if (IS_ERR(ctx->addr)) {
dev_err(dev, "ioremap failed\n");
-- 
2.7.4

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 6/7] drm/stm: ltdc: Remove unnecessary platform_get_resource() error check

2017-12-18 Thread Fabio Estevam
From: Fabio Estevam <fabio.este...@nxp.com>

devm_ioremap_resource() already checks if the resource is NULL, so
remove the unnecessary platform_get_resource() error check.

Cc: Philippe Cornu <philippe.co...@st.com>
Signed-off-by: Fabio Estevam <fabio.este...@nxp.com>
---
 drivers/gpu/drm/stm/ltdc.c | 6 --
 1 file changed, 6 deletions(-)

diff --git a/drivers/gpu/drm/stm/ltdc.c b/drivers/gpu/drm/stm/ltdc.c
index 394613b..6dc5d4e 100644
--- a/drivers/gpu/drm/stm/ltdc.c
+++ b/drivers/gpu/drm/stm/ltdc.c
@@ -901,12 +901,6 @@ int ltdc_load(struct drm_device *ddev)
}
 
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-   if (!res) {
-   DRM_ERROR("Unable to get resource\n");
-   ret = -ENODEV;
-   goto err;
-   }
-
ldev->regs = devm_ioremap_resource(dev, res);
if (IS_ERR(ldev->regs)) {
DRM_ERROR("Unable to get ltdc registers\n");
-- 
2.7.4

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 7/7] drm/tegra: vic: Remove unnecessary platform_get_resource() error check

2017-12-18 Thread Fabio Estevam
From: Fabio Estevam <fabio.este...@nxp.com>

devm_ioremap_resource() already checks if the resource is NULL, so
remove the unnecessary platform_get_resource() error check.

Cc: Thierry Reding <thierry.red...@gmail.com>
Signed-off-by: Fabio Estevam <fabio.este...@nxp.com>
---
 drivers/gpu/drm/tegra/vic.c | 5 -
 1 file changed, 5 deletions(-)

diff --git a/drivers/gpu/drm/tegra/vic.c b/drivers/gpu/drm/tegra/vic.c
index f5794dd..088a795 100644
--- a/drivers/gpu/drm/tegra/vic.c
+++ b/drivers/gpu/drm/tegra/vic.c
@@ -304,11 +304,6 @@ static int vic_probe(struct platform_device *pdev)
return -ENOMEM;
 
regs = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-   if (!regs) {
-   dev_err(>dev, "failed to get registers\n");
-   return -ENXIO;
-   }
-
vic->regs = devm_ioremap_resource(dev, regs);
if (IS_ERR(vic->regs))
return PTR_ERR(vic->regs);
-- 
2.7.4

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 5/7] drm/stm: dsi: Remove unnecessary platform_get_resource() error check

2017-12-18 Thread Fabio Estevam
From: Fabio Estevam <fabio.este...@nxp.com>

devm_ioremap_resource() already checks if the resource is NULL, so
remove the unnecessary platform_get_resource() error check.

Cc: Philippe Cornu <philippe.co...@st.com>
Signed-off-by: Fabio Estevam <fabio.este...@nxp.com>
---
 drivers/gpu/drm/stm/dw_mipi_dsi-stm.c | 5 -
 1 file changed, 5 deletions(-)

diff --git a/drivers/gpu/drm/stm/dw_mipi_dsi-stm.c 
b/drivers/gpu/drm/stm/dw_mipi_dsi-stm.c
index 82dcb20..fd02506 100644
--- a/drivers/gpu/drm/stm/dw_mipi_dsi-stm.c
+++ b/drivers/gpu/drm/stm/dw_mipi_dsi-stm.c
@@ -290,11 +290,6 @@ static int dw_mipi_dsi_stm_probe(struct platform_device 
*pdev)
return -ENOMEM;
 
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-   if (!res) {
-   DRM_ERROR("Unable to get resource\n");
-   return -ENODEV;
-   }
-
dsi->base = devm_ioremap_resource(dev, res);
if (IS_ERR(dsi->base)) {
DRM_ERROR("Unable to get dsi registers\n");
-- 
2.7.4

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH v2 RESEND] display: panel: Add AUO g070vvn01 display support (800x480)

2018-05-09 Thread Fabio Estevam
Hi Lukasz,

On Wed, May 9, 2018 at 12:39 PM, Lukasz Majewski  wrote:

> +Example device-tree definition when connected to iMX6Q based board
> +
> +   lcd_panel: lcd-panel {
> +   compatible = "auo,g070vvn01";
> +   backlight = <_lcd>;
> +   bus-format-override = "rgb565";

Please remove this property as it is not documented nor used anywhere.
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v2] MAINTAINERS: drm: fsl-dcu: Update to Alison's NXP email address

2018-05-20 Thread Fabio Estevam
From: Fabio Estevam <fabio.este...@nxp.com>

The freescale.com email domain is not valid anymore, so use
the nxp.com domain instead.

Signed-off-by: Fabio Estevam <fabio.este...@nxp.com>
---
Changes since v1:
- State that the fsl.com is not a valid domain anymore.

 MAINTAINERS | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index 4923621..794c130 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -4661,7 +4661,7 @@ F:
Documentation/devicetree/bindings/display/exynos/
 
 DRM DRIVERS FOR FREESCALE DCU
 M: Stefan Agner <ste...@agner.ch>
-M: Alison Wang <alison.w...@freescale.com>
+M: Alison Wang <alison.w...@nxp.com>
 L: dri-devel@lists.freedesktop.org
 S: Supported
 F: drivers/gpu/drm/fsl-dcu/
-- 
2.7.4

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH] drm/bridge: dw-hdmi: Switch to SPDX identifier

2018-05-20 Thread Fabio Estevam
From: Fabio Estevam <fabio.este...@nxp.com>

Adopt the SPDX license identifier headers to ease license compliance
management.

Signed-off-by: Fabio Estevam <fabio.este...@nxp.com>
---
 drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 7 +--
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c 
b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
index ec8d000..3bc62d5 100644
--- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
+++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
@@ -1,15 +1,10 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * DesignWare High-Definition Multimedia Interface (HDMI) driver
  *
  * Copyright (C) 2013-2015 Mentor Graphics Inc.
  * Copyright (C) 2011-2013 Freescale Semiconductor, Inc.
  * Copyright (C) 2010, Guennadi Liakhovetski <g.liakhovet...@gmx.de>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
  */
 #include 
 #include 
-- 
2.7.4

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH] drm/mxsfb: rename driver to mxsfb-drm

2018-06-12 Thread Fabio Estevam
On Tue, Jun 12, 2018 at 11:35 AM, Stefan Agner  wrote:

> There are two drivers for the LCDIF/MXSFB peripheral. If the DRM
> and fbdev are compiled in, the registration of the second driver
> fails:
>   mxs-dma 3300.dma-apbh: initialized
>   mxsfb 3073.lcdif: 3073.lcdif supply lcd not found, using dummy 
> regulator
>   mxsfb 3073.lcdif: initialized
>   Error: Driver 'mxsfb' is already registered, aborting...
>
> Avoid driver name conflict with MXS fbdev driver by renaming the
> more recently added DRM driver.
>
> Signed-off-by: Stefan Agner 

Yes, this driver name collision is annoying:

Reviewed-by: Fabio Estevam 
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH] drm/mxsfb: rename driver to mxsfb-drm

2018-06-13 Thread Fabio Estevam
On Wed, Jun 13, 2018 at 9:38 AM, Stefan Agner  wrote:

> It seems to me a rather extreme measure though, given we could fix the
> situation rather easily.

There are dtb's using the fbdev mxsfb driver like for example:
arch/arm/boot/dts/imx28-evk.dts

If we kill the fbdev mxsfb driver then the display will stop working
for some users and I don't think they will be happy.

Last time I tried it was not possible to use the original fbdev mxsfb
bindings with the new drm driver.

Of course we can convert to the drm mxsfb driver, but IMHO we should
avoid functional breakage all of a sudden.

In the meantime Stefan's patch seems to be a good approach.
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH 1/3] drm: mxsfb: Change driver.name to mxsfb-drm

2018-06-15 Thread Fabio Estevam
On Fri, Jun 15, 2018 at 5:58 PM, Leonard Crestez
 wrote:

> In that thread there is a proposal for removing the old fbdev/mxsfb
> driver entirely.
>
> That would break old DTBs, isn't this generally considered bad? Also,
> are we sure the removal of fbdev/mxsfb wouldn't lose any features?

Yes, I also think we should not break old dtb's.

> What my series does is make both drivers work with the same kernel
> image and turns the choice into a board-level dtb decision. Supporting
> everything at once seems desirable to me and it allows for a very
> smooth upgrade path.
>
> The old driver could be removed later, after all users are converted.

Agreed.

Maybe the mxs fbdev driver needs to warn users saying that that the
driver is deprecated and the bindings need to be updated to the DRM
bindings style.
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH 1/3] drm: mxsfb: Change driver.name to mxsfb-drm

2018-06-15 Thread Fabio Estevam
Hi Leonard,

On Fri, Jun 15, 2018 at 4:43 PM, Leonard Crestez
 wrote:
> The FBDEV driver uses the same name and both can't be registered at the
> same time. Fix this by renaming the drm driver to mxsfb-drm
>
> Signed-off-by: Leonard Crestez 

Stefan sent the same patch a few days ago:
https://www.spinics.net/lists/dri-devel/msg179489.html
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH 1/3] drm: mxsfb: Change driver.name to mxsfb-drm

2018-06-15 Thread Fabio Estevam
On Fri, Jun 15, 2018 at 6:36 PM, Marek Vasut  wrote:

> Having two drivers in the kernel with different set of bugs is always bad.

Sure, but breaking dtb's is also bad.

Can the mxsfb driver be modified to handle the old style bindings?

The IPU drm driver is capable of handling both the old style where the
display timing is passed in dts and the new drm style.

For example:

arch/arm/boot/dts/imx6qdl-sabresd.dtsi uses the drm style binding
arch/arm/boot/dts/imx6qdl-sabreauto.dtsi uses the old style of passing
the display timings in dts

Both formats are accepted by the ipu drm driver.

Can't mxsfb drm driver support both? Then we don't need to worry about
breaking dtb's and could safely remove the mxs fbdev driver.
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v4 1/2] drm/etnaviv: Check for platform_device_register_simple() failure

2018-06-27 Thread Fabio Estevam
From: Fabio Estevam 

platform_device_register_simple() may fail, so we should better
check its return value and propagate it in the case of error.

Cc: 
Fixes: 246774d17fc0 ("drm/etnaviv: remove the need for a gpu-subsystem DT node")
Signed-off-by: Fabio Estevam 
---
Changes since v3:
- Only set etnaviv_drm when platform_device_register_simple()
succeeds (Phillip)

 drivers/gpu/drm/etnaviv/etnaviv_drv.c | 21 ++---
 1 file changed, 18 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/etnaviv/etnaviv_drv.c 
b/drivers/gpu/drm/etnaviv/etnaviv_drv.c
index e5013a9..f8d264a 100644
--- a/drivers/gpu/drm/etnaviv/etnaviv_drv.c
+++ b/drivers/gpu/drm/etnaviv/etnaviv_drv.c
@@ -631,8 +631,11 @@ static struct platform_driver etnaviv_platform_driver = {
},
 };
 
+static struct platform_device *etnaviv_drm;
+
 static int __init etnaviv_init(void)
 {
+   struct platform_device *pdev;
int ret;
struct device_node *np;
 
@@ -644,7 +647,7 @@ static int __init etnaviv_init(void)
 
ret = platform_driver_register(_platform_driver);
if (ret != 0)
-   platform_driver_unregister(_gpu_driver);
+   goto unregister_gpu_driver;
 
/*
 * If the DT contains at least one available GPU device, instantiate
@@ -653,12 +656,24 @@ static int __init etnaviv_init(void)
for_each_compatible_node(np, NULL, "vivante,gc") {
if (!of_device_is_available(np))
continue;
-
-   platform_device_register_simple("etnaviv", -1, NULL, 0);
+   pdev = platform_device_register_simple("etnaviv", -1,
+  NULL, 0);
+   if (IS_ERR(pdev)) {
+   ret = PTR_ERR(pdev);
+   of_node_put(np);
+   goto unregister_platform_driver;
+   }
+   etnaviv_drm = pdev;
of_node_put(np);
break;
}
 
+   return 0;
+
+unregister_platform_driver:
+   platform_driver_unregister(_platform_driver);
+unregister_gpu_driver:
+   platform_driver_unregister(_gpu_driver);
return ret;
 }
 module_init(etnaviv_init);
-- 
2.7.4

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v4 2/2] drm/etnaviv: Fix driver unregistering

2018-06-27 Thread Fabio Estevam
From: Fabio Estevam 

Russell King reported:

"When removing and reloading the etnaviv module, the following splat
occurs:

sysfs: cannot create duplicate filename '/devices/platform/etnaviv'
CPU: 0 PID: 1471 Comm: modprobe Not tainted 4.17.0+ #1608
Hardware name: Marvell Dove (Cubox)
Backtrace:
[] (dump_backtrace) from [] (show_stack+0x18/0x1c)
 r6:ef033e38 r5:ee07b340 r4:edb9d000 r3:
[] (show_stack) from [] (dump_stack+0x20/0x28)
[] (dump_stack) from [] (sysfs_warn_dup+0x5c/0x70)
[] (sysfs_warn_dup) from [] (sysfs_create_dir_ns+0x90/0x98)
..."

Commit 246774d17fc0 ("drm/etnaviv: remove the need for a gpu-subsystem
DT node") introduced DRM registration via
platform_device_register_simple(), but missed to call
platform_device_unregister() inside etnaviv_exit().

Fix the problem by calling platform_device_unregister() inside
etnaviv_exit(). While at it, also rearrange the function calls
in the exit path to make them happen in the opposite order of
registration.

Tested on a imx6-sabresd board.

Cc: 
Fixes: 246774d17fc0 ("drm/etnaviv: remove the need for a gpu-subsystem DT node")
Reported-by: Russell King 
Signed-off-by: Fabio Estevam 
Reviewed-by: Philipp Zabel 
---
Changes since v3:
- By setting etnaviv_drm only when platform_device_register_simple()
succeeds in the previous patch we can
call platform_device_unregister(etnaviv_drm) unconditionally, which makes
the code simpler (Philipp).
 drivers/gpu/drm/etnaviv/etnaviv_drv.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/etnaviv/etnaviv_drv.c 
b/drivers/gpu/drm/etnaviv/etnaviv_drv.c
index f8d264a..4a580b0 100644
--- a/drivers/gpu/drm/etnaviv/etnaviv_drv.c
+++ b/drivers/gpu/drm/etnaviv/etnaviv_drv.c
@@ -680,8 +680,9 @@ module_init(etnaviv_init);
 
 static void __exit etnaviv_exit(void)
 {
-   platform_driver_unregister(_gpu_driver);
+   platform_device_unregister(etnaviv_drm);
platform_driver_unregister(_platform_driver);
+   platform_driver_unregister(_gpu_driver);
 }
 module_exit(etnaviv_exit);
 
-- 
2.7.4

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH] drm/etnaviv: bring back progress check in job timeout handler

2018-06-27 Thread Fabio Estevam
Hi Lucas,

On Wed, Jun 27, 2018 at 11:34 AM, Lucas Stach  wrote:
> When the hangcheck handler was replaced by the DRM scheduler timeout
> handling we dropped the forward progress check, as this might allow
> clients to hog the GPU for a long time with a big job.
>
> It turns out that even reasonably well behaved clients like the
> Armada Xorg driver occasionally trip over the 500ms timeout. Bring
> back the forward progress check to get rid of the userspace regression.
>
> We would still like to fix userspace to submit smaller batches
> if possible, but that is for another day.
>
> Fixes: 6d7a20c07760 (drm/etnaviv: replace hangcheck with scheduler timeout)

Maybe you could add a Reported-by tag from Russell?

> Signed-off-by: Lucas Stach 

> +   /*
> +* If the GPU managed to complete this jobs fence, the timout is

s/timout/timeout

Thanks
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH v2] drm/etnaviv: Fix driver unregistering

2018-06-25 Thread Fabio Estevam
Hi Philipp,

On Mon, Jun 25, 2018 at 5:02 AM, Philipp Zabel  wrote:

>> +static struct platform_device *etnaviv_drm;
>> +
>>  static int __init etnaviv_init(void)
>>  {
>>   int ret;
>> @@ -654,7 +656,8 @@ static int __init etnaviv_init(void)
>>   if (!of_device_is_available(np))
>>   continue;
>>
>> - platform_device_register_simple("etnaviv", -1, NULL, 0);
>> + etnaviv_drm = platform_device_register_simple("etnaviv", -1,
>> +   NULL, 0);
>
> If there are multiple vivante,gc device nodes, this overwrites
> etnaviv_drm with each additional device after the first one.

In fact there are multiple vivante,gc device nodes, but
platform_device_register_simple() is only called once as expected.

I will make this clear and will also check for the error code on
platform_device_register_simple().

Thanks
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v3 2/2] drm/etnaviv: Fix driver unregistering

2018-06-25 Thread Fabio Estevam
From: Fabio Estevam 

Russell King reported:

"When removing and reloading the etnaviv module, the following splat
occurs:

sysfs: cannot create duplicate filename '/devices/platform/etnaviv'
CPU: 0 PID: 1471 Comm: modprobe Not tainted 4.17.0+ #1608
Hardware name: Marvell Dove (Cubox)
Backtrace:
[] (dump_backtrace) from [] (show_stack+0x18/0x1c)
 r6:ef033e38 r5:ee07b340 r4:edb9d000 r3:
[] (show_stack) from [] (dump_stack+0x20/0x28)
[] (dump_stack) from [] (sysfs_warn_dup+0x5c/0x70)
[] (sysfs_warn_dup) from [] (sysfs_create_dir_ns+0x90/0x98)
..."

Commit 246774d17fc0 ("drm/etnaviv: remove the need for a gpu-subsystem
DT node") introduced DRM registration via
platform_device_register_simple(), but missed to call
platform_device_unregister() inside etnaviv_exit().

Fix the problem by calling platform_device_unregister() inside
etnaviv_exit(). While at it, also rearrange the function calls
in the exit path to make them happen in the opposite order of
registration.

Tested on a imx6-sabresd board.

Cc: 
Fixes: 246774d17fc0 ("drm/etnaviv: remove the need for a gpu-subsystem DT node")
Reported-by: Russell King 
Signed-off-by: Fabio Estevam 
---
Changes since v2:
- Add a 'available_gpu' bool variable to indicate that an available
"vivante,gc" has been found

 drivers/gpu/drm/etnaviv/etnaviv_drv.c | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/etnaviv/etnaviv_drv.c 
b/drivers/gpu/drm/etnaviv/etnaviv_drv.c
index ac23c0f..9044bf9 100644
--- a/drivers/gpu/drm/etnaviv/etnaviv_drv.c
+++ b/drivers/gpu/drm/etnaviv/etnaviv_drv.c
@@ -632,6 +632,7 @@ static struct platform_driver etnaviv_platform_driver = {
 };
 
 static struct platform_device *etnaviv_drm;
+static bool available_gpu;
 
 static int __init etnaviv_init(void)
 {
@@ -655,6 +656,7 @@ static int __init etnaviv_init(void)
for_each_compatible_node(np, NULL, "vivante,gc") {
if (!of_device_is_available(np))
continue;
+   available_gpu = true;
etnaviv_drm = platform_device_register_simple("etnaviv", -1,
  NULL, 0);
if (IS_ERR(etnaviv_drm)) {
@@ -677,8 +679,10 @@ module_init(etnaviv_init);
 
 static void __exit etnaviv_exit(void)
 {
-   platform_driver_unregister(_gpu_driver);
+   if (available_gpu)
+   platform_device_unregister(etnaviv_drm);
platform_driver_unregister(_platform_driver);
+   platform_driver_unregister(_gpu_driver);
 }
 module_exit(etnaviv_exit);
 
-- 
2.7.4

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v3 1/2] drm/etnaviv: Check for platform_device_register_simple() failure

2018-06-25 Thread Fabio Estevam
From: Fabio Estevam 

platform_device_register_simple() may fail, so we should better
check its return value and propagate it in the case of error.

Cc: 
Fixes: 246774d17fc0 ("drm/etnaviv: remove the need for a gpu-subsystem DT node")
Signed-off-by: Fabio Estevam 
---
Changes since v2:
- Newly introduced in this version

 drivers/gpu/drm/etnaviv/etnaviv_drv.c | 18 +++---
 1 file changed, 15 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/etnaviv/etnaviv_drv.c 
b/drivers/gpu/drm/etnaviv/etnaviv_drv.c
index e5013a9..ac23c0f 100644
--- a/drivers/gpu/drm/etnaviv/etnaviv_drv.c
+++ b/drivers/gpu/drm/etnaviv/etnaviv_drv.c
@@ -631,6 +631,8 @@ static struct platform_driver etnaviv_platform_driver = {
},
 };
 
+static struct platform_device *etnaviv_drm;
+
 static int __init etnaviv_init(void)
 {
int ret;
@@ -644,7 +646,7 @@ static int __init etnaviv_init(void)
 
ret = platform_driver_register(_platform_driver);
if (ret != 0)
-   platform_driver_unregister(_gpu_driver);
+   goto unregister_gpu_driver;
 
/*
 * If the DT contains at least one available GPU device, instantiate
@@ -653,12 +655,22 @@ static int __init etnaviv_init(void)
for_each_compatible_node(np, NULL, "vivante,gc") {
if (!of_device_is_available(np))
continue;
-
-   platform_device_register_simple("etnaviv", -1, NULL, 0);
+   etnaviv_drm = platform_device_register_simple("etnaviv", -1,
+ NULL, 0);
+   if (IS_ERR(etnaviv_drm)) {
+   ret = PTR_ERR(etnaviv_drm);
+   goto unregister_platform_driver;
+   }
of_node_put(np);
break;
}
 
+   return 0;
+
+unregister_platform_driver:
+   platform_driver_unregister(_platform_driver);
+unregister_gpu_driver:
+   platform_driver_unregister(_gpu_driver);
return ret;
 }
 module_init(etnaviv_init);
-- 
2.7.4

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [BUG 4.17] reloading etnaviv module causes kernel warning

2018-06-23 Thread Fabio Estevam
Hi Russell,

On Thu, Jun 21, 2018 at 7:23 AM, Russell King - ARM Linux
 wrote:
> When removing and reloading the etnaviv module, the following splat
> occurs:

We are missing to call platform_device_unregister() in etnaviv_exit().

Calling platform_device_unregister() like in the patch from the link
below seems to fix the problem:

http://code.bulix.org/6h4iz5-364009
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH] drm/etnaviv: Fix driver unregistering

2018-06-23 Thread Fabio Estevam
From: Fabio Estevam 

Russell King reported:

"When removing and reloading the etnaviv module, the following splat
occurs:

sysfs: cannot create duplicate filename '/devices/platform/etnaviv'
CPU: 0 PID: 1471 Comm: modprobe Not tainted 4.17.0+ #1608
Hardware name: Marvell Dove (Cubox)
Backtrace:
[] (dump_backtrace) from [] (show_stack+0x18/0x1c)
 r6:ef033e38 r5:ee07b340 r4:edb9d000 r3:
[] (show_stack) from [] (dump_stack+0x20/0x28)
[] (dump_stack) from [] (sysfs_warn_dup+0x5c/0x70)
[] (sysfs_warn_dup) from [] (sysfs_create_dir_ns+0x90/0x98)
..."

Commit 246774d17fc0 ("drm/etnaviv: remove the need for a gpu-subsystem
DT node") introduced DRM registration via
platform_device_register_simple(), but missed to call
platform_device_unregister() inside etnaviv_exit().

Fix the problem by calling platform_device_unregister() inside
etnaviv_exit(). While at it, also rearrange the function calls
in the exit path to make them happen in the opposite order of
registration.

Tested on a imx6-sabresd board.

Cc: 
Fixes: 246774d17fc0 ("drm/etnaviv: remove the need for a gpu-subsystem DT node")
Reported-by: Russell King 
Signed-off-by: Fabio Estevam 
---
 drivers/gpu/drm/etnaviv/etnaviv_drv.c | 8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/etnaviv/etnaviv_drv.c 
b/drivers/gpu/drm/etnaviv/etnaviv_drv.c
index e5013a9..88ab61b 100644
--- a/drivers/gpu/drm/etnaviv/etnaviv_drv.c
+++ b/drivers/gpu/drm/etnaviv/etnaviv_drv.c
@@ -631,6 +631,8 @@ static struct platform_driver etnaviv_platform_driver = {
},
 };
 
+static struct platform_device *etnaviv_drm;
+
 static int __init etnaviv_init(void)
 {
int ret;
@@ -654,7 +656,8 @@ static int __init etnaviv_init(void)
if (!of_device_is_available(np))
continue;
 
-   platform_device_register_simple("etnaviv", -1, NULL, 0);
+   etnaviv_drm = platform_device_register_simple("etnaviv", -1,
+ NULL, 0);
of_node_put(np);
break;
}
@@ -665,8 +668,9 @@ module_init(etnaviv_init);
 
 static void __exit etnaviv_exit(void)
 {
-   platform_driver_unregister(_gpu_driver);
+   platform_device_unregister(etnaviv_drm);
platform_driver_unregister(_platform_driver);
+   platform_driver_unregister(_gpu_driver);
 }
 module_exit(etnaviv_exit);
 
-- 
2.7.4

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [BUG 4.17] reloading etnaviv module causes kernel warning

2018-06-23 Thread Fabio Estevam
On Sat, Jun 23, 2018 at 6:20 PM, Fabio Estevam  wrote:
> Hi Russell,
>
> On Thu, Jun 21, 2018 at 7:23 AM, Russell King - ARM Linux
>  wrote:
>> When removing and reloading the etnaviv module, the following splat
>> occurs:
>
> We are missing to call platform_device_unregister() in etnaviv_exit().
>
> Calling platform_device_unregister() like in the patch from the link
> below seems to fix the problem:
>
> http://code.bulix.org/6h4iz5-364009

I sent the patch, but missed to put you on Cc, Russell. Sorry.

https://lists.freedesktop.org/archives/dri-devel/2018-June/180990.html
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v2] drm/etnaviv: Fix driver unregistering

2018-06-24 Thread Fabio Estevam
From: Fabio Estevam 

Russell King reported:

"When removing and reloading the etnaviv module, the following splat
occurs:

sysfs: cannot create duplicate filename '/devices/platform/etnaviv'
CPU: 0 PID: 1471 Comm: modprobe Not tainted 4.17.0+ #1608
Hardware name: Marvell Dove (Cubox)
Backtrace:
[] (dump_backtrace) from [] (show_stack+0x18/0x1c)
 r6:ef033e38 r5:ee07b340 r4:edb9d000 r3:
[] (show_stack) from [] (dump_stack+0x20/0x28)
[] (dump_stack) from [] (sysfs_warn_dup+0x5c/0x70)
[] (sysfs_warn_dup) from [] (sysfs_create_dir_ns+0x90/0x98)
..."

Commit 246774d17fc0 ("drm/etnaviv: remove the need for a gpu-subsystem
DT node") introduced DRM registration via
platform_device_register_simple(), but missed to call
platform_device_unregister() inside etnaviv_exit().

Fix the problem by calling platform_device_unregister() inside
etnaviv_exit(). While at it, also rearrange the function calls
in the exit path to make them happen in the opposite order of
registration.

Tested on a imx6-sabresd board.

Cc: 
Fixes: 246774d17fc0 ("drm/etnaviv: remove the need for a gpu-subsystem DT node")
Reported-by: Russell King 
Signed-off-by: Fabio Estevam 
---
Changes since v1:
- Make the exit path symmetrical to the init path by calling
platform_device_unregister() inside for_each_compatible_node()

 drivers/gpu/drm/etnaviv/etnaviv_drv.c | 18 --
 1 file changed, 16 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/etnaviv/etnaviv_drv.c 
b/drivers/gpu/drm/etnaviv/etnaviv_drv.c
index e5013a9..626ad8b 100644
--- a/drivers/gpu/drm/etnaviv/etnaviv_drv.c
+++ b/drivers/gpu/drm/etnaviv/etnaviv_drv.c
@@ -631,6 +631,8 @@ static struct platform_driver etnaviv_platform_driver = {
},
 };
 
+static struct platform_device *etnaviv_drm;
+
 static int __init etnaviv_init(void)
 {
int ret;
@@ -654,7 +656,8 @@ static int __init etnaviv_init(void)
if (!of_device_is_available(np))
continue;
 
-   platform_device_register_simple("etnaviv", -1, NULL, 0);
+   etnaviv_drm = platform_device_register_simple("etnaviv", -1,
+ NULL, 0);
of_node_put(np);
break;
}
@@ -665,8 +668,19 @@ module_init(etnaviv_init);
 
 static void __exit etnaviv_exit(void)
 {
-   platform_driver_unregister(_gpu_driver);
+   struct device_node *np;
+
+   for_each_compatible_node(np, NULL, "vivante,gc") {
+   if (!of_device_is_available(np))
+   continue;
+
+   platform_device_unregister(etnaviv_drm);
+   of_node_put(np);
+   break;
+   }
+
platform_driver_unregister(_platform_driver);
+   platform_driver_unregister(_gpu_driver);
 }
 module_exit(etnaviv_exit);
 
-- 
2.7.4

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH] Add SPDX idenitifier and clarify license

2018-05-03 Thread Fabio Estevam
On Thu, May 3, 2018 at 12:48 PM, Dirk Hohndel  wrote:

> But if you do the same analysis for header files...
>
> hohndel@rrmbpvm:~/src/linux[VMware-license-cleanup]
> $ git grep SPDX | grep \.h: | cut -d: -f2 | sort | grep ^// | wc
> 5491098   14823
> hohndel@rrmbpvm:~/src/linux[VMware-license-cleanup]
> $ git grep SPDX | grep \.h: | cut -d: -f2 | sort | grep ^/\* | wc
>7981   15962  215364

Right, Documentation/process/license-rules.rst says /* style should be
used for .h files.
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH] Add SPDX idenitifier and clarify license

2018-05-03 Thread Fabio Estevam
On Wed, May 2, 2018 at 10:46 AM, Thomas Hellstrom  wrote:

> diff --git a/drivers/gpu/drm/ttm/ttm_agp_backend.c 
> b/drivers/gpu/drm/ttm/ttm_agp_backend.c
> index 7c2485fe88d8..ea4d59eb8966 100644
> --- a/drivers/gpu/drm/ttm/ttm_agp_backend.c
> +++ b/drivers/gpu/drm/ttm/ttm_agp_backend.c
> @@ -1,3 +1,4 @@
> +/* SPDX-License-Identifier: GPL-2.0 OR MIT */

According to Documentation/process/license-rules.rst the SPDX tag
should start with // in .c files.
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH] drm/etnaviv: etnaviv_sched: Staticize functions when possible

2018-02-13 Thread Fabio Estevam
From: Fabio Estevam <fabio.este...@nxp.com>

etnaviv_sched_dependency() and etnaviv_sched_run_job() are only
used in this file, so make them static.

This fixes the following sparse warnings:

drivers/gpu/drm/etnaviv/etnaviv_sched.c:30:18: warning: symbol 
'etnaviv_sched_dependency' was not declared. Should it be static?
drivers/gpu/drm/etnaviv/etnaviv_sched.c:81:18: warning: symbol 
'etnaviv_sched_run_job' was not declared. Should it be static?

Signed-off-by: Fabio Estevam <fabio.este...@nxp.com>
---
 drivers/gpu/drm/etnaviv/etnaviv_sched.c | 7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/etnaviv/etnaviv_sched.c 
b/drivers/gpu/drm/etnaviv/etnaviv_sched.c
index 3e33473..4b761b7 100644
--- a/drivers/gpu/drm/etnaviv/etnaviv_sched.c
+++ b/drivers/gpu/drm/etnaviv/etnaviv_sched.c
@@ -27,8 +27,9 @@ module_param_named(job_hang_limit, etnaviv_job_hang_limit, 
int , 0444);
 static int etnaviv_hw_jobs_limit = 2;
 module_param_named(hw_job_limit, etnaviv_hw_jobs_limit, int , 0444);
 
-struct dma_fence *etnaviv_sched_dependency(struct drm_sched_job *sched_job,
-  struct drm_sched_entity *entity)
+static struct dma_fence *
+etnaviv_sched_dependency(struct drm_sched_job *sched_job,
+struct drm_sched_entity *entity)
 {
struct etnaviv_gem_submit *submit = to_etnaviv_submit(sched_job);
struct dma_fence *fence;
@@ -78,7 +79,7 @@ struct dma_fence *etnaviv_sched_dependency(struct 
drm_sched_job *sched_job,
return NULL;
 }
 
-struct dma_fence *etnaviv_sched_run_job(struct drm_sched_job *sched_job)
+static struct dma_fence *etnaviv_sched_run_job(struct drm_sched_job *sched_job)
 {
struct etnaviv_gem_submit *submit = to_etnaviv_submit(sched_job);
struct dma_fence *fence = NULL;
-- 
2.7.4

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 1/2] drm/imx: ipuv3-plane: Make functions static when possible

2018-02-13 Thread Fabio Estevam
From: Fabio Estevam <fabio.este...@nxp.com>

ipu_plane_state_reset(), ipu_plane_duplicate_state() and 
ipu_plane_destroy_state() are only used in this file, so make them static.

This fixes the following sparse warnings:

drivers/gpu/drm/imx/ipuv3-plane.c:275:6: warning: symbol 
'ipu_plane_state_reset' was not declared. Should it be static?
drivers/gpu/drm/imx/ipuv3-plane.c:295:24: warning: symbol 
'ipu_plane_duplicate_state' was not declared. Should it be static?
drivers/gpu/drm/imx/ipuv3-plane.c:309:6: warning: symbol 
'ipu_plane_destroy_state' was not declared. Should it be static?

Signed-off-by: Fabio Estevam <fabio.este...@nxp.com>
---
 drivers/gpu/drm/imx/ipuv3-plane.c | 9 +
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/imx/ipuv3-plane.c 
b/drivers/gpu/drm/imx/ipuv3-plane.c
index 57ed56d..d9f0a76 100644
--- a/drivers/gpu/drm/imx/ipuv3-plane.c
+++ b/drivers/gpu/drm/imx/ipuv3-plane.c
@@ -272,7 +272,7 @@ static void ipu_plane_destroy(struct drm_plane *plane)
kfree(ipu_plane);
 }
 
-void ipu_plane_state_reset(struct drm_plane *plane)
+static void ipu_plane_state_reset(struct drm_plane *plane)
 {
struct ipu_plane_state *ipu_state;
 
@@ -292,7 +292,8 @@ void ipu_plane_state_reset(struct drm_plane *plane)
plane->state = _state->base;
 }
 
-struct drm_plane_state *ipu_plane_duplicate_state(struct drm_plane *plane)
+static struct drm_plane_state *
+ipu_plane_duplicate_state(struct drm_plane *plane)
 {
struct ipu_plane_state *state;
 
@@ -306,8 +307,8 @@ struct drm_plane_state *ipu_plane_duplicate_state(struct 
drm_plane *plane)
return >base;
 }
 
-void ipu_plane_destroy_state(struct drm_plane *plane,
-struct drm_plane_state *state)
+static void ipu_plane_destroy_state(struct drm_plane *plane,
+   struct drm_plane_state *state)
 {
struct ipu_plane_state *ipu_state = to_ipu_plane_state(state);
 
-- 
2.7.4

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 2/2] drm/imx: ipuv3-plane: Include "imx-drm.h" header file

2018-02-13 Thread Fabio Estevam
From: Fabio Estevam <fabio.este...@nxp.com>

ipu_planes_assign_pre() prototype is in "imx-drm.h" header file, so
include it to fix the following sparse warning:

drivers/gpu/drm/imx/ipuv3-plane.c:729:5: warning: symbol 
'ipu_planes_assign_pre' was not declared. Should it be static?

Signed-off-by: Fabio Estevam <fabio.este...@nxp.com>
---
 drivers/gpu/drm/imx/ipuv3-plane.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/imx/ipuv3-plane.c 
b/drivers/gpu/drm/imx/ipuv3-plane.c
index d9f0a76..d9113fa 100644
--- a/drivers/gpu/drm/imx/ipuv3-plane.c
+++ b/drivers/gpu/drm/imx/ipuv3-plane.c
@@ -22,6 +22,7 @@
 #include 
 
 #include "video/imx-ipu-v3.h"
+#include "imx-drm.h"
 #include "ipuv3-plane.h"
 
 struct ipu_plane_state {
-- 
2.7.4

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH] drm/bridge: dw-hdmi: Remove unused hdmi_enable_overflow_interrupts()

2018-02-16 Thread Fabio Estevam
From: Fabio Estevam <fabio.este...@nxp.com>

The cable_plugin member never receives an assignment, so it is always
false, which causes hdmi_enable_overflow_interrupts() to never
be called as per the logic below:

if (hdmi->cable_plugin && hdmi->sink_is_hdmi)
hdmi_enable_overflow_interrupts(hdmi);

This has been the case since the driver was originally introduced
in commit 9aaf880ed4ee ("imx-drm: Add mx6 hdmi transmitter support").

Remove the cable_plugin element and the hdmi_enable_overflow_interrupts()
function that is never called.

Signed-off-by: Fabio Estevam <fabio.este...@nxp.com>
---
 drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 9 -
 1 file changed, 9 deletions(-)

diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c 
b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
index a38db40..b0b9570 100644
--- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
+++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
@@ -147,7 +147,6 @@ struct dw_hdmi {
int vic;
 
u8 edid[HDMI_EDID_LEN];
-   bool cable_plugin;
 
struct {
const struct dw_hdmi_phy_ops *ops;
@@ -1658,12 +1657,6 @@ static void dw_hdmi_clear_overflow(struct dw_hdmi *hdmi)
hdmi_writeb(hdmi, val, HDMI_FC_INVIDCONF);
 }
 
-static void hdmi_enable_overflow_interrupts(struct dw_hdmi *hdmi)
-{
-   hdmi_writeb(hdmi, 0, HDMI_FC_MASK2);
-   hdmi_writeb(hdmi, 0, HDMI_IH_MUTE_FC_STAT2);
-}
-
 static void hdmi_disable_overflow_interrupts(struct dw_hdmi *hdmi)
 {
hdmi_writeb(hdmi, HDMI_IH_MUTE_FC_STAT2_OVERFLOW_MASK,
@@ -1753,8 +1746,6 @@ static int dw_hdmi_setup(struct dw_hdmi *hdmi, struct 
drm_display_mode *mode)
hdmi_tx_hdcp_config(hdmi);
 
dw_hdmi_clear_overflow(hdmi);
-   if (hdmi->cable_plugin && hdmi->sink_is_hdmi)
-   hdmi_enable_overflow_interrupts(hdmi);
 
return 0;
 }
-- 
2.7.4

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 2/2] drm/panel: seiko-43wvf1g: Add missing ">" character in author's email

2018-07-25 Thread Fabio Estevam
From: Fabio Estevam 

There is a missing ">" character in Marco's email.

Fix it.

Signed-off-by: Fabio Estevam 
---
 drivers/gpu/drm/panel/panel-seiko-43wvf1g.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/panel/panel-seiko-43wvf1g.c 
b/drivers/gpu/drm/panel/panel-seiko-43wvf1g.c
index 70654f9..2d99e28 100644
--- a/drivers/gpu/drm/panel/panel-seiko-43wvf1g.c
+++ b/drivers/gpu/drm/panel/panel-seiko-43wvf1g.c
@@ -363,6 +363,6 @@ static struct platform_driver seiko_panel_platform_driver = 
{
 };
 module_platform_driver(seiko_panel_platform_driver);
 
-MODULE_AUTHOR("Marco Franchi ");
 MODULE_DESCRIPTION("Seiko 43WVF1G panel driver");
 MODULE_LICENSE("GPL v2");
-- 
2.7.4

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 1/2] drm/panel: seiko-43wvf1g: Switch to SPDX identifier

2018-07-25 Thread Fabio Estevam
From: Fabio Estevam 

Adopt the SPDX license identifier headers to ease license compliance
management.

Signed-off-by: Fabio Estevam 
---
 drivers/gpu/drm/panel/panel-seiko-43wvf1g.c | 5 +
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/panel/panel-seiko-43wvf1g.c 
b/drivers/gpu/drm/panel/panel-seiko-43wvf1g.c
index 75f9253..70654f9 100644
--- a/drivers/gpu/drm/panel/panel-seiko-43wvf1g.c
+++ b/drivers/gpu/drm/panel/panel-seiko-43wvf1g.c
@@ -1,12 +1,9 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * Copyright (C) 2017 NXP Semiconductors.
  * Author: Marco Franchi 
  *
  * Based on Panel Simple driver by Thierry Reding 
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License version
- * 2 as published by the Free Software Foundation.
  */
 
 #include 
-- 
2.7.4

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [RFC] clk: imx6: Mark imx_clk_mux as glitchy by default

2018-08-21 Thread Fabio Estevam
Hi Leonard,

On Tue, Aug 21, 2018 at 4:34 PM, Leonard Crestez
 wrote:

> More concretely on 6qp-sdb blanking the display happens like this:
>  * imx_ldb_encoder_disable switches ipu1_di0_sel to ipu1_di0_pre from 
> ldb_di1_podf
>  * reparenting to ipu1_di0_pre enables it and its parents up to pll5
>  * possibly glitchy muxing
>  * ipu_di_disable disables ipu1_di0 (and parents, up to pll5)

Have you seen such glitch issue in practice with the LDB clocks?

We have already taken care of it in these commits:

commit 5d283b083800867dc329e6433576664bf0fc18d5
Author: Fabio Estevam 
Date:   Mon Oct 17 22:29:14 2016 -0200

clk: imx6: Fix procedure to switch the parent of LDB_DI_CLK

Due to incorrect placement of the clock gate cell in the ldb_di[x]_clk
tree, the glitchy parent mux of ldb_di[x]_clk can cause a glitch to
enter the ldb_di_ipu_div divider. If the divider gets locked up, no
ldb_di[x]_clk is generated, and the LVDS display will hang when the
ipu_di_clk is sourced from ldb_di_clk.

To fix the problem, both the new and current parent of the ldb_di_clk
should be disabled before the switch. This patch ensures that correct
steps are followed when ldb_di_clk parent is switched in the beginning
of boot. The glitchy muxes are then registered as read-only. The clock
parent can be selected using the assigned-clocks and
assigned-clock-parents properties of the ccm device tree node:

 {
assigned-clocks = < IMX6QDL_CLK_LDB_DI0_SEL>,
  < IMX6QDL_CLK_LDB_DI1_SEL>;
assigned-clock-parents = < IMX6QDL_CLK_MMDC_CH1_AXI>,
 < IMX6QDL_CLK_PLL5_VIDEO_DIV>;
};

The issue is explained in detail in EB821 ("LDB Clock Switch Procedure &
i.MX6 Asynchronous Clock Switching Guidelines") [1].

[1] http://www.nxp.com/files/32bit/doc/eng_bulletin/EB821.pdf

Signed-off-by: Ranjani Vaidyanathan 
Signed-off-by: Fabio Estevam 
Signed-off-by: Philipp Zabel 
Reviewed-by: Akshay Bhat 
Tested-by Joshua Clayton 
Tested-by: Charles Kang 
Signed-off-by: Shawn Guo 

commit 03d576f202e8cd40d500aa4f7594ad702d861096
Author: Philipp Zabel 
Date:   Mon Oct 17 22:29:13 2016 -0200

clk: imx6: Make the LDB_DI0 and LDB_DI1 clocks read-only

Due to incorrect placement of the clock gate cell in the ldb_di[x]_clk
tree, the glitchy parent mux of ldb_di[x]_clk can cause a glitch to
enter the ldb_di_ipu_div divider. If the divider gets locked up, no
ldb_di[x]_clk is generated, and the LVDS display will hang when the
ipu_di_clk is sourced from ldb_di_clk.

To fix the problem, both the new and current parent of the ldb_di_clk
should be disabled before the switch. As this can not be guaranteed by
the clock framework during runtime, make the ldb_di[x]_sel muxes read-only.
A workaround to set the muxes once during boot could be added to the
kernel or bootloader.

    Signed-off-by: Philipp Zabel 
Signed-off-by: Fabio Estevam 
Signed-off-by: Shawn Guo 

,but I think we should also take care of the other glitchy muxes as
you propose here.
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH 1/2] drm/panel: Add support for Armadeus ST0700 Adapt

2018-07-17 Thread Fabio Estevam
Hi Sébastien,

On Tue, Jul 17, 2018 at 4:23 AM, Sébastien Szymanski
 wrote:
> This patch adds support for the Armadeus ST0700 Adapt. It comes with a
> Santek ST0700I5Y-RBSLW 7.0" WVGA (800x480) TFT and an adapter board so
> that it can be connected on the TFT header of Armadeus Dev boards.
>
> Signed-off-by: Sébastien Szymanski 
> ---
>  .../display/panel/armadeus,st0700-adapt.txt|  9 +++
>  drivers/gpu/drm/panel/panel-simple.c   | 29 
> ++
>  2 files changed, 38 insertions(+)
>  create mode 100644 
> Documentation/devicetree/bindings/display/panel/armadeus,st0700-adapt.txt
>
> diff --git 
> a/Documentation/devicetree/bindings/display/panel/armadeus,st0700-adapt.txt 
> b/Documentation/devicetree/bindings/display/panel/armadeus,st0700-adapt.txt
> new file mode 100644
> index ..a30d63db3c8f
> --- /dev/null
> +++ 
> b/Documentation/devicetree/bindings/display/panel/armadeus,st0700-adapt.txt
> @@ -0,0 +1,9 @@
> +Armadeus ST0700 Adapt. A Santek ST0700I5Y-RBSLW 7.0" WVGA (800x480) TFT with
> +an adapter board.
> +
> +Required properties:
> +- compatible: "armadeus,st0700-adapt"

Shouldn't this be named "santek,st0700i5y" instead?

Santek is the vendor of the panel and st0700i5y is the model.

Then you could add a "santek" entry in
Documentation/devicetree/bindings/vendor-prefixes.txt.

Regards,

Fabio Estevam
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH v2] ARM: dts: imx6sl: Add vivante gpu nodes

2018-07-15 Thread Fabio Estevam
On Fri, Jul 13, 2018 at 6:39 AM, Leonard Crestez
 wrote:
> The imx6sl soc has gpu_2d and gpu_vg, no 3d support:
>
> etnaviv-gpu 220.gpu: model: GC320, revision: 5007
> etnaviv-gpu 2204000.gpu: model: GC355, revision: 1215
>
> The IP blocks seem to be already supported.
>
> Signed-off-by: Leonard Crestez 
> Reviewed-by: Lucas Stach 

Reviewed-by: Fabio Estevam 
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH] drm/imx: Switch to SPDX identifier

2018-07-25 Thread Fabio Estevam
Adopt the SPDX license identifier headers to ease license compliance
management.

Signed-off-by: Fabio Estevam 
---
 drivers/gpu/drm/imx/dw_hdmi-imx.c  |  5 +
 drivers/gpu/drm/imx/imx-drm-core.c | 11 +--
 drivers/gpu/drm/imx/imx-ldb.c  | 10 +-
 drivers/gpu/drm/imx/imx-tve.c  | 10 +-
 drivers/gpu/drm/imx/ipuv3-crtc.c   | 10 +-
 drivers/gpu/drm/imx/ipuv3-plane.c  | 10 +-
 drivers/gpu/drm/imx/parallel-display.c | 10 +-
 7 files changed, 7 insertions(+), 59 deletions(-)

diff --git a/drivers/gpu/drm/imx/dw_hdmi-imx.c 
b/drivers/gpu/drm/imx/dw_hdmi-imx.c
index fe6becd..77a26fd 100644
--- a/drivers/gpu/drm/imx/dw_hdmi-imx.c
+++ b/drivers/gpu/drm/imx/dw_hdmi-imx.c
@@ -1,10 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0
 /* Copyright (C) 2011-2013 Freescale Semiconductor, Inc.
  *
  * derived from imx-hdmi.c(renamed to bridge/dw_hdmi.c now)
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
  */
 #include 
 #include 
diff --git a/drivers/gpu/drm/imx/imx-drm-core.c 
b/drivers/gpu/drm/imx/imx-drm-core.c
index f0122af..14bf05c 100644
--- a/drivers/gpu/drm/imx/imx-drm-core.c
+++ b/drivers/gpu/drm/imx/imx-drm-core.c
@@ -1,17 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * Freescale i.MX drm driver
  *
  * Copyright (C) 2011 Sascha Hauer, Pengutronix
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
  */
 #include 
 #include 
diff --git a/drivers/gpu/drm/imx/imx-ldb.c b/drivers/gpu/drm/imx/imx-ldb.c
index 3bd0f8a..2c5bbe3 100644
--- a/drivers/gpu/drm/imx/imx-ldb.c
+++ b/drivers/gpu/drm/imx/imx-ldb.c
@@ -1,16 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * i.MX drm driver - LVDS display bridge
  *
  * Copyright (C) 2012 Sascha Hauer, Pengutronix
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
  */
 
 #include 
diff --git a/drivers/gpu/drm/imx/imx-tve.c b/drivers/gpu/drm/imx/imx-tve.c
index cffd331..4bc3ead 100644
--- a/drivers/gpu/drm/imx/imx-tve.c
+++ b/drivers/gpu/drm/imx/imx-tve.c
@@ -1,16 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * i.MX drm driver - Television Encoder (TVEv2)
  *
  * Copyright (C) 2013 Philipp Zabel, Pengutronix
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
  */
 
 #include 
diff --git a/drivers/gpu/drm/imx/ipuv3-crtc.c b/drivers/gpu/drm/imx/ipuv3-crtc.c
index 7d4b710..058b53c 100644
--- a/drivers/gpu/drm/imx/ipuv3-crtc.c
+++ b/drivers/gpu/drm/imx/ipuv3-crtc.c
@@ -1,16 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * i.MX IPUv3 Graphics driver
  *
  * Copyright (C) 2011 Sascha Hauer, Pengutronix
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
  */
 #include 
 #include 
diff --git a/drivers/gpu/drm/imx/ipuv3-plane.c 
b/drivers/gpu/drm/imx/ipuv3-plane.c
index 203f247..b9a9d53 100644
--- a/drivers/gpu/drm/imx/ipuv3-plane.c
+++ b/drivers/gpu/drm/imx/ipuv3-plane.c
@@ -1,16 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * i.MX IPUv3 DP Overlay Planes
  *
  * Copyright (C) 2013 Philipp Zabel, Pengutronix
- *
- * This program is free

[PATCH RESEND 1/2] drm/panel: seiko-43wvf1g: Switch to SPDX identifier

2018-09-05 Thread Fabio Estevam
From: Fabio Estevam 

Adopt the SPDX license identifier headers to ease license compliance
management.

Signed-off-by: Fabio Estevam 
---
 drivers/gpu/drm/panel/panel-seiko-43wvf1g.c | 5 +
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/panel/panel-seiko-43wvf1g.c 
b/drivers/gpu/drm/panel/panel-seiko-43wvf1g.c
index 75f9253..70654f9 100644
--- a/drivers/gpu/drm/panel/panel-seiko-43wvf1g.c
+++ b/drivers/gpu/drm/panel/panel-seiko-43wvf1g.c
@@ -1,12 +1,9 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * Copyright (C) 2017 NXP Semiconductors.
  * Author: Marco Franchi 
  *
  * Based on Panel Simple driver by Thierry Reding 
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License version
- * 2 as published by the Free Software Foundation.
  */
 
 #include 
-- 
2.7.4

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH RESEND 2/2] drm/panel: seiko-43wvf1g: Add missing ">" character in author's email

2018-09-05 Thread Fabio Estevam
From: Fabio Estevam 

There is a missing ">" character in Marco's email.

Fix it.

Signed-off-by: Fabio Estevam 
---
 drivers/gpu/drm/panel/panel-seiko-43wvf1g.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/panel/panel-seiko-43wvf1g.c 
b/drivers/gpu/drm/panel/panel-seiko-43wvf1g.c
index 70654f9..2d99e28 100644
--- a/drivers/gpu/drm/panel/panel-seiko-43wvf1g.c
+++ b/drivers/gpu/drm/panel/panel-seiko-43wvf1g.c
@@ -363,6 +363,6 @@ static struct platform_driver seiko_panel_platform_driver = 
{
 };
 module_platform_driver(seiko_panel_platform_driver);
 
-MODULE_AUTHOR("Marco Franchi ");
 MODULE_DESCRIPTION("Seiko 43WVF1G panel driver");
 MODULE_LICENSE("GPL v2");
-- 
2.7.4

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH] ARM: dts: imx6sl: Add vivante gpu nodes

2018-07-12 Thread Fabio Estevam
Hi Leonard,

On Thu, Jul 12, 2018 at 10:37 AM, Leonard Crestez
 wrote:

> diff --git a/arch/arm/boot/dts/imx6sl.dtsi b/arch/arm/boot/dts/imx6sl.dtsi
> index a6bc21433839..49a56b4fd393 100644
> --- a/arch/arm/boot/dts/imx6sl.dtsi
> +++ b/arch/arm/boot/dts/imx6sl.dtsi
> @@ -130,10 +130,30 @@
> cache-level = <2>;
> arm,tag-latency = <4 2 3>;
> arm,data-latency = <4 2 3>;
> };
>
> +   gpu_2d: gpu@220 {
> +   compatible = "vivante,gc";
> +   reg = <0x0220 0x4000>;
> +   interrupts = <0 10 IRQ_TYPE_LEVEL_HIGH>;
> +   clocks = < IMX6SL_CLK_MMDC_ROOT>,
> +< IMX6SL_CLK_GPU2D_OVG>;
> +   clock-names = "bus", "core";
> +   power-domains = <_pu>;
> +   };
> +
> +   gpu_vg: gpu@2204000 {
> +   compatible = "vivante,gc";
> +   reg = <0x02204000 0x4000>;
> +   interrupts = <0 11 IRQ_TYPE_LEVEL_HIGH>;
> +   clocks = < IMX6SL_CLK_MMDC_ROOT>,
> +< IMX6SL_CLK_GPU2D_OVG>;
> +   clock-names = "bus", "core";
> +   power-domains = <_pu>;
> +   };
> +
> aips1: aips-bus@200 {

We try to keep the peripherals sorted by address range in dtsi, so
please put the gpu nodes below aips2.
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH] drm: dw-hdmi-i2s: Remove owner assignment from platform_driver

2018-03-15 Thread Fabio Estevam
From: Fabio Estevam <fabio.este...@nxp.com>

platform_driver does not need to set the owner field, as this will
be populated by the driver core.

Generated by scripts/coccinelle/api/platform_no_drv_owner.cocci.

Signed-off-by: Fabio Estevam <fabio.este...@nxp.com>
---
 drivers/gpu/drm/bridge/synopsys/dw-hdmi-i2s-audio.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi-i2s-audio.c 
b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-i2s-audio.c
index 3b7e5c5..8f9c8a6 100644
--- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi-i2s-audio.c
+++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-i2s-audio.c
@@ -152,7 +152,6 @@ static struct platform_driver snd_dw_hdmi_driver = {
.remove = snd_dw_hdmi_remove,
.driver = {
.name = DRIVER_NAME,
-   .owner = THIS_MODULE,
},
 };
 module_platform_driver(snd_dw_hdmi_driver);
-- 
2.7.4

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH] drm/etnaviv: init DMA ops for virtual master device

2018-03-09 Thread Fabio Estevam
Hi Russell,

On Fri, Mar 9, 2018 at 8:34 AM, Russell King - ARM Linux
 wrote:
> On Fri, Mar 09, 2018 at 12:20:59PM +0100, Lucas Stach wrote:
>> All the DRM GEM dma-buf import/export operations are done through the
>> virtual DRM master device. As this isn't instanciated from DT anymore
>> we need to make sure the DMA ops are set up correctly.
>>
>> Signed-off-by: Lucas Stach 
>> ---
>>  drivers/gpu/drm/etnaviv/etnaviv_drv.c | 3 ++-
>>  1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/gpu/drm/etnaviv/etnaviv_drv.c 
>> b/drivers/gpu/drm/etnaviv/etnaviv_drv.c
>> index ab50090d066c..d7666aed943b 100644
>> --- a/drivers/gpu/drm/etnaviv/etnaviv_drv.c
>> +++ b/drivers/gpu/drm/etnaviv/etnaviv_drv.c
>> @@ -655,7 +655,8 @@ static int etnaviv_pdev_probe(struct platform_device 
>> *pdev)
>>   struct device *dev = >dev;
>>   struct component_match *match = NULL;
>>
>> - dma_set_coherent_mask(>dev, DMA_BIT_MASK(32));
>> + arch_setup_dma_ops(dev, 0, 0x1, NULL, false);
>> + dma_coerce_mask_and_coherent(dev, DMA_BIT_MASK(32));
>
> NAK.  dma_coerce_mask_and_coherent() exists for broken devices.  Please
> instead ensure that the device is created with the proper default DMA
> mask.

Should it be like this (like vc4_drv.c) ?

--- a/drivers/gpu/drm/etnaviv/etnaviv_drv.c
+++ b/drivers/gpu/drm/etnaviv/etnaviv_drv.c
@@ -578,6 +578,8 @@ static int etnaviv_bind(struct device *dev)
struct drm_device *drm;
int ret;

+   dev->coherent_dma_mask = DMA_BIT_MASK(32);
+
drm = drm_dev_alloc(_drm_driver, dev);
if (IS_ERR(drm))
return PTR_ERR(drm);
@@ -655,8 +657,6 @@ static int etnaviv_pdev_probe(struct platform_device *pdev)
struct device *dev = >dev;
struct component_match *match = NULL;

-   dma_set_coherent_mask(>dev, DMA_BIT_MASK(32));
-
if (!dev->platform_data) {
struct device_node *core_node;
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH] drm/bridge: dw-hdmi: Remove unused hdmi_enable_overflow_interrupts()

2018-03-14 Thread Fabio Estevam
Hi Laurent,

On Mon, Feb 19, 2018 at 4:50 PM, Laurent Pinchart
<laurent.pinch...@ideasonboard.com> wrote:
> Hi Fabio,
>
> Thank you for the patch.
>
> On Friday, 16 February 2018 22:16:10 EET Fabio Estevam wrote:
>> From: Fabio Estevam <fabio.este...@nxp.com>
>>
>> The cable_plugin member never receives an assignment, so it is always
>> false, which causes hdmi_enable_overflow_interrupts() to never
>> be called as per the logic below:
>>
>>   if (hdmi->cable_plugin && hdmi->sink_is_hdmi)
>>   hdmi_enable_overflow_interrupts(hdmi);
>>
>> This has been the case since the driver was originally introduced
>> in commit 9aaf880ed4ee ("imx-drm: Add mx6 hdmi transmitter support").
>>
>> Remove the cable_plugin element and the hdmi_enable_overflow_interrupts()
>> function that is never called.
>>
>> Signed-off-by: Fabio Estevam <fabio.este...@nxp.com>
>
> Tested-by: Laurent Pinchart <laurent.pinch...@ideasonboard.com> # On R-Car H3
> Reviewed-by: Laurent Pinchart <laurent.pinch...@ideasonboard.com>

Are you able to apply this patch or should Archit Taneja handle it?

Thanks
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH] drm: dw-hdmi-i2s: Remove owner assignment from platform_driver

2018-04-22 Thread Fabio Estevam
Andrzej/Archit,

Any comments?

On Thu, Mar 15, 2018 at 3:04 PM, Fabio Estevam <feste...@gmail.com> wrote:
> From: Fabio Estevam <fabio.este...@nxp.com>
>
> platform_driver does not need to set the owner field, as this will
> be populated by the driver core.
>
> Generated by scripts/coccinelle/api/platform_no_drv_owner.cocci.
>
> Signed-off-by: Fabio Estevam <fabio.este...@nxp.com>
> ---
>  drivers/gpu/drm/bridge/synopsys/dw-hdmi-i2s-audio.c | 1 -
>  1 file changed, 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi-i2s-audio.c 
> b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-i2s-audio.c
> index 3b7e5c5..8f9c8a6 100644
> --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi-i2s-audio.c
> +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-i2s-audio.c
> @@ -152,7 +152,6 @@ static struct platform_driver snd_dw_hdmi_driver = {
> .remove = snd_dw_hdmi_remove,
> .driver = {
> .name = DRIVER_NAME,
> -   .owner = THIS_MODULE,
> },
>  };
>  module_platform_driver(snd_dw_hdmi_driver);
> --
> 2.7.4
>
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH] MAINTAINERS: drm: fsl-dcu: Update to NXP email address

2018-04-23 Thread Fabio Estevam
Hi Stefan,

On Fri, Mar 30, 2018 at 2:10 PM, Fabio Estevam <feste...@gmail.com> wrote:
> From: Fabio Estevam <fabio.este...@nxp.com>
>
> The freescale.com domain will stop working soon, so use
> the nxp.com domain instead.
>
> Signed-off-by: Fabio Estevam <fabio.este...@nxp.com>
> ---
>  MAINTAINERS | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 4923621..794c130 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -4661,7 +4661,7 @@ F:
> Documentation/devicetree/bindings/display/exynos/
>
>  DRM DRIVERS FOR FREESCALE DCU
>  M: Stefan Agner <ste...@agner.ch>
> -M: Alison Wang <alison.w...@freescale.com>
> +M: Alison Wang <alison.w...@nxp.com>

A gentle ping...
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH] MAINTAINERS: drm: fsl-dcu: Update to NXP email address

2018-03-30 Thread Fabio Estevam
From: Fabio Estevam <fabio.este...@nxp.com>

The freescale.com domain will stop working soon, so use
the nxp.com domain instead.

Signed-off-by: Fabio Estevam <fabio.este...@nxp.com>
---
 MAINTAINERS | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index 4923621..794c130 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -4661,7 +4661,7 @@ F:
Documentation/devicetree/bindings/display/exynos/
 
 DRM DRIVERS FOR FREESCALE DCU
 M: Stefan Agner <ste...@agner.ch>
-M: Alison Wang <alison.w...@freescale.com>
+M: Alison Wang <alison.w...@nxp.com>
 L: dri-devel@lists.freedesktop.org
 S: Supported
 F: drivers/gpu/drm/fsl-dcu/
-- 
2.7.4

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH] drm/imx: Remove last traces of struct imx_drm_crtc

2018-04-03 Thread Fabio Estevam
On Tue, Mar 27, 2018 at 6:39 PM, Leonard Crestez
<leonard.cres...@nxp.com> wrote:
> When the definition of this struct was removed a forward declaration and an
> unused struct member were still left around. Remove them because they serve
> no purpose.
>
> Fixes 44b460cfe554 ("drm: imx: remove struct imx_drm_crtc and 
> imx_drm_crtc_helper_funcs")
>
> Signed-off-by: Leonard Crestez <leonard.cres...@nxp.com>

Reviewed-by: Fabio Estevam <fabio.este...@nxp.com>
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH 1/3] dt-bindings: display: dw_hdmi.txt

2018-03-19 Thread Fabio Estevam
Hi Hans,

On Mon, Mar 19, 2018 at 8:43 AM, Hans Verkuil  wrote:
> From: Hans Verkuil 

It seems the Subject line is missing some content?
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH v1 3/4] ARM: imx_v6_v7_defconfig: Select TOUCHSCREEN_GOODIX

2018-10-25 Thread Fabio Estevam
On Thu, Oct 25, 2018 at 12:11 PM Alex Gonzalez  wrote:
>
> Select CONFIG_TOUCHSCREEN_GOODIX so that we can have functional touch
> screen by default on Digi International's AUO/Goodix LCD accessory kit used
> with the ConnectCore 6UL SBC Pro (ccimx6ulsbcpro) board.
>
> Signed-off-by: Alex Gonzalez 

Reviewed-by: Fabio Estevam 
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH v1 4/4] ARM: dts: ccimx6ulsbcpro: Add support for Goodix touch controller

2018-10-25 Thread Fabio Estevam
On Thu, Oct 25, 2018 at 12:10 PM Alex Gonzalez  wrote:
>
> The ConnectCore 6UL SBC Pro has an AUO/Goodix LCD accessory kit that is
> connected on the LVDS interface through an on-board LVDS transceiver.
>
> This change adds support for the touch interface.
>
> Signed-off-by: Alex Gonzalez 

Reviewed-by: Fabio Estevam 
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH v1 2/4] ARM: dts: ccimx6ulsbcpro: Enable AUO G101EVN010 lcdif panel

2018-10-25 Thread Fabio Estevam
On Thu, Oct 25, 2018 at 12:11 PM Alex Gonzalez  wrote:
>
> This change adds support for the AUO G101EVN010 lcdif panel for the
> mxsfb DRM driver.
>
> Signed-off-by: Alex Gonzalez 
> ---
>  arch/arm/boot/dts/imx6ul-ccimx6ulsbcpro.dts | 18 ++
>  1 file changed, 18 insertions(+)
>
> diff --git a/arch/arm/boot/dts/imx6ul-ccimx6ulsbcpro.dts 
> b/arch/arm/boot/dts/imx6ul-ccimx6ulsbcpro.dts
> index 11966d12af76..f6e6b2cf780b 100644
> --- a/arch/arm/boot/dts/imx6ul-ccimx6ulsbcpro.dts
> +++ b/arch/arm/boot/dts/imx6ul-ccimx6ulsbcpro.dts
> @@ -24,6 +24,18 @@
> status = "okay";
> };
>
> +   panel {
> +   compatible = "auo,g101evn010", "simple-panel";

The "simple-panel" string could be dropped.

Reviewed-by: Fabio Estevam 


> +   power-supply = <_ext>;
> +   backlight = <_backlight>;
> +
> +   port {
> +   panel_in: endpoint {
> +   remote-endpoint = <_out>;
> +   };
> +   };
> +   };
> +
> reg_usb_otg1_vbus: regulator-usb-otg1 {
> compatible = "regulator-fixed";
> regulator-name = "usb_otg1_vbus";
> @@ -112,6 +124,12 @@
>  _lcdif_hvsync>;
> lcd-supply = <_ext>;   /* BU90T82 LVDS bridge power */
> status = "okay";
> +
> +   port {
> +   display_out: endpoint {
> +   remote-endpoint = <_in>;
> +   };
> +   };
>  };
>
>  _ext {
>
> ___
> linux-arm-kernel mailing list
> linux-arm-ker...@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH] drm/imx: Switch to SPDX identifier

2018-09-28 Thread Fabio Estevam
Adopt the SPDX license identifier headers to ease license compliance
management.

Signed-off-by: Fabio Estevam 
---
 drivers/gpu/drm/imx/dw_hdmi-imx.c  |  5 +
 drivers/gpu/drm/imx/imx-drm-core.c | 11 +--
 drivers/gpu/drm/imx/imx-ldb.c  | 10 +-
 drivers/gpu/drm/imx/imx-tve.c  | 10 +-
 drivers/gpu/drm/imx/ipuv3-crtc.c   | 10 +-
 drivers/gpu/drm/imx/ipuv3-plane.c  | 10 +-
 drivers/gpu/drm/imx/parallel-display.c | 10 +-
 7 files changed, 7 insertions(+), 59 deletions(-)

diff --git a/drivers/gpu/drm/imx/dw_hdmi-imx.c 
b/drivers/gpu/drm/imx/dw_hdmi-imx.c
index fe6becd..77a26fd 100644
--- a/drivers/gpu/drm/imx/dw_hdmi-imx.c
+++ b/drivers/gpu/drm/imx/dw_hdmi-imx.c
@@ -1,10 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0
 /* Copyright (C) 2011-2013 Freescale Semiconductor, Inc.
  *
  * derived from imx-hdmi.c(renamed to bridge/dw_hdmi.c now)
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
  */
 #include 
 #include 
diff --git a/drivers/gpu/drm/imx/imx-drm-core.c 
b/drivers/gpu/drm/imx/imx-drm-core.c
index 0e6942f..820c7e3 100644
--- a/drivers/gpu/drm/imx/imx-drm-core.c
+++ b/drivers/gpu/drm/imx/imx-drm-core.c
@@ -1,17 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * Freescale i.MX drm driver
  *
  * Copyright (C) 2011 Sascha Hauer, Pengutronix
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
  */
 #include 
 #include 
diff --git a/drivers/gpu/drm/imx/imx-ldb.c b/drivers/gpu/drm/imx/imx-ldb.c
index 3bd0f8a..2c5bbe3 100644
--- a/drivers/gpu/drm/imx/imx-ldb.c
+++ b/drivers/gpu/drm/imx/imx-ldb.c
@@ -1,16 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * i.MX drm driver - LVDS display bridge
  *
  * Copyright (C) 2012 Sascha Hauer, Pengutronix
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
  */
 
 #include 
diff --git a/drivers/gpu/drm/imx/imx-tve.c b/drivers/gpu/drm/imx/imx-tve.c
index cffd331..4bc3ead 100644
--- a/drivers/gpu/drm/imx/imx-tve.c
+++ b/drivers/gpu/drm/imx/imx-tve.c
@@ -1,16 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * i.MX drm driver - Television Encoder (TVEv2)
  *
  * Copyright (C) 2013 Philipp Zabel, Pengutronix
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
  */
 
 #include 
diff --git a/drivers/gpu/drm/imx/ipuv3-crtc.c b/drivers/gpu/drm/imx/ipuv3-crtc.c
index 7d4b710..058b53c 100644
--- a/drivers/gpu/drm/imx/ipuv3-crtc.c
+++ b/drivers/gpu/drm/imx/ipuv3-crtc.c
@@ -1,16 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * i.MX IPUv3 Graphics driver
  *
  * Copyright (C) 2011 Sascha Hauer, Pengutronix
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
  */
 #include 
 #include 
diff --git a/drivers/gpu/drm/imx/ipuv3-plane.c 
b/drivers/gpu/drm/imx/ipuv3-plane.c
index 40605fd..9db833b 100644
--- a/drivers/gpu/drm/imx/ipuv3-plane.c
+++ b/drivers/gpu/drm/imx/ipuv3-plane.c
@@ -1,16 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * i.MX IPUv3 DP Overlay Planes
  *
  * Copyright (C) 2013 Philipp Zabel, Pengutronix
- *
- * This program is free

Re: [PATCH] qcom-scm: Include header

2018-12-29 Thread Fabio Estevam
Hi Bjorn,

On Fri, Dec 28, 2018 at 10:27 PM Bjorn Andersson
 wrote:

> Sorry about that, I forgot that the header file is not covered by the
> MAINTAINERS file.
>
> Your second patch looks good, but I'm hoping we can merge the upcoming
> v3 of Amit's patch right after the merge window. It fixes this and a lot
> of other pieces where we would like to include linux-arm-msm@:
>
> https://lore.kernel.org/lkml/d153a86748f99526e7790bfc4ef8781a2016fd51.1545126964.git.amit.kuche...@linaro.org/

Amit's patch adds the following entry:

+F: include/linux/*/qcom*

but it does not catch include/linux/qcom_scm.h

It also needs

+F: include/linux/qcom*

in order to catch include/linux/qcom-geni-se.h  and include/linux/qcom_scm.h

I can add that entry after Amit's patch gets applied.
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH] qcom-scm: Include header

2019-01-14 Thread Fabio Estevam
Hi Chris,

On Mon, Jan 14, 2019 at 5:54 PM Chris Healy  wrote:
>
> Perhaps I am confused but it appears that this patch has already
> landed upstream and got included in 5.0-rc2:

The patch that Amit is referring is the following entry in MAINTAINERS file:

+F: include/linux/qcom*

so that the proper lists can be put on Cc on future changes of this file.
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH] qcom-scm: Include header

2018-12-26 Thread Fabio Estevam
Since commit e6f6d63ed14c ("drm/msm: add headless gpu device for imx5")
the DRM_MSM symbol can be selected by SOC_IMX5 causing the following
error when building imx_v6_v7_defconfig:

In file included from ../drivers/gpu/drm/msm/adreno/a5xx_gpu.c:17:0:
../include/linux/qcom_scm.h: In function 'qcom_scm_set_cold_boot_addr':
../include/linux/qcom_scm.h:73:10: error: 'ENODEV' undeclared (first use in 
this function)
  return -ENODEV;

Include the  header file to fix this problem.

Reported-by: kernelci.org bot 
Fixes: e6f6d63ed14c ("drm/msm: add headless gpu device for imx5")
Signed-off-by: Fabio Estevam 
---
 include/linux/qcom_scm.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/linux/qcom_scm.h b/include/linux/qcom_scm.h
index 06996ad4f2bc..ce5a476fd733 100644
--- a/include/linux/qcom_scm.h
+++ b/include/linux/qcom_scm.h
@@ -13,6 +13,7 @@
 #ifndef __QCOM_SCM_H
 #define __QCOM_SCM_H
 
+#include 
 #include 
 #include 
 
-- 
2.17.1

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH 3/3] drm/panel: simple: Add support for VXT VL050-8048NT-C01 panel

2018-12-16 Thread Fabio Estevam
Hi Thierry,

On Tue, Dec 4, 2018 at 2:57 PM Fabio Estevam  wrote:
>
> Add support for the VXT VL050-8048NT-C01 800x480 panel to the
> panel-simple driver.
>
> This panel is used on some boards manufactured by TechNexion, such as
> imx7d-pico.
>
> Signed-off-by: Fabio Estevam 

Do you think it is possible to get this series applied for 4.21?

Thanks
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 3/3] drm/panel: simple: Add support for VXT VL050-8048NT-C01 panel

2018-12-04 Thread Fabio Estevam
Add support for the VXT VL050-8048NT-C01 800x480 panel to the
panel-simple driver. 

This panel is used on some boards manufactured by TechNexion, such as
imx7d-pico.

Signed-off-by: Fabio Estevam 
---
 drivers/gpu/drm/panel/panel-simple.c | 27 +++
 1 file changed, 27 insertions(+)

diff --git a/drivers/gpu/drm/panel/panel-simple.c 
b/drivers/gpu/drm/panel/panel-simple.c
index 5fbee83..2e76e95 100644
--- a/drivers/gpu/drm/panel/panel-simple.c
+++ b/drivers/gpu/drm/panel/panel-simple.c
@@ -2410,6 +2410,30 @@ static const struct panel_desc urt_umsh_8596md_parallel 
= {
.bus_format = MEDIA_BUS_FMT_RGB666_1X18,
 };
 
+static const struct drm_display_mode vl050_8048nt_c01_mode = {
+   .clock = 3,
+   .hdisplay = 800,
+   .hsync_start = 800 + 210,
+   .hsync_end = 800 + 210 + 20,
+   .htotal = 800 + 210 + 20 + 46,
+   .vdisplay =  480,
+   .vsync_start = 480 + 22,
+   .vsync_end = 480 + 22 + 10,
+   .vtotal = 480 + 22 + 10 + 23,
+   .vrefresh = 60,
+};
+
+static const struct panel_desc vl050_8048nt_c01 = {
+   .modes = _8048nt_c01_mode,
+   .num_modes = 1,
+   .bpc = 8,
+   .size = {
+   .width = 120,
+   .height = 76,
+   },
+   .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
+};
+
 static const struct drm_display_mode winstar_wf35ltiacd_mode = {
.clock = 6410,
.hdisplay = 320,
@@ -2725,6 +2749,9 @@ static const struct of_device_id platform_of_match[] = {
.compatible = "urt,umsh-8596md-20t",
.data = _umsh_8596md_parallel,
}, {
+   .compatible = "vxt,vl050-8048nt-c01",
+   .data = _8048nt_c01,
+   }, {
.compatible = "winstar,wf35ltiacd",
.data = _wf35ltiacd,
}, {
-- 
2.7.4

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 2/3] dt-bindings: Add VXT VL050-8048NT-C01 panel bindings

2018-12-04 Thread Fabio Estevam
The VXT VL050-8048NT-C01 is a TFT LCD panel with a 800x480 resolution
connected via 24 width parallel interface.

Signed-off-by: Fabio Estevam 
---
 .../devicetree/bindings/display/panel/vl050_8048nt_c01.txt   | 12 
 1 file changed, 12 insertions(+)
 create mode 100644 
Documentation/devicetree/bindings/display/panel/vl050_8048nt_c01.txt

diff --git 
a/Documentation/devicetree/bindings/display/panel/vl050_8048nt_c01.txt 
b/Documentation/devicetree/bindings/display/panel/vl050_8048nt_c01.txt
new file mode 100644
index 000..b42bf06
--- /dev/null
+++ b/Documentation/devicetree/bindings/display/panel/vl050_8048nt_c01.txt
@@ -0,0 +1,12 @@
+VXT 800x480 color TFT LCD panel
+
+Required properties:
+- compatible: should be "vxt,vl050-8048nt-c01"
+- power-supply: as specified in the base binding
+
+Optional properties:
+- backlight: as specified in the base binding
+- enable-gpios: as specified in the base binding
+
+This binding is compatible with the simple-panel binding, which is specified
+in simple-panel.txt in this directory.
-- 
2.7.4

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 1/3] dt-bindings: Add vendor prefix for VXT Ltd

2018-12-04 Thread Fabio Estevam
VXT Ltd is a manufacturer of projected capacitive touch panel
and display solutions: http://www.vxt.com.tw/

Signed-off-by: Fabio Estevam 
---
 Documentation/devicetree/bindings/vendor-prefixes.txt | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/vendor-prefixes.txt 
b/Documentation/devicetree/bindings/vendor-prefixes.txt
index 3bbe3b8..16a2a97 100644
--- a/Documentation/devicetree/bindings/vendor-prefixes.txt
+++ b/Documentation/devicetree/bindings/vendor-prefixes.txt
@@ -426,6 +426,7 @@ vivante Vivante Corporation
 vocore VoCore Studio
 voipac Voipac Technologies s.r.o.
 votVision Optical Technology Co., Ltd.
+vxtVXT Ltd
 wd Western Digital Corp.
 wetek  WeTek Electronics, limited.
 wexler Wexler
-- 
2.7.4

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH 08/10] drm/mxsfb: Update mxsfb to support LCD reset

2019-01-10 Thread Fabio Estevam
Hi Robert,

On Thu, Jan 10, 2019 at 6:34 AM Robert Chiras  wrote:
>
> The eLCDIF controller has control pin for the external LCD reset pin.
> Add support for it and assert this pin in enable and de-assert it in
> disable.
> Also, correct the pm_runtime_enable call, since it was made too early in
> the probe, causing issues to DRM enable routines.

The pm_runtime change should be on a different patch.

> Signed-off-by: Robert Chiras 
> ---
>  drivers/gpu/drm/mxsfb/mxsfb_crtc.c | 12 ++--
>  drivers/gpu/drm/mxsfb/mxsfb_drv.c  | 20 
>  drivers/gpu/drm/mxsfb/mxsfb_regs.h |  1 +
>  3 files changed, 19 insertions(+), 14 deletions(-)
>
> diff --git a/drivers/gpu/drm/mxsfb/mxsfb_crtc.c 
> b/drivers/gpu/drm/mxsfb/mxsfb_crtc.c
> index b62b607..8d1b6a6 100644
> --- a/drivers/gpu/drm/mxsfb/mxsfb_crtc.c
> +++ b/drivers/gpu/drm/mxsfb/mxsfb_crtc.c
> @@ -230,9 +230,12 @@ static void mxsfb_enable_controller(struct 
> mxsfb_drm_private *mxsfb)
> clk_prepare_enable(mxsfb->clk_disp_axi);
> clk_prepare_enable(mxsfb->clk);
>
> -   if (mxsfb->devdata->ipversion >= 4)
> +   if (mxsfb->devdata->ipversion >= 4) {
> writel(CTRL2_OUTSTANDING_REQS(REQ_16),
> mxsfb->base + LCDC_V4_CTRL2 + REG_SET);
> +   /* Assert LCD Reset bit */
> +   writel(CTRL2_LCD_RESET, mxsfb->base + LCDC_V4_CTRL2 + 
> REG_SET);
> +   }
>
> /* If it was disabled, re-enable the mode again */
> writel(CTRL_DOTCLK_MODE, mxsfb->base + LCDC_CTRL + REG_SET);
> @@ -250,9 +253,12 @@ static void mxsfb_disable_controller(struct 
> mxsfb_drm_private *mxsfb)
>  {
> u32 reg;
>
> -   if (mxsfb->devdata->ipversion >= 4)
> +   if (mxsfb->devdata->ipversion >= 4) {
> writel(CTRL2_OUTSTANDING_REQS(0x7),
> mxsfb->base + LCDC_V4_CTRL2 + REG_CLR);
> +   /* De-assert LCD Reset bit */
> +   writel(CTRL2_LCD_RESET, mxsfb->base + LCDC_V4_CTRL2 + 
> REG_CLR);
> +   }
>
> writel(CTRL_RUN, mxsfb->base + LCDC_CTRL + REG_CLR);
>
> @@ -346,6 +352,8 @@ static void mxsfb_crtc_mode_set_nofb(struct 
> mxsfb_drm_private *mxsfb)
> return;
>
> clk_set_rate(mxsfb->clk, m->crtc_clock * 1000);
> +   DRM_DEV_DEBUG_DRIVER(drm->dev, "Pixel clock: %dkHz (actual: %dkHz)\n",
> +   m->crtc_clock, (int)(clk_get_rate(mxsfb->clk) / 1000));

This unrelated change should also be in a different patch.
>
> DRM_DEV_DEBUG_DRIVER(drm->dev,
> "Connector bus_flags: 0x%08X\n", bus_flags);
> diff --git a/drivers/gpu/drm/mxsfb/mxsfb_drv.c 
> b/drivers/gpu/drm/mxsfb/mxsfb_drv.c
> index f528a37..135b8e1 100644
> --- a/drivers/gpu/drm/mxsfb/mxsfb_drv.c
> +++ b/drivers/gpu/drm/mxsfb/mxsfb_drv.c
> @@ -287,7 +287,7 @@ static int mxsfb_load(struct drm_device *drm, unsigned 
> long flags)
> if (IS_ERR(mxsfb->base))
> return PTR_ERR(mxsfb->base);
>
> -   mxsfb->clk = devm_clk_get(drm->dev, NULL);
> +   mxsfb->clk = devm_clk_get(drm->dev, "pix");

This breaks mx23 and mx28 as there is no "pix" clock defined in their
dtsi files.
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH] qcom-scm: Include header

2018-12-28 Thread Fabio Estevam
On Fri, Dec 28, 2018 at 5:52 PM Fabio Estevam  wrote:

> > Andy, please pick up for inclusion in -rc
>
> Yes, it would be really nice if we could get this fix into 4.20-rc1 so
> that imx_v6_v7_defconfig could be built.

Ops, I meant 4.21-rc1 :-)
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH] qcom-scm: Include header

2018-12-28 Thread Fabio Estevam
Hi Bjorn,

On Fri, Dec 28, 2018 at 5:31 PM Bjorn Andersson
 wrote:
>
> On Wed 26 Dec 04:06 PST 2018, Fabio Estevam wrote:
>
> > Since commit e6f6d63ed14c ("drm/msm: add headless gpu device for imx5")
> > the DRM_MSM symbol can be selected by SOC_IMX5 causing the following
> > error when building imx_v6_v7_defconfig:
> >
> > In file included from ../drivers/gpu/drm/msm/adreno/a5xx_gpu.c:17:0:
> > ../include/linux/qcom_scm.h: In function 'qcom_scm_set_cold_boot_addr':
> > ../include/linux/qcom_scm.h:73:10: error: 'ENODEV' undeclared (first use in 
> > this function)
> >   return -ENODEV;
> >
> > Include the  header file to fix this problem.
> >
>
> Reviewed-by: Bjorn Andersson 
>
> Andy, please pick up for inclusion in -rc

Yes, it would be really nice if we could get this fix into 4.20-rc1 so
that imx_v6_v7_defconfig could be built.

> Fabio, please use get_maintainers, so your patches hits the appropriate
> mailing lists (linux-arm-msm@ in this case)

Sorry, I copied the folks involved in the offending commit:
e6f6d63ed14c ("drm/msm: add headless gpu device for imx5")

By the way, I just ran get_maintainers in this patch and linux-arm-msm
is not listed.

Thanks
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH] qcom-scm: Include header

2018-12-28 Thread Fabio Estevam
Hi Bjorn,

On Fri, Dec 28, 2018 at 5:52 PM Fabio Estevam  wrote:

> By the way, I just ran get_maintainers in this patch and linux-arm-msm
> is not listed.

Would you like to me to submit a patch like this to fix this problem?

diff --git a/MAINTAINERS b/MAINTAINERS
index 7a9804a891fd..e014de05b046 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -4797,6 +4797,7 @@ L:freedr...@lists.freedesktop.org
 T: git git://people.freedesktop.org/~robclark/linux
 S: Maintained
 F: drivers/gpu/drm/msm/
+F: include/linux/qcom_scm.h
 F: include/uapi/drm/msm_drm.h
 F: Documentation/devicetree/bindings/display/msm/
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH] qcom-scm: Include header

2018-12-28 Thread Fabio Estevam
On Fri, Dec 28, 2018 at 5:56 PM Fabio Estevam  wrote:
>
> Hi Bjorn,
>
> On Fri, Dec 28, 2018 at 5:52 PM Fabio Estevam  wrote:
>
> > By the way, I just ran get_maintainers in this patch and linux-arm-msm
> > is not listed.
>
> Would you like to me to submit a patch like this to fix this problem?

Just realized that include/linux/qcom_scm.h is used in several
subsystems, so maybe a better location would be under ARM/QUALCOMM
SUPPORT?

diff --git a/MAINTAINERS b/MAINTAINERS
index 7a9804a891fd..77836b9a8ffd 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1950,6 +1950,7 @@ F:drivers/tty/serial/msm_serial.c
 F: drivers/*/pm8???-*
 F: drivers/mfd/ssbi.c
 F: drivers/firmware/qcom_scm*
+F: include/linux/qcom_scm.h
 T: git git://git.kernel.org/pub/scm/linux/kernel/git/agross/linux.git

 ARM/RADISYS ENP2611 MACHINE SUPPORT
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH 2/2] phy: Add driver for mixel dphy

2019-01-28 Thread Fabio Estevam
Hi Guido,

On Fri, Jan 25, 2019 at 8:15 AM Guido Günther  wrote:

> +config PHY_MIXEL_MIPI_DPHY
> +   bool
> +   depends on OF
> +   select GENERIC_PHY
> +   select GENERIC_PHY_MIPI_DPHY
> +   default ARCH_MXC && ARM64

No need to force this selection for all i.MX8M boards, as not everyone
is interested in using Mixel DSI.

> --- /dev/null
> +++ b/drivers/phy/phy-mixel-mipi-dphy.c
> @@ -0,0 +1,449 @@
> +/*
> + * Copyright 2017 NXP
> + * Copyright 2019 Purism SPC
> + *
> + * SPDX-License-Identifier: GPL-2.0

SPDX line should be in the first line and start with //

> + */
> +
> +/* #define DEBUG 1 */

Please remove it.

> +/* DPHY registers */
> +#define DPHY_PD_DPHY   0x00
> +#define DPHY_M_PRG_HS_PREPARE  0x04
> +#define DPHY_MC_PRG_HS_PREPARE 0x08
> +#define DPHY_M_PRG_HS_ZERO 0x0c
> +#define DPHY_MC_PRG_HS_ZERO0x10
> +#define DPHY_M_PRG_HS_TRAIL0x14
> +#define DPHY_MC_PRG_HS_TRAIL   0x18
> +#define DPHY_PD_PLL0x1c
> +#define DPHY_TST   0x20
> +#define DPHY_CN0x24
> +#define DPHY_CM0x28
> +#define DPHY_CO0x2c
> +#define DPHY_LOCK  0x30
> +#define DPHY_LOCK_BYP  0x34
> +#define DPHY_TX_RCAL   0x38
> +#define DPHY_AUTO_PD_EN0x3c
> +#define DPHY_RXLPRP0x40
> +#define DPHY_RXCDRP0x44

In the NXP vendor tree we have these additional offsets for imx8m that
are missing here:

.reg_rxhs_settle = 0x48,
.reg_bypass_pll = 0x4c,

> +#define MBPS(x) ((x) * 100)
> +
> +#define DATA_RATE_MAX_SPEED MBPS(1500)
> +#define DATA_RATE_MIN_SPEED MBPS(80)
> +
> +#define CN_BUF 0xcb7a89c0
> +#define CO_BUF 0x63
> +#define CM(x)  (   \
> +   ((x) <  32)?0xe0|((x)-16) : \
> +   ((x) <  64)?0xc0|((x)-32) : \
> +   ((x) < 128)?0x80|((x)-64) : \
> +   ((x) - 128))
> +#define CN(x)  (((x) == 1)?0x1f : (((CN_BUF)>>((x)-1))&0x1f))
> +#define CO(x)  ((CO_BUF)>>(8-(x))&0x3)
> +
> +static inline u32 phy_read(struct phy *phy, unsigned int reg)
> +{
> +   struct mixel_dphy_priv *priv = phy_get_drvdata(phy);
> +
> +   return readl(priv->regs + reg);

Maybe it's worth using regmap here. It makes it very easy to dump all
the MIXEL registers at once.

> +static int mixel_dphy_config_from_opts(struct phy *phy,
> +  struct phy_configure_opts_mipi_dphy *dphy_opts,
> +  struct mixel_dphy_cfg *cfg)
> +{
> +   struct mixel_dphy_priv *priv = dev_get_drvdata(phy->dev.parent);
> +   unsigned long ref_clk = clk_get_rate(priv->phy_ref_clk);
> +   int i;
> +   unsigned long numerator, denominator, frequency;
> +   unsigned step;
> +
> +   if (dphy_opts->hs_clk_rate > DATA_RATE_MAX_SPEED ||
> +   dphy_opts->hs_clk_rate < DATA_RATE_MIN_SPEED)
> +   return -EINVAL;
> +   cfg->hs_clk_rate = dphy_opts->hs_clk_rate;
> +
> +   numerator = dphy_opts->hs_clk_rate;
> +   denominator = ref_clk;
> +   get_best_ratio(, , 255, 256);
> +   if (!numerator || !denominator) {
> +   dev_dbg(>dev, "Invalid %ld/%ld for %ld/%ld\n",

dev_err should be more appropriate here.

> +static int mixel_dphy_ref_power_on(struct phy *phy)
> +{
> +   struct mixel_dphy_priv *priv = phy_get_drvdata(phy);
> +   u32 lock, timeout;
> +   int ret = 0;
> +
> +   mutex_lock(>lock);
> +   clk_prepare_enable(priv->phy_ref_clk);
> +
> +   phy_write(phy, PWR_ON, DPHY_PD_DPHY);
> +   phy_write(phy, PWR_ON, DPHY_PD_PLL);
> +
> +   timeout = 100;
> +   while (!(lock = phy_read(phy, DPHY_LOCK))) {
> +   udelay(10);
> +   if (--timeout == 0) {
> +   dev_err(>dev, "Could not get DPHY lock!\n");
> +   mutex_unlock(>lock);
> +   return -EINVAL;

Could you use readl_poll_timeout() instead?

> +static int mixel_dphy_ref_power_off(struct phy *phy)
> +{
> +   struct mixel_dphy_priv *priv = phy_get_drvdata(phy);
> +   int ret = 0;

This variable is not needed.

> +
> +   mutex_lock(>lock);
> +
> +   phy_write(phy, PWR_OFF, DPHY_PD_PLL);
> +   phy_write(phy, PWR_OFF, DPHY_PD_DPHY);
> +
> +   clk_disable_unprepare(priv->phy_ref_clk);
> +   mutex_unlock(>lock);
> +
> +   return ret;

and you could simply do a 'return 0' instead.

> +   phy_write(phy, 0x00, DPHY_LOCK_BYP);
> +   phy_write(phy, 0x01, DPHY_TX_RCAL);
> +   phy_write(phy, 0x00, DPHY_AUTO_PD_EN);
> +   phy_write(phy, 0x01, DPHY_RXLPRP);
> +   phy_write(phy, 0x01, DPHY_RXCDRP);

In the NXP vendor code the value 2 is written to this register:

phy_write(phy, 0x02, priv->plat_data->reg_rxcdrp);

It would be good to dump all Mixel DSI PHY registers in 

Re: [PATCH v4 2/3] dt-bindings: Add Rocktech jh057n00900 panel bindings

2019-03-25 Thread Fabio Estevam
On Mon, Mar 25, 2019 at 11:06 AM Guido Günther  wrote:

> --- /dev/null
> +++ b/Documentation/devicetree/bindings/display/panel/rocktech,jh057n00900.txt
> @@ -0,0 +1,18 @@
> +Rocktech jh057n00900 5.5" 720x1440 TFT LCD panel
> +
> +Required properties:
> +- compatible: should be "rocktech,jh057n00900"
> +- reg: DSI virtual channel of the peripheral
> +- reset-gpios: panel reset gpio
> +- backlight: phandle of the backlight device attached to the panel
> +
> +Example:
> +
> +   _dsi {
> +   panel {
> +   compatible = "rocktech,jh057n00900";
> +   reg = <0>;

Passing the reg property without its corresponding @0 would cause a
dtc warning when building with W=1.
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Re: [PATCH v2 3/3] drm/panel: simple: Add support for VXT VL050-8048NT-C01 panel

2019-04-01 Thread Fabio Estevam
Hi Thierry,

On Mon, Feb 18, 2019 at 9:27 PM Fabio Estevam  wrote:
>
> Add support for the VXT VL050-8048NT-C01 800x480 panel to the
> panel-simple driver.
>
> This panel is used on some boards manufactured by TechNexion, such as
> imx7d-pico.
>
> Reviewed-by: Otavio Salvador 
> Reviewed-by: Sam Ravnborg 
> Signed-off-by: Fabio Estevam 

Any feedback, please?

Trying to get this one upstreamed for four months already and hope to
get it to 5.2.

Thanks
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

[PATCH v2 3/3] drm/panel: simple: Add support for VXT VL050-8048NT-C01 panel

2019-02-18 Thread Fabio Estevam
Add support for the VXT VL050-8048NT-C01 800x480 panel to the
panel-simple driver. 

This panel is used on some boards manufactured by TechNexion, such as
imx7d-pico.

Reviewed-by: Otavio Salvador 
Reviewed-by: Sam Ravnborg 
Signed-off-by: Fabio Estevam 
---
Changes since v1:
- Pass .flags and .bus_flags (Sam)

 drivers/gpu/drm/panel/panel-simple.c | 29 
 1 file changed, 29 insertions(+)

diff --git a/drivers/gpu/drm/panel/panel-simple.c 
b/drivers/gpu/drm/panel/panel-simple.c
index 9c69e739a524..737cbf3aee11 100644
--- a/drivers/gpu/drm/panel/panel-simple.c
+++ b/drivers/gpu/drm/panel/panel-simple.c
@@ -2434,6 +2434,32 @@ static const struct panel_desc urt_umsh_8596md_parallel 
= {
.bus_format = MEDIA_BUS_FMT_RGB666_1X18,
 };
 
+static const struct drm_display_mode vl050_8048nt_c01_mode = {
+   .clock = 3,
+   .hdisplay = 800,
+   .hsync_start = 800 + 210,
+   .hsync_end = 800 + 210 + 20,
+   .htotal = 800 + 210 + 20 + 46,
+   .vdisplay =  480,
+   .vsync_start = 480 + 22,
+   .vsync_end = 480 + 22 + 10,
+   .vtotal = 480 + 22 + 10 + 23,
+   .vrefresh = 60,
+   .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
+};
+
+static const struct panel_desc vl050_8048nt_c01 = {
+   .modes = _8048nt_c01_mode,
+   .num_modes = 1,
+   .bpc = 8,
+   .size = {
+   .width = 120,
+   .height = 76,
+   },
+   .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
+   .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_POSEDGE,
+};
+
 static const struct drm_display_mode winstar_wf35ltiacd_mode = {
.clock = 6410,
.hdisplay = 320,
@@ -2751,6 +2777,9 @@ static const struct of_device_id platform_of_match[] = {
}, {
.compatible = "urt,umsh-8596md-20t",
.data = _umsh_8596md_parallel,
+   }, {
+   .compatible = "vxt,vl050-8048nt-c01",
+   .data = _8048nt_c01,
}, {
.compatible = "winstar,wf35ltiacd",
.data = _wf35ltiacd,
-- 
2.17.1

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

[PATCH v2 2/3] dt-bindings: Add VXT VL050-8048NT-C01 panel bindings

2019-02-18 Thread Fabio Estevam
The VXT VL050-8048NT-C01 is a TFT LCD panel with a 800x480 resolution
connected via 24 width parallel interface.

Reviewed-by: Otavio Salvador 
Reviewed-by: Rob Herring 
---
Changes since v1:
- None

 .../bindings/display/panel/vl050_8048nt_c01.txt  | 12 
 1 file changed, 12 insertions(+)
 create mode 100644 
Documentation/devicetree/bindings/display/panel/vl050_8048nt_c01.txt

diff --git 
a/Documentation/devicetree/bindings/display/panel/vl050_8048nt_c01.txt 
b/Documentation/devicetree/bindings/display/panel/vl050_8048nt_c01.txt
new file mode 100644
index ..b42bf06bbd99
--- /dev/null
+++ b/Documentation/devicetree/bindings/display/panel/vl050_8048nt_c01.txt
@@ -0,0 +1,12 @@
+VXT 800x480 color TFT LCD panel
+
+Required properties:
+- compatible: should be "vxt,vl050-8048nt-c01"
+- power-supply: as specified in the base binding
+
+Optional properties:
+- backlight: as specified in the base binding
+- enable-gpios: as specified in the base binding
+
+This binding is compatible with the simple-panel binding, which is specified
+in simple-panel.txt in this directory.
-- 
2.17.1

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

[PATCH v2 1/3] dt-bindings: Add vendor prefix for VXT Ltd

2019-02-18 Thread Fabio Estevam
VXT Ltd is a manufacturer of projected capacitive touch panel
and display solutions: http://www.vxt.com.tw/

Reviewed-by: Otavio Salvador 
Reviewed-by: Rob Herring 
Signed-off-by: Fabio Estevam 
---
Changes since v1:
- None

 Documentation/devicetree/bindings/vendor-prefixes.txt | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/vendor-prefixes.txt 
b/Documentation/devicetree/bindings/vendor-prefixes.txt
index 389508584f48..096ad1857692 100644
--- a/Documentation/devicetree/bindings/vendor-prefixes.txt
+++ b/Documentation/devicetree/bindings/vendor-prefixes.txt
@@ -427,6 +427,7 @@ vivante Vivante Corporation
 vocore VoCore Studio
 voipac Voipac Technologies s.r.o.
 votVision Optical Technology Co., Ltd.
+vxtVXT Ltd
 wd Western Digital Corp.
 wetek  WeTek Electronics, limited.
 wexler Wexler
-- 
2.17.1

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Re: [PATCH 3/3] drm/panel: simple: Add support for VXT VL050-8048NT-C01 panel

2019-01-24 Thread Fabio Estevam
Ping

On Sun, Dec 16, 2018 at 10:39 PM Fabio Estevam  wrote:
>
> Hi Thierry,
>
> On Tue, Dec 4, 2018 at 2:57 PM Fabio Estevam  wrote:
> >
> > Add support for the VXT VL050-8048NT-C01 800x480 panel to the
> > panel-simple driver.
> >
> > This panel is used on some boards manufactured by TechNexion, such as
> > imx7d-pico.
> >
> > Signed-off-by: Fabio Estevam 
>
> Do you think it is possible to get this series applied for 4.21?
>
> Thanks
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH v2 3/3] phy: Add driver for mixel dphy found on imx8

2019-02-01 Thread Fabio Estevam
Hi Guido,

Thanks for the respin. It looks better :-)

On Fri, Feb 1, 2019 at 6:50 AM Guido Günther  wrote:

> +config PHY_MIXEL_MIPI_DPHY
> +   tristate "Mixel MIPI DSI PHY support"
> +   depends on OF
> +   select GENERIC_PHY
> +   select GENERIC_PHY_MIPI_DPHY

Since you converted to regmap, I guess you need:
select REGMAP_MMIO now?

> +   help
> + Enable this to add support for the Mixel DSI PHY as found
> + on NXP's i.MX8 family of SOCs.
> diff --git a/drivers/phy/freescale/Makefile b/drivers/phy/freescale/Makefile
> index dc2b3f1f2f80..07491c926a2c 100644
> --- a/drivers/phy/freescale/Makefile
> +++ b/drivers/phy/freescale/Makefile
> @@ -1 +1,2 @@
>  obj-$(CONFIG_PHY_FSL_IMX8MQ_USB)   += phy-fsl-imx8mq-usb.o
> +obj-$(CONFIG_PHY_MIXEL_MIPI_DPHY)  += phy-fsl-imx8-mipi-dphy.o
> diff --git a/drivers/phy/freescale/phy-fsl-imx8-mipi-dphy.c 
> b/drivers/phy/freescale/phy-fsl-imx8-mipi-dphy.c
> new file mode 100644
> index ..4b182f2eaa6e
> --- /dev/null
> +++ b/drivers/phy/freescale/phy-fsl-imx8-mipi-dphy.c
> @@ -0,0 +1,494 @@
> +// SPDX-License-Identifier: GPL-2.0+
> +/*
> + * Copyright 2017,2018 NXP
> + * Copyright 2019 Purism SPC
> + */
> +
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +
> +/* DPHY registers */
> +#define DPHY_PD_DPHY   0x00
> +#define DPHY_M_PRG_HS_PREPARE  0x04
> +#define DPHY_MC_PRG_HS_PREPARE 0x08
> +#define DPHY_M_PRG_HS_ZERO 0x0c
> +#define DPHY_MC_PRG_HS_ZERO0x10
> +#define DPHY_M_PRG_HS_TRAIL0x14
> +#define DPHY_MC_PRG_HS_TRAIL   0x18
> +#define DPHY_PD_PLL0x1c
> +#define DPHY_TST   0x20
> +#define DPHY_CN0x24
> +#define DPHY_CM0x28
> +#define DPHY_CO0x2c
> +#define DPHY_LOCK  0x30
> +#define DPHY_LOCK_BYP  0x34
> +#define DPHY_REG_BYPASS_PLL0x4C
> +
> +#define MBPS(x) ((x) * 100)
> +
> +#define DATA_RATE_MAX_SPEED MBPS(1500)
> +#define DATA_RATE_MIN_SPEED MBPS(80)
> +
> +#define CN_BUF 0xcb7a89c0
> +#define CO_BUF 0x63
> +#define CM(x)  (   \
> +   ((x) <  32)?0xe0|((x)-16) : \

Doesn't checkpatch complain about the need of space between operators?

> +   ((x) <  64)?0xc0|((x)-32) : \
> +   ((x) < 128)?0x80|((x)-64) : \
> +   ((x) - 128))
> +#define CN(x)  (((x) == 1)?0x1f : (((CN_BUF)>>((x)-1))&0x1f))
> +#define CO(x)  ((CO_BUF)>>(8-(x))&0x3)
> +
> +/* PHY power on is LOW_ENABLE */

active low is probably a better term.

> +#define PWR_ON 0
> +#define PWR_OFF1

> +static inline u32 phy_read(struct phy *phy, unsigned int reg)

After the conversion to regmap this function is unused now and you
should remove it.

> +static inline void phy_write(struct phy *phy, u32 value, unsigned int reg)

No need for "inline".

Make it static int instead.

> +{
> +   struct mixel_dphy_priv *priv = phy_get_drvdata(phy);
> +   int ret;
> +
> +   ret = regmap_write(priv->regs, reg, value);

Or maybe get rid of this function and use regmap_write() instead.

> +   frequency = ref_clk * numerator / (2 * denominator);
> +   dev_info(>dev, "freq=%ld, hs_clk/ref_clk=%ld/%ld ⩰ %ld/%ld\n",

dev_dbg() would be better?

> +frequency, dphy_opts->hs_clk_rate, ref_clk,
> +numerator, denominator);
> +
> +   /* LP clock period */
> +   lp_t = 1L / dphy_opts->lp_clk_rate; /* ps */
> +   dev_dbg(>dev, "LP clock %lu, period: %lu ps\n",
> +   dphy_opts->lp_clk_rate, lp_t);
> +   /*
> +*  hs_prepare: in lp clock periods
> +*/

Please use single line comment style instead.

> +   if (2 * dphy_opts->hs_prepare > 5 * lp_t) {
> +   dev_err(>dev,
> +   "hs_prepare (%u) > 2.5 * lp clock period (%lu)",
> +   dphy_opts->hs_prepare, lp_t);
> +   return -EINVAL;
> +   }
> +   /* 00: lp_t, 01: 1.5 * lp_t, 10: 2 * lp_t, 11: 2.5 * lp_t */
> +   if (dphy_opts->hs_prepare < lp_t)
> +   n = 0;
> +   else
> +   n = 2 * (dphy_opts->hs_prepare - lp_t) / lp_t;
> +   cfg->m_prg_hs_prepare = n;
> +
> +   /*
> +* clk_prepare: in lp clock periods
> +*/

Same here.

> +   if (2 * dphy_opts->clk_prepare > 3 * lp_t) {
> +   dev_err(>dev,
> +   "clk_prepare (%u) > 1.5 * lp clock period (%lu)",
> +   dphy_opts->clk_prepare, lp_t);
> +   return -EINVAL;
> +   }
> +   /* 00: lp_t, 01: 1.5 * lp_t */
> +   cfg->mc_prg_hs_prepare = dphy_opts->clk_prepare > lp_t ? 1 : 0;
> +
> +   /*
> +* hs_zero: forumula from NXP BSP


[PATCH] drm/syncobj: Include the header

2019-05-27 Thread Fabio Estevam
The prototype for 'drm_timeout_abs_to_jiffies' is provided by
the  header.

Include this header to fix the following sparse warning:

drivers/gpu/drm/drm_syncobj.c:937:13: warning: symbol 
'drm_timeout_abs_to_jiffies' was not declared. Should it be static?

Signed-off-by: Fabio Estevam 
---
 drivers/gpu/drm/drm_syncobj.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/drm_syncobj.c b/drivers/gpu/drm/drm_syncobj.c
index 3d400905100b..b06fa424bd44 100644
--- a/drivers/gpu/drm/drm_syncobj.c
+++ b/drivers/gpu/drm/drm_syncobj.c
@@ -46,6 +46,7 @@
  * The file takes a reference on the kref.
  */
 
+#include 
 #include 
 #include 
 #include 
-- 
2.17.1

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

[PATCH] drm/damage-helper: Use NULL instead of 0

2019-05-27 Thread Fabio Estevam
The 'clips' member is a pointer, so assign NULL instead of 0.

This fixes the following sparse warning:

drivers/gpu/drm/drm_damage_helper.c:289:31: warning: Using plain integer as 
NULL pointer

Signed-off-by: Fabio Estevam 
---
 drivers/gpu/drm/drm_damage_helper.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/drm_damage_helper.c 
b/drivers/gpu/drm/drm_damage_helper.c
index ee67c96841fa..8230dac01a89 100644
--- a/drivers/gpu/drm/drm_damage_helper.c
+++ b/drivers/gpu/drm/drm_damage_helper.c
@@ -286,7 +286,7 @@ drm_atomic_helper_damage_iter_init(struct 
drm_atomic_helper_damage_iter *iter,
iter->plane_src.y2 = (state->src.y2 >> 16) + !!(state->src.y2 & 0x);
 
if (!iter->clips || !drm_rect_equals(>src, _state->src)) {
-   iter->clips = 0;
+   iter->clips = NULL;
iter->num_clips = 0;
iter->full_update = true;
}
-- 
2.17.1

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

[PATCH] drm/etnaviv: Use devm_platform_ioremap_resource()

2019-06-05 Thread Fabio Estevam
Use devm_platform_ioremap_resource() to simplify the code a bit.

Signed-off-by: Fabio Estevam 
---
 drivers/gpu/drm/etnaviv/etnaviv_gpu.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c 
b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
index 72d01e873160..a4ff1ee41bfa 100644
--- a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
+++ b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
@@ -1711,7 +1711,6 @@ static int etnaviv_gpu_platform_probe(struct 
platform_device *pdev)
 {
struct device *dev = >dev;
struct etnaviv_gpu *gpu;
-   struct resource *res;
int err;
 
gpu = devm_kzalloc(dev, sizeof(*gpu), GFP_KERNEL);
@@ -1723,8 +1722,7 @@ static int etnaviv_gpu_platform_probe(struct 
platform_device *pdev)
mutex_init(>fence_lock);
 
/* Map registers: */
-   res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-   gpu->mmio = devm_ioremap_resource(>dev, res);
+   gpu->mmio = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(gpu->mmio))
return PTR_ERR(gpu->mmio);
 
-- 
2.17.1

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Re: dpms mode change with wayland on iMX.6

2019-06-05 Thread Fabio Estevam
On Mon, May 27, 2019 at 10:53 AM Pintu Agarwal  wrote:

> One more point:
> Although it is having Kernel 3.10, but the DRM modules were upgraded
> to Kernel 4.9.xx from mainline.
> So, latest DRM changes are already applied.

Please don't do this: just use a recent mainline kernel instead of
mixing 3.10 kernel + DRM part from 4.9.
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Re: [PATCH 1/2] dt-bindings: display: panel: Add support for Raydium RM67191 panel

2019-06-14 Thread Fabio Estevam
On Fri, Jun 14, 2019 at 8:53 AM Robert Chiras  wrote:
>
> Add dt-bindings documentation for Raydium RM67191 DSI panel.
>
> Signed-off-by: Robert Chiras 
> ---
>  .../bindings/display/panel/raydium,rm67191.txt | 42 
> ++
>  1 file changed, 42 insertions(+)
>  create mode 100644 
> Documentation/devicetree/bindings/display/panel/raydium,rm67191.txt
>
> diff --git 
> a/Documentation/devicetree/bindings/display/panel/raydium,rm67191.txt 
> b/Documentation/devicetree/bindings/display/panel/raydium,rm67191.txt
> new file mode 100644
> index 000..5a6268d
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/display/panel/raydium,rm67191.txt
> @@ -0,0 +1,42 @@
> +Raydium RM67171 OLED LCD panel with MIPI-DSI protocol
> +
> +Required properties:
> +- compatible:  "raydium,rm67191"
> +- reg: virtual channel for MIPI-DSI protocol
> +   must be <0>
> +- dsi-lanes:   number of DSI lanes to be used
> +   must be <3> or <4>
> +- port:input port node with endpoint definition as
> +   defined in 
> Documentation/devicetree/bindings/graph.txt;
> +   the input port should be connected to a MIPI-DSI 
> device
> +   driver
> +
> +Optional properties:
> +- reset-gpio:  a GPIO spec for the RST_B GPIO pin

reset-gpios (with the s in the end) is the recommendation.

> +- display-timings: timings for the connected panel according to [1]

This is not needed.

> +- video-mode:  0 - burst-mode
> +   1 - non-burst with sync event
> +   2 - non-burst with sync pulse
> +
> +[1]: Documentation/devicetree/bindings/display/display-timing.txt

This path does not exist.

Also, could you try to align these bindings with the one from raydium,rm68200?

There are power-supply and backlight optional properties there, which
seem useful.

> +
> +Example:
> +
> +   panel@0 {
> +   compatible = "raydium,rm67191";
> +   reg = <0>;
> +   pinctrl-0 = <_mipi_dsi_0_1_en>;

You should also pass pinctrl-names = "default"; if you use pinctrl-0.

> +   reset-gpio = < 7 GPIO_ACTIVE_HIGH>;

Should be active low.
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Re: [PATCH 2/2] drm/panel: Add support for Raydium RM67191 panel driver

2019-06-14 Thread Fabio Estevam
Hi Robert,

On Fri, Jun 14, 2019 at 8:52 AM Robert Chiras  wrote:

> --- /dev/null
> +++ b/drivers/gpu/drm/panel/panel-raydium-rm67191.c
> @@ -0,0 +1,730 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/*
> + * i.MX drm driver - Raydium MIPI-DSI panel driver
> + *
> + * Copyright (C) 2017 NXP
> + *
> + * This program is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU General Public License
> + * as published by the Free Software Foundation; either version 2
> + * of the License, or (at your option) any later version.
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + * GNU General Public License for more details.

No need for this text as you are using SPDX tag.

> +static int color_format_from_dsi_format(enum mipi_dsi_pixel_format format)
> +{
> +   switch (format) {
> +   case MIPI_DSI_FMT_RGB565:
> +   return 0x55;
> +   case MIPI_DSI_FMT_RGB666:
> +   case MIPI_DSI_FMT_RGB666_PACKED:
> +   return 0x66;
> +   case MIPI_DSI_FMT_RGB888:
> +   return 0x77;

Could you use defines for these magic 0x55, 0x66 and 0x77 numbers?

> +static int rad_panel_prepare(struct drm_panel *panel)
> +{
> +   struct rad_panel *rad = to_rad_panel(panel);
> +
> +   if (rad->prepared)
> +   return 0;
> +
> +   if (rad->reset) {
> +   gpiod_set_value(rad->reset, 0);
> +   usleep_range(5000, 1);
> +   gpiod_set_value(rad->reset, 1);
> +   usleep_range(2, 25000);

This does not look correct.

The correct way to do a reset with gpiod API is:

 gpiod_set_value(rad->reset, 1);

delay

gpiod_set_value(rad->reset, 0);

I don't have the datasheet for the RM67191 panel, but I assume the
reset GPIO is active low.

Since you inverted the polarity in the dts and inside the driver, you
got it right by accident.

You could also consider using gpiod_set_value_cansleep() variant
instead because the GPIO reset could be provided by an I2C GPIO
expander, for example.

Also, when sleeping for more than 10ms, msleep is a better fit as per
Documentation/timers/timers-howto.txt.

> +   if (rad->reset) {
> +   gpiod_set_value(rad->reset, 0);
> +   usleep_range(15000, 17000);
> +   gpiod_set_value(rad->reset, 1);
> +   }

Another reset?
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Re: [EXT] Re: [PATCH 2/2] drm/panel: Add support for Raydium RM67191 panel driver

2019-06-14 Thread Fabio Estevam
On Fri, Jun 14, 2019 at 10:29 AM Robert Chiras  wrote:

> The GPIO is active high, and the above sequence was received from the
> panel vendor in the following form:
> SET_RESET_PIN(1);
> MDELAY(10);
> SET_RESET_PIN(0);
> MDELAY(5);
> SET_RESET_PIN(1);
> MDELAY(20);
> I got rid of the first transition to high since seemed redundant.
> Also, according to the manual reference, the RSTB pin needs to be
> active high while operating the display.

That's exactly my point :-)

In normal operation the GPIO reset needs to be high.

During reset the GPIO reset needs to be low., which means that the
GPIO reset is "active low".

So you should invert both the dts and the driver to behave correctly.


[PATCH] drm/etnaviv: Use dev_info() instead of pr_info()

2019-06-11 Thread Fabio Estevam
dev_info() is more appropriate for printing error messages inside
drivers, so switch to dev_info().

Signed-off-by: Fabio Estevam 
---
 drivers/gpu/drm/etnaviv/etnaviv_buffer.c | 14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/gpu/drm/etnaviv/etnaviv_buffer.c 
b/drivers/gpu/drm/etnaviv/etnaviv_buffer.c
index 160ce3c060a5..827b5e42dbe3 100644
--- a/drivers/gpu/drm/etnaviv/etnaviv_buffer.c
+++ b/drivers/gpu/drm/etnaviv/etnaviv_buffer.c
@@ -414,18 +414,18 @@ void etnaviv_buffer_queue(struct etnaviv_gpu *gpu, u32 
exec_state,
buffer->user_size - 4);
 
if (drm_debug & DRM_UT_DRIVER)
-   pr_info("stream link to 0x%08x @ 0x%08x %p\n",
-   return_target, etnaviv_cmdbuf_get_va(cmdbuf),
-   cmdbuf->vaddr);
+   dev_info(gpu->dev, "stream link to 0x%08x @ 0x%08x %p\n",
+return_target, etnaviv_cmdbuf_get_va(cmdbuf),
+cmdbuf->vaddr);
 
if (drm_debug & DRM_UT_DRIVER) {
print_hex_dump(KERN_INFO, "cmd ", DUMP_PREFIX_OFFSET, 16, 4,
   cmdbuf->vaddr, cmdbuf->size, 0);
 
-   pr_info("link op: %p\n", buffer->vaddr + waitlink_offset);
-   pr_info("addr: 0x%08x\n", link_target);
-   pr_info("back: 0x%08x\n", return_target);
-   pr_info("event: %d\n", event);
+   dev_info(gpu->dev, "link op: %p\n", buffer->vaddr + 
waitlink_offset);
+   dev_info(gpu->dev, "addr: 0x%08x\n", link_target);
+   dev_info(gpu->dev, "back: 0x%08x\n", return_target);
+   dev_info(gpu->dev, "event: %d\n", event);
}
 
/*
-- 
2.17.1

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

[PATCH v2] drm/etnaviv: Use dev_info() instead of pr_info()

2019-06-11 Thread Fabio Estevam
dev_info() is more appropriate for printing _info level messages
inside drivers, so switch to dev_info().

Signed-off-by: Fabio Estevam 
---
Changes since v1:
- Adjust commit log to say "_info level" instead of "error"

 drivers/gpu/drm/etnaviv/etnaviv_buffer.c | 14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/gpu/drm/etnaviv/etnaviv_buffer.c 
b/drivers/gpu/drm/etnaviv/etnaviv_buffer.c
index 160ce3c060a5..827b5e42dbe3 100644
--- a/drivers/gpu/drm/etnaviv/etnaviv_buffer.c
+++ b/drivers/gpu/drm/etnaviv/etnaviv_buffer.c
@@ -414,18 +414,18 @@ void etnaviv_buffer_queue(struct etnaviv_gpu *gpu, u32 
exec_state,
buffer->user_size - 4);
 
if (drm_debug & DRM_UT_DRIVER)
-   pr_info("stream link to 0x%08x @ 0x%08x %p\n",
-   return_target, etnaviv_cmdbuf_get_va(cmdbuf),
-   cmdbuf->vaddr);
+   dev_info(gpu->dev, "stream link to 0x%08x @ 0x%08x %p\n",
+return_target, etnaviv_cmdbuf_get_va(cmdbuf),
+cmdbuf->vaddr);
 
if (drm_debug & DRM_UT_DRIVER) {
print_hex_dump(KERN_INFO, "cmd ", DUMP_PREFIX_OFFSET, 16, 4,
   cmdbuf->vaddr, cmdbuf->size, 0);
 
-   pr_info("link op: %p\n", buffer->vaddr + waitlink_offset);
-   pr_info("addr: 0x%08x\n", link_target);
-   pr_info("back: 0x%08x\n", return_target);
-   pr_info("event: %d\n", event);
+   dev_info(gpu->dev, "link op: %p\n", buffer->vaddr + 
waitlink_offset);
+   dev_info(gpu->dev, "addr: 0x%08x\n", link_target);
+   dev_info(gpu->dev, "back: 0x%08x\n", return_target);
+   dev_info(gpu->dev, "event: %d\n", event);
}
 
/*
-- 
2.17.1

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Re: [PATCH v4 2/2] drm/panel: Add support for Raydium RM67191 panel driver

2019-06-25 Thread Fabio Estevam
Hi Robert,

On Tue, Jun 25, 2019 at 4:28 AM Robert Chiras  wrote:

> +static int rad_bl_get_brightness(struct backlight_device *bl)
> +{
> +   struct mipi_dsi_device *dsi = bl_get_data(bl);
> +   struct rad_panel *rad = mipi_dsi_get_drvdata(dsi);
> +   struct device *dev = >dev;
> +   u16 brightness;
> +   int ret;
> +
> +   if (!rad->prepared)
> +   return 0;
> +
> +   DRM_DEV_DEBUG_DRIVER(dev, "\n");

Please remove this debug line.

> +   if (!rad->prepared)
> +   return 0;
> +
> +   DRM_DEV_DEBUG_DRIVER(dev, "New brightness: %d\n", 
> bl->props.brightness);

Please remove it.

> +   ret = of_property_read_u32(np, "dsi-lanes", >lanes);
> +   if (ret) {
> +   dev_err(dev, "Failed to get dsi-lanes property (%d)\n", ret);
> +   return ret;
> +   }
> +
> +   panel->reset = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_LOW);

Even it is optional, you still need to check for error and propagate
it in the case of error.

Otherwise defer probe will not work.

> +   ret = drm_panel_add(>panel);
> +   if (ret)
> +   return ret;
> +
> +

One blank line is enough.
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

etnaviv: Possible circular lockingon i.MX6QP

2019-06-12 Thread Fabio Estevam
Hi,

On a imx6qp-wandboard I get the warning below about a possible
circular locking dependency running 5.1.9 built from
imx_v6_v7_defconfig.

Such warning does not happen on the imx6q or imx6solo variants of
wandboard though.

Any ideas?

Thanks,

Fabio Estevam

** (matchbox-panel:708): WARNING **: Failed to load applet "battery"
(/usr/lib/matchbox-panel/libbattery.so: cannot open shared object
file: No such file or directory).
matchbox-wm: X error warning (0xe3): BadWindow (invalid Window
parameter) (opcode: 12)
etnaviv-gpu 134000.gpu: MMU fault status 0x0001
etnaviv-gpu 134000.gpu: MMU 0 fault addr 0x0805ffc0

==
WARNING: possible circular locking dependency detected
5.1.9 #58 Not tainted
--
kworker/0:1/29 is trying to acquire lock:
(ptrval) (&(>fence_spinlock)->rlock){-...}, at:
dma_fence_remove_callback+0x14/0x50

but task is already holding lock:
(ptrval) (&(>job_list_lock)->rlock){-...}, at: drm_sched_stop+0x1c/0x124

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #1 (&(>job_list_lock)->rlock){-...}:
   drm_sched_process_job+0x5c/0x1c8
   dma_fence_signal+0xdc/0x1d4
   irq_handler+0xd0/0x1e0
   __handle_irq_event_percpu+0x48/0x360
   handle_irq_event_percpu+0x28/0x7c
   handle_irq_event+0x38/0x5c
   handle_fasteoi_irq+0xc0/0x17c
   generic_handle_irq+0x20/0x34
   __handle_domain_irq+0x64/0xe0
   gic_handle_irq+0x4c/0xa8
   __irq_svc+0x70/0x98
   cpuidle_enter_state+0x168/0x5a4
   cpuidle_enter_state+0x168/0x5a4
   do_idle+0x220/0x2c0
   cpu_startup_entry+0x18/0x20
   start_kernel+0x3e4/0x498

-> #0 (&(>fence_spinlock)->rlock){-...}:
   _raw_spin_lock_irqsave+0x38/0x4c
   dma_fence_remove_callback+0x14/0x50
   drm_sched_stop+0x98/0x124
   etnaviv_sched_timedout_job+0x7c/0xb4
   drm_sched_job_timedout+0x34/0x5c
   process_one_work+0x2ac/0x704
   worker_thread+0x2c/0x574
   kthread+0x134/0x148
   ret_from_fork+0x14/0x20
 (null)

other info that might help us debug this:

 Possible unsafe locking scenario:

   CPU0CPU1
   
  lock(&(>job_list_lock)->rlock);
   lock(&(>fence_spinlock)->rlock);
   lock(&(>job_list_lock)->rlock);
  lock(&(>fence_spinlock)->rlock);

 *** DEADLOCK ***

3 locks held by kworker/0:1/29:
 #0: (ptrval) ((wq_completion)events){+.+.}, at: process_one_work+0x1f4/0x704
 #1: (ptrval) ((work_completion)(&(>work_tdr)->work)){+.+.},
at: process_one_work+0x1f4/0x704
 #2: (ptrval) (&(>job_list_lock)->rlock){-...}, at:
drm_sched_stop+0x1c/0x124

stack backtrace:
CPU: 0 PID: 29 Comm: kworker/0:1 Not tainted 5.1.9 #58
Hardware name: Freescale i.MX6 Quad/DualLite (Device Tree)
Workqueue: events drm_sched_job_timedout
[] (unwind_backtrace) from [] (show_stack+0x10/0x14)
[] (show_stack) from [] (dump_stack+0xd8/0x110)
[] (dump_stack) from []
(print_circular_bug.constprop.19+0x1bc/0x2f0)
[] (print_circular_bug.constprop.19) from []
(__lock_acquire+0x1778/0x1f38)
[] (__lock_acquire) from [] (lock_acquire+0xcc/0x1e8)
[] (lock_acquire) from [] (_raw_spin_lock_irqsave+0x38/0x4c)
[] (_raw_spin_lock_irqsave) from []
(dma_fence_remove_callback+0x14/0x50)
[] (dma_fence_remove_callback) from []
(drm_sched_stop+0x98/0x124)
[] (drm_sched_stop) from []
(etnaviv_sched_timedout_job+0x7c/0xb4)
[] (etnaviv_sched_timedout_job) from []
(drm_sched_job_timedout+0x34/0x5c)
[] (drm_sched_job_timedout) from []
(process_one_work+0x2ac/0x704)
[] (process_one_work) from [] (worker_thread+0x2c/0x574)
[] (worker_thread) from [] (kthread+0x134/0x148)
[] (kthread) from [] (ret_from_fork+0x14/0x20)
Exception stack(0xe81f7fb0 to 0xe81f7ff8)
7fa0:    
7fc0:        
7fe0:     0013 
etnaviv-gpu 134000.gpu: recover hung GPU!
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Re: [PATCH v2 1/2] dt-bindings: display: panel: Add support for Raydium RM67191 panel

2019-06-19 Thread Fabio Estevam
Hi Robert,

On Tue, Jun 18, 2019 at 10:33 AM Robert Chiras  wrote:

> +Optional properties:
> +- reset-gpios: a GPIO spec for the RST_B GPIO pin
> +- pinctrl-0phandle to the pin settings for the reset pin
> +- width-mm:physical panel width [mm]
> +- height-mm:   physical panel height [mm]
> +- display-timings: timings for the connected panel according to [1]

Still not convinced we need the 'display-timings' property, even as an
optional property. My understanding is that passing display timings in
the devicetree is not encouraged.

Last time you said you need to pass ''display-timings' to workaround
the problem of connecting this panel to mx8m DCSS or eLCDIF.

The panel timings come from the LCD manufacturer and it is agnostic to
what display controller interface it is connected to.

So I suggest making sure the timings passed in the driver are correct
as per the vendor datasheet. If they are correct and one specific
interface is not able to drive it, then probably it is a bug in this
specific display controller interface or in the SoC clock driver.


Re: [PATCH v2 2/2] drm/panel: Add support for Raydium RM67191 panel driver

2019-06-19 Thread Fabio Estevam
On Tue, Jun 18, 2019 at 10:31 AM Robert Chiras  wrote:

> --- /dev/null
> +++ b/drivers/gpu/drm/panel/panel-raydium-rm67191.c
> @@ -0,0 +1,709 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/*
> + * i.MX drm driver - Raydium MIPI-DSI panel driver

Please remove the "i.MX drm driver" as there is nothing i.MX specific
in this driver.


> + *
> + * Copyright 2019 NXP
> + */
> +
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +
> +#include 
> +#include 
> +#include 
> +
> +#include 
> +#include 
> +#include 
> +#include 
> +
> +/* Write Manufacture Command Set Control */
> +#define WRMAUCCTR 0xFE
> +
> +#define COL_FMT_16BPP 0x55
> +#define COL_FMT_18BPP 0x66
> +#define COL_FMT_24BPP 0x77
> +
> +/* Manufacturer Command Set pages (CMD2) */
> +struct cmd_set_entry {
> +   u8 cmd;
> +   u8 param;
> +};
> +
> +/*
> + * There is no description in the Reference Manual about these commands.
> + * We received them from vendor, so just use them as is.
> + */
> +static const struct cmd_set_entry manufacturer_cmd_set[] = {
> +   {0xFE, 0x0B},
> +   {0x28, 0x40},
> +   {0x29, 0x4F},
> +   {0xFE, 0x0E},
> +   {0x4B, 0x00},
> +   {0x4C, 0x0F},
> +   {0x4D, 0x20},
> +   {0x4E, 0x40},
> +   {0x4F, 0x60},
> +   {0x50, 0xA0},
> +   {0x51, 0xC0},
> +   {0x52, 0xE0},
> +   {0x53, 0xFF},
> +   {0xFE, 0x0D},
> +   {0x18, 0x08},
> +   {0x42, 0x00},
> +   {0x08, 0x41},
> +   {0x46, 0x02},
> +   {0x72, 0x09},
> +   {0xFE, 0x0A},
> +   {0x24, 0x17},
> +   {0x04, 0x07},
> +   {0x1A, 0x0C},
> +   {0x0F, 0x44},
> +   {0xFE, 0x04},
> +   {0x00, 0x0C},
> +   {0x05, 0x08},
> +   {0x06, 0x08},
> +   {0x08, 0x08},
> +   {0x09, 0x08},
> +   {0x0A, 0xE6},
> +   {0x0B, 0x8C},
> +   {0x1A, 0x12},
> +   {0x1E, 0xE0},
> +   {0x29, 0x93},
> +   {0x2A, 0x93},
> +   {0x2F, 0x02},
> +   {0x31, 0x02},
> +   {0x33, 0x05},
> +   {0x37, 0x2D},
> +   {0x38, 0x2D},
> +   {0x3A, 0x1E},
> +   {0x3B, 0x1E},
> +   {0x3D, 0x27},
> +   {0x3F, 0x80},
> +   {0x40, 0x40},
> +   {0x41, 0xE0},
> +   {0x4F, 0x2F},
> +   {0x50, 0x1E},
> +   {0xFE, 0x06},
> +   {0x00, 0xCC},
> +   {0x05, 0x05},
> +   {0x07, 0xA2},
> +   {0x08, 0xCC},
> +   {0x0D, 0x03},
> +   {0x0F, 0xA2},
> +   {0x32, 0xCC},
> +   {0x37, 0x05},
> +   {0x39, 0x83},
> +   {0x3A, 0xCC},
> +   {0x41, 0x04},
> +   {0x43, 0x83},
> +   {0x44, 0xCC},
> +   {0x49, 0x05},
> +   {0x4B, 0xA2},
> +   {0x4C, 0xCC},
> +   {0x51, 0x03},
> +   {0x53, 0xA2},
> +   {0x75, 0xCC},
> +   {0x7A, 0x03},
> +   {0x7C, 0x83},
> +   {0x7D, 0xCC},
> +   {0x82, 0x02},
> +   {0x84, 0x83},
> +   {0x85, 0xEC},
> +   {0x86, 0x0F},
> +   {0x87, 0xFF},
> +   {0x88, 0x00},
> +   {0x8A, 0x02},
> +   {0x8C, 0xA2},
> +   {0x8D, 0xEA},
> +   {0x8E, 0x01},
> +   {0x8F, 0xE8},
> +   {0xFE, 0x06},
> +   {0x90, 0x0A},
> +   {0x92, 0x06},
> +   {0x93, 0xA0},
> +   {0x94, 0xA8},
> +   {0x95, 0xEC},
> +   {0x96, 0x0F},
> +   {0x97, 0xFF},
> +   {0x98, 0x00},
> +   {0x9A, 0x02},
> +   {0x9C, 0xA2},
> +   {0xAC, 0x04},
> +   {0xFE, 0x06},
> +   {0xB1, 0x12},
> +   {0xB2, 0x17},
> +   {0xB3, 0x17},
> +   {0xB4, 0x17},
> +   {0xB5, 0x17},
> +   {0xB6, 0x11},
> +   {0xB7, 0x08},
> +   {0xB8, 0x09},
> +   {0xB9, 0x06},
> +   {0xBA, 0x07},
> +   {0xBB, 0x17},
> +   {0xBC, 0x17},
> +   {0xBD, 0x17},
> +   {0xBE, 0x17},
> +   {0xBF, 0x17},
> +   {0xC0, 0x17},
> +   {0xC1, 0x17},
> +   {0xC2, 0x17},
> +   {0xC3, 0x17},
> +   {0xC4, 0x0F},
> +   {0xC5, 0x0E},
> +   {0xC6, 0x00},
> +   {0xC7, 0x01},
> +   {0xC8, 0x10},
> +   {0xFE, 0x06},
> +   {0x95, 0xEC},
> +   {0x8D, 0xEE},
> +   {0x44, 0xEC},
> +   {0x4C, 0xEC},
> +   {0x32, 0xEC},
> +   {0x3A, 0xEC},
> +   {0x7D, 0xEC},
> +   {0x75, 0xEC},
> +   {0x00, 0xEC},
> +   {0x08, 0xEC},
> +   {0x85, 0xEC},
> +   {0xA6, 0x21},
> +   {0xA7, 0x05},
> +   {0xA9, 0x06},
> +   {0x82, 0x06},
> +   {0x41, 0x06},
> +   {0x7A, 0x07},
> +   {0x37, 0x07},
> +   {0x05, 0x06},
> +   {0x49, 0x06},
> +   {0x0D, 0x04},
> +   {0x51, 0x04},
> +};
> +
> +static const u32 rad_bus_formats[] = {
> +   MEDIA_BUS_FMT_RGB888_1X24,
> +   MEDIA_BUS_FMT_RGB666_1X18,
> +   MEDIA_BUS_FMT_RGB565_1X16,
> +};
> +
> +struct rad_panel {
> +   struct drm_panel panel;
> +   struct mipi_dsi_device *dsi;
> +
> +   struct gpio_desc *reset;
> +   struct backlight_device *backlight;
> +
> +   bool prepared;
> +   bool enabled;
> +
> +   struct videomode vm;
> +   u32 width_mm;
> +   u32 height_mm;
> +};
> +
> 

Re: [PATCH v2 2/2] drm/panel: Add support for Raydium RM67191 panel driver

2019-06-19 Thread Fabio Estevam
Hi Robert,

On Tue, Jun 18, 2019 at 10:31 AM Robert Chiras  wrote:

> +static const struct display_timing rad_default_timing = {
> +   .pixelclock = { 6600, 13200, 13200 },
> +   .hactive = { 1080, 1080, 1080 },
> +   .hfront_porch = { 20, 20, 20 },
> +   .hsync_len = { 2, 2, 2 },
> +   .hback_porch = { 34, 34, 34 },
> +   .vactive = { 1920, 1920, 1920 },
> +   .vfront_porch = { 10, 10, 10 },
> +   .vsync_len = { 2, 2, 2 },
> +   .vback_porch = { 4, 4, 4 },

Are you sure that the sync_len and porch parameters are the same for
both 66MHz and 132MHz?


Re: [PATCH v3 2/2] drm/panel: Add support for Raydium RM67191 panel driver

2019-06-21 Thread Fabio Estevam
Hi Robert,

On Thu, Jun 20, 2019 at 10:31 AM Robert Chiras  wrote:

> +fail:
> +   if (rad->reset)
> +   gpiod_set_value_cansleep(rad->reset, 1);

gpiod_set_value_cansleep() can handle NULL, so no need for the if() check.

> +static const struct display_timing rad_default_timing = {
> +   .pixelclock = { 13200, 13200, 13200 },

Having the same information listed three times does not seem useful.

You could use a drm_display_mode structure with a single entry instead.

> +   videomode_from_timing(_default_timing, >vm);
> +
> +   of_property_read_u32(np, "width-mm", >width_mm);
> +   of_property_read_u32(np, "height-mm", >height_mm);
> +
> +   panel->reset = devm_gpiod_get(dev, "reset", GPIOD_OUT_LOW);

Since this is optional it would be better to use
devm_gpiod_get_optional() instead.


> +
> +   if (IS_ERR(panel->reset))
> +   panel->reset = NULL;
> +   else
> +   gpiod_set_value_cansleep(panel->reset, 1);

This is not handling defer probing, so it would be better to do like this:

panel->reset = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_LOW);
if (IS_ERR(panel->reset))
  return  PTR_ERR(panel->reset);

> +   memset(_props, 0, sizeof(bl_props));
> +   bl_props.type = BACKLIGHT_RAW;
> +   bl_props.brightness = 255;
> +   bl_props.max_brightness = 255;
> +
> +   panel->backlight = devm_backlight_device_register(dev, dev_name(dev),
> + dev, dsi,
> + _bl_ops,
> + _props);

Could you put more parameters into the same line?

Using 4 lines seems excessive.

> +   if (IS_ERR(panel->backlight)) {
> +   ret = PTR_ERR(panel->backlight);
> +   dev_err(dev, "Failed to register backlight (%d)\n", ret);
> +   return ret;
> +   }
> +
> +   drm_panel_init(>panel);
> +   panel->panel.funcs = _panel_funcs;
> +   panel->panel.dev = dev;
> +   dev_set_drvdata(dev, panel);
> +
> +   ret = drm_panel_add(>panel);
> +

Unneeded blank line

> +   if (ret < 0)
> +   return ret;
> +
> +   ret = mipi_dsi_attach(dsi);
> +   if (ret < 0)
> +   drm_panel_remove(>panel);
> +
> +   return ret;

You did not handle the "power" regulator.

> +static int __maybe_unused rad_panel_suspend(struct device *dev)
> +{
> +   struct rad_panel *rad = dev_get_drvdata(dev);
> +
> +   if (!rad->reset)
> +   return 0;
> +
> +   devm_gpiod_put(dev, rad->reset);
> +   rad->reset = NULL;
> +
> +   return 0;
> +}
> +
> +static int __maybe_unused rad_panel_resume(struct device *dev)
> +{
> +   struct rad_panel *rad = dev_get_drvdata(dev);
> +
> +   if (rad->reset)
> +   return 0;
> +
> +   rad->reset = devm_gpiod_get(dev, "reset", GPIOD_OUT_LOW);

Why do you call devm_gpiod_get() once again?

I am having a hard time to understand the need for this suspend/resume hooks.

Can't you simply remove them?
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Re: [PATCH v3 1/2] dt-bindings: display: panel: Add support for Raydium RM67191 panel

2019-06-21 Thread Fabio Estevam
Hi Robert,

On Thu, Jun 20, 2019 at 10:32 AM Robert Chiras  wrote:
>
> Add dt-bindings documentation for Raydium RM67191 DSI panel.
>
> Signed-off-by: Robert Chiras 
> Reviewed-by: Sam Ravnborg 
> ---
>  .../bindings/display/panel/raydium,rm67191.txt | 39 
> ++
>  1 file changed, 39 insertions(+)
>  create mode 100644 
> Documentation/devicetree/bindings/display/panel/raydium,rm67191.txt
>
> diff --git 
> a/Documentation/devicetree/bindings/display/panel/raydium,rm67191.txt 
> b/Documentation/devicetree/bindings/display/panel/raydium,rm67191.txt
> new file mode 100644
> index 000..52af272
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/display/panel/raydium,rm67191.txt
> @@ -0,0 +1,39 @@
> +Raydium RM67171 OLED LCD panel with MIPI-DSI protocol
> +
> +Required properties:
> +- compatible:  "raydium,rm67191"
> +- reg: virtual channel for MIPI-DSI protocol
> +   must be <0>
> +- dsi-lanes:   number of DSI lanes to be used
> +   must be <3> or <4>
> +- port:input port node with endpoint definition as
> +   defined in 
> Documentation/devicetree/bindings/graph.txt;
> +   the input port should be connected to a MIPI-DSI 
> device
> +   driver
> +
> +Optional properties:
> +- reset-gpios: a GPIO spec for the RST_B GPIO pin
> +- width-mm:see panel-common.txt
> +- height-mm:   see panel-common.txt
> +- video-mode:  0 - burst-mode
> +   1 - non-burst with sync event
> +   2 - non-burst with sync po ulse

No power-supply property?


Re: [EXT] Re: [PATCH v3 1/2] dt-bindings: display: panel: Add support for Raydium RM67191 panel

2019-06-21 Thread Fabio Estevam
Hi Robert,

On Fri, Jun 21, 2019 at 11:16 AM Robert Chiras  wrote:

> From what I've seen in the schematics, the power lines on the DSI port
> on all the i.MX8 cores are coming from a PMIC providing power for all
> the peripherals. Since I didn't find a way to cut the power on a single
> peripheral (like DSI, for example) it doesn't make sense for power-
> supply property. For now, at least.

This panel driver is not supposed to only work with i.MX8 NXP reference boards.

The dt-bindings should be as accurate as possible from day one, so
describing the power-supply is important.

Please look at the panel datasheet and describe the required power
supplies accordingly.

Thanks


Re: [EXT] Re: [PATCH v3 2/2] drm/panel: Add support for Raydium RM67191 panel driver

2019-06-24 Thread Fabio Estevam
Hi Robert,

On Mon, Jun 24, 2019 at 4:44 AM Robert Chiras  wrote:

> > You did not handle the "power" regulator.
> There is no need for a power regulator.

I am sure the panel requires power to be applied so that it can work :-)

> > Can't you simply remove them?
> The reset gpio pin is shared between the DSI display controller and

Looking at the imx8mq-evk schematics it is not clear for me what pin
in shared between the OLED display and touch screen.

Could you please clarify which pin you are referring to?

> touch controller, both found on the same panel. Since, the touch driver
> also acceses this gpio pin, in some cases the display can be put to
> sleep, but the touch is still active. This is why, during suspend I
> release the gpio resource, and I have to take it back in resume.
> Without this release/acquire mechanism during suspend/resume, stress-
> tests showed some failures: the resume freezes completly.

Looking at the imx8mq-evk dts from the vendor tree I see that the
touchscreen is not supported in mainline yet.

Maybe there is a better way to solve this, so what if you don't
introduce the suspend/resume hooks for now and then we revisit this
after the touchscreen driver is added?


Re: [PATCH] drm: etnaviv: avoid DMA API warning when importing buffers

2019-05-18 Thread Fabio Estevam
Hi Russell,

On Sat, May 18, 2019 at 2:51 PM Russell King - ARM Linux admin
 wrote:
>
> Ping.

This patch is present in Lucas' pull request:
https://lists.freedesktop.org/archives/etnaviv/2019-May/002490.html
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Re: [PATCH v11 2/2] phy: Add driver for mixel mipi dphy found on NXP's i.MX8 SoCs

2019-05-24 Thread Fabio Estevam
Hi Kishon,

On Sun, May 12, 2019 at 7:49 AM Guido Günther  wrote:
>
> This adds support for the Mixel DPHY as found on i.MX8 CPUs but since
> this is an IP core it will likely be found on others in the future. So
> instead of adding this to the nwl host driver make it a generic PHY
> driver.
>
> The driver supports the i.MX8MQ. Support for i.MX8QM and i.MX8QXP can be
> added once the necessary system controller bits are in via
> mixel_dphy_devdata.
>
> Signed-off-by: Guido Günther 
> Co-developed-by: Robert Chiras 
> Signed-off-by: Robert Chiras 
> Reviewed-by: Fabio Estevam 
> Reviewed-by: Sam Ravnborg 

Would you have any comments on this series, please?

Thanks
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

[PATCH] video: fbdev: mxsfb: Remove driver

2019-05-20 Thread Fabio Estevam
There is a DRM version of the mxsfb driver for quite some time
at drivers/gpu/drm/mxsfb/, so there is no need to keep maintaining
the fbdev version any longer.

Remove the fbdev mxsfb driver in favour of the DRM version.

Signed-off-by: Fabio Estevam 
---
 drivers/video/fbdev/Kconfig  |   13 +-
 drivers/video/fbdev/Makefile |1 -
 drivers/video/fbdev/mxsfb.c  | 1036 --
 3 files changed, 1 insertion(+), 1049 deletions(-)
 delete mode 100644 drivers/video/fbdev/mxsfb.c

diff --git a/drivers/video/fbdev/Kconfig b/drivers/video/fbdev/Kconfig
index bf6b77b964f1..61c173b0c906 100644
--- a/drivers/video/fbdev/Kconfig
+++ b/drivers/video/fbdev/Kconfig
@@ -2171,7 +2171,7 @@ config FB_EP93XX
 
 config FB_PRE_INIT_FB
bool "Don't reinitialize, use bootloader's GDC/Display configuration"
-   depends on FB && (FB_MB862XX_LIME || FB_MXS)
+   depends on FB && FB_MB862XX_LIME
---help---
  Select this option if display contents should be inherited as set by
  the bootloader.
@@ -2212,17 +2212,6 @@ config FB_JZ4740
help
  Framebuffer support for the JZ4740 SoC.
 
-config FB_MXS
-   tristate "MXS LCD framebuffer support"
-   depends on FB && (ARCH_MXS || ARCH_MXC)
-   select FB_CFB_FILLRECT
-   select FB_CFB_COPYAREA
-   select FB_CFB_IMAGEBLIT
-   select FB_MODE_HELPERS
-   select VIDEOMODE_HELPERS
-   help
- Framebuffer support for the MXS SoC.
-
 config FB_PUV3_UNIGFX
tristate "PKUnity v3 Unigfx framebuffer support"
depends on FB && UNICORE32 && ARCH_PUV3
diff --git a/drivers/video/fbdev/Makefile b/drivers/video/fbdev/Makefile
index 655f2537cac1..7dc4861a93e6 100644
--- a/drivers/video/fbdev/Makefile
+++ b/drivers/video/fbdev/Makefile
@@ -131,7 +131,6 @@ obj-$(CONFIG_FB_VGA16)+= vga16fb.o
 obj-$(CONFIG_FB_OF)   += offb.o
 obj-$(CONFIG_FB_MX3) += mx3fb.o
 obj-$(CONFIG_FB_DA8XX)   += da8xx-fb.o
-obj-$(CONFIG_FB_MXS) += mxsfb.o
 obj-$(CONFIG_FB_SSD1307) += ssd1307fb.o
 obj-$(CONFIG_FB_SIMPLE)   += simplefb.o
 
diff --git a/drivers/video/fbdev/mxsfb.c b/drivers/video/fbdev/mxsfb.c
deleted file mode 100644
index 1fdd1eb38fe0..
--- a/drivers/video/fbdev/mxsfb.c
+++ /dev/null
@@ -1,1036 +0,0 @@
-/*
- * Copyright (C) 2010 Juergen Beisert, Pengutronix
- *
- * This code is based on:
- * Author: Vitaly Wool 
- *
- * Copyright 2008-2009 Freescale Semiconductor, Inc. All Rights Reserved.
- * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- */
-
-#define DRIVER_NAME "mxsfb"
-
-/**
- * @file
- * @brief LCDIF driver for i.MX23 and i.MX28
- *
- * The LCDIF support four modes of operation
- * - MPU interface (to drive smart displays) -> not supported yet
- * - VSYNC interface (like MPU interface plus Vsync) -> not supported yet
- * - Dotclock interface (to drive LC displays with RGB data and sync signals)
- * - DVI (to drive ITU-R BT656)  -> not supported yet
- *
- * This driver depends on a correct setup of the pins used for this purpose
- * (platform specific).
- *
- * For the developer: Don't forget to set the data bus width to the display
- * in the imx_fb_videomode structure. You will else end up with ugly colours.
- * If you fight against jitter you can vary the clock delay. This is a feature
- * of the i.MX28 and you can vary it between 2 ns ... 8 ns in 2 ns steps. Give
- * the required value in the imx_fb_videomode structure.
- */
-
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-
-#define REG_SET4
-#define REG_CLR8
-
-#define LCDC_CTRL  0x00
-#define LCDC_CTRL1 0x10
-#define LCDC_V4_CTRL2  0x20
-#define LCDC_V3_TRANSFER_COUNT 0x20
-#define LCDC_V4_TRANSFER_COUNT 0x30
-#define LCDC_V4_CUR_BUF0x40
-#define LCDC_V4_NEXT_BUF   0x50
-#define LCDC_V3_CUR_BUF0x30
-#define LCDC_V3_NEXT_BUF   0x40
-#define LCDC_TIMING0x60
-#define LCDC_VDCTRL0   0x70
-#define LCDC_VDCTRL1   0x80
-#define LCDC_VDCTRL2   0x90
-#define LCDC_VDCTRL3   0xa0
-#define LCDC_VDCTRL4   0xb0

Re: [PATCH v2 1/3] dt-bindings: Add vendor prefix for VXT Ltd

2019-05-20 Thread Fabio Estevam
On Tue, Apr 23, 2019 at 8:03 AM Thierry Reding  wrote:
>
> On Mon, Feb 18, 2019 at 09:27:04PM -0300, Fabio Estevam wrote:
> > VXT Ltd is a manufacturer of projected capacitive touch panel
> > and display solutions: http://www.vxt.com.tw/
> >
> > Reviewed-by: Otavio Salvador 
> > Reviewed-by: Rob Herring 
> > Signed-off-by: Fabio Estevam 
> > ---
> > Changes since v1:
> > - None
> >
> >  Documentation/devicetree/bindings/vendor-prefixes.txt | 1 +
> >  1 file changed, 1 insertion(+)
>
> Applied all three patches, thanks.

I don't see any of these patches applied in linux-next nor 5.2-rc1.

What is the issue here?
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Re: [PATCH v9 2/2] phy: Add driver for mixel mipi dphy found on NXP's i.MX8 SoCs

2019-04-30 Thread Fabio Estevam
Hi Guido,

On Tue, Apr 30, 2019 at 11:40 AM Guido Günther  wrote:
>
> This adds support for the Mixel DPHY as found on i.MX8 CPUs but since
> this is an IP core it will likely be found on others in the future. So
> instead of adding this to the nwl host driver make it a generic PHY
> driver.
>
> The driver supports the i.MX8MQ. Support for i.MX8QM and i.MX8QXP can be
> added once the necessary system controller bits are in via
> mixel_dphy_devdata.
>
> Co-authored-by: Robert Chiras 
> Signed-off-by: Guido Günther 

I wish I could test it on a imx8m-evk , but there are some other
pieces needed such as Northwest Logic driver, mxsfb changes for
supporting mx8m, OLED panel driver, etc

Anyway, it looks good to me and I have only a few minor comments:

> ---
>  drivers/phy/freescale/Kconfig |  11 +
>  drivers/phy/freescale/Makefile|   1 +
>  .../phy/freescale/phy-fsl-imx8-mipi-dphy.c| 506 ++
>  3 files changed, 518 insertions(+)
>  create mode 100644 drivers/phy/freescale/phy-fsl-imx8-mipi-dphy.c
>
> diff --git a/drivers/phy/freescale/Kconfig b/drivers/phy/freescale/Kconfig
> index 832670b4952b..a111b130f9d2 100644
> --- a/drivers/phy/freescale/Kconfig
> +++ b/drivers/phy/freescale/Kconfig
> @@ -3,3 +3,14 @@ config PHY_FSL_IMX8MQ_USB
> depends on OF && HAS_IOMEM
> select GENERIC_PHY
> default ARCH_MXC && ARM64
> +
> +config PHY_MIXEL_MIPI_DPHY
> +   tristate "Mixel MIPI DSI PHY support"
> +   depends on OF && HAS_IOMEM
> +   select GENERIC_PHY
> +   select GENERIC_PHY_MIPI_DPHY
> +   select REGMAP_MMIO
> +   default ARCH_MXC && ARM64

I don't think that this default is a good idea.

There are imx8m systems that do not have display, so in this case it
does not make sense to always force the build of this driver.

> +   help
> + Enable this to add support for the Mixel DSI PHY as found
> + on NXP's i.MX8 family of SOCs.
> diff --git a/drivers/phy/freescale/Makefile b/drivers/phy/freescale/Makefile
> index dc2b3f1f2f80..07491c926a2c 100644
> --- a/drivers/phy/freescale/Makefile
> +++ b/drivers/phy/freescale/Makefile
> @@ -1 +1,2 @@
>  obj-$(CONFIG_PHY_FSL_IMX8MQ_USB)   += phy-fsl-imx8mq-usb.o
> +obj-$(CONFIG_PHY_MIXEL_MIPI_DPHY)  += phy-fsl-imx8-mipi-dphy.o
> diff --git a/drivers/phy/freescale/phy-fsl-imx8-mipi-dphy.c 
> b/drivers/phy/freescale/phy-fsl-imx8-mipi-dphy.c
> new file mode 100644
> index ..d6b5af0b3380
> --- /dev/null
> +++ b/drivers/phy/freescale/phy-fsl-imx8-mipi-dphy.c
> @@ -0,0 +1,506 @@
> +// SPDX-License-Identifier: GPL-2.0+
> +/*
> + * Copyright 2017,2018 NXP
> + * Copyright 2019 Purism SPC
> + */
> +
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 

Please keep the headers sorted.

> +#include 


> +static int mixel_dphy_validate(struct phy *phy, enum phy_mode mode, int 
> submode,
> +  union phy_configure_opts *opts)
> +{
> +   struct mixel_dphy_cfg cfg = { 0 };
> +
> +   if (mode != PHY_MODE_MIPI_DPHY)
> +   return -EINVAL;
> +
> +   return mixel_dphy_config_from_opts(phy, >mipi_dphy, );
> +}
> +
> +

A single blank line is enough.

> +static int mixel_dphy_init(struct phy *phy)
> +{
> +   phy_write(phy, PWR_OFF, DPHY_PD_PLL);
> +   phy_write(phy, PWR_OFF, DPHY_PD_DPHY);
> +
> +   return 0;
> +}
> +
> +

Ditto.

> +static int mixel_dphy_exit(struct phy *phy)
> +{
> +   phy_write(phy, 0, DPHY_CM);
> +   phy_write(phy, 0, DPHY_CN);
> +   phy_write(phy, 0, DPHY_CO);
> +
> +   return 0;
> +}
> +
> +

Ditto.

> +static int mixel_dphy_power_off(struct phy *phy)
> +{
> +   struct mixel_dphy_priv *priv = phy_get_drvdata(phy);
> +
> +   phy_write(phy, PWR_OFF, DPHY_PD_PLL);
> +   phy_write(phy, PWR_OFF, DPHY_PD_DPHY);
> +
> +   clk_disable_unprepare(priv->phy_ref_clk);
> +
> +   return 0;
> +}
> +
> +

Ditto.

> +   res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> +   regs = devm_ioremap_resource(dev, res);
> +   if (IS_ERR(regs)) {
> +   dev_err(dev, "Couldn't map the DPHY registers\n");

You can skip this error message, because the core already complains on
ioremap failures.
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Re: [PATCH v10 2/2] phy: Add driver for mixel mipi dphy found on NXP's i.MX8 SoCs

2019-05-07 Thread Fabio Estevam
On Tue, May 7, 2019 at 4:47 AM Guido Günther  wrote:
>
> This adds support for the Mixel DPHY as found on i.MX8 CPUs but since
> this is an IP core it will likely be found on others in the future. So
> instead of adding this to the nwl host driver make it a generic PHY
> driver.
>
> The driver supports the i.MX8MQ. Support for i.MX8QM and i.MX8QXP can be
> added once the necessary system controller bits are in via
> mixel_dphy_devdata.
>
> Signed-off-by: Guido Günther 
> Co-developed-by: Robert Chiras 
> Signed-off-by: Robert Chiras 

Reviewed-by: Fabio Estevam 
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Re: [PATCH v10 1/2] dt-bindings: phy: Add documentation for mixel dphy

2019-05-07 Thread Fabio Estevam
On Tue, May 7, 2019 at 4:47 AM Guido Günther  wrote:
>
> Add support for the MIXEL DPHY IP as found on NXP's i.MX8MQ SoCs.
>
> Signed-off-by: Guido Günther 
> Reviewed-by: Sam Ravnborg 
> Reviewed-by: Rob Herring 

Reviewed-by: Fabio Estevam 
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Re: [PATCH RE-RESEND 2/2] ARM: dts: opos6uldev: use OF graph to describe the display

2019-05-07 Thread Fabio Estevam
Hi Sébastien,

On Tue, May 7, 2019 at 12:27 PM Sébastien Szymanski
 wrote:
>
> To make use of the new eLCDIF DRM driver OF graph description is
> required. Describe the display using OF graph nodes.
>
> Cc: sta...@vger.kernel.org # v4.19

The Cc to stable applies to bugfixes, which is not the case here.

With such tag removed:

Reviewed-by: Fabio Estevam 
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

<    1   2   3   4   5   6   >