swaywm / sway

i3-compatible Wayland compositor
https://swaywm.org
MIT License
14.63k stars 1.11k forks source link

Can't enable third display after waking up from suspend. #4878

Closed vesim987 closed 4 years ago

vesim987 commented 4 years ago

After waking up my laptopm from suspend i can't enable third display. Restarting sway is fixing the issue.

And also it looks like sway leaked modesetting from my second display to the third one.

Versions:

swaymsg -t get_outputs:

Output eDP-1 'Unknown 0x422A 0x00000000' (focused)
  Current mode: 3000x2000 @ 59.999001 Hz
  Position: 230,1080
  Scale factor: 2.000000
  Scale filter: nearest
  Subpixel hinting: unknown
  Transform: normal
  Workspace: 1
  Max render time: off
  Available modes:
    3000x2000 @ 48.008999 Hz
    3000x2000 @ 59.999001 Hz

Output DP-1 'Apple Computer Inc Color LCD 0x00000000'
  Current mode: 2048x1536 @ 60.000000 Hz
  Position: 1730,1080
  Scale factor: 2.000000
  Scale filter: nearest
  Subpixel hinting: unknown
  Transform: normal
  Workspace: 8
  Max render time: off
  Available modes:
    2048x1536 @ 60.000000 Hz

Output DP-2 'Dell Inc. DELL U2414H 292K46A515ML' (inactive)
  Available modes:
    720x400 @ 70.082001 Hz
    640x480 @ 59.939999 Hz
    [...] // just standard modes for my display
    1920x1080 @ 60.000000 Hz
    2048x1536 @ 60.000000 Hz // this mode shouldn't be here

Logs after connecting the third display:

