[PATCH v2 weston 04/16] compositor-drm: Record current DPMS level
Daniel Stone
daniels at collabora.com
Mon Jun 22 09:25:09 PDT 2015
Track the current DPMS level for any given output, and track failure (or
otherwise) of the DPMS-setting property call.
Signed-off-by: Daniel Stone <daniels at collabora.com>
---
src/compositor-drm.c | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/src/compositor-drm.c b/src/compositor-drm.c
index 43dd483..f8ba427 100644
--- a/src/compositor-drm.c
+++ b/src/compositor-drm.c
@@ -168,6 +168,8 @@ struct drm_output {
drmModePropertyPtr dpms_prop;
uint32_t format;
+ enum dpms_enum dpms;
+
int vblank_pending;
int page_flip_pending;
int destroy_pending;
@@ -1602,12 +1604,20 @@ drm_set_dpms(struct weston_output *output_base, enum dpms_enum level)
struct drm_output *output = (struct drm_output *) output_base;
struct weston_compositor *ec = output_base->compositor;
struct drm_compositor *c = (struct drm_compositor *) ec;
+ int ret;
if (!output->dpms_prop)
return;
- drmModeConnectorSetProperty(c->drm.fd, output->connector_id,
- output->dpms_prop->prop_id, level);
+ ret = drmModeConnectorSetProperty(c->drm.fd, output->connector_id,
+ output->dpms_prop->prop_id, level);
+ if (ret) {
+ weston_log("DRM: DPMS: failed property set for %s\n",
+ output->base.name);
+ return;
+ }
+
+ output->dpms = level;
}
static const char * const connector_type_names[] = {
--
2.4.3
More information about the wayland-devel
mailing list