DisplayPort connection gets lost when using a KVM switch

Thanks for the replies. I managed to fix it by adding a custom modeline and applying it to X.org.

See: xrandr - ArchWiki

Here’s my configuration:

Section "Monitor"
    Identifier "DisplayPort-2"
    Modeline "3440x1440_144.00"  1086.75  3440 3744 4128 4816  1440 1443 1453 1568 -hsync +vsync
    Option "PreferredMode" "3440x1440_144.00"
EndSection

Section "Screen"
    Identifier "Screen0"
    Monitor "DisplayPort-2"
    DefaultDepth 24
    SubSection "Display"
        Modes "3440x1440_144.00"
    EndSubSection
EndSection

Section "Device"
     Identifier "AMD"
     Driver "amdgpu"
EndSection