I've been having a lot of problems with DisplayPort KVMs. I have a 4K monitor and at the time of purchase, I think DisplayPort had better specs. But there are very few KVMs at the 4K resolution. The one I got was literally a switch in the sense that it didn't emulate the video and usb on the disconnected side. There seems to be lots of problems with disconnected DisplayPort devices and drivers. For Linux I found that shutting off the monitor would result in the video not coming back on unless I manually did a "xset dpms" call through ssh. In the end I now got a cheap second monitor and a USB switch for the keyboard/mouse. It just takes up a lot more space.

Now that you have a second monitor, might as well use Synergy for keyboard and mouse sharing!

https://symless.com/synergy

That product is walking dead. Use https://github.com/debauchee/barrier which forked the last open source version.