qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Jamie Lokier <jamie@shareable.org>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] opengl rendering in the sdl window
Date: Fri, 5 Sep 2008 13:02:15 +0100	[thread overview]
Message-ID: <20080905120214.GD1373@shareable.org> (raw)
In-Reply-To: <48BFB318.206@eu.citrix.com>

Stefano Stabellini wrote:
> Anthony Liguori wrote:
> 
> > Stefano Stabellini wrote:
> >> This patch comes from xen-unstable and adds opengl support for rendering
> >> the guest framebuffer in the SDL window.
> >> SDL is needed anyway to open the window and handle the events.
> >> Opengl rendering is optional and can be turned off at both compile time
> >> and run time (--disable-opengl).
> >> Some of the benefits of using opengl are:
> >>
> >> -faster rendering, less CPU intensive, especially with good graphic
> >> cards;
> >>   
> > 
> > Have you measured this or is this just intuition?  I've measured it with
> > gtk-vnc and I did not observe any CPU usage decrease in using OpenGL for
> > rendering verses an XShmImage.
> 
> 
> I wrote that because before my patches all the colour conversions were
> done in vga_template; after the sdl shared buffer patch the colour
> conversions are done by SDL that sadly most of the time still implements
> them using CPU based algorithms.
> The opengl code should be able to offload all the colour conversions to
> the GPU.
> So I was referring to SDL vs. OpenGL.

Fwiw, in my experience with Xine and mplayer, drawing video updates to
the screen using OpenGL was quite a lot slower than drawing them with
XShmImage.  That needs colour conversion as video doesn't even use RGB.

Probably OpenGL is faster on some hardware, and slower on some hardware.
Don't assume it's always faster.

> Then there is the video memory versus system memory discussion: the
> opengl patch loads the guest framebuffer into video memory then does the
> conversion and blitting video->video that should be accelerated.
> SDL_CreateRGBSurfaceFrom creates the surface in system memory so the
> blitting shouldn't be accelerated.
> I am saying should and shouldn't because it also depends on the video
> card drivers and the opengl implementation.

Yes it very much depends on the drivers and opengl implementation.  It
isn't always possible to map the guest framebuffer into video
(texture) memory, and also some opengl implementations are not
particularly fast at copying textures from CPU memory to texture memory.

Another way to map guest framebuffer to video memory is the XF86DGA
extension, which is great when you can use it.  I think VMware uses it
in full-screen mode.

-- Jamie

  reply	other threads:[~2008-09-05 12:02 UTC|newest]

Thread overview: 75+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-29 15:22 [Qemu-devel] [PATCH] opengl rendering in the sdl window Stefano Stabellini
2008-09-02 16:53 ` Ian Jackson
2008-09-04  3:00 ` Anthony Liguori
2008-09-04  7:41   ` Gerd Hoffmann
2008-09-04  9:42   ` Daniel P. Berrange
2008-09-04 10:06     ` Andreas Färber
2008-09-04 10:20       ` Daniel P. Berrange
2008-09-05 16:42         ` Andreas Färber
2008-09-07  7:51         ` Avi Kivity
2008-09-07  3:07     ` Anthony Liguori
2008-09-07 16:31       ` Daniel P. Berrange
2008-09-08  0:12         ` Anthony Liguori
2008-09-04 10:06   ` Stefano Stabellini
2008-09-05 12:02     ` Jamie Lokier [this message]
2008-09-05 12:11       ` Samuel Thibault
2008-09-06 23:27         ` Jamie Lokier
2008-09-07 14:22           ` Samuel Thibault
2008-09-07 14:36             ` Paul Brook
2008-09-07 14:42               ` Samuel Thibault
2008-09-07 15:03                 ` Paul Brook
2008-09-07 15:12                   ` Samuel Thibault
2008-09-07 15:35                     ` Paul Brook
2008-09-07 15:41                       ` Samuel Thibault
2008-09-07 15:57                         ` Paul Brook
2008-09-08  0:08                         ` Anthony Liguori
2008-09-08  0:21                           ` Samuel Thibault
2008-09-08  1:18               ` Jamie Lokier
2008-09-08 10:38                 ` Stefano Stabellini
2008-09-08 13:21                   ` Jamie Lokier
2008-09-05 16:44       ` Stefano Stabellini
2008-09-05 16:55         ` Daniel P. Berrange
2008-09-05 17:13           ` Stefano Stabellini
2008-09-07  3:21             ` Anthony Liguori
2008-09-08 10:48               ` Stefano Stabellini
2008-09-08 13:16               ` Jamie Lokier
2008-09-08 13:51                 ` Stefano Stabellini
2008-09-08 13:41               ` Jamie Lokier
2008-09-08 13:48                 ` Daniel P. Berrange
2008-09-08 14:56                   ` Gerd Hoffmann
2008-09-08 15:08                     ` Jamie Lokier
2008-09-08 15:35                       ` Gerd Hoffmann
2008-09-08 15:39                         ` Jamie Lokier
2008-09-08 16:23                           ` Gerd Hoffmann
2008-09-08 16:47                             ` Anthony Liguori
2008-09-08 19:15                               ` Gerd Hoffmann
2008-09-08 19:43                             ` Jamie Lokier
2008-09-08 15:47                       ` Daniel P. Berrange
2008-09-08 16:05                         ` Anthony Liguori
2008-09-08 17:08                           ` Mike Kronenberg
2008-09-08 19:21                             ` Gerd Hoffmann
2008-09-08 21:06                               ` Mike Kronenberg
2008-09-08 19:32                           ` Jamie Lokier
2008-09-08 19:48                           ` Jamie Lokier
2008-09-08 19:57                             ` Anthony Liguori
2008-09-08 20:11                               ` Jamie Lokier
2008-09-08 23:18                         ` Daniel P. Berrange
2008-09-09  0:10                           ` Jamie Lokier
2008-09-09  2:45                             ` Anthony Liguori
2008-09-09  4:17                               ` Jamie Lokier
2008-09-08 14:22                 ` Anthony Liguori
2008-09-07  7:48           ` Avi Kivity
2008-09-07 11:57             ` Daniel P. Berrange
2008-09-07 13:12               ` Avi Kivity
2008-09-08 10:30                 ` Stefano Stabellini
2008-09-08 10:35                   ` Daniel P. Berrange
2008-09-08 10:53                     ` Stefano Stabellini
2008-09-08 11:00                       ` Daniel P. Berrange
2008-09-08 12:38                         ` François Revol
2008-09-08 13:05                           ` Jamie Lokier
2008-09-08 13:08                           ` Anthony Liguori
2008-09-08 13:44                             ` François Revol
2008-09-05 18:11         ` malc
2008-09-04 10:14   ` Stefano Stabellini
2008-09-07  3:09     ` Anthony Liguori
2008-09-04 10:21   ` Andreas Färber

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=20080905120214.GD1373@shareable.org \
    --to=jamie@shareable.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).