All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/panel: simple: ensure Sharp lq123p1jx31 isn't turned off too soon
@ 2017-02-02 23:38 ` Douglas Anderson
  0 siblings, 0 replies; 8+ messages in thread
From: Douglas Anderson @ 2017-02-02 23:38 UTC (permalink / raw)
  To: thierry.reding
  Cc: seanpaul, marcheu, briannorris, hoegsberg, Douglas Anderson,
	airlied, dri-devel, linux-kernel

The Sharp lq123p1jx31 has a requirement that the VDD is on for at
least 300 ms before being turned off.  At the moment nothing anywhere
in the kernel is ensuring this.

The simplest way to ensure this is to add a "disable" timing of 150
ms.  With this the we know that there will be at least 300 ms between
the regulator/gpio being turned on and being turned off.
Specifically, here's what happens after this change:

* prepare: enable regulator, delay 110 ms (10 for regulator, then 100)
* enable: delay 50 ms
* disable: delay 150 ms, then disable regulator
* unprepare: delay 550 ms (50 for regulator, 500 to off=>on too quick)

As you can see, even giving the regulator 10 ms (the max the panel
spec allows) for ramping up we are sure that the regulator was on for
300 ms now.

Signed-off-by: Douglas Anderson <dianders@chromium.org>
---
 drivers/gpu/drm/panel/panel-simple.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c
index 89eb0422821c..dbaadfa6b823 100644
--- a/drivers/gpu/drm/panel/panel-simple.c
+++ b/drivers/gpu/drm/panel/panel-simple.c
@@ -1622,6 +1622,7 @@ static const struct panel_desc sharp_lq123p1jx31 = {
 	.delay = {
 		.prepare = 110,
 		.enable = 50,
+		.disable = 150,
 		.unprepare = 550,
 	},
 };
-- 
2.11.0.483.g087da7b7c-goog

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH] drm/panel: simple: ensure Sharp lq123p1jx31 isn't turned off too soon
@ 2017-02-02 23:38 ` Douglas Anderson
  0 siblings, 0 replies; 8+ messages in thread
From: Douglas Anderson @ 2017-02-02 23:38 UTC (permalink / raw)
  To: thierry.reding
  Cc: briannorris, Douglas Anderson, dri-devel, linux-kernel,
	hoegsberg, marcheu

The Sharp lq123p1jx31 has a requirement that the VDD is on for at
least 300 ms before being turned off.  At the moment nothing anywhere
in the kernel is ensuring this.

The simplest way to ensure this is to add a "disable" timing of 150
ms.  With this the we know that there will be at least 300 ms between
the regulator/gpio being turned on and being turned off.
Specifically, here's what happens after this change:

* prepare: enable regulator, delay 110 ms (10 for regulator, then 100)
* enable: delay 50 ms
* disable: delay 150 ms, then disable regulator
* unprepare: delay 550 ms (50 for regulator, 500 to off=>on too quick)

As you can see, even giving the regulator 10 ms (the max the panel
spec allows) for ramping up we are sure that the regulator was on for
300 ms now.

Signed-off-by: Douglas Anderson <dianders@chromium.org>
---
 drivers/gpu/drm/panel/panel-simple.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c
index 89eb0422821c..dbaadfa6b823 100644
--- a/drivers/gpu/drm/panel/panel-simple.c
+++ b/drivers/gpu/drm/panel/panel-simple.c
@@ -1622,6 +1622,7 @@ static const struct panel_desc sharp_lq123p1jx31 = {
 	.delay = {
 		.prepare = 110,
 		.enable = 50,
+		.disable = 150,
 		.unprepare = 550,
 	},
 };
-- 
2.11.0.483.g087da7b7c-goog

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

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH] drm/panel: simple: ensure Sharp lq123p1jx31 isn't turned off too soon
  2017-02-02 23:38 ` Douglas Anderson
@ 2017-02-04  2:36   ` Doug Anderson
  -1 siblings, 0 replies; 8+ messages in thread
From: Doug Anderson @ 2017-02-04  2:36 UTC (permalink / raw)
  To: Thierry Reding
  Cc: Sean Paul, Stéphane Marchesin, Brian Norris,
	Kristian Kristensen, Douglas Anderson, David Airlie, dri-devel,
	linux-kernel

Hi

