Xen guest paravirtualized framebuffer with GEM

Ben Guthro ben at guthro.net
Wed Mar 20 08:38:19 PDT 2013


Background:
In order for me to properly ask this question, let me first describe what we
are trying to accomplish.

We (Citrix XenClient Enterprise team http://www.citrix.com/xenclient ) are
attempting to use Xen, in combination with GEM to get a zero copy
paravirtualized rendering path from a guest framebuffer running on a local
machine where the guest takes up a full screen window in Xorg.

The intent here is to ultimately
  a. Get GEM to manage the memory in GTT space
  b. Get the guest framebuffer to render into that memory
  c. Get that memory displayed on an X window

The approach we have taken thus far is
1. Modify libdrm/i915 kernel driver to have a new ioctl that will return an
array of pfns for the pages in a gem object

2. Modify Xen to allow access to pages from multiple domains, similar to
the suggestion in this thread:
http://www.gossamer-threads.com/lists/xen/devel/215894?do=post_view_threaded#215894

3. Modify qemu to
   a. Create a gem object.
   b. Map the gem object.
   c. Pin the gem object.
   d. Get the pfns of the gem object, as described in 1.
   e. Add these pfns to the guest's framebuffer

And so we come to the problem - how do you get this buffer on screen?

Ideally, this would be mapped to some GL buffer, so we could use the
standard GLX calls to manipulate this data.

However, since all of the APIs are hardware agnostic, I'm struggling to see
a path that allows us to take this GEM object, and create something we can
actually get on the screen.

The following post from Jessie Barnes provided some suggestions, but I'm
not sure it is entirely what we want:
http://virtuousgeek.org/blog/index.php/jbarnes/2011/10/31/writing_stanalone_programs_with_egl_and_

I also just also came across Chris Wilson's new proposed userptr ioctl.
https://patchwork.kernel.org/patch/2139711/
This seems very similar to what we did with the Xen specific
modification...but it is still not obvious to me how to take such an object
and turn it into something usable with OpenGL.

So this is my question -
>From a high level, does this sound like an approach that is viable?
If so - how would you recommend we go about that last bit about getting the
gem
object on screen?

If not - where do you see the architecture falling over?

Is there an easier way to do what we are trying to do?

Thanks for any insight you can provide.


Ben
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/dri-devel/attachments/20130320/8dbea643/attachment.html>


More information about the dri-devel mailing list