Unplugging the main graphics device

Dave Airlie airlied at gmail.com
Mon Feb 22 20:29:06 UTC 2016


On 22 February 2016 at 22:20, Michael Thayer <michael.thayer at oracle.com> wrote:
> 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.
>

Install driver, ask user to reboot.

Trying to remove the first screen from X is a long and insanity
inspiring process.

I've spent months hacking up something that lets us migrate stuff from screen A
to screen B, but it's really messy and the current X server code doesn't lend
itself to it at all, so I pretty much gave up the last time I tried.

Dave.


More information about the xorg-devel mailing list