[RFC] compositor: add dpms and backlight support

Kristian Høgsberg krh at bitplanet.net
Tue Feb 28 10:25:14 PST 2012


On Tue, Feb 28, 2012 at 1:19 PM, Jesse Barnes <jbarnes at virtuousgeek.org> wrote:
> On Tue, 28 Feb 2012 13:52:21 +0200
> Tiago Vignatti <tiago.vignatti at intel.com> wrote:
>> @@ -907,11 +912,76 @@ sprite_handle_pending_buffer_destroy(struct wl_listener *listener,
>>       sprite->pending_surface = NULL;
>>  }
>>
>> +static void
>> +drm_set_backlight(struct weston_output *output_base, uint32_t up_down)
>> +{
>> +     struct drm_output *output = (struct drm_output *) output_base;
>> +     long brightness;
>> +
>> +     if (!output->backlight)
>> +             return;
>> +
>> +     /* I know, very very rudimentary logic for turning brighter/darker.
>> +      * Maybe we should normalize brightness value to have a scale say from
>> +      * 1 to 10 or something. */
>
> So if it's just up & down, why not make an enum to make the code
> clearer?  Then you don't need the last else clause too.

I was thinking that instead of up_down, we could just have an
well-defined range or a float 0-1 and have theweston_output
set_backlight interface take an absolute value in that range.  That
was we can actually make shell.c dim the backlight on idle and restore
it to what it was on activity.

Kristian


More information about the wayland-devel mailing list