GPU hard crash when switching between 1 and 2 monitors
When switching between 1 and 2 monitors with an external DisplayPort switch, extreme flickering starts, one of the monitors is half black vertically, everything becomes increasingly unstable over a few seconds until a hard reboot is required.
03:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Navi 14 [Radeon RX 5500/5500M / Pro 5500M] (rev c5)
On Fedora 32 and kernel 5.7.8 with unrelated PCIe ACS patch (same with default, unpatched Fedora 32 kernel)
gnome-shell[2197]: meta_display_get_monitor_in_fullscreen: assertion 'monitor >= 0 && monitor < n_logical_monitors' failed
gnome-shell[2197]: meta_monitor_manager_get_logical_monitor_from_number: assertion '(unsigned int) number < g_list_length (manager->logical_monitors)' failed
gnome-shell[2197]: meta_workspace_get_work_area_for_monitor: assertion 'logical_monitor != NULL' failed
kernel: ------------[ cut here ]------------
kernel: WARNING: CPU: 9 PID: 2197 at drivers/gpu/drm/amd/amdgpu/../display/dc/dcn10/dcn10_mpc.c:197 mpc1_insert_plane+0x422/0x430 [amdgpu]
kernel: Modules linked in: uinput rfcomm xt_CHECKSUM xt_MASQUERADE xt_conntrack ipt_REJECT nf_nat_tftp nf_conntrack_tftp tun ccm nft_objref nf_conntrack_netbio>
kernel: snd_soc_acpi_intel_match snd_soc_acpi snd_soc_core btusb btrtl btbcm btintel bluetooth snd_compress ac97_bus snd_pcm_dmaengine i2c_i801 ecdh_generic e>
kernel: CPU: 9 PID: 2197 Comm: gnome-shell Not tainted 5.7.6-200.acsoverride.fc32.x86_64 #1
kernel: Hardware name: Gigabyte Technology Co., Ltd. Z490 AORUS MASTER/Z490 AORUS MASTER, BIOS F6a 06/22/2020
kernel: RIP: 0010:mpc1_insert_plane+0x422/0x430 [amdgpu]
kernel: Code: 40 50 8b b4 b2 d8 00 00 00 ba 01 00 00 00 e8 55 34 08 00 e9 ea fd ff ff 0f 0b 8b 93 38 4d 00 00 44 0f a3 ea 0f 83 28 fc ff ff <0f> 0b e9 21 fc ff>
kernel: RSP: 0018:ffffb07703a13760 EFLAGS: 00010207
kernel: RAX: 0000000000000006 RBX: ffffa0c724150000 RCX: 0000000000000000
kernel: RDX: 000000000000000b RSI: ffffa0c72427cb20 RDI: ffffa0c724150000
kernel: RBP: ffffa0c724280000 R08: 0000000000000000 R09: 0000000000000003
kernel: R10: 0000000000000003 R11: 0000000000000000 R12: ffffa0c72427cb20
kernel: R13: 0000000000000003 R14: ffffa0c72427cb20 R15: 0000000000000000
kernel: FS: 00007f17585a8d00(0000) GS:ffffa0c73da40000(0000) knlGS:0000000000000000
kernel: CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
kernel: CR2: 000056057d31a000 CR3: 00000010606a8002 CR4: 00000000007606e0
kernel: PKRU: 55555554
kernel: Call Trace:
kernel: dcn20_update_mpcc+0x13b/0x200 [amdgpu]
kernel: dcn20_program_front_end_for_ctx+0x671/0xa60 [amdgpu]
kernel: dc_commit_updates_for_stream+0xfaa/0x1910 [amdgpu]
kernel: amdgpu_dm_atomic_commit_tail+0x12f4/0x2220 [amdgpu]
kernel: commit_tail+0x94/0x130 [drm_kms_helper]
kernel: drm_atomic_helper_commit+0x113/0x140 [drm_kms_helper]
kernel: drm_atomic_helper_set_config+0x70/0xb0 [drm_kms_helper]
kernel: drm_mode_setcrtc+0x1cf/0x6c0 [drm]
kernel: ? drm_mode_getcrtc+0x180/0x180 [drm]
kernel: drm_ioctl_kernel+0x86/0xd0 [drm]
kernel: drm_ioctl+0x206/0x390 [drm]
kernel: ? drm_mode_getcrtc+0x180/0x180 [drm]
kernel: amdgpu_drm_ioctl+0x49/0x80 [amdgpu]
kernel: ksys_ioctl+0x82/0xc0
kernel: ? switch_fpu_return+0x46/0xc0
kernel: __x64_sys_ioctl+0x16/0x20
kernel: do_syscall_64+0x5b/0xf0
kernel: entry_SYSCALL_64_after_hwframe+0x44/0xa9
kernel: RIP: 0033:0x7f175c1b947b
kernel: Code: 0f 1e fa 48 8b 05 1d aa 0c 00 64 c7 00 26 00 00 00 48 c7 c0 ff ff ff ff c3 66 0f 1f 44 00 00 f3 0f 1e fa b8 10 00 00 00 0f 05 <48> 3d 01 f0 ff ff>
kernel: RSP: 002b:00007ffcf3dbccc8 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
kernel: RAX: ffffffffffffffda RBX: 00007ffcf3dbcd00 RCX: 00007f175c1b947b
kernel: RDX: 00007ffcf3dbcd00 RSI: 00000000c06864a2 RDI: 0000000000000009
kernel: RBP: 00000000c06864a2 R08: 0000000000000000 R09: 00005605815454e0
kernel: R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
kernel: R13: 0000000000000009 R14: 00005605815454e0 R15: 0000560581870010
kernel: ---[ end trace c6441dd2aeeeae33 ]---
Edited by Stéphane Travostino