qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH] (Experimental) Initial patch providing accelerated


From: Even Rouault
Subject: [Qemu-devel] [PATCH] (Experimental) Initial patch providing accelerated OpenGL for Linux i386
Date: Tue, 14 Nov 2006 21:47:15 -0000
User-agent: KMail/1.9.5

Here's an attempt of providing accelerated OpenGL for QEMU.

I must underline first that it should really really be considered as 
experimental or a proof-of-concept. There's still a lot of work to do to make 
it reliable and releasable.

So what is it exactly ?
- a patch for QEMU itself that intercepts any call to 'int $0x99' which is the 
  interface I have chosen to dedicate to communication between guest user
  programs and QEMU. The modification of QEMU existing code is very slight.
  The essential of code on the guest side is in new files.
- a replacement libGL.so library that must be used inside the Linux guest. The
  library redirects guest OpenGL and GLX calls to host side, where your host
  libGL.so will do the real job.

Now, the good news : which programs do currently work with this patch ?
- glxinfo
- glxgears
- some mesa demos programs
- ... and ppracer ! (some crash from time to time)

It works currently only with Linux x86 as guest and host OS.
Successfully tested on the following platforms :
- Ubuntu Edgy x86 as host with ATI FGLRX driver / FC5 x86 as guest
- Ubuntu Dapper x86 as host with NVIDIA Proprietary driver / Ubuntu Dapper x86 
as guest

How fast is it ? Enough fast to have 15 FPS in ppracer with KQEMU disabled.
When KQEMU is enabled, paradoxically, the performance is really poor :-(

Which programs do not work : probably most for the moment ;-)
I'd like to make it work with XGL (I've downloaded the latest Mandriva 2007 
Live CD and I'm quite impatient to enable the 3D in it) and GoogleEarth.

How to use it ?
* Apply the patch and recompile QEMU 
* Lauch QEMU with -enable-gl option
* Compile target-i386/opengl_client.c into libGL.so (do not use optimization 
flags. It compiles but doesn't work)
* In the guest OS : LD_LIBRARY_PATH=/path/to/replacement/libGL.so glxgears

TODO list :
- implement correctly full OpenGL API
- improve vertex arrays support
- maybe fix how the end of the guest process is detected
- make replacement libGL work when compiled with optimization flags
- integrate in a better way the window that popups on the guest side with the 
main qemu window
- integrate it properly into QEMU build system (helper_opengl.c can't compile 
with -O2 : 'unable to find a register to spill in class `DIREG'')
- understand why it's slower when KQEMU enabled and try to fix that if 
possible
- enable several guest OS processes to use OpenGL at the same time
- make it run on x86_64, and allowing any combination guest x86/x86_64 and 
host x86/x86_64, other archs
- port it to other UNIX-like OS with X
- improve security if possible (preventing malicious guest code from crashing 
host qemu)
- clean the code !
- much testing and debugging
- port it to Windows platform (first OpenGL / WGL, then D3D through Wine 
libs ?)
- make a patch to Valgrind to make it happy with 'int $0x99' when running on 
guest side
- ...

In the mean time, enjoy and feel free to contribute ! As you see, there's a 
huge amount of remaining work.

The new files :
- opengl_client.c  : the OpenGL guest library
- helper_opengl.c : main guest-side code
- gl_func.h, server_stub.c, client_stub.c : generated files by parse_gl_h.c 
from gl.h parsing
- glgetv_cst.h  : generated file from parsing of a man page
- gl_func_perso.h, opengl_func.h : hand-written "prototypes"

Attachment: qemu_opengl.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]