<div>Background:</div><div>In order for me to properly ask this question, let me first describe what we</div><div>are trying to accomplish.</div><div><br></div><div>We (Citrix XenClient Enterprise team <a href="http://www.citrix.com/xenclient">http://www.citrix.com/xenclient</a> ) 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.</div>
<div><br></div><div>The intent here is to ultimately</div><div>  a. Get GEM to manage the memory in GTT space</div><div>  b. Get the guest framebuffer to render into that memory</div><div>  c. Get that memory displayed on an X window</div>
<div><br></div><div>The approach we have taken thus far is</div><div>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</div><div><br></div><div>2. Modify Xen to allow access to pages from multiple domains, similar to the suggestion in this thread:</div>
<div><a href="http://www.gossamer-threads.com/lists/xen/devel/215894?do=post_view_threaded#215894">http://www.gossamer-threads.com/lists/xen/devel/215894?do=post_view_threaded#215894</a></div><div><br></div><div>3. Modify qemu to </div>
<div>   a. Create a gem object.</div><div>   b. Map the gem object.</div><div>   c. Pin the gem object.</div><div>   d. Get the pfns of the gem object, as described in 1.</div><div>   e. Add these pfns to the guest's framebuffer</div>
<div><br></div><div>And so we come to the problem - how do you get this buffer on screen?</div><div><br></div><div>Ideally, this would be mapped to some GL buffer, so we could use the standard GLX calls to manipulate this data.</div>
<div><br></div><div>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.</div><div><br></div>
<div>The following post from Jessie Barnes provided some suggestions, but I'm not sure it is entirely what we want:</div><div><a href="http://virtuousgeek.org/blog/index.php/jbarnes/2011/10/31/writing_stanalone_programs_with_egl_and_">http://virtuousgeek.org/blog/index.php/jbarnes/2011/10/31/writing_stanalone_programs_with_egl_and_</a></div>
<div><br></div><div>I also just also came across Chris Wilson's new proposed userptr ioctl. </div><div><a href="https://patchwork.kernel.org/patch/2139711/">https://patchwork.kernel.org/patch/2139711/</a></div><div>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.</div>
<div><br></div><div>So this is my question -</div><div>From a high level, does this sound like an approach that is viable?</div><div>If so - how would you recommend we go about that last bit about getting the gem</div><div>
object on screen?</div><div><br></div><div>If not - where do you see the architecture falling over?</div><div><br></div><div>Is there an easier way to do what we are trying to do?</div><div><br></div><div>Thanks for any insight you can provide.</div>
<div><br></div><div><br></div><div>Ben</div><div><br></div>