Skip to content
This repository has been archived by the owner on Nov 1, 2021. It is now read-only.

Resume from DPMS is broken under Sway #2312

Closed
forgottenswitch opened this issue Jul 1, 2020 · 2 comments · Fixed by #2313
Closed

Resume from DPMS is broken under Sway #2312

forgottenswitch opened this issue Jul 1, 2020 · 2 comments · Fixed by #2313

Comments

@forgottenswitch
Copy link

When using 0.10.0-216-g6c8f66ff59b2 ("xcursor: add xorg-x11 and cursors path to XCURSORPATH") against Sway 1.5-rc1-2-gbb85b9070d05 ("tree/view: fix smart borders with tabbed/stacked ancestor") on a non-atomic-modesetting-enabled machine, an swaymsg output 0 dpms on is unable to restore the monitor back from DPMS sleep previously entered into by means of swaymsg output 0 dpms off. Only switching to another VT and back achieves the desired effect.

Testing 15d8f18 (cc @emersion) against Sway 1.2-rc1-372-g6f7b548589fe ("ipc: invert output transformation when necessary") revealed that the cause is the following(1) undocumented semantical bit:

--- a/backend/drm/legacy.c
+++ b/backend/drm/legacy.c
<..>
@@ -28,18 +28,20 @@ static bool legacy_crtc_commit(struct wlr_drm_backend *drm,
<..>
                uint32_t *conns = NULL;
                size_t conns_len = 0;
                drmModeModeInfo *mode = NULL;
-               if (crtc->active) {
+               if (crtc->pending.mode != NULL) {
                        conns = &conn->id;
                        conns_len = 1;
<..>

instead of the purely syntactical

-               if (crtc->active) {
+               if (crtc->pending.active) {

A quickly testable version is here (without pretending that its description is too insightful).

emersion added a commit to emersion/wlroots that referenced this issue Jul 2, 2020
This mirrors what the atomic code does in create_mode_blob.

Closes: swaywm#2312
@emersion
Copy link
Member

emersion commented Jul 2, 2020

Can you try #2313?

ddevault pushed a commit that referenced this issue Jul 2, 2020
This mirrors what the atomic code does in create_mode_blob.

Closes: #2312
@forgottenswitch
Copy link
Author

Confirming that f82a27f works.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

Successfully merging a pull request may close this issue.

2 participants