swaywm / sway

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

Display is not recognized when power is turned back on #8114

Open tkna91 opened 5 months ago

tkna91 commented 5 months ago

I have not found a clear commit range where this occurs, but it did not occur at dc9f217. It occurs from dcb142b through 1267e47 .

Reproduction procedure

  1. Run the bellow script sway-run-debug and login
  2. Run $mod+enter foot
  3. swaymsg -t get_outputs
  4. Turn off the display 'Dell Inc. DELL P2418HT MYDM775F152L' by pressing the power button
  5. Press the power button on the display 'Dell Inc. DELL P2418HT MYDM775F152L' to turn it on. -> Display not recognized
  6. swaymsg -t get_outputs

Environment

kennylevinsen commented 5 months ago

[wlr] [backend/drm/legacy.c:175] connector HDMI-A-4: drmModePageFlip failed: Device or resource busy

So our attempt to enable the output fails. If you try to enable it again with swaymsg, does it come alive?

Please test with https://github.com/swaywm/sway/pull/8095 to see if that resolves the issue.

tkna91 commented 5 months ago

@kennylevinsen I checked below and both did not seem to work.

Procedure:

  1. sway login
  2. Run $mod+enter foot
  3. swaymsg -t get_outputs
  4. Turn off the display 'Dell Inc. DELL P2418HT MYDM775F152L' by pressing the power button
  5. Press the power button on the display 'Dell Inc. DELL P2418HT MYDM775F152L' to turn it on. -> Display not recognized
  6. swaymsg -t get_outputs
  7. swaymsg output HDMI-A-3 power on -> Display not recognized
  8. swaymsg output HDMI-A-3 power off
  9. swaymsg output HDMI-A-3 power on -> Display not recognized
  10. sway logout

So our attempt to enable the output fails. If you try to enable it again with swaymsg, does it come alive?

Please test with #8095 to see if that resolves the issue.

kennylevinsen commented 5 months ago

It just keeps failing with:

00:00:36.366 [DEBUG] [wlr] [types/output/cursor.c:169] Failed to get cursor display formats
00:00:36.366 [DEBUG] [wlr] [types/output/cursor.c:207] Failed to pick cursor format
00:00:36.366 [DEBUG] [wlr] [types/output/cursor.c:286] Failed to render cursor buffer
00:00:36.366 [DEBUG] [wlr] [types/output/cursor.c:386] Falling back to software cursor on output 'HDMI-A-4'
00:00:36.367 [ERROR] [wlr] [backend/drm/legacy.c:175] connector DVI-D-1: drmModePageFlip failed: Device or resource busy
tkna91 commented 4 months ago

I followed the following page and it solved the problem.

https://github.com/swaywm/sway/wiki#i-have-a-multi-gpu-setup-like-intelnvidia-or-intelamd-and-sway-does-not-start--some-video-cards-cannot-display--full-screen-images-etc-will-be-corrupted

Apart from this problem, I have been troubled with the following problem since a certain version of sway (sway-git-1.10.r7328.dcb142b-1-x86_64.pkg.tar.zst).

However, I noticed that when I connected to the other of the two GPUs it would show up. It seems the problem was not with the display, but with the video card. I am using the following two GPUs

# lspci | grep -i "disp\|vga"
00:02.0 Display controller: Intel Corporation Alder Lake-S GT1 [UHD Graphics 730] (rev 0c)
01:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Caicos [Radeon HD 6450/7450/8450 / R5 230 OEM]
#
# udevadm info --attribute-walk --name=/dev/dri/card0 | grep DRIVERS==\"[^\"]
    DRIVERS=="radeon"
    DRIVERS=="pcieport"
# udevadm info --attribute-walk --name=/dev/dri/card1 | grep DRIVERS==\"[^\"]
    DRIVERS=="i915"
#

The following was added to the script that starts udev-rule and Sway, and now it appears correctly in the latest version.

# cat /etc/udev/rules.d/set-dri-links.rules
KERNEL=="card*", SUBSYSTEM=="drm", ATTRS{vendor}=="0x1002", ATTRS{device}=="0x6779", SYMLINK+="dri/by-name/radeon-0x6779"
KERNEL=="card*", SUBSYSTEM=="drm", ATTRS{vendor}=="0x8086", ATTRS{device}=="0x4692", SYMLINK+="dri/by-name/i915-0x4692"
#
if [ "`hostname`" == "gb1" ] ; then
    export WLR_DRM_DEVICES=/dev/dri/by-name/i915-0x4692:/dev/dri/by-name/radeon-0x6779
fi

Power off/on is also no problem. There is no problem to display the video in full screen. Perhaps this correspondence could close some of the other existing issues.

You can close it if you wish.

$ pacman -Q sway-git wlroots-git mesa linux
sway-git 1.10.r7348.2e9139d-1
wlroots-git 0.18.0.r7063.6e6c4408d-1
mesa 1:24.1.0-1
linux 6.9.2.arch1-1
$
AkechiShiro commented 4 months ago

Any input on the last comment, I have only one GPU (iGPU Intel) but was able to reproduce this issue with an ASUS monitor and a Dell monitor @kennylevinsen under Sway