* [PATCH] drm/sun4i: rgb: add missing calls to drm_panel_{prepare,unprepare}
@ 2016-08-30 6:55 ` Jonathan Liu
0 siblings, 0 replies; 9+ messages in thread
From: Jonathan Liu @ 2016-08-30 6:55 UTC (permalink / raw)
To: Maxime Ripard
Cc: David Airlie, Chen-Yu Tsai, dri-devel, linux-arm-kernel,
linux-kernel, linux-sunxi, Jonathan Liu
If the enable-gpios property of a simple panel in device tree is set,
the GPIO is not toggled on/off because of missing calls to
drm_panel_prepare and drm_panel_unprepare.
Signed-off-by: Jonathan Liu <net147@gmail.com>
---
drivers/gpu/drm/sun4i/sun4i_rgb.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/gpu/drm/sun4i/sun4i_rgb.c b/drivers/gpu/drm/sun4i/sun4i_rgb.c
index f5bbac6..d6943e9 100644
--- a/drivers/gpu/drm/sun4i/sun4i_rgb.c
+++ b/drivers/gpu/drm/sun4i/sun4i_rgb.c
@@ -151,6 +151,7 @@ static void sun4i_rgb_encoder_enable(struct drm_encoder *encoder)
DRM_DEBUG_DRIVER("Enabling RGB output\n");
+ drm_panel_prepare(tcon->panel);
drm_panel_enable(tcon->panel);
sun4i_tcon_channel_enable(tcon, 0);
}
@@ -165,6 +166,7 @@ static void sun4i_rgb_encoder_disable(struct drm_encoder *encoder)
sun4i_tcon_channel_disable(tcon, 0);
drm_panel_disable(tcon->panel);
+ drm_panel_unprepare(tcon->panel);
}
static void sun4i_rgb_encoder_mode_set(struct drm_encoder *encoder,
--
2.9.3
^ permalink raw reply related [flat|nested] 9+ messages in thread* [PATCH] drm/sun4i: rgb: add missing calls to drm_panel_{prepare,unprepare}
@ 2016-08-30 6:55 ` Jonathan Liu
0 siblings, 0 replies; 9+ messages in thread
From: Jonathan Liu @ 2016-08-30 6:55 UTC (permalink / raw)
To: Maxime Ripard
Cc: David Airlie, Chen-Yu Tsai,
dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
linux-sunxi-/JYPxA39Uh5TLH3MbocFFw, Jonathan Liu
If the enable-gpios property of a simple panel in device tree is set,
the GPIO is not toggled on/off because of missing calls to
drm_panel_prepare and drm_panel_unprepare.
Signed-off-by: Jonathan Liu <net147-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
---
drivers/gpu/drm/sun4i/sun4i_rgb.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/gpu/drm/sun4i/sun4i_rgb.c b/drivers/gpu/drm/sun4i/sun4i_rgb.c
index f5bbac6..d6943e9 100644
--- a/drivers/gpu/drm/sun4i/sun4i_rgb.c
+++ b/drivers/gpu/drm/sun4i/sun4i_rgb.c
@@ -151,6 +151,7 @@ static void sun4i_rgb_encoder_enable(struct drm_encoder *encoder)
DRM_DEBUG_DRIVER("Enabling RGB output\n");
+ drm_panel_prepare(tcon->panel);
drm_panel_enable(tcon->panel);
sun4i_tcon_channel_enable(tcon, 0);
}
@@ -165,6 +166,7 @@ static void sun4i_rgb_encoder_disable(struct drm_encoder *encoder)
sun4i_tcon_channel_disable(tcon, 0);
drm_panel_disable(tcon->panel);
+ drm_panel_unprepare(tcon->panel);
}
static void sun4i_rgb_encoder_mode_set(struct drm_encoder *encoder,
--
2.9.3
^ permalink raw reply related [flat|nested] 9+ messages in thread* [PATCH] drm/sun4i: rgb: add missing calls to drm_panel_{prepare,unprepare}
@ 2016-08-30 12:53 ` Maxime Ripard
0 siblings, 0 replies; 9+ messages in thread
From: Maxime Ripard @ 2016-08-30 12:53 UTC (permalink / raw)
To: linux-arm-kernel
Hi,
On Tue, Aug 30, 2016 at 04:55:00PM +1000, Jonathan Liu wrote:
> If the enable-gpios property of a simple panel in device tree is set,
> the GPIO is not toggled on/off because of missing calls to
> drm_panel_prepare and drm_panel_unprepare.
>
> Signed-off-by: Jonathan Liu <net147@gmail.com>
This was not applying properly, but I merged it.
Please make sure that it applies on top of the current next branch.
Good catch, thanks!
Maxime
--
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20160830/f006f93f/attachment.sig>
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: [PATCH] drm/sun4i: rgb: add missing calls to drm_panel_{prepare,unprepare}
@ 2016-08-30 12:53 ` Maxime Ripard
0 siblings, 0 replies; 9+ messages in thread
From: Maxime Ripard @ 2016-08-30 12:53 UTC (permalink / raw)
To: Jonathan Liu
Cc: David Airlie, Chen-Yu Tsai, dri-devel, linux-arm-kernel,
linux-kernel, linux-sunxi
[-- Attachment #1: Type: text/plain, Size: 563 bytes --]
Hi,
On Tue, Aug 30, 2016 at 04:55:00PM +1000, Jonathan Liu wrote:
> If the enable-gpios property of a simple panel in device tree is set,
> the GPIO is not toggled on/off because of missing calls to
> drm_panel_prepare and drm_panel_unprepare.
>
> Signed-off-by: Jonathan Liu <net147@gmail.com>
This was not applying properly, but I merged it.
Please make sure that it applies on top of the current next branch.
Good catch, thanks!
Maxime
--
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: [PATCH] drm/sun4i: rgb: add missing calls to drm_panel_{prepare,unprepare}
@ 2016-08-30 12:53 ` Maxime Ripard
0 siblings, 0 replies; 9+ messages in thread
From: Maxime Ripard @ 2016-08-30 12:53 UTC (permalink / raw)
To: Jonathan Liu
Cc: David Airlie, Chen-Yu Tsai,
dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
linux-sunxi-/JYPxA39Uh5TLH3MbocFFw
[-- Attachment #1: Type: text/plain, Size: 572 bytes --]
Hi,
On Tue, Aug 30, 2016 at 04:55:00PM +1000, Jonathan Liu wrote:
> If the enable-gpios property of a simple panel in device tree is set,
> the GPIO is not toggled on/off because of missing calls to
> drm_panel_prepare and drm_panel_unprepare.
>
> Signed-off-by: Jonathan Liu <net147-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
This was not applying properly, but I merged it.
Please make sure that it applies on top of the current next branch.
Good catch, thanks!
Maxime
--
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH] drm/sun4i: rgb: add missing calls to drm_panel_{prepare, unprepare}
@ 2016-08-30 15:21 ` Emil Velikov
0 siblings, 0 replies; 9+ messages in thread
From: Emil Velikov @ 2016-08-30 15:21 UTC (permalink / raw)
To: linux-arm-kernel
On 30 August 2016 at 07:55, Jonathan Liu <net147@gmail.com> wrote:
> If the enable-gpios property of a simple panel in device tree is set,
> the GPIO is not toggled on/off because of missing calls to
> drm_panel_prepare and drm_panel_unprepare.
>
> Signed-off-by: Jonathan Liu <net147@gmail.com>
> ---
> drivers/gpu/drm/sun4i/sun4i_rgb.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/gpu/drm/sun4i/sun4i_rgb.c b/drivers/gpu/drm/sun4i/sun4i_rgb.c
> index f5bbac6..d6943e9 100644
> --- a/drivers/gpu/drm/sun4i/sun4i_rgb.c
> +++ b/drivers/gpu/drm/sun4i/sun4i_rgb.c
> @@ -151,6 +151,7 @@ static void sun4i_rgb_encoder_enable(struct drm_encoder *encoder)
>
> DRM_DEBUG_DRIVER("Enabling RGB output\n");
>
> + drm_panel_prepare(tcon->panel);
> drm_panel_enable(tcon->panel);
IMHO it's worth having a _prepare_enable, and alike on the dtor side,
similar to clk. The clk helper attributes when .enable() fails, which
is a good idea. Looking on the drm side - all the users of such
helper(s) don't bother checking neither .prepare or .enable. So
updating that alongside the introduction would be a great move ;-)
Just an idea about another small task.
Emil
P.S. Skimming through v4.7 mediatek (mtk) driver looks a bit
assymetrical wrt using the drm_panel API. Worth checking if things
have improved with later versions ?
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: [PATCH] drm/sun4i: rgb: add missing calls to drm_panel_{prepare, unprepare}
@ 2016-08-30 15:21 ` Emil Velikov
0 siblings, 0 replies; 9+ messages in thread
From: Emil Velikov @ 2016-08-30 15:21 UTC (permalink / raw)
To: Jonathan Liu
Cc: Maxime Ripard, linux-sunxi, ML dri-devel,
Linux-Kernel@Vger. Kernel. Org, Chen-Yu Tsai, LAKML
On 30 August 2016 at 07:55, Jonathan Liu <net147@gmail.com> wrote:
> If the enable-gpios property of a simple panel in device tree is set,
> the GPIO is not toggled on/off because of missing calls to
> drm_panel_prepare and drm_panel_unprepare.
>
> Signed-off-by: Jonathan Liu <net147@gmail.com>
> ---
> drivers/gpu/drm/sun4i/sun4i_rgb.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/gpu/drm/sun4i/sun4i_rgb.c b/drivers/gpu/drm/sun4i/sun4i_rgb.c
> index f5bbac6..d6943e9 100644
> --- a/drivers/gpu/drm/sun4i/sun4i_rgb.c
> +++ b/drivers/gpu/drm/sun4i/sun4i_rgb.c
> @@ -151,6 +151,7 @@ static void sun4i_rgb_encoder_enable(struct drm_encoder *encoder)
>
> DRM_DEBUG_DRIVER("Enabling RGB output\n");
>
> + drm_panel_prepare(tcon->panel);
> drm_panel_enable(tcon->panel);
IMHO it's worth having a _prepare_enable, and alike on the dtor side,
similar to clk. The clk helper attributes when .enable() fails, which
is a good idea. Looking on the drm side - all the users of such
helper(s) don't bother checking neither .prepare or .enable. So
updating that alongside the introduction would be a great move ;-)
Just an idea about another small task.
Emil
P.S. Skimming through v4.7 mediatek (mtk) driver looks a bit
assymetrical wrt using the drm_panel API. Worth checking if things
have improved with later versions ?
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: [PATCH] drm/sun4i: rgb: add missing calls to drm_panel_{prepare, unprepare}
@ 2016-08-30 15:21 ` Emil Velikov
0 siblings, 0 replies; 9+ messages in thread
From: Emil Velikov @ 2016-08-30 15:21 UTC (permalink / raw)
To: Jonathan Liu
Cc: Maxime Ripard, linux-sunxi-/JYPxA39Uh5TLH3MbocFFw, ML dri-devel,
Linux-Kernel@Vger. Kernel. Org, Chen-Yu Tsai, LAKML
On 30 August 2016 at 07:55, Jonathan Liu <net147-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> If the enable-gpios property of a simple panel in device tree is set,
> the GPIO is not toggled on/off because of missing calls to
> drm_panel_prepare and drm_panel_unprepare.
>
> Signed-off-by: Jonathan Liu <net147-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> ---
> drivers/gpu/drm/sun4i/sun4i_rgb.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/gpu/drm/sun4i/sun4i_rgb.c b/drivers/gpu/drm/sun4i/sun4i_rgb.c
> index f5bbac6..d6943e9 100644
> --- a/drivers/gpu/drm/sun4i/sun4i_rgb.c
> +++ b/drivers/gpu/drm/sun4i/sun4i_rgb.c
> @@ -151,6 +151,7 @@ static void sun4i_rgb_encoder_enable(struct drm_encoder *encoder)
>
> DRM_DEBUG_DRIVER("Enabling RGB output\n");
>
> + drm_panel_prepare(tcon->panel);
> drm_panel_enable(tcon->panel);
IMHO it's worth having a _prepare_enable, and alike on the dtor side,
similar to clk. The clk helper attributes when .enable() fails, which
is a good idea. Looking on the drm side - all the users of such
helper(s) don't bother checking neither .prepare or .enable. So
updating that alongside the introduction would be a great move ;-)
Just an idea about another small task.
Emil
P.S. Skimming through v4.7 mediatek (mtk) driver looks a bit
assymetrical wrt using the drm_panel API. Worth checking if things
have improved with later versions ?
^ permalink raw reply [flat|nested] 9+ messages in thread