On Thu, Feb 2, 2017 at 3:38 PM, Douglas Anderson <dianders@chromium.org> wrote:
> The Sharp lq123p1jx31 has a requirement that the VDD is on for at
> least 300 ms before being turned off.  At the moment nothing anywhere
> in the kernel is ensuring this.
>
> The simplest way to ensure this is to add a "disable" timing of 150
> ms.  With this the we know that there will be at least 300 ms between
> the regulator/gpio being turned on and being turned off.
> Specifically, here's what happens after this change:
>
> * prepare: enable regulator, delay 110 ms (10 for regulator, then 100)
> * enable: delay 50 ms
> * disable: delay 150 ms, then disable regulator
> * unprepare: delay 550 ms (50 for regulator, 500 to off=>on too quick)
>
> As you can see, even giving the regulator 10 ms (the max the panel
> spec allows) for ramping up we are sure that the regulator was on for
> 300 ms now.
>
> Signed-off-by: Douglas Anderson <dianders@chromium.org>
> ---
>  drivers/gpu/drm/panel/panel-simple.c | 1 +
>  1 file changed, 1 insertion(+)

NAKing my own patch.

While this patch _does_ indeed enforce a requirement from the
datasheet and also empirically fixes the problem I was seeing, I'm
nearly certain that the reason it works has more to do with luck than
anything else.

After a little more digging, I'm becoming more certain that we need to
manage the backlight state for this panel and sequence it properly
with the enable signals.  Assuming this is correct, I will likely post
another patch adding a custom panel driver.

-Doug

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] drm/panel: simple: ensure Sharp lq123p1jx31 isn't turned off too soon
@ 2017-02-04  2:36   ` Doug Anderson
  0 siblings, 0 replies; 8+ messages in thread
From: Doug Anderson @ 2017-02-04  2:36 UTC (permalink / raw)
  To: Thierry Reding
  Cc: Brian Norris, Douglas Anderson, dri-devel, linux-kernel,
	Kristian Kristensen, Stéphane Marchesin

Hi

On Thu, Feb 2, 2017 at 3:38 PM, Douglas Anderson <dianders@chromium.org> wrote:
> The Sharp lq123p1jx31 has a requirement that the VDD is on for at
> least 300 ms before being turned off.  At the moment nothing anywhere
> in the kernel is ensuring this.
>
> The simplest way to ensure this is to add a "disable" timing of 150
> ms.  With this the we know that there will be at least 300 ms between
> the regulator/gpio being turned on and being turned off.
> Specifically, here's what happens after this change:
>
> * prepare: enable regulator, delay 110 ms (10 for regulator, then 100)
> * enable: delay 50 ms
> * disable: delay 150 ms, then disable regulator
> * unprepare: delay 550 ms (50 for regulator, 500 to off=>on too quick)
>
> As you can see, even giving the regulator 10 ms (the max the panel
> spec allows) for ramping up we are sure that the regulator was on for
> 300 ms now.
>
> Signed-off-by: Douglas Anderson <dianders@chromium.org>
> ---
>  drivers/gpu/drm/panel/panel-simple.c | 1 +
>  1 file changed, 1 insertion(+)

NAKing my own patch.

While this patch _does_ indeed enforce a requirement from the
datasheet and also empirically fixes the problem I was seeing, I'm
nearly certain that the reason it works has more to do with luck than
anything else.

After a little more digging, I'm becoming more certain that we need to
manage the backlight state for this panel and sequence it properly
with the enable signals.  Assuming this is correct, I will likely post
another patch adding a custom panel driver.

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] drm/panel: simple: ensure Sharp lq123p1jx31 isn't turned off too soon
  2017-02-02 23:38 ` Douglas Anderson
@ 2017-02-06 12:03   ` Thierry Reding
  -1 siblings, 0 replies; 8+ messages in thread
From: Thierry Reding @ 2017-02-06 12:03 UTC (permalink / raw)
  To: Douglas Anderson
  Cc: seanpaul, marcheu, briannorris, hoegsberg, airlied, dri-devel,
	linux-kernel

[-- Attachment #1: Type: text/plain, Size: 594 bytes --]

On Thu, Feb 02, 2017 at 03:38:53PM -0800, Douglas Anderson wrote:
> The Sharp lq123p1jx31 has a requirement that the VDD is on for at
> least 300 ms before being turned off.  At the moment nothing anywhere
> in the kernel is ensuring this.

Looks to me like .delay.prepare would be a better fit. That enables the
regulator and setting it to 300 ms would make sure that the regulator
will always get enabled for at least 300 ms.

Anyway, your commit message says nothing about why this is important.
What are the side-effects if the above isn't true? Does the display hang
in some way?

Thierry

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] drm/panel: simple: ensure Sharp lq123p1jx31 isn't turned off too soon
@ 2017-02-06 12:03   ` Thierry Reding
  0 siblings, 0 replies; 8+ messages in thread
From: Thierry Reding @ 2017-02-06 12:03 UTC (permalink / raw)
  To: Douglas Anderson; +Cc: briannorris, linux-kernel, dri-devel, hoegsberg, marcheu


