All of lore.kernel.org
 help / color / mirror / Atom feed
From: Fabrice Bellard <fabrice@bellard.org>
To: even.rouault@mines-paris.org
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] Experimental initial patch providing accelerated OpenGL for Linux i386 (2nd attempt to post)
Date: Thu, 16 Nov 2006 23:41:51 +0100	[thread overview]
Message-ID: <455CE92F.2000100@bellard.org> (raw)
In-Reply-To: <200611162134.48783.even.rouault@mines-paris.org>

Hi,

I find your patch interesting and I'll try to include it in QEMU ASAP.

My main remark is that the host/guest communication system must be 
changed and I can help you to implement it. I would prefer to use a PCI 
device and to avoid any i386 dependent code. For the PCI device, using 
the Bochs VGA adapter could be a possible idea. All the parameters and 
data should be transmitted as if the PCI device was doing DMA. A single 
I/O port could be used to start executing a list of OpenGL commands.

Once a basic Linux target OpenGL library is OK, it would be good to work 
on the equivalent Windows guest code by reusing the wine D3D code...

Regards,

Fabrice.

Even Rouault wrote:
> 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.
> 
> It works currently only with Linux x86 as guest and host OS.
> 
> Now, the good news : which programs do currently work with this patch ?
> - glxinfo
> - glxgears. I get ~330 FPS with QEMU/GL (direct GLX), ~210 FPS through a SSH 
> console on the guest OS (indirect GLX)
> - some mesa demos programs.
>     * tunnel     : ~26 FPS with QEMU/GL,  ~3 FPS through a SSH console on the 
> guest OS
>     * teapot     : ~50 FPS with QEMU/GL,  ~7 FPS through a SSH console on the 
> guest OS
>     * fire       : ~14 FPS with QEMU/GL,  ~2 FPS through a SSH console on the 
> guest OS
>     * arbfplight : ~100 FPS with QEMU/GL,  not possible through a SSH console 
> on the guest OS (GL_ARB_vertex_program not available)
> - ... and ppracer ! (some crash from time to time. Starting at ~20 FPS at the 
> beginning of the race, and finishing at ~10 FPS... strange...)
> 
> 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 :-(
> 
> 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
> 
> 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 ? (ONLY on Linux i386 and with only i386-softmmu as target-list)
> * Apply the patch and recompile QEMU 
> * Lauch QEMU with -enable-gl option
> * Get the compiled libGL.so from ./i386-softmmu and copy it to the guest OS
> * 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
> - ...
> 
> 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"
> 
> In the mean time, enjoy !
> 
> PS :
> I posted a similar message thursday, but it didn't get to the list apparently, 
> maybe because of the two big attached patch (500 kB). I have reduced the size 
> of the patch to 160 KB by not including generated source files. I will send 
> it just after, so this message has a chance of coming. If you don't see a 
> following message with the patch attached, I'll have to figure out where to 
> store the patch...
> 
> 
> _______________________________________________
> Qemu-devel mailing list
> Qemu-devel@nongnu.org
> http://lists.nongnu.org/mailman/listinfo/qemu-devel
> 
> 

  parent reply	other threads:[~2006-11-16 22:42 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-16 20:34 [Qemu-devel] [PATCH] Experimental initial patch providing accelerated OpenGL for Linux i386 (2nd attempt to post) Even Rouault
2006-11-16 21:13 ` Even Rouault
2006-11-16 22:41 ` Fabrice Bellard [this message]
2006-11-17  1:25   ` Paul Brook
2006-11-18 12:59   ` Even Rouault
2006-11-18 17:40     ` Fabrice Bellard
2006-11-19 19:01     ` Avi Kivity
2006-11-17  7:16 ` Stefan Kombrink
2006-11-17  7:29 ` Laurent Desnogues
2006-11-20  3:48 ` [Qemu-devel] [PATCH] Experimental initial patch providingaccelerated " Kazu
  -- strict thread matches above, loose matches on Subject: below --
2006-11-16 20:36 [Qemu-devel] [PATCH] Experimental initial patch providing accelerated " Even Rouault

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=455CE92F.2000100@bellard.org \
    --to=fabrice@bellard.org \
    --cc=even.rouault@mines-paris.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.