From: Daniel Thompson <daniel.thompson@linaro.org>
To: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
Cc: Philipp Zabel <p.zabel@pengutronix.de>,
Thierry Reding <thierry.reding@gmail.com>,
Lee Jones <lee@kernel.org>, Jingoo Han <jingoohan1@gmail.com>,
Helge Deller <deller@gmx.de>,
linux-pwm@vger.kernel.org, dri-devel@lists.freedesktop.org,
linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org,
kernel@pengutronix.de
Subject: Re: [PATCH] backlight: pwm_bl: Avoid backlight flicker applying initial PWM state
Date: Mon, 23 Oct 2023 13:49:09 +0100 [thread overview]
Message-ID: <20231023124909.GC49511@aspen.lan> (raw)
In-Reply-To: <20231020121148.3g6t3v5uuyubifpb@pengutronix.de>
On Fri, Oct 20, 2023 at 02:11:48PM +0200, Uwe Kleine-König wrote:
> Hello Daniel,
>
> On Fri, Oct 20, 2023 at 12:27:27PM +0100, Daniel Thompson wrote:
> > On Wed, Oct 18, 2023 at 11:07:41PM +0200, Uwe Kleine-König wrote:
> > > Hello Philipp,
> > >
> > > On Thu, Jun 08, 2023 at 04:11:14PM +0200, Philipp Zabel wrote:
> > > > The initial PWM state returned by pwm_init_state() has a duty cycle
> > > > of 0 ns.
> > >
> > > This is only true for drivers without a .get_state() callback, isn't it?
> >
> > pwm_init_state() explicitly zeros the duty-cycle in order to avoid
> > problems when the default args have a different period to the currently
> > applied config:
> > https://elixir.bootlin.com/linux/latest/source/include/linux/pwm.h#L174
>
> Ah right, pwm_init_state() is strange in a different way than I
> remembered :-) pwm_get_state() is only called to get .enabled set
> appropriately.
>
> Looking at the callers:
>
> <snip>
> - drivers/video/backlight/lm3630a_bl.c
> explictily sets .enabled before calling pwm_apply_state()
>
> - drivers/video/backlight/lp855x_bl.c
> explictily sets .enabled before calling pwm_apply_state()
>
> - drivers/video/backlight/pwm_bl.c
> This is the one we currently discuss. I think even with the patch
> applied it uses the .enabled value returned by pwm_init_state() but
> it shouldn't.
Agreed.
> So all consumers using pwm_init_state() either don't use the .enabled
> value returned by pwm_init_state() or at least shouldn't do that.
Looking a little deeper in the PWM code, it looks to me like pwm_bl.c
could just use pwm_adjust_config() during probe to transition between
bootloader settings and kernel settings!
Daniel.
prev parent reply other threads:[~2023-10-23 12:49 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-08 14:11 [PATCH] backlight: pwm_bl: Avoid backlight flicker applying initial PWM state Philipp Zabel
2023-06-26 15:05 ` Daniel Thompson
2023-10-18 21:07 ` Uwe Kleine-König
2023-10-20 11:27 ` Daniel Thompson
2023-10-20 12:11 ` Uwe Kleine-König
2023-10-23 12:49 ` Daniel Thompson [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20231023124909.GC49511@aspen.lan \
--to=daniel.thompson@linaro.org \
--cc=deller@gmx.de \
--cc=dri-devel@lists.freedesktop.org \
--cc=jingoohan1@gmail.com \
--cc=kernel@pengutronix.de \
--cc=lee@kernel.org \
--cc=linux-fbdev@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pwm@vger.kernel.org \
--cc=p.zabel@pengutronix.de \
--cc=thierry.reding@gmail.com \
--cc=u.kleine-koenig@pengutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox