From: Jani Nikula <jani.nikula@linux.intel.com>
To: Daniel Vetter <daniel@ffwll.ch>, Anders Kaseorg <andersk@MIT.EDU>
Cc: intel-gfx@lists.freedesktop.org,
"Rafael J. Wysocki" <rafael.j.wysocki@intel.com>,
linux-acpi@vger.kernel.org,
Daniel Vetter <daniel.vetter@ffwll.ch>
Subject: Re: PROBLEM: Native backlight regressed from logarithmic to linear scale
Date: Fri, 08 Aug 2014 12:38:13 +0300 [thread overview]
Message-ID: <87k36jmid6.fsf@intel.com> (raw)
In-Reply-To: <20140729103822.GO4747@phenom.ffwll.local>
On Tue, 29 Jul 2014, Daniel Vetter <daniel@ffwll.ch> wrote:
> On Tue, Jul 29, 2014 at 06:14:16AM -0400, Anders Kaseorg wrote:
>> On Tue, 29 Jul 2014, Hans de Goede wrote:
>> > I've been thinking a bit about this, and I believe that the right answer
>> > here is to do the linear to logarithmic mapping in user-space. The intel
>> > backlight interface has a type of raw, clearly signalling to userspace
>> > that it is a raw "untranslated" interface, as such any fanciness such as
>> > creating a logarithmic scale should be done in userspace IMHO.
>>
>> I was going to respond that the kernel does its own brightness stepping
>> when userspace isn’t paying attention. But apparently only acpi_video
>> does that, and intel_backlight does not; my brightness keys now have no
>> effect outside of the X server. Is that the expected behavior?
>
> Userspace on linux is supposed to catch brightness keys and update the
> backlight. Some acpi drivers do funny stuff behind everyone's back, but
> generally that's the expected behavior. You'd need a deamon for the
> backlight to work on the console.
>
>> In any case, if you think punting part of the problem to userspace is the
>> right answer, then to flesh out the details: do you think it’s right for
>> userspace to assume that any backlight with type ‘raw’ is a linear scale
>> that needs to be converted, and one with type ‘firmware’ or ‘platform’ has
>> already been converted appropriately?
>
> I don't think you can generally assume anything - what we do is send the
> pwm signal, how linearly that translates into brightness is totally panel
> and driver dependent. So no matter what you pick someone will complain I
> think.
Because the mapping from PWM duty cycle to luminance is panel dependent,
the ACPI opregion contains such mapping. Likely the ACPI backlight uses
just that. We (i915) currently don't. I don't think the userspace has a
sensible interface to that information. I'm not sure it should either.
I haven't made up my mind on this, but I might go for doing the mapping
in i915. Additionally I think we should probably use a fixed range of,
say, 0-100 that gets exposed to the userspace; there's no point in
exposing e.g. 100000 levels when the hardware can not physically produce
nor can the user distinguish that many distinct levels.
I'd go for making this as simple as possible to use and implement
right. Anything fancy is going to blow up in fantastic ways.
BR,
Jani.
--
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
prev parent reply other threads:[~2014-08-08 9:38 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-22 4:32 PROBLEM: Native backlight regressed from logarithmic to linear scale Anders Kaseorg
2014-07-22 12:24 ` Rafael J. Wysocki
2014-07-29 9:46 ` Hans de Goede
2014-07-29 10:14 ` [Intel-gfx] " Anders Kaseorg
2014-07-29 10:38 ` Daniel Vetter
2014-08-08 9:38 ` Jani Nikula [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=87k36jmid6.fsf@intel.com \
--to=jani.nikula@linux.intel.com \
--cc=andersk@MIT.EDU \
--cc=daniel.vetter@ffwll.ch \
--cc=daniel@ffwll.ch \
--cc=intel-gfx@lists.freedesktop.org \
--cc=linux-acpi@vger.kernel.org \
--cc=rafael.j.wysocki@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