Wlroots: External monitors blank with intel+nouveau mgpu setup

Created on 8 Dec 2020  路  42Comments  路  Source: swaywm/wlroots

With latest sources, external monitors are blank with just the cursor visible in an multi-gpu setup (intel-nouveau). Log attached.

sway.log

bug backendrm

All 42 comments

Hm, wait, I read your bug description too fast. The bug I had in mind was about the cursor only, not the primary plane.

This log doesn't contain any error message. Is there anything interesting in dmesg?

Just this: "Cannot find any crtc or sizes"

[    9.857226] vga_switcheroo: enabled
[    9.857315] [TTM] Zone  kernel: Available graphics memory: 16268492 KiB 
[    9.857316] [TTM] Zone   dma32: Available graphics memory: 2097152 KiB 
[    9.857317] [TTM] Initializing pool allocator
[    9.857320] [TTM] Initializing DMA pool allocator
[    9.857336] nouveau 0000:01:00.0: DRM: VRAM: 4096 MiB 
[    9.857337] nouveau 0000:01:00.0: DRM: GART: 1048576 MiB 
[    9.857340] nouveau 0000:01:00.0: DRM: TMDS table version 2.0 
[    9.857341] nouveau 0000:01:00.0: DRM: DCB version 4.0 
[    9.857343] nouveau 0000:01:00.0: DRM: DCB outp 03: 01075fd6 0f420020
[    9.857344] nouveau 0000:01:00.0: DRM: DCB outp 04: 01075f92 00020020
[    9.857345] nouveau 0000:01:00.0: DRM: DCB outp 05: 08014fc6 0f420010
[    9.857346] nouveau 0000:01:00.0: DRM: DCB outp 06: 08014f82 00020010
[    9.857346] nouveau 0000:01:00.0: DRM: DCB outp 08: 04038fb6 0f420010
[    9.857347] nouveau 0000:01:00.0: DRM: DCB outp 09: 04038f72 00020010
[    9.857348] nouveau 0000:01:00.0: DRM: DCB conn 04: 01000446
[    9.857349] nouveau 0000:01:00.0: DRM: DCB conn 05: 02000546
[    9.857350] nouveau 0000:01:00.0: DRM: DCB conn 07: 00010747
[    9.857350] nouveau 0000:01:00.0: DRM: DCB conn 08: 00020846
[    9.857351] nouveau 0000:01:00.0: DRM: DCB conn 09: 00000900
[    9.859073] nouveau 0000:01:00.0: DRM: MM: using COPY for buffer copies
[    9.923699] snd_hda_intel 0000:01:00.1: bound 0000:01:00.0 (ops nv50_audio_component_bind_ops [nouveau])
[   10.081216] nouveau 0000:01:00.0: [drm] Cannot find any crtc or sizes
[   10.085497] [drm] Initialized nouveau 1.3.1 20120801 for 0000:01:00.0 on minor 1
[   10.123241] ACPI: \: failed to evaluate _DSM (0x1001)
[   10.126468] input: PS/2 Generic Mouse as /devices/platform/i8042/serio2/input/input13
[   10.154956] mousedev: PS/2 mouse device common for all mice
[   10.241226] nouveau 0000:01:00.0: [drm] Cannot find any crtc or sizes
[   10.254541] random: crng init done
[   10.401218] nouveau 0000:01:00.0: [drm] Cannot find any crtc or sizes
[   10.424671] input: ST LIS3LV02DL Accelerometer as /devices/platform/lis3lv02d/input/input26
[   10.912890] psmouse serio3: synaptics: queried max coordinates: x [..5660], y [..4730]
[   10.947196] psmouse serio3: synaptics: queried min coordinates: x [1324..], y [1248..]

Doing multiple hotplugs, I'm able to reproduce a lockup which produces this in the log as a final entry:

00:07:54.679 [ERROR] [backend/drm/legacy.c:117] DP-3: Failed to page flip: Device or resource busy

Maybe a nouveau issue?

Dec 09 23:30:33 jonmwork kernel: ------------[ cut here ]------------
Dec 09 23:30:33 jonmwork kernel: WARNING: CPU: 6 PID: 235 at drivers/gpu/drm/nouveau/include/nvkm/subdev/i2c.h:172 nouveau_dp_detect+0xa3/0x240 [nouveau]
Dec 09 23:30:33 jonmwork kernel: Modules linked in: hid_logitech_hidpp hid_logitech_dj snd_usb_audio snd_usbmidi_lib snd_rawmidi snd_seq_device cmac algif_hash algif_skcipher af_alg bnep hid_generic usbhid hid joydev mmc_block btusb btrtl btbcm btintel bluetooth uvcvid> 
Dec 09 23:30:33 jonmwork kernel:  cfg80211 intel_uncore snd_pcm pcspkr cec psmouse i2c_i801 rc_core snd_timer intel_gtt input_leds snd syscopyarea i2c_smbus e1000e sysfillrect rfkill mei_me sysimgblt fb_sys_fops soundcore mei lpc_ich parport_pc tpm_tis wmi parport tpm_> 
Dec 09 23:30:33 jonmwork kernel: CPU: 6 PID: 235 Comm: kworker/6:2 Not tainted 5.9.13-arch1-1 #1
Dec 09 23:30:33 jonmwork kernel: Hardware name: Hewlett-Packard HP ZBook 17 G2/2255, BIOS M70 Ver. 01.26 03/03/2020
Dec 09 23:30:33 jonmwork kernel: Workqueue: events nvif_notify_work [nouveau]
Dec 09 23:30:33 jonmwork kernel: RIP: 0010:nouveau_dp_detect+0xa3/0x240 [nouveau]
Dec 09 23:30:33 jonmwork kernel: Code: 8d 4c 24 0c 4c 8d 44 24 10 4c 89 ef ba 09 00 00 00 be 01 00 00 00 e8 2c 0a f8 ff 85 c0 0f 85 55 01 00 00 80 7c 24 0c 08 74 02 <0f> 0b 4c 89 ef e8 c3 07 f8 ff 44 0f b6 44 24 11 0f b6 4c 24 12 8b
Dec 09 23:30:33 jonmwork kernel: RSP: 0018:ffffa6a780707ca8 EFLAGS: 00010293
Dec 09 23:30:33 jonmwork kernel: RAX: 0000000000000000 RBX: ffffa0526fd67c00 RCX: ffffa6a780707cb4 
Dec 09 23:30:33 jonmwork kernel: RDX: ffffa6a780707c60 RSI: ffffa6a78700e5d4 RDI: 0000000001009007
Dec 09 23:30:33 jonmwork kernel: RBP: ffffa05268fda800 R08: 0000000000000000 R09: ffffa6a780707cb4
Dec 09 23:30:33 jonmwork kernel: R10: 0000000000000000 R11: ffffa0526865e400 R12: ffffa0526d65c000
Dec 09 23:30:33 jonmwork kernel: R13: ffffa0526e060800 R14: ffffa05268fda800 R15: ffffa0526b81e000
Dec 09 23:30:33 jonmwork kernel: FS:  0000000000000000(0000) GS:ffffa0527ff80000(0000) knlGS:0000000000000000
Dec 09 23:30:33 jonmwork kernel: CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
Dec 09 23:30:33 jonmwork kernel: CR2: 000056207a61c4e9 CR3: 0000000873744002 CR4: 00000000001706e0
Dec 09 23:30:33 jonmwork kernel: Call Trace:
Dec 09 23:30:33 jonmwork kernel:  nouveau_connector_detect+0xad/0x540 [nouveau]
Dec 09 23:30:33 jonmwork kernel:  ? __flush_work.isra.0+0x189/0x210
Dec 09 23:30:33 jonmwork kernel:  drm_helper_probe_detect_ctx+0x96/0x100 [drm_kms_helper]
Dec 09 23:30:33 jonmwork kernel:  drm_helper_hpd_irq_event+0xe9/0x1c0 [drm_kms_helper]
Dec 09 23:30:33 jonmwork kernel:  nouveau_connector_hotplug+0x144/0x240 [nouveau]
Dec 09 23:30:33 jonmwork kernel:  nvif_notify_work+0x2a/0xb0 [nouveau]
Dec 09 23:30:33 jonmwork kernel:  ? preempt_count_add+0x68/0xa0
Dec 09 23:30:33 jonmwork kernel:  process_one_work+0x1da/0x3d0
Dec 09 23:30:33 jonmwork kernel:  worker_thread+0x4d/0x3d0
Dec 09 23:30:33 jonmwork kernel:  ? rescuer_thread+0x410/0x410
Dec 09 23:30:33 jonmwork kernel:  kthread+0x142/0x160
Dec 09 23:30:33 jonmwork kernel:  ? __kthread_bind_mask+0x60/0x60
Dec 09 23:30:33 jonmwork kernel:  ret_from_fork+0x22/0x30
Dec 09 23:30:33 jonmwork kernel: ---[ end trace 09bef4c96b8a88a4 ]---
Dec 09 23:30:33 jonmwork kernel: nouveau 0000:01:00.0: DRM: DDC responded, but no EDID for DP-1

