aboutsummaryrefslogtreecommitdiff
path: root/backend
diff options
context:
space:
mode:
authorMarkus Ongyerth <ongy@ongy.net>2018-03-01 15:48:25 +0100
committerMarkus Ongyerth <ongy@ongy.net>2018-03-01 15:48:25 +0100
commit2cea4304889564e773454d9ac9e6403691b25383 (patch)
tree28afb9a33ef896321ada3edc77edbb0cb57d115c /backend
parent73045a7d9dd4d26a02d5c6b9ea9013f1e938e61d (diff)
prevent current_mode null on output_enable(false)
The current mode was set to NULL to abuse it as state variable persisting DRM suspend/resume, this results resulted in a segfault on normal DPMS cycle. This reverts that change and uses the wlr_output enabled variable, which also persists and makes more sense.
Diffstat (limited to 'backend')
-rw-r--r--backend/drm/backend.c2
-rw-r--r--backend/drm/drm.c2
2 files changed, 1 insertions, 3 deletions
diff --git a/backend/drm/backend.c b/backend/drm/backend.c
index fec14da9..75b44210 100644
--- a/backend/drm/backend.c
+++ b/backend/drm/backend.c
@@ -81,7 +81,7 @@ static void session_signal(struct wl_listener *listener, void *data) {
struct wlr_drm_connector *conn;
wl_list_for_each(conn, &drm->outputs, link){
- if (conn->output.current_mode) {
+ if (conn->output.enabled) {
wlr_output_set_mode(&conn->output, conn->output.current_mode);
} else {
wlr_drm_connector_enable(&conn->output, false);
diff --git a/backend/drm/drm.c b/backend/drm/drm.c
index d6388597..3b714300 100644
--- a/backend/drm/drm.c
+++ b/backend/drm/drm.c
@@ -296,8 +296,6 @@ void wlr_drm_connector_enable(struct wlr_output *output, bool enable) {
if (enable) {
wlr_drm_connector_start_renderer(conn);
- } else {
- output->current_mode = NULL;
}
wlr_output_update_enabled(&conn->output, enable);