From: Jesse Barnes <jesse.barnes@intel.com>
To: Jani Nikula <jani.nikula@intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 2/2] drm/i915: respect the VBT minimum backlight brightness
Date: Mon, 30 Jun 2014 08:05:34 -0700 [thread overview]
Message-ID: <20140630080534.2fcb3ccb@jbarnes-desktop> (raw)
In-Reply-To: <87d2dtjggw.fsf@intel.com>
On Sat, 28 Jun 2014 16:45:03 +0300
Jani Nikula <jani.nikula@intel.com> wrote:
> >> +/* Scale user_level in range [0..user_max] to [0..hw_max], clamping the result
> >> + * to [hw_min..hw_max]. */
> >> +static inline u32 clamp_user_to_hw(struct intel_connector *connector,
> >> + u32 user_level, u32 user_max)
> >> +{
> >> + struct intel_panel *panel = &connector->panel;
> >> + u32 hw_level;
> >> +
> >> + hw_level = scale(user_level, 0, user_max, 0, panel->backlight.max);
> >> + hw_level = clamp(hw_level, panel->backlight.min, panel->backlight.max);
> >> +
> >> + return hw_level;
> >> +}
> >
> > I like the direction here, but does this mean some user values will
> > potentially be no-ops? E.g. the low 10 values or something would all
> > map to backlight.min depending on the min?
>
> This patch doesn't really change the fact. For a max backlight of, say,
> 100000, we're bound to not have user perceivable difference between
> consecutive levels. I agree we should have a fixed, limited range here.
>
> This also depends on the backlight modulation frequency, see my earlier
> message about this: http://mid.gmane.org/87iooecg1e.fsf@intel.com
>
> > I just want to make sure every value we expose to userspace is
> > meaningful, and somehow equidistant from the values next to it, so we
> > have nice, smooth backlight transitions, and fades look good (on that
> > front, is 256 enough? or should we have a scaled range up to 1024 or
> > so?)
>
> Probably even fewer than that is enough.
>
> But you bring up another requirement, equidistant - do you mean in terms
> of luminance? Almost certainly a linear mapping to the duty cycle is not
> going to give you a linear luminance! It's possible to define a curve
> for this in the acpi opregion; patches to implement this are welcome. ;)
Ok, I guess both of these are projects for future patches. For making
the brightness levels evenly spaced, yeah I guess we'd need to apply a
rough approximation of a luminosity function (doesn't look like a
simple exponential curve, oh well).
Jesse
next prev parent reply other threads:[~2014-06-30 15:06 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-24 15:27 [PATCH 1/2] drm/i915: extract backlight minimum brightness from VBT Jani Nikula
2014-06-24 15:27 ` [PATCH 2/2] drm/i915: respect the VBT minimum backlight brightness Jani Nikula
2014-06-27 15:51 ` Jesse Barnes
2014-06-28 13:45 ` Jani Nikula
2014-06-30 15:05 ` Jesse Barnes [this message]
2014-07-22 21:19 ` Jesse Barnes
2014-07-22 21:19 ` [PATCH 1/2] drm/i915: extract backlight minimum brightness from VBT Jesse Barnes
2014-07-23 5:08 ` Daniel Vetter
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=20140630080534.2fcb3ccb@jbarnes-desktop \
--to=jesse.barnes@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=jani.nikula@intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox