Re: PROBLEM: Native backlight regressed from logarithmic to linear scale

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 29 Jul 2014, Daniel Vetter <daniel@xxxxxxxx> 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@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/intel-gfx





[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux