simpledrm, running display servers, and drivers replacing simpledrm while the display server is running

Thomas Zimmermann tzimmermann at suse.de
Fri May 10 07:32:02 UTC 2024


Hi

Am 09.05.24 um 15:06 schrieb nerdopolis:
>
> Hi
>
>
> So I have been made aware of an apparent race condition of some 
> drivers taking a bit longer to load, which could lead to a possible 
> race condition of display servers/greeters using the simpledrm device, 
> and then experiencing problems once the real driver loads, the 
> simpledrm device that the display servers are using as their primary 
> GPU goes away.
>
>
> For example Weston crashes, Xorg crashes, wlroots seems to stay 
> running, but doesn't draw anything on the screen, kwin aborts,
>
> This is if you boot on a QEMU machine with the virtio card, with 
> modprobe.blacklist=virtio_gpu, and then, when the display server is 
> running, run sudo modprobe virtio-gpu
>
>
> Namely, it's been recently reported here: 
> https://github.com/sddm/sddm/issues/1917 and here 
> https://github.com/systemd/systemd/issues/32509
>
>
> My thinking: Instead of simpledrm's /dev/dri/card0 device going away 
> when the real driver loads, is it possible for simpledrm to instead 
> simulate an unplug of the fake display/CRTC?
>

To my knowledge, there's no hotplugging for CRTCs.

> That way in theory, the simpledrm device will now be useless for 
> drawing for drawing to the screen at that point, since the real driver 
> is now taken over, but this way here, at least the display server 
> doesn't lose its handles to the /dev/dri/card0 device, (and then maybe 
> only remove itself once the final handle to it closes?)
>
>
> Is something like this possible to do with the way simpledrm works 
> with the low level video memory? Or is this not possible?
>

Userspace needs to be prepared that graphics devices can do hotplugging. 
The correct solution is to make compositors work without graphics devices.

The next best solution is to keep the final DRM device open until a new 
one shows up. All DRM graphics drivers with hotplugging support are 
required to accept commands after their hardware has been unplugged. 
They simply won't display anything.

Best regards
Thomas


>
> Thanks
>

-- 
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstrasse 146, 90461 Nuernberg, Germany
GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman
HRB 36809 (AG Nuernberg)



More information about the dri-devel mailing list