Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 21 Sep 2011 23:48:46 -0400
From:      Justin Hibbits <jrh29@alumni.cwru.edu>
To:        Peter Grehan <grehan@freebsd.org>
Cc:        FreeBSD PowerPC ML <freebsd-ppc@freebsd.org>
Subject:   Re: ofw syscons brightness patch
Message-ID:  <CAHSQbTALfRBxLakJvYj-J7fBXeD--x6_2PCrG755Qd6fs_2AoQ@mail.gmail.com>
In-Reply-To: <4E7AAA9D.9010503@freebsd.org>
References:  <91CC14C1-14F2-41B3-81F1-D90B42F038CA@alumni.cwru.edu> <4E7AAA9D.9010503@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Sep 21, 2011 at 11:25 PM, Peter Grehan <grehan@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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAHSQbTALfRBxLakJvYj-J7fBXeD--x6_2PCrG755Qd6fs_2AoQ>