[PATCH weston] libweston/compositor-drm: Reset repaint scheduled status when setting DPMS level to off
Marius Vlad
marius-cristian.vlad at nxp.com
Wed Mar 7 17:36:46 UTC 2018
Otherwise when setting dpms level DPMS_ON, weston_output_schedule_repaint()
will bail out early and never get a chance to wake up the output.
Arguably this could also be done in drm_set_dpms() when setting dpms_off_pending
but I figure it better to do it when deferred.
Signed-off-by: Marius Vlad <marius-cristian.vlad at nxp.com>
CC: Daniel Stone <daniel at fooishbar.org>
CC: Pekka Paalanen <ppaalanen at gmail.com>
---
libweston/compositor-drm.c | 6 ++++++
libweston/compositor.c | 2 +-
libweston/compositor.h | 2 ++
3 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/libweston/compositor-drm.c b/libweston/compositor-drm.c
index 9594425..a53086e 100644
--- a/libweston/compositor-drm.c
+++ b/libweston/compositor-drm.c
@@ -1439,6 +1439,12 @@ drm_output_update_complete(struct drm_output *output, uint32_t flags,
} else if (output->dpms_off_pending) {
struct drm_pending_state *pending = drm_pending_state_alloc(b);
output->dpms_off_pending = 0;
+ /* reset repaint status so that weston_output_schedule_repaint()
+ * will start the repaint_loop when DPMS level is ON */
+#ifdef DEBUG
+ weston_log("Reseting repaint status for output %s\n", output->base.name);
+#endif
+ weston_output_schedule_repaint_reset(&output->base);
drm_output_get_disable_state(pending, output);
drm_pending_state_apply_sync(pending);
return;
diff --git a/libweston/compositor.c b/libweston/compositor.c
index 274a22d..79c8d21 100644
--- a/libweston/compositor.c
+++ b/libweston/compositor.c
@@ -2360,7 +2360,7 @@ weston_output_repaint(struct weston_output *output, void *repaint_data)
return r;
}
-static void
+WL_EXPORT void
weston_output_schedule_repaint_reset(struct weston_output *output)
{
output->repaint_status = REPAINT_NOT_SCHEDULED;
diff --git a/libweston/compositor.h b/libweston/compositor.h
index 010f1fa..afd49f5 100644
--- a/libweston/compositor.h
+++ b/libweston/compositor.h
@@ -1461,6 +1461,8 @@ weston_output_finish_frame(struct weston_output *output,
void
weston_output_schedule_repaint(struct weston_output *output);
void
+weston_output_schedule_repaint_reset(struct weston_output *output);
+void
weston_output_damage(struct weston_output *output);
void
weston_compositor_schedule_repaint(struct weston_compositor *compositor);
--
2.9.3
More information about the wayland-devel
mailing list