[Spice-devel] RFC: Integrating Virgil and Spice

Dave Airlie airlied at gmail.com
Wed Oct 9 00:40:36 CEST 2013


> I've already had a quick discussion about this with Dave Airlie, and
> our ideas on this aligned perfectly.
>
> The basic idea is to use qemu's console layer (include/ui/console.h)
> as an abstraction between the new virtio-vga device Dave has in mind
> (which will include optional 3D rendering capability through VIRGIL),
> and various display options, ie SDL, vnc and Spice.
>
> The console layer would need some extensions for this:
>
> 1) Multi head support, a question which comes up here, is do we only
> add support for multiple heads on a single card, or do we also want
> to support multiple cards each driving a head here ? I myself tend
> to go with the KISS solution for now and only support a single
> card with multiple heads.

I'm thinking it shouldn't be a major enhancement to go for
multiple-cards with multiple-heads,
I'm not sure its a worthy goal in the real world though, but it might
be nice for testing corner cases.

>
> 2) The ability for a video-card generating output to pass a dma-buf
> context to the display (ui in qemu terms) to get the contents from,
> rather then requiring the contents to be rendered to some memory
> buffer. This way we can save the quite expensive read-back from gpu
> memory of the rendered result and then copying that back to the
> framebuffer of the gpu for local displays (ie gtk, SDL), we would
> of course still need the read back of the rendered output for
> vnc / spice.

Well at the moment I'm just using SDL/GLX inside the qemu process to talk direct
to the X server, this isn't suitable long term for VMs that aren't
running directly on the
desktop,

So the longer term plan is to abstract the GLX bits away and hopefully
with SDL2.0,
use EGL to talk to the GPU device, now it could still use GLX for
local testing VMs,
but in the libvirt situation the qemu process running as the qemu user
would talk to the
new drm rendernodes via EGL, then using an EGL extension export the scanout
buffer via dma-buf (hand wavy magic not withstanding). There are some
EGL extensions
in the works for this. Then we'd just need to make the libvirt viewer
use EGL/GLX so
it can actually render the scanout buffer to the screen.

> For proper multi-head support in the ui layer for local displays,
> we will need to use SDL-2, either by porting the current SDL ui code
> to SDL-2, or by introducing a new SDL-2 ui component.

I've done an initial SDL2 port already just using ifdef :)

http://cgit.freedesktop.org/~airlied/qemu/commit/?h=virtio-gpu&id=ee44399a3dbce8da810329230f0a439a3b88cd67

however the input side of SDL changed quite a bit and it needs a bit
more work, though if people are inclined
towards a separate sdl2.c I could do that I suppose. The other reason
I wanted SDL2.0 is it supports argb cursors.

Dave.


More information about the Spice-devel mailing list