ofw syscons brightness patch
Justin Hibbits
jrh29 at alumni.cwru.edu
Thu Sep 22 03:48:48 UTC 2011
On Wed, Sep 21, 2011 at 11:25 PM, Peter Grehan <grehan at freebsd.org> wrote:
> Hi Justin,
>
>
> Attached is a patch that adds brightness control to ofw syscons
>> (dev.sc.0.brightness sysctl). Pretty simple. Comments and tests
>> requested. Hopefully the listserv doesn't eat the patch.
>>
>
> Is it possible to have the value in the sysctl be 0-100, or 0-10 ? It
> might be a bit confusing for the user to have to know that the range is
> 0x34-0xff, and have the sysctl code clamp to these.
>
> Are the MIN_BRIGHTNESS/MAX_BRIGHTNESS values the same for all models ?
>
> later,
>
> Peter.
>
Good points. I took those values from OpenBSD's driver, which hides it in
an ioctl (not hidden very well, it still leaks out to userspace), so I'm
assuming it's the same for all models. I can apply a simple scale factor,
and clamp it at 0-100 (capped below 0xff for even intervals), or 0-17
(perfect increments of 12, capped at 0xff). I also plan to make it check
the model for "PowerBook" and similar, so that it's not provided for
non-laptop (and iMac?) machines.
- Justin
More information about the freebsd-ppc
mailing list