More from journal and trace:

systemd-coredump[2174]: Process 690 (sway) of user 1000 dumped core.

    Stack trace of thread 690:
    #0  0x00007fcc84dfd3fc n/a (libgbm.so.1 + 0x53fc)
    #1  0x00007fcc85703477 drm_fb_clear (libwlroots.so.7 + 0x39477)
    #2  0x00007fcc857030df drm_plane_finish_surface (libwlroots.so.7 + 0x390df)
    #3  0x00007fcc856ffa8d dealloc_crtc (libwlroots.so.7 + 0x35a8d)
    #4  0x00007fcc85701c02 drm_connector_cleanup (libwlroots.so.7 + 0x37c02)
    #5  0x00007fcc856ff95c drm_connector_destroy (libwlroots.so.7 + 0x3595c)
    #6  0x00007fcc85743787 wlr_output_destroy (libwlroots.so.7 + 0x79787)
    #7  0x00007fcc856fbe17 backend_destroy (libwlroots.so.7 + 0x31e17)
    #8  0x00007fcc856fa66a wlr_backend_destroy (libwlroots.so.7 + 0x3066a)
    #9  0x00007fcc8570aa6d multi_backend_destroy (libwlroots.so.7 + 0x40a6d)
    #10 0x00007fcc8570abed handle_display_destroy (libwlroots.so.7 + 0x40bed)
    #11 0x00007fcc85098e0f n/a (libwayland-server.so.0 + 0x8e0f)
    #12 0x00007fcc850995a7 wl_display_destroy (libwayland-server.so.0 + 0x95a7)
    #13 0x0000561aac2c2800 server_fini (sway + 0x20800)
    #14 0x0000561aac2c1f68 main (sway + 0x1ff68)
    #15 0x00007fcc84e6f152 __libc_start_main (libc.so.6 + 0x28152)
    #16 0x0000561aac2b350e _start (sway + 0x1150e)

    Stack trace of thread 715:
    #0  0x00007fcc84b5c6a2 pthread_cond_wait@@GLIBC_2.3.2 (libpthread.so.0 + 0xf6a2)
    #1  0x00007fcc7951c72c n/a (nouveau_dri.so + 0x4ed72c)
    #2  0x00007fcc7951aef8 n/a (nouveau_dri.so + 0x4ebef8)
    #3  0x00007fcc84b563e9 start_thread (libpthread.so.0 + 0x93e9)
    #4  0x00007fcc84f47293 __clone (libc.so.6 + 0x100293)

    Stack trace of thread 716:
    #0  0x00007fcc84b5c6a2 pthread_cond_wait@@GLIBC_2.3.2 (libpthread.so.0 + 0xf6a2)
    #1  0x00007fcc7951c72c n/a (nouveau_dri.so + 0x4ed72c)
    #2  0x00007fcc7951aef8 n/a (nouveau_dri.so + 0x4ebef8)
    #3  0x00007fcc84b563e9 start_thread (libpthread.so.0 + 0x93e9)
    #4  0x00007fcc84f47293 __clone (libc.so.6 + 0x100293)

    Stack trace of thread 714:
    #0  0x00007fcc84b5c6a2 pthread_cond_wait@@GLIBC_2.3.2 (libpthread.so.0 + 0xf6a2)
    #1  0x00007fcc7951c72c n/a (nouveau_dri.so + 0x4ed72c)
    #2  0x00007fcc7951aef8 n/a (nouveau_dri.so + 0x4ebef8)
    #3  0x00007fcc84b563e9 start_thread (libpthread.so.0 + 0x93e9)
    #4  0x00007fcc84f47293 __clone (libc.so.6 + 0x100293)

    Stack trace of thread 717:
    #0  0x00007fcc84b5c6a2 pthread_cond_wait@@GLIBC_2.3.2 (libpthread.so.0 + 0xf6a2)
    #1  0x00007fcc7951c72c n/a (nouveau_dri.so + 0x4ed72c)
    #2  0x00007fcc7951aef8 n/a (nouveau_dri.so + 0x4ebef8)
    #3  0x00007fcc84b563e9 start_thread (libpthread.so.0 + 0x93e9)
    #4  0x00007fcc84f47293 __clone (libc.so.6 + 0x100293)