[-- Attachment #1.1: Type: text/plain, Size: 594 bytes --]

On Thu, Feb 02, 2017 at 03:38:53PM -0800, Douglas Anderson wrote:
> The Sharp lq123p1jx31 has a requirement that the VDD is on for at
> least 300 ms before being turned off.  At the moment nothing anywhere
> in the kernel is ensuring this.

Looks to me like .delay.prepare would be a better fit. That enables the
regulator and setting it to 300 ms would make sure that the regulator
will always get enabled for at least 300 ms.

Anyway, your commit message says nothing about why this is important.
What are the side-effects if the above isn't true? Does the display hang
in some way?

Thierry

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] drm/panel: simple: ensure Sharp lq123p1jx31 isn't turned off too soon
  2017-02-06 12:03   ` Thierry Reding
@ 2017-02-06 16:15     ` Doug Anderson
  -1 siblings, 0 replies; 8+ messages in thread
From: Doug Anderson @ 2017-02-06 16:15 UTC (permalink / raw)
  To: Thierry Reding
  Cc: Sean Paul, Stéphane Marchesin, Brian Norris,
	Kristian Kristensen, David Airlie, dri-devel, linux-kernel

Hi,

On Mon, Feb 6, 2017 at 4:03 AM, Thierry Reding <thierry.reding@gmail.com> wrote:
> On Thu, Feb 02, 2017 at 03:38:53PM -0800, Douglas Anderson wrote:
>> The Sharp lq123p1jx31 has a requirement that the VDD is on for at
>> least 300 ms before being turned off.  At the moment nothing anywhere
>> in the kernel is ensuring this.
>
> Looks to me like .delay.prepare would be a better fit. That enables the
> regulator and setting it to 300 ms would make sure that the regulator
> will always get enabled for at least 300 ms.

This would also ensure that the 300 ms wasn't violated, right.


> Anyway, your commit message says nothing about why this is important.
> What are the side-effects if the above isn't true? Does the display hang
> in some way?

See my own response where I NAKed my own patch because I realized that
it wasn't fixing the root cause of the problem I was seeing (it just
happened to push timing around).  Basically the problem was that the
backlight was getting turned on while the panel was off and the panel
didn't like that.  This appears to already be addressed with upstream
patches, so picking those into my tree fixed the problem.

It might be nice long term to address some of these "the panel needs
to be on for at least 300 ms" or "the panel needs to be off for at
least 500 ms" in a way that doesn't require a hardcoded delay.

I suppose it could be done today with a custom panel driver, so I
guess it depends on how common those types of requirements are in the
spec and how important they are to actually follow.

-Doug

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] drm/panel: simple: ensure Sharp lq123p1jx31 isn't turned off too soon
@ 2017-02-06 16:15     ` Doug Anderson
  0 siblings, 0 replies; 8+ messages in thread
From: Doug Anderson @ 2017-02-06 16:15 UTC (permalink / raw)
  To: Thierry Reding
  Cc: Brian Norris, linux-kernel, dri-devel, Kristian Kristensen,
	Stéphane Marchesin

Hi,

On Mon, Feb 6, 2017 at 4:03 AM, Thierry Reding <thierry.reding@gmail.com> wrote:
> On Thu, Feb 02, 2017 at 03:38:53PM -0800, Douglas Anderson wrote:
>> The Sharp lq123p1jx31 has a requirement that the VDD is on for at
>> least 300 ms before being turned off.  At the moment nothing anywhere
>> in the kernel is ensuring this.
>
> Looks to me like .delay.prepare would be a better fit. That enables the
> regulator and setting it to 300 ms would make sure that the regulator
> will always get enabled for at least 300 ms.

This would also ensure that the 300 ms wasn't violated, right.


> Anyway, your commit message says nothing about why this is important.
> What are the side-effects if the above isn't true? Does the display hang
> in some way?

See my own response where I NAKed my own patch because I realized that
it wasn't fixing the root cause of the problem I was seeing (it just
happened to push timing around).  Basically the problem was that the
backlight was getting turned on while the panel was off and the panel
didn't like that.  This appears to already be addressed with upstream
patches, so picking those into my tree fixed the problem.

It might be nice long term to address some of these "the panel needs
to be on for at least 300 ms" or "the panel needs to be off for at
least 500 ms" in a way that doesn't require a hardcoded delay.

I suppose it could be done today with a custom panel driver, so I
guess it depends on how common those types of requirements are in the
spec and how important they are to actually follow.

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2017-02-06 16:15 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-02 23:38 [PATCH] drm/panel: simple: ensure Sharp lq123p1jx31 isn't turned off too soon Douglas Anderson
2017-02-02 23:38 ` Douglas Anderson
2017-02-04  2:36 ` Doug Anderson
2017-02-04  2:36   ` Doug Anderson
2017-02-06 12:03 ` Thierry Reding
2017-02-06 12:03   ` Thierry Reding
2017-02-06 16:15   ` Doug Anderson
2017-02-06 16:15     ` Doug Anderson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.