diff options
author | Drew DeVault <sir@cmpwn.com> | 2018-02-26 13:07:29 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-02-26 13:07:29 -0500 |
commit | bae17ab97c471f280dc47ebe33b0aa62220fbfb5 (patch) | |
tree | 62b13e22e9a4650bba0d755c94124e0951b5984a | |
parent | 3296365ce591ae4ba115befa8134bc2526b36710 (diff) | |
parent | a65ef8ea860e70183d0e0b44d650f0e9d2a9bf0e (diff) |
Merge pull request #683 from Ongy/drm_remember_dpms
restore dpms state on drm resume
-rw-r--r-- | backend/drm/backend.c | 2 | ||||
-rw-r--r-- | backend/drm/drm.c | 4 | ||||
-rw-r--r-- | include/backend/drm/drm.h | 1 |
3 files changed, 6 insertions, 1 deletions
diff --git a/backend/drm/backend.c b/backend/drm/backend.c index 47dff227..fec14da9 100644 --- a/backend/drm/backend.c +++ b/backend/drm/backend.c @@ -83,6 +83,8 @@ static void session_signal(struct wl_listener *listener, void *data) { wl_list_for_each(conn, &drm->outputs, link){ if (conn->output.current_mode) { wlr_output_set_mode(&conn->output, conn->output.current_mode); + } else { + wlr_drm_connector_enable(&conn->output, false); } if (!conn->crtc) { diff --git a/backend/drm/drm.c b/backend/drm/drm.c index b2863414..d6388597 100644 --- a/backend/drm/drm.c +++ b/backend/drm/drm.c @@ -282,7 +282,7 @@ void wlr_drm_connector_start_renderer(struct wlr_drm_connector *conn) { } } -static void wlr_drm_connector_enable(struct wlr_output *output, bool enable) { +void wlr_drm_connector_enable(struct wlr_output *output, bool enable) { struct wlr_drm_connector *conn = (struct wlr_drm_connector *)output; if (conn->state != WLR_DRM_CONN_CONNECTED) { return; @@ -296,6 +296,8 @@ static 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); diff --git a/include/backend/drm/drm.h b/include/backend/drm/drm.h index 65db04ef..ee3fd38e 100644 --- a/include/backend/drm/drm.h +++ b/include/backend/drm/drm.h @@ -144,6 +144,7 @@ void wlr_drm_restore_outputs(struct wlr_drm_backend *drm); void wlr_drm_connector_cleanup(struct wlr_drm_connector *conn); void wlr_drm_scan_connectors(struct wlr_drm_backend *state); int wlr_drm_event(int fd, uint32_t mask, void *data); +void wlr_drm_connector_enable(struct wlr_output *output, bool enable); void wlr_drm_connector_start_renderer(struct wlr_drm_connector *conn); |