gdb.txt

Edit: Formatting and split trace file

#0  0x00007fcc84dfd3fc in  () at /usr/lib/libgbm.so.1
#1  0x00007fcc85703477 in drm_fb_clear (fb=0x561aad575518) at ../subprojects/wlroots/backend/drm/renderer.c:295
        __PRETTY_FUNCTION__ = "drm_fb_clear"
#2  0x00007fcc857030df in drm_plane_finish_surface (plane=0x561aad575480) at ../subprojects/wlroots/backend/drm/renderer.c:211
#3  0x00007fcc856ffa8d in dealloc_crtc (conn=0x561aae4a88a0) at ../subprojects/wlroots/backend/drm/drm.c:1074
        drm = 0x561aad574970
#4  0x00007fcc85701c02 in drm_connector_cleanup (conn=0x561aae4a88a0) at ../subprojects/wlroots/backend/drm/drm.c:1622
        mode = 0x561aae4a8940
        tmp = 0x561aae4a8940
#5  0x00007fcc856ff95c in drm_connector_destroy (output=0x561aae4a88a0) at ../subprojects/wlroots/backend/drm/drm.c:1027
        conn = 0x561aae4a88a0
#6  0x00007fcc85743787 in wlr_output_destroy (output=0x561aae4a88a0) at ../subprojects/wlroots/types/wlr_output.c:395
        cursor = 0x561aae4a8ae0
        tmp_cursor = 0x561aae4a8ae0
#7  0x00007fcc856fbe17 in backend_destroy (backend=0x561aad574970) at ../subprojects/wlroots/backend/drm/backend.c:41
        drm = 0x561aad574970
        conn = 0x561aae4a88a0
        next = 0x561aae43cd20
#8  0x00007fcc856fa66a in wlr_backend_destroy (backend=0x561aad574970) at ../subprojects/wlroots/backend/backend.c:47
#9  0x00007fcc8570aa6d in multi_backend_destroy (wlr_backend=0x561aacd4b2d0) at ../subprojects/wlroots/backend/multi/backend.c:57
        sub = 0x561aadb86b70
        backend = 0x561aacd4b2d0
