Unplugging the main graphics device

Michael Thayer michael.thayer at oracle.com
Mon Feb 22 12:20:56 UTC 2016

On 19.02.2016 16:16, Michael Thayer wrote:
> I have been experimenting a bit with plugging and unplugging of graphics
> devices (using a dummy KMS driver which is udl stripped of the actual
> hardware poking) and how the X server copes with that.  It seems to cope
> well with a secondary device being removed, but not with the only
> graphics device in the system disappearing (in that case the
> hot-pluggable device is not deemed to be a GPU device, and therefore not
> removable if I understood what is happening correctly).
> This is interesting for me because I am looking at putting a KMS driver
> for the VirtualBox video device into the upstream kernel, but would like
> to be able to update the driver at run-time, so that we are not stuck
> with whatever version some guest distribution which is no longer being
> updated happens to provide.  My first idea for handling this was to
> simulate a device unplug so that the old driver could be removed and the
> new one added.  (Not sure if I am handling the hotplug right in the
> vboxvideo driver yet of course, but I assume that my dummy driver, which
> just copies code from udl, does get it right.)
> I will take a look at this when I get a chance of course, but I thought
> I would write to the list before that in case anyone else has thoughts,
> ideas or fixes (potenially including how I could better handle the
> driver update).

Re-reading the X server code a couple of days later makes it clear that 
this is intended.  The question is how I should best deal with this. 
Would people be open to having the first graphics device hot-removable 
too?  Obviously there are other use cases for this, like using 
DisplayLink with a headless embedded device.  But I realise that the X 
server was designed with the assumption that this will not happen.  Any 
other suggestions?  I doubt having a dummy first device which can stay 
in place would go down well elsewhere.

> Regards,
> Michael

Michael Thayer | VirtualBox engineer
ORACLE Deutschland B.V. & Co. KG | Werkstr. 24 | D-71384 Weinstadt

ORACLE Deutschland B.V. & Co. KG
Hauptverwaltung: Riesstraße 25, D-80992 München
Registergericht: Amtsgericht München, HRA 95603

Komplementärin: ORACLE Deutschland Verwaltung B.V.
Hertogswetering 163/167, 3543 AS Utrecht, Niederlande
Handelsregister der Handelskammer Midden-Nederland, Nr. 30143697
Geschäftsführer: Alexander van der Ven, Jan Schultheiss, Val Maher

More information about the xorg-devel mailing list