From: Matthias Kaehlcke <mka@chromium.org>
To: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Cc: linux-pwm@vger.kernel.org,
Daniel Thompson <daniel.thompson@linaro.org>,
Douglas Anderson <dianders@chromium.org>,
Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>,
Jingoo Han <jingoohan1@gmail.com>,
Brian Norris <briannorris@chromium.org>,
linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org,
linux-kernel@vger.kernel.org,
Thierry Reding <thierry.reding@gmail.com>,
Jacek Anaszewski <jacek.anaszewski@gmail.com>,
Pavel Machek <pavel@ucw.cz>, Lee Jones <lee.jones@linaro.org>
Subject: Re: [PATCH] backlight: pwm_bl: Fix heuristic to determine number of brightness levels
Date: Thu, 13 Jun 2019 15:43:57 +0000 [thread overview]
Message-ID: <20190613154357.GN137143@google.com> (raw)
In-Reply-To: <fd554750-7ec6-73e1-be3a-5bac0749fa0b@collabora.com>
On Thu, Jun 13, 2019 at 11:14:55AM +0200, Enric Balletbo i Serra wrote:
> Hi Matthias,
>
> On 12/6/19 20:00, Matthias Kaehlcke wrote:
> > With commit 88ba95bedb79 ("backlight: pwm_bl: Compute brightness of
> > LED linearly to human eye") the number of set bits (aka hweight())
> > in the PWM period is used in the heuristic to determine the number
> > of brightness levels, when the brightness table isn't specified in
> > the DT. The number of set bits doesn't provide a reliable clue about
> > the length of the period, instead change the heuristic to:
> >
> > nlevels = period / fls(period)
> >
> > Also limit the maximum number of brightness levels to 4096 to avoid
> > excessively large tables.
> >
> > With this the number of levels increases monotonically with the PWM
> > period, until the maximum of 4096 levels is reached:
> >
> > period (ns) # levels
> >
> > 100 16
> > 500 62
> > 1000 111
> > 5000 416
> > 10000 769
> > 50000 3333
> > 100000 4096
> >
> > Fixes: 88ba95bedb79 ("backlight: pwm_bl: Compute brightness of LED linearly to human eye")
> > Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
>
> Tested on Samsung Chromebook Plus (16-bit pwm)
>
> Tested-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Thanks!
WARNING: multiple messages have this Message-ID (diff)
From: Matthias Kaehlcke <mka@chromium.org>
To: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Cc: linux-pwm@vger.kernel.org,
Daniel Thompson <daniel.thompson@linaro.org>,
Douglas Anderson <dianders@chromium.org>,
Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>,
Jingoo Han <jingoohan1@gmail.com>,
Brian Norris <briannorris@chromium.org>,
linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org,
linux-kernel@vger.kernel.org,
Thierry Reding <thierry.reding@gmail.com>,
Jacek Anaszewski <jacek.anaszewski@gmail.com>,
Pavel Machek <pavel@ucw.cz>, Lee Jones <lee.jones@linaro.org>
Subject: Re: [PATCH] backlight: pwm_bl: Fix heuristic to determine number of brightness levels
Date: Thu, 13 Jun 2019 08:43:57 -0700 [thread overview]
Message-ID: <20190613154357.GN137143@google.com> (raw)
In-Reply-To: <fd554750-7ec6-73e1-be3a-5bac0749fa0b@collabora.com>
On Thu, Jun 13, 2019 at 11:14:55AM +0200, Enric Balletbo i Serra wrote:
> Hi Matthias,
>
> On 12/6/19 20:00, Matthias Kaehlcke wrote:
> > With commit 88ba95bedb79 ("backlight: pwm_bl: Compute brightness of
> > LED linearly to human eye") the number of set bits (aka hweight())
> > in the PWM period is used in the heuristic to determine the number
> > of brightness levels, when the brightness table isn't specified in
> > the DT. The number of set bits doesn't provide a reliable clue about
> > the length of the period, instead change the heuristic to:
> >
> > nlevels = period / fls(period)
> >
> > Also limit the maximum number of brightness levels to 4096 to avoid
> > excessively large tables.
> >
> > With this the number of levels increases monotonically with the PWM
> > period, until the maximum of 4096 levels is reached:
> >
> > period (ns) # levels
> >
> > 100 16
> > 500 62
> > 1000 111
> > 5000 416
> > 10000 769
> > 50000 3333
> > 100000 4096
> >
> > Fixes: 88ba95bedb79 ("backlight: pwm_bl: Compute brightness of LED linearly to human eye")
> > Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
>
> Tested on Samsung Chromebook Plus (16-bit pwm)
>
> Tested-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Thanks!
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
WARNING: multiple messages have this Message-ID (diff)
From: Matthias Kaehlcke <mka@chromium.org>
To: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Cc: Thierry Reding <thierry.reding@gmail.com>,
Lee Jones <lee.jones@linaro.org>,
Daniel Thompson <daniel.thompson@linaro.org>,
Jingoo Han <jingoohan1@gmail.com>,
Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>,
linux-pwm@vger.kernel.org, dri-devel@lists.freedesktop.org,
linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org,
Douglas Anderson <dianders@chromium.org>,
Brian Norris <briannorris@chromium.org>,
Pavel Machek <pavel@ucw.cz>,
Jacek Anaszewski <jacek.anaszewski@gmail.com>
Subject: Re: [PATCH] backlight: pwm_bl: Fix heuristic to determine number of brightness levels
Date: Thu, 13 Jun 2019 08:43:57 -0700 [thread overview]
Message-ID: <20190613154357.GN137143@google.com> (raw)
In-Reply-To: <fd554750-7ec6-73e1-be3a-5bac0749fa0b@collabora.com>
On Thu, Jun 13, 2019 at 11:14:55AM +0200, Enric Balletbo i Serra wrote:
> Hi Matthias,
>
> On 12/6/19 20:00, Matthias Kaehlcke wrote:
> > With commit 88ba95bedb79 ("backlight: pwm_bl: Compute brightness of
> > LED linearly to human eye") the number of set bits (aka hweight())
> > in the PWM period is used in the heuristic to determine the number
> > of brightness levels, when the brightness table isn't specified in
> > the DT. The number of set bits doesn't provide a reliable clue about
> > the length of the period, instead change the heuristic to:
> >
> > nlevels = period / fls(period)
> >
> > Also limit the maximum number of brightness levels to 4096 to avoid
> > excessively large tables.
> >
> > With this the number of levels increases monotonically with the PWM
> > period, until the maximum of 4096 levels is reached:
> >
> > period (ns) # levels
> >
> > 100 16
> > 500 62
> > 1000 111
> > 5000 416
> > 10000 769
> > 50000 3333
> > 100000 4096
> >
> > Fixes: 88ba95bedb79 ("backlight: pwm_bl: Compute brightness of LED linearly to human eye")
> > Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
>
> Tested on Samsung Chromebook Plus (16-bit pwm)
>
> Tested-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Thanks!
next prev parent reply other threads:[~2019-06-13 15:43 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-12 18:00 [PATCH] backlight: pwm_bl: Fix heuristic to determine number of brightness levels Matthias Kaehlcke
2019-06-12 18:00 ` Matthias Kaehlcke
2019-06-13 9:14 ` Enric Balletbo i Serra
2019-06-13 9:14 ` Enric Balletbo i Serra
2019-06-13 15:43 ` Matthias Kaehlcke [this message]
2019-06-13 15:43 ` Matthias Kaehlcke
2019-06-13 15:43 ` Matthias Kaehlcke
2019-06-21 12:49 ` Daniel Thompson
2019-06-21 12:49 ` Daniel Thompson
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=20190613154357.GN137143@google.com \
--to=mka@chromium.org \
--cc=b.zolnierkie@samsung.com \
--cc=briannorris@chromium.org \
--cc=daniel.thompson@linaro.org \
--cc=dianders@chromium.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=enric.balletbo@collabora.com \
--cc=jacek.anaszewski@gmail.com \
--cc=jingoohan1@gmail.com \
--cc=lee.jones@linaro.org \
--cc=linux-fbdev@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pwm@vger.kernel.org \
--cc=pavel@ucw.cz \
--cc=thierry.reding@gmail.com \
/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 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.