#10 0x00007fcc8570abed in handle_display_destroy (listener=0x561aacd4b320, data=0x561aacd4b1f0)
    at ../subprojects/wlroots/backend/multi/backend.c:110
        backend = 0x561aacd4b2d0
#11 0x00007fcc85098e0f in  () at /usr/lib/libwayland-server.so.0
#12 0x00007fcc850995a7 in wl_display_destroy () at /usr/lib/libwayland-server.so.0
#13 0x0000561aac2c2800 in server_fini (server=0x561aac33a320 <server>) at ../sway/server.c:203
#14 0x0000561aac2c1f68 in main (argc=1, argv=0x7ffc9fa741b8) at ../sway/main.c:417

With drm refactor that happened today, my external monitors started flashing (gray and black). So looks like we are moving in the right direction :grin:

OK, thanks for trying new commits. Can you once again obtain Sway debug logs plus a dmesg dump?

Log file and trace for crash. Not sure if the garbled screen and crash are related.

sway.log
gdb.txt

dmesg dump:

[  727.450384] ------------[ cut here ]------------
[  727.450449] WARNING: CPU: 6 PID: 2749 at drivers/gpu/drm/nouveau/include/nvkm/subdev/i2c.h:172 nouveau_dp_detect+0xa3/0x240 [nouveau]
[  727.450449] Modules linked in: rfcomm hid_logitech_hidpp cmac algif_hash algif_skcipher af_alg bnep 8021q garp mrp stp llc joydev hid_logitech_dj intel_rapl_msr intel_rapl_common mousedev x86_pkg_temp_thermal intel_powerclamp btusb coretemp btrtl kvm_intel btbcm btintel bluetooth kvm snd_hda_codec_realtek uvcvideo snd_hda_codec_generic iwlmvm irqbypass ecdh_generic ledtrig_audio snd_usb_audio ecc videobuf2_vmalloc ofpart mmc_block hid_generic videobuf2_memops cmdlinepart i915 videobuf2_v4l2 nouveau snd_usbmidi_lib snd_hda_codec_hdmi videobuf2_common crct10dif_pclmul snd_rawmidi crc32_pclmul intel_spi_platform mac80211 mei_hdcp mei_wdt at24 videodev snd_hda_intel snd_seq_device intel_spi ghash_clmulni_intel iTCO_wdt spi_nor snd_intel_dspcfg aesni_intel usbhid mc intel_pmc_bxt libarc4 mtd hid snd_hda_codec crypto_simd iTCO_vendor_support cryptd iwlwifi glue_helper ttm snd_hda_core ppdev i2c_algo_bit hp_wmi rapl drm_kms_helper mxm_wmi wmi_bmof sparse_keymap snd_hwdep tpm_infineon intel_cstate
[  727.450476]  cfg80211 snd_pcm intel_uncore pcspkr cec snd_timer rc_core intel_gtt snd i2c_i801 syscopyarea sysfillrect sysimgblt psmouse input_leds mei_me e1000e rfkill fb_sys_fops soundcore lpc_ich i2c_smbus parport_pc tpm_tis mei parport battery evdev tpm_tis_core hp_accel mac_hid lis3lv02d tpm ac wmi hp_wireless rng_core drm sg crypto_user agpgart fuse ip_tables x_tables ext4 crc32c_generic crc16 mbcache jbd2 rtsx_pci_sdmmc mmc_core serio_raw atkbd libps2 crc32c_intel xhci_pci sr_mod xhci_pci_renesas cdrom rtsx_pci xhci_hcd ehci_pci ehci_hcd i8042 serio
[  727.450499] CPU: 6 PID: 2749 Comm: kworker/6:0 Not tainted 5.9.14-arch1-1 #1
[  727.450500] Hardware name: Hewlett-Packard HP ZBook 17 G2/2255, BIOS M70 Ver. 01.26 03/03/2020
[  727.450524] Workqueue: events nvif_notify_work [nouveau]
[  727.450565] RIP: 0010:nouveau_dp_detect+0xa3/0x240 [nouveau]
[  727.450567] Code: 8d 4c 24 0c 4c 8d 44 24 10 4c 89 ef ba 09 00 00 00 be 01 00 00 00 e8 2c 0a f8 ff 85 c0 0f 85 55 01 00 00 80 7c 24 0c 08 74 02 <0f> 0b 4c 89 ef e8 c3 07 f8 ff 44 0f b6 44 24 11 0f b6 4c 24 12 8b
[  727.450568] RSP: 0018:ffffabc2c4c77ca8 EFLAGS: 00010293
[  727.450569] RAX: 0000000000000000 RBX: ffff9a89f44d2600 RCX: ffffabc2c4c77cb4
[  727.450570] RDX: ffffabc2c4c77c60 RSI: ffffabc2c600e5d4 RDI: 0000000001009007
[  727.450571] RBP: ffff9a89eb769000 R08: 0000000000000000 R09: ffffabc2c4c77cb4
[  727.450572] R10: 0000000000000000 R11: ffff9a89e6519900 R12: ffff9a89fc128000
[  727.450572] R13: ffff9a89eb557000 R14: ffff9a89eb769000 R15: ffff9a89e897b000
[  727.450574] FS:  0000000000000000(0000) GS:ffff9a89fff80000(0000) knlGS:0000000000000000
[  727.450574] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[  727.450575] CR2: 0000560c8f23f7e0 CR3: 000000080640e004 CR4: 00000000001706e0
[  727.450576] Call Trace:
[  727.450621]  nouveau_connector_detect+0xad/0x540 [nouveau]
[  727.450626]  ? __flush_work.isra.0+0x189/0x210
[  727.450641]  drm_helper_probe_detect_ctx+0x96/0x100 [drm_kms_helper]
[  727.450649]  drm_helper_hpd_irq_event+0xe9/0x1c0 [drm_kms_helper]
[  727.450692]  nouveau_connector_hotplug+0x144/0x240 [nouveau]
[  727.450719]  nvif_notify_work+0x2a/0xb0 [nouveau]
[  727.450722]  ? preempt_count_add+0x68/0xa0
[  727.450724]  process_one_work+0x1da/0x3d0
[  727.450726]  worker_thread+0x4d/0x3d0
[  727.450728]  ? rescuer_thread+0x410/0x410
[  727.450731]  kthread+0x142/0x160
[  727.450734]  ? __kthread_bind_mask+0x60/0x60
[  727.450737]  ret_from_fork+0x22/0x30
[  727.450740] ---[ end trace 0e31752dfca9d5f5 ]---
[  727.450792] nouveau 0000:01:00.0: DRM: DDC responded, but no EDID for DP-1

