disp: ERROR 5 [INVALID_STATE] with wlroots
wlroots changed its DRM backend lately and this makes nouveau unhappy.
To reproduce, compile latest commits of Sway and wlroots (https://github.com/swaywm/sway/wiki/Development-Setup#compiling-as-a-subproject), then start Sway.
wlroots allocates a buffer with GBM, exports it to a DMA-BUF, imports it via GBM, then creates a DRM FB out of it. This results in:
[ 498.977394] nouveau 0000:06:00.0: disp: ERROR 5 [INVALID_STATE] 09 [] chid 1 mthd 0080 data 00000001
[ 498.977398] nouveau 0000:06:00.0: disp: Base 1:
[ 498.977404] nouveau 0000:06:00.0: disp: 0084: 00000000
[ 498.977410] nouveau 0000:06:00.0: disp: 0088: 00000000
[ 498.977415] nouveau 0000:06:00.0: disp: 008c: 00000000
[ 498.977419] nouveau 0000:06:00.0: disp: 0090: 00000000
[ 498.977424] nouveau 0000:06:00.0: disp: 0094: 00000000
[ 498.977430] nouveau 0000:06:00.0: disp: 00a0: 00000060 -> 00000070
[ 498.977435] nouveau 0000:06:00.0: disp: 00a4: f0000000
[ 498.977440] nouveau 0000:06:00.0: disp: 00c0: fb000000
[ 498.977446] nouveau 0000:06:00.0: disp: 00c4: 00000000
[ 498.977451] nouveau 0000:06:00.0: disp: 00c8: 00000000
[ 498.977456] nouveau 0000:06:00.0: disp: 00cc: 00000000
[ 498.977462] nouveau 0000:06:00.0: disp: 00e0: 40000000
[ 498.977467] nouveau 0000:06:00.0: disp: 00e4: 00000000
[ 498.977472] nouveau 0000:06:00.0: disp: 00e8: 00000000
[ 498.977477] nouveau 0000:06:00.0: disp: 00ec: 00000000
[ 498.977482] nouveau 0000:06:00.0: disp: 00fc: 00000000
[ 498.977487] nouveau 0000:06:00.0: disp: 0100: fffe0000
[ 498.977493] nouveau 0000:06:00.0: disp: 0104: 00000000
[ 498.977498] nouveau 0000:06:00.0: disp: 0110: 00000000
[ 498.977503] nouveau 0000:06:00.0: disp: 0114: 00000000
[ 498.977504] nouveau 0000:06:00.0: disp: Base 1 - Image 0:
[ 498.977510] nouveau 0000:06:00.0: disp: 0800: 00000600 -> 0003ce00
[ 498.977516] nouveau 0000:06:00.0: disp: 0804: 00000000
[ 498.977521] nouveau 0000:06:00.0: disp: 0808: 041a0690
[ 498.977526] nouveau 0000:06:00.0: disp: 080c: 00101b00 -> 00101a00
[ 498.977531] nouveau 0000:06:00.0: disp: 0810: 0000cf00
[ 498.977532] nouveau 0000:06:00.0: disp: Base 1 - Image 1:
[ 498.977538] nouveau 0000:06:00.0: disp: 0c00: 00000600 -> 0003ce00
[ 498.977543] nouveau 0000:06:00.0: disp: 0c04: 00000000
[ 498.977548] nouveau 0000:06:00.0: disp: 0c08: 041a0690
[ 498.977553] nouveau 0000:06:00.0: disp: 0c0c: 00101b00 -> 00101a00
[ 498.977558] nouveau 0000:06:00.0: disp: 0c10: 0000cf00
[ 500.976851] nouveau 0000:06:00.0: DRM: core notifier timeout
[ 502.976919] nouveau 0000:06:00.0: DRM: base-0: timeout
[ 503.000786] nouveau 0000:06:00.0: DRM: Moving pinned object 000000006921082c!
[ 503.092113] nouveau 0000:06:00.0: DRM: bo 000000006921082c pinned elsewhere: 0x00000001 vs 0x00000002
[ 503.387809] audit: type=1130 audit(1609942701.506:71): pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=rtkit-daemon comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
[ 503.574954] usb 3-4: reset high-speed USB device number 3 using xhci_hcd
[ 506.293781] nouveau 0000:06:00.0: DRM: base-0: timeout
[ 506.295828] ------------[ cut here ]------------
[ 506.295904] WARNING: CPU: 6 PID: 1952 at drivers/gpu/drm/nouveau/nouveau_bo.c:142 nouveau_bo_del_ttm+0xbb/0xd0 [nouveau]
[ 506.295905] Modules linked in: rfkill xt_tcpudp xt_state xt_conntrack nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 iptable_filter ext4 crc16 mbcache jbd2 nls_iso8859_1 vfat fat snd_hda_codec_realtek snd_hda_codec_generic ledtrig_audio snd_hda_codec_hdmi snd_hda_intel amdgpu snd_intel_dspcfg soundwire_intel soundwire_generic_allocation soundwire_cadence nouveau snd_hda_codec snd_hda_core soundwire_bus mxm_wmi wmi_bmof gpu_sched snd_usb_audio video snd_soc_core uvcvideo i2c_algo_bit snd_usbmidi_lib ttm edac_mce_amd videobuf2_vmalloc r8169 snd_hwdep videobuf2_memops videobuf2_v4l2 snd_rawmidi snd_compress snd_seq_device realtek drm_kms_helper videobuf2_common kvm_amd ac97_bus snd_pcm_dmaengine videodev snd_pcm cec kvm snd_timer mdio_devres syscopyarea irqbypass sysfillrect rapl snd sp5100_tco sysimgblt joydev mousedev pcspkr libphy soundcore k10temp mc i2c_piix4 fb_sys_fops gpio_amdpt mac_hid gpio_generic pinctrl_amd acpi_cpufreq wmi drm fuse agpgart bpf_preload ip_tables x_tables btrfs
[ 506.295980] blake2b_generic libcrc32c crc32c_generic xor raid6_pq dm_crypt cbc encrypted_keys dm_mod trusted tpm usbhid crct10dif_pclmul crc32_pclmul crc32c_intel ghash_clmulni_intel aesni_intel crypto_simd cryptd glue_helper ccp rng_core xhci_pci xhci_pci_renesas
[ 506.296002] CPU: 6 PID: 1952 Comm: sway Not tainted 5.10.4-arch2-1 #1
[ 506.296004] Hardware name: Gigabyte Technology Co., Ltd. B450M DS3H/B450M DS3H-CF, BIOS F42h 10/18/2019
[ 506.296071] RIP: 0010:nouveau_bo_del_ttm+0xbb/0xd0 [nouveau]
[ 506.296074] Code: 89 ef 41 c6 44 24 08 00 e8 62 6c 33 fa 48 83 7d 08 00 74 08 48 89 ef e8 53 96 5f ff 5b 48 89 ef 5d 41 5c 41 5d e9 f5 ee b5 f9 <0f> 0b e9 66 ff ff ff 66 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 00 0f
[ 506.296075] RSP: 0018:ffffa26e4ad7fe18 EFLAGS: 00010202
[ 506.296078] RAX: 0000000000000001 RBX: ffff8d1ed17b3800 RCX: 0000000000000000
[ 506.296079] RDX: 0000000000000002 RSI: 0000000080200003 RDI: ffff8d1ec0df2c00
[ 506.296081] RBP: ffff8d1ec0df2c00 R08: 0000000000000001 R09: 0000000000000000
[ 506.296082] R10: ffff8d1f1c0f2200 R11: 0000000000000001 R12: ffff8d1ec61c76d0
[ 506.296083] R13: ffff8d1ec0df2c00 R14: 0000000000014480 R15: 0000000000000000
[ 506.296086] FS: 00007fd43ff25a00(0000) GS:ffff8d21de980000(0000) knlGS:0000000000000000
[ 506.296088] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 506.296089] CR2: 00000c088005e5fb CR3: 0000000154152000 CR4: 0000000000350ee0
[ 506.296090] Call Trace:
[ 506.296104] ttm_bo_release+0x1d5/0x310 [ttm]
[ 506.296172] nouveau_gem_object_del+0x51/0x80 [nouveau]
[ 506.296201] drm_gem_dmabuf_release+0x36/0x50 [drm]
[ 506.296206] dma_buf_release+0x4a/0xd0
[ 506.296211] __dentry_kill+0xfb/0x170
[ 506.296214] __fput+0xdd/0x230
[ 506.296219] task_work_run+0x5c/0x90
[ 506.296222] exit_to_user_mode_prepare+0xf7/0x120
[ 506.296226] syscall_exit_to_user_mode+0x28/0x160
[ 506.296230] entry_SYSCALL_64_after_hwframe+0x44/0xa9
[ 506.296233] RIP: 0033:0x7fd440e1d72b
[ 506.296235] Code: 03 00 00 00 0f 05 48 3d 00 f0 ff ff 77 41 c3 48 83 ec 18 89 7c 24 0c e8 73 41 f9 ff 8b 7c 24 0c 41 89 c0 b8 03 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 35 44 89 c7 89 44 24 0c e8 d1 41 f9 ff 8b 44
[ 506.296237] RSP: 002b:00007ffcea92bb10 EFLAGS: 00000293 ORIG_RAX: 0000000000000003
[ 506.296239] RAX: 0000000000000000 RBX: 00007fd442571a20 RCX: 00007fd440e1d72b
[ 506.296241] RDX: 0000000000000002 RSI: 0000000000000000 RDI: 000000000000002b
[ 506.296242] RBP: 00007ffcea92bb60 R08: 0000000000000000 R09: 0000000000000000
[ 506.296244] R10: 000000000000001e R11: 0000000000000293 R12: 0000611000000e00
[ 506.296245] R13: 00000fff9d5257ea R14: 00007ffcea92cbb2 R15: 00007ffcea92bf50
[ 506.296248] ---[ end trace 636778ef5995eb90 ]---
Full dmesg: https://l.sr.ht/Etd7.log
Edited by Simon Ser