compositor: add dpms and backlight support
DPMS kicks in only when wscreensaver is launched, in the moment that shell
call lock() for the second time. Backlight control internals are managed by
libbacklight:
http://cgit.freedesktop.org/~vignatti/libbacklight/
Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
diff --git a/src/compositor.h b/src/compositor.h
index dd9cb20..8c57e4f 100644
--- a/src/compositor.h
+++ b/src/compositor.h
@@ -62,6 +62,14 @@
float trans_x, trans_y;
};
+/* bit compatible with drm definitions. */
+enum dpms_enum {
+ WESTON_DPMS_ON,
+ WESTON_DPMS_STANDBY,
+ WESTON_DPMS_SUSPEND,
+ WESTON_DPMS_OFF
+};
+
struct weston_output {
struct wl_list link;
struct weston_compositor *compositor;
@@ -86,6 +94,11 @@
void (*repaint)(struct weston_output *output);
void (*destroy)(struct weston_output *output);
void (*assign_planes)(struct weston_output *output);
+
+ /* backlight values are on 1-10 range, where higher is brighter */
+ uint32_t backlight_current;
+ void (*set_backlight)(struct weston_output *output, uint32_t value);
+ void (*set_dpms)(struct weston_output *output, enum dpms_enum level);
};
struct weston_input_device {