For the crash, compiling with ASan might help figuring out what happens, this sounds like a possible use-after-free.

For the crash, compiling with ASan might help figuring out what happens, this sounds like a possible use-after-free.

Ok, I'll give that a shot and report back. As far as the garbled external displays are concerned they look similar to the picture attached to this report:

https://github.com/swaywm/wlroots/issues/2451

Edit: External displays used to be completely blank. Post drm refactor, now they look like the picture in the above report.

For some reason I'm unable to generate a dump with symbols attached with Asan build. I'm trying to figure out what the problem is, but for now, this is what is logged in the Sway debug log:

sway: ../libdrm-2.4.103/nouveau/pushbuf.c:723: nouveau_pushbuf_data: Assertion `kref' failed.
00:00:29.072 [ERROR] [common/ipc-client.c:87] Unable to receive IPC response
(EE) failed to read Wayland events: Broken pipe

I guess symbols are stripped with ASan builds. I'm attaching the full log in the hope that there will be something there to give you some idea of why my monitors are blank.
sway.log

AddressSanitizer:DEADLYSIGNAL
=================================================================
==1160==ERROR: AddressSanitizer: SEGV on unknown address 0x7fcff2b841a0 (pc 0x7fcff6c8a3fc bp 0x607000621670 sp 0x7ffe502af100 T0)
==1160==The signal is caused by a READ memory access.
    #0 0x7fcff6c8a3fc  (/usr/lib/libgbm.so.1+0x53fc)
    #1 0x7fcff77bee82 in buffer_destroy ../subprojects/wlroots/render/gbm_allocator.c:58
    #2 0x7fcff7849d91 in buffer_consider_destroy ../subprojects/wlroots/types/wlr_buffer.c:26
    #3 0x7fcff7849e5a in wlr_buffer_drop ../subprojects/wlroots/types/wlr_buffer.c:36
    #4 0x7fcff77c8e25 in slot_reset ../subprojects/wlroots/render/swapchain.c:43
    #5 0x7fcff77c8e88 in wlr_swapchain_destroy ../subprojects/wlroots/render/swapchain.c:52
    #6 0x7fcff77e0a11 in finish_drm_surface ../subprojects/wlroots/backend/drm/renderer.c:110
    #7 0x7fcff77e150e in drm_plane_finish_surface ../subprojects/wlroots/backend/drm/renderer.c:198
    #8 0x7fcff77d9710 in dealloc_crtc ../subprojects/wlroots/backend/drm/drm.c:1066
    #9 0x7fcff77d9246 in drm_connector_destroy_output ../subprojects/wlroots/backend/drm/drm.c:1009
    #10 0x7fcff7878c19 in wlr_output_destroy ../subprojects/wlroots/types/wlr_output.c:393
    #11 0x7fcff77de460 in disconnect_drm_connector ../subprojects/wlroots/backend/drm/drm.c:1557
    #12 0x7fcff77de4e2 in destroy_drm_connector ../subprojects/wlroots/backend/drm/drm.c:1563
    #13 0x7fcff77cfcc5 in backend_destroy ../subprojects/wlroots/backend/drm/backend.c:41
    #14 0x7fcff77cc54a in wlr_backend_destroy ../subprojects/wlroots/backend/backend.c:47
    #15 0x7fcff77f249d in multi_backend_destroy ../subprojects/wlroots/backend/multi/backend.c:57
    #16 0x7fcff77f2764 in handle_display_destroy ../subprojects/wlroots/backend/multi/backend.c:110
    #17 0x7fcff714ce0e  (/usr/lib/libwayland-server.so.0+0x8e0e)
    #18 0x7fcff714d5a6 in wl_display_destroy (/usr/lib/libwayland-server.so.0+0x95a6)
    #19 0x564f05078c5d in server_fini ../sway/server.c:203
    #20 0x564f050773d0 in main ../sway/main.c:436
    #21 0x7fcff6f23151 in __libc_start_main (/usr/lib/libc.so.6+0x28151)
    #22 0x564f0505667d in _start (/usr/local/bin/sway+0x4067d)

Oh good. Thanks! Does this explain the blank screens? I'm surprised nobody else has run into this problem.

No, this doesn't explain the blank screens.

Ok, thanks. I got some time to bisect for the blank monitors issue and this is the offending commit:

https://github.com/swaywm/wlroots/commit/ef846a883950e59f95507daa6d3f96f0e84da3af

(I bisected by building against: https://github.com/swaywm/sway/commit/9d6787d10d3800ff4873ad6ac3abe4b096090427)

I'm personally hitting this issue: https://gitlab.freedesktop.org/drm/nouveau/-/issues/36

Please try with just Nouveau: export WLR_DRM_DEVICES=/dev/dri/card0 (assuming card0 is the NVIDIA one, check with drm_info). Please also try with export WLR_NO_HARDWARE_CURSORS=1. Monitor dmesg for anything coming from Nouveau.

The bug seems related to the cursor plane. WLR_NO_HARDWARE_CURSORS=1 fixes it for me, and I'm even able to run a multi-GPU amdgpu+nouveau setup. I also had to set WLR_DRM_NO_MODIFIERS=1 (otherwise the INVALID_STATE error above is triggered) and to use Mesa master (otherwise a segfault in radeonsi gbm_bo_create_with_modifiers happens).

OK, spoke too soon. After more testing:

  • nouveau only, WLR_DRM_NO_MODIFIERS=1, WLR_NO_HARDWARE_CURSORS=0: no black screen
  • amdgpu+nouveau, WLR_DRM_NO_MODIFIERS=1, WLR_NO_HARDWARE_CURSORS=0: no black screen

However, after hovering a client that changes the cursor image (my terminal), the whole machine freezes. WLR_NO_HARDWARE_CURSORS=1 would prevent that.

However, after hovering a client that changes the cursor image (my terminal), the whole machine freezes. WLR_NO_HARDWARE_CURSORS=1 would prevent that.

Is this freeze specific to amdgpu? I'm not seeing this on nouveau with only WLR_DRM_NO_MODIFIERS=1 set.

Hm, maybe. I'll re-try with nouveau only.

Did WLR_DRM_NO_MODIFIERS=1 help in your case?

Did WLR_DRM_NO_MODIFIERS=1 help in your case?

Yes. External monitors display fine and cursor is good too. I just tried it briefly with my terminal and the cursor change didn't trigger any freeze. I'll keep an eye out.

Looks like programs running under xwayland are not registering the cursor on external monitors. The cursor behaves as expected visually, but clicks don't register. I have to move the program to the primary monitor before clicks register. I think I've seen this before but can't find an open issue. I can't verify if it is related to WLR_DRM_NO_MODIFIERS=1 workaround for obvious reasons.

Could it be because the x or y position of the external monitor is negative? I remember that was a bug with Xwayland which caused pointer events to be ignored.

Could it be because the x or y position of the external monitor is negative? I remember that was a bug with Xwayland which caused pointer events to be ignored.

Do you mean Renderer v6 does not like this, because it was working fine at least before the switch. It is also possible the switch itself did not cause this. I'll try and bisect and test with WLR_DRM_NO_MODIFIERS=1.

https://gitlab.freedesktop.org/xorg/xserver/-/issues/899 this was like a year ago, so its most probably not this if your setup was working fine before

Changes to the DRM code should have absolutely no impact on input events. DRM is completely separate from everything related to imput.

ok, thanks. I'll bisect and file a separate report.

So I just tested on i915+nouveau with WLR_DRM_NO_MODIFIERS=1:

  • external monitor displays perfectly
  • pointer events on Xwayland on the external monitor seem fine
  • however: my cursor disappears when inside Xwayland windows on external monitor (is this the exact opposite of what @J0nnyMak0 reported? Seems fishy)

my cursor disappears when inside Xwayland windows on external monitor

You're probably hitting https://github.com/swaywm/wlroots/issues/2525.

I've investigated more the nouveau INVALID_STATE issue today (no multi-GPU, just nouveau). Here are the bugs encountered along the way:

https://github.com/swaywm/wlroots/commit/e128e6c08dc0a735b1a8c6cc61097eaf0f61fb83 has killed the WLR_DRM_NO_MODIFIERS=1 workaround. External monitors are again dead starting with this commit :cry:

I've noticed it's been broken as well during my daily testing. I've found that https://github.com/swaywm/wlroots/pull/2652 helped, but got some kernel oops past that. Maybe try if that helps?

Oh, wait, I see what happens. init_drm_renderer may initialize a renderer for the parent GPU instead of the local GPU. I'll try to come up with a fix.

https://github.com/swaywm/wlroots/blob/32c30481d397d545b368ee0e328f485923c0e8c6/backend/drm/renderer.c#L31

Is this issue still relevant?

Is this issue still relevant?

I think this can be closed, since the modifiers issue is upstream.

Was this page helpful?
0 / 5 - 0 ratings