I use Arch Linux with the 5.2.5 stock kernel, Cinnamon 4.2.3, LightDM 1.30.0 and Mesa 19.1.3. My GPU is a Radeon RX 550 2GB.
Sometimes, my desktop freezes as if there's a problem with the GPU or the graphics driver. This happens when I'm using the Cinnamon desktop, or sometimes when the screen is locked as well. Not only it freezes, but whatever is being rendered to the screen gets visually corrupted (it closely resembles the last image that was displayed on the screen, but is corrupted and static).
I've been getting this since I first bought this graphics card almost two years ago. At first, there was nothing I could do about it, except a hard reset. But, since a couple of months ago, I noticed I could switch to a tty console (this was not possible with previous versions of the kernel or mesa) and then issue
systemctl restart lightdm. This gives me a new X.org session with valid display output and I can login and resume my work.
Except, everything I was working on during the X.org session gets closed without saving.
Is there a way to perhaps restart the graphics driver itself, without losing the X server session?