2020-01-04 18:44:30 - [backend/drm/drm.c:1234] Scanning DRM connectors
2020-01-04 18:44:30 - [backend/drm/drm.c:1333] 'DP-2' connected
2020-01-04 18:44:30 - [backend/drm/drm.c:1334] Current CRTC: -1
2020-01-04 18:44:30 - [backend/drm/drm.c:1339] Physical size: 530x300
2020-01-04 18:44:30 - [backend/drm/drm.c:1351] Detected modes:
2020-01-04 18:44:30 - [backend/drm/drm.c:1373]   1920x1080@60000 (preferred)
2020-01-04 18:44:30 - [backend/drm/drm.c:1373]   1920x1080@60000 
2020-01-04 18:44:30 - [backend/drm/drm.c:1373]   1920x1080@59940 
2020-01-04 18:44:30 - [backend/drm/drm.c:1373]   1920x1080@50000 
2020-01-04 18:44:30 - [backend/drm/drm.c:1373]   1600x1200@60000 
2020-01-04 18:44:30 - [backend/drm/drm.c:1373]   1600x900@60000 
2020-01-04 18:44:30 - [backend/drm/drm.c:1373]   1280x1024@75025 
2020-01-04 18:44:30 - [backend/drm/drm.c:1373]   1280x1024@60020 
2020-01-04 18:44:30 - [backend/drm/drm.c:1373]   1152x864@75000 
2020-01-04 18:44:30 - [backend/drm/drm.c:1373]   1280x720@60000 
2020-01-04 18:44:30 - [backend/drm/drm.c:1373]   1280x720@60000 
2020-01-04 18:44:30 - [backend/drm/drm.c:1373]   1280x720@59940 
2020-01-04 18:44:30 - [backend/drm/drm.c:1373]   1280x720@50000 
2020-01-04 18:44:30 - [backend/drm/drm.c:1373]   1024x768@75029 
2020-01-04 18:44:30 - [backend/drm/drm.c:1373]   1024x768@60004 
2020-01-04 18:44:30 - [backend/drm/drm.c:1373]   800x600@75000 
2020-01-04 18:44:30 - [backend/drm/drm.c:1373]   800x600@60317 
2020-01-04 18:44:30 - [backend/drm/drm.c:1373]   720x576@50000 
2020-01-04 18:44:30 - [backend/drm/drm.c:1373]   720x480@60000 
2020-01-04 18:44:30 - [backend/drm/drm.c:1373]   720x480@60000 
2020-01-04 18:44:30 - [backend/drm/drm.c:1373]   720x480@59940 
2020-01-04 18:44:30 - [backend/drm/drm.c:1373]   720x480@59940 
2020-01-04 18:44:30 - [backend/drm/drm.c:1373]   720x480@59940 
2020-01-04 18:44:30 - [backend/drm/drm.c:1373]   640x480@75000 
2020-01-04 18:44:30 - [backend/drm/drm.c:1373]   640x480@60000 
2020-01-04 18:44:30 - [backend/drm/drm.c:1373]   640x480@59940 
2020-01-04 18:44:30 - [backend/drm/drm.c:1373]   640x480@59940 
2020-01-04 18:44:30 - [backend/drm/drm.c:1373]   720x400@70082 
2020-01-04 18:44:30 - [backend/drm/drm.c:1067] Reallocating CRTCs
2020-01-04 18:44:30 - [backend/drm/drm.c:1078] State before reallocation:
2020-01-04 18:44:30 - [backend/drm/drm.c:1084]   'eDP-1' crtc=1 state=3 desired_enabled=1
2020-01-04 18:44:30 - [backend/drm/drm.c:1084]   'DP-1' crtc=2 state=3 desired_enabled=1
2020-01-04 18:44:30 - [backend/drm/drm.c:1084]   'DP-2' crtc=-1 state=1 desired_enabled=1
2020-01-04 18:44:30 - [backend/drm/drm.c:1084]   'HDMI-A-1' crtc=-1 state=0 desired_enabled=0
2020-01-04 18:44:30 - [backend/drm/drm.c:1136] State after reallocation:
2020-01-04 18:44:30 - [backend/drm/drm.c:1143]   'eDP-1' crtc=1 state=3 desired_enabled=1
2020-01-04 18:44:30 - [backend/drm/drm.c:1143]   'DP-1' crtc=2 state=3 desired_enabled=1
2020-01-04 18:44:30 - [backend/drm/drm.c:1143]   'DP-2' crtc=0 state=1 desired_enabled=1
2020-01-04 18:44:30 - [backend/drm/drm.c:1143]   'HDMI-A-1' crtc=-1 state=0 desired_enabled=0
2020-01-04 18:44:30 - [backend/drm/drm.c:1437] Requesting modeset for 'DP-2'
2020-01-04 18:44:30 - [sway/desktop/output.c:867] New output 0x559188ef8e30: DP-2
2020-01-04 18:44:30 - [sway/config/output.c:333] Turning on screen
2020-01-04 18:44:30 - [backend/drm/atomic.c:56] DP-2: Atomic commit failed (modeset): Invalid argument
2020-01-04 18:44:30 - [sway/config/output.c:339] Set Dell Inc. DELL U2414H 292K46A515ML mode to 1920x1080 (-1.000000 Hz)
2020-01-04 18:44:30 - [sway/config/output.c:261] Assigning configured mode to DP-2
2020-01-04 18:44:30 - [backend/drm/drm.c:653] Modesetting 'DP-2' with '1920x1080@60000 mHz'
2020-01-04 18:44:30 - [backend/drm/drm.c:549] Initializing renderer on connector 'DP-2'
2020-01-04 18:44:30 - [backend/drm/atomic.c:56] DP-2: Atomic commit failed (modeset): Invalid argument
2020-01-04 18:44:30 - [backend/drm/drm.c:568] Page-flip failed with primary FB modifiers enabled, retrying without modifiers
2020-01-04 18:44:30 - [backend/drm/atomic.c:56] DP-2: Atomic commit failed (modeset): Invalid argument
2020-01-04 18:44:30 - [backend/drm/drm.c:576] Failed to initialize renderer on connector 'DP-2': initial page-flip failed
2020-01-04 18:44:30 - [backend/drm/drm.c:659] Failed to initialize renderer for plane
2020-01-04 18:44:30 - [sway/config/output.c:354] Failed to modeset output DP-2

