[Spice-devel] RFC: Integrating Virgil and Spice

Gerd Hoffmann kraxel at redhat.com
Wed Oct 9 10:44:58 CEST 2013


On Mi, 2013-10-09 at 08:46 +1000, Dave Airlie wrote:
> > That leaves the question how to do single-card multihead.  I think the
> > most sensible approach here is to go the spice route, i.e. have one big
> > framebuffer and define scanout rectangles for the virtual monitors.
> > This is how real hardware works, and is also provides a natural fallback
> > mode for UIs not supporting scanout rectangles:  They show a single
> > window with the whole framebuffer, simliar to old spice clients.
> 
> No real hw doesn't work like that, that is how we program real hw at the moment,
> but for example wayland won't do this, and neither does Windows mostly,
> 
> real hw can have multiple separate framebuffers with separate strides,
> and separate
> scanouts from them, and the kms device drivers fully support this mode
> of operation,
> just the X server prevents it from being useable.

Ok.  So scratch that idea.  It's probably better to have the gfx card
register multiple QemuConsoles then (one for each virtual connector),
with some infrastructure bits in the ui core + frontends to allow
enabling/disabling them.

> The other thing is for virgil to work at all we need to render the
> whole console using
> GL interfaces, at the moment I just use glDrawPixels in the SDL ui
> update when in GL
> mode, so there is no direct access to the framebuffer in this case
> anyways, its all
> just GL rendered.

When the guests virtual gfx card doesn't let the gpu render into a
dma-buf we have to copy the bits anyway.  Ideally just memcpy from guest
framebuffer to a dma-buf (not sure drm allows that), so we can hand out
a dma-buf handle for rendering no matter whenever the guest uses virgil
or cirrus.

> > Second, you can have your scanout framebuffer in main memory.  That
> > isn't a problem at all.  It only needs to be contiguous in guest
> > physical memory, scatter-gather for the framebuffer isn't going to fly.
> 
> Scatter-gather for the framebuffer is fine as long as
> its not VESA LFB. I already have virtio-vga device allocating a
> non-contig framebuffer
> and just using DMA operations to move data in/out.

Sure it's possible.  All qemu UIs want a linear framebuffer they can
operate on though.  So with scatter-gather you have to copy the data
into a linear buffer in qemu memory.  Without scatter-gather you can
pass a reference to guest memory to the UIs and avoid the extra copy.

May not matter if you offload the work to the gpu anyway.

What is virtio-vga btw?  The virgil virtual vga device or something
else?

cheers,
  Gerd




More information about the Spice-devel mailing list