Logs after executing `output DP-2 enable':

2020-01-04 18:58:04 - [sway/commands.c:255] Handling command 'output DP-2 enable'
2020-01-04 18:58:04 - [sway/commands.c:423] Subcommand: enable
2020-01-04 18:58:04 - [sway/config/output.c:177] Generated id on name output config "Dell Inc. DELL U2414H 292K46A515ML on DP-2" (enabled: 1) (1920x1080@-1.000000Hz position 0,0 scale 1.000000 transform -1) (bg /home/vesim/Downloads/wallhaven-w8kkor_3000x2000.png fill) (dpms 1) (max render time: -1)
2020-01-04 18:58:04 - [sway/config/output.c:206] Adding non-wildcard output config
2020-01-04 18:58:04 - [sway/config/output.c:209] Merging on top of output * config
2020-01-04 18:58:04 - [sway/config/output.c:223] Config stored for output DP-2 (enabled: 1) (-1x-1@-1.000000Hz position -1,-1 scale -1.000000 subpixel unknown transform -1) (bg /home/vesim/Downloads/wallhaven-w8kkor_3000x2000.png fill) (dpms 1) (max render time: -1)
2020-01-04 18:58:04 - [backend/drm/atomic.c:56] DP-2: Atomic commit failed (modeset): Invalid argument
2020-01-04 18:58:04 - [sway/config/output.c:333] Turning on screen
2020-01-04 18:58:04 - [backend/drm/atomic.c:56] DP-2: Atomic commit failed (modeset): Invalid argument
2020-01-04 18:58:04 - [sway/config/output.c:339] Set Dell Inc. DELL U2414H 292K46A515ML on DP-2 mode to 1920x1080 (-1.000000 Hz)
2020-01-04 18:58:04 - [sway/config/output.c:261] Assigning configured mode to DP-2
2020-01-04 18:58:04 - [backend/drm/drm.c:653] Modesetting 'DP-2' with '1920x1080@60000 mHz'
2020-01-04 18:58:04 - [backend/drm/drm.c:549] Initializing renderer on connector 'DP-2'
2020-01-04 18:58:04 - [backend/drm/atomic.c:56] DP-2: Atomic commit failed (modeset): Invalid argument
2020-01-04 18:58:04 - [backend/drm/drm.c:568] Page-flip failed with primary FB modifiers enabled, retrying without modifiers
2020-01-04 18:58:04 - [backend/drm/atomic.c:56] DP-2: Atomic commit failed (modeset): Invalid argument
2020-01-04 18:58:04 - [backend/drm/drm.c:576] Failed to initialize renderer on connector 'DP-2': initial page-flip failed
2020-01-04 18:58:04 - [backend/drm/drm.c:659] Failed to initialize renderer for plane
2020-01-04 18:58:04 - [sway/config/output.c:354] Failed to modeset output DP-2
2020-01-04 18:58:04 - [sway/ipc-server.c:937] Added IPC reply of type 0x0 to client 280 queue: [ { "success": true } ]
2020-01-04 18:58:04 - [sway/ipc-server.c:524] Client 280 writable
2020-01-04 18:58:04 - [sway/ipc-server.c:215] Client 280 hung up

Logs after executing output DP-1 disable:

2020-01-04 18:59:32 - [sway/commands.c:255] Handling command 'output DP-1 disable'
2020-01-04 18:59:32 - [sway/commands.c:423] Subcommand: disable
2020-01-04 18:59:32 - [sway/config/output.c:206] Adding non-wildcard output config
2020-01-04 18:59:32 - [sway/config/output.c:209] Merging on top of output * config
2020-01-04 18:59:32 - [sway/config/output.c:223] Config stored for output DP-1 (enabled: 0) (-1x-1@-1.000000Hz position -1,-1 scale -1.000000 subpixel unknown transform -1) (bg /home/vesim/Downloads/wallhaven-w8kkor_3000x2000.png fill) (dpms 1) (max render time: -1)
2020-01-04 18:59:32 - [sway/tree/output.c:262] Disabling output 'DP-1'
2020-01-04 18:59:32 - [sway/tree/workspace.c:143] Destroying workspace '8'
2020-01-04 18:59:32 - [sway/tree/arrange.c:261] Usable area for ws: 1500x1000@0,0
[...] // just arranging stuff
2020-01-04 18:59:32 - [sway/tree/arrange.c:77] Arranging 0x7ffe965eb3c0 horizontally
2020-01-04 18:59:32 - [sway/desktop/transaction.c:411] Transaction 0x5591896a4ca0 committing with 28 instructions
2020-01-04 18:59:32 - [sway/desktop/transaction.c:280] Applying transaction 0x5591896a4ca0
2020-01-04 18:59:32 - [backend/drm/drm.c:1067] Reallocating CRTCs
2020-01-04 18:59:32 - [backend/drm/drm.c:1078] State before reallocation:
2020-01-04 18:59:32 - [backend/drm/drm.c:1084]   'eDP-1' crtc=1 state=3 desired_enabled=1
2020-01-04 18:59:32 - [backend/drm/drm.c:1084]   'DP-1' crtc=2 state=3 desired_enabled=0
2020-01-04 18:59:32 - [backend/drm/drm.c:1084]   'DP-2' crtc=0 state=1 desired_enabled=1
2020-01-04 18:59:32 - [backend/drm/drm.c:1084]   'HDMI-A-1' crtc=-1 state=0 desired_enabled=0
2020-01-04 18:59:32 - [backend/drm/drm.c:1136] State after reallocation:
2020-01-04 18:59:32 - [backend/drm/drm.c:1143]   'eDP-1' crtc=1 state=3 desired_enabled=1
2020-01-04 18:59:32 - [backend/drm/drm.c:1143]   'DP-1' crtc=2 state=3 desired_enabled=0
2020-01-04 18:59:32 - [backend/drm/drm.c:1143]   'DP-2' crtc=0 state=1 desired_enabled=1
2020-01-04 18:59:32 - [backend/drm/drm.c:1143]   'HDMI-A-1' crtc=-1 state=0 desired_enabled=0
2020-01-04 18:59:32 - [sway/ipc-server.c:937] Added IPC reply of type 0x0 to client 78 queue: [ { "success": true } ]
2020-01-04 18:59:32 - [swaybg/main.c:167] Destroying output DP-1 (Apple Computer Inc Color LCD 0x00000000)
2020-01-04 18:59:32 - [sway/ipc-server.c:524] Client 78 writable
2020-01-04 18:59:32 - [sway/desktop/layer_shell.c:331] Layer surface destroyed (wallpaper)

Logs after executing 'output DP-2 enable'

2020-01-04 18:59:37 - [sway/config/output.c:160] Merging on top of existing id on name config
2020-01-04 18:59:37 - [sway/config/output.c:200] Merging on top of existing output config
2020-01-04 18:59:37 - [sway/config/output.c:223] Config stored for output DP-2 (enabled: 1) (-1x-1@-1.000000Hz position -1,-1 scale -1.000000 subpixel unknown transform -1) (bg /home/vesim/Downloads/wallhaven-w8kkor_3000x2000.png fill) (dpms 1) (max render time: -1)
2020-01-04 18:59:37 - [sway/config/output.c:333] Turning on screen
2020-01-04 18:59:37 - [sway/config/output.c:339] Set Dell Inc. DELL U2414H 292K46A515ML on DP-2 mode to 1920x1080 (-1.000000 Hz)
2020-01-04 18:59:37 - [sway/config/output.c:261] Assigning configured mode to DP-2
2020-01-04 18:59:37 - [backend/drm/drm.c:653] Modesetting 'DP-2' with '1920x1080@60000 mHz'
2020-01-04 18:59:37 - [backend/drm/drm.c:549] Initializing renderer on connector 'DP-2'
emersion commented 4 years ago

Can you do this from a TTY:

echo 0xFE | sudo tee /sys/module/drm/parameters/debug # Enable verbose DRM logging
sudo dmesg -C
dmesg -w >dmesg.log & # Continuously write DRM logs to a file
sway -d >sway.log 2>&1 # Exit immediately when sway has started
fg # Kill dmesg with Ctrl+C
echo 0x00 | sudo tee /sys/module/drm/parameters/debug
vesim987 commented 4 years ago

@emersion dmesg.log sway.log There are both log files

emersion commented 4 years ago

Hrm, sorry, can you do the same but try to reproduce the bug while sway is running?

emersion commented 4 years ago

Closing because this is missing DRM logs. Please re-open once you get these.