qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paul Brook <paul@codesourcery.com>
To: qemu-devel@nongnu.org
Cc: Lennart Sorensen <lsorense@csclub.uwaterloo.ca>,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: Re: [Qemu-devel] Re: Extremely slow graphic updates
Date: Wed, 21 Jan 2009 01:50:15 +0000	[thread overview]
Message-ID: <200901210150.17344.paul@codesourcery.com> (raw)
In-Reply-To: <200901201811.19920.paul@codesourcery.com>

> Steps to reproduce:
> - Start qemu (doesn't matter which target or guest OS).
> - Press c-a-2 to switch to the monitor.
> - type "help<enter>"
> - Watch the output slowly appear over the next 30 seconds
>
> Running qemu over a forwarded X connection from a different machine (i.e.
> ssh -X) suffers a marked slowdown. With this configuration the early x86
> boot stages are visibly much slower, in addition to the virtual console
> slowness mentioned above.

I've applied a patch to fix this.

The problem was that we were incorrectly using SDL_Flip in sdl_update.

This is fundamentally wrong because the blit immediately above has only 
updated the recently changes section of the image. With a flipped surface the 
contents will be the frame before last (if not the one before that), so we'd 
actually need to blit everything that has changed in the last 2 (or 3) 
frames.

However we don't set SDL_DOUBLEBUFFER when SDL_SetVideoMode, so SDL_Flip this 
is just a confusing way of writing SDL_UpdateRect(real_screen, 0, 0, 0, 0); 
On systems where copying to the front buffer is expensive (in particular 
remote connections, or primitive Xorg drivers), needlessly refreshing the 
whole display has a huge effect on the cases mentioned above.

I've applied a patch to use the correct SDL_UpdateRect call instead.
This gets us almost back where we started. 

The virtual consoles are still slow over a remote connection. The text 
terminal code generates a lot of small redundant update. It appears that 
these now require an X server round trip, where they didn't before.
I'm not sure why, I can only guess that the blit rather than direct 
framebuffer access is foiling some internal SDL/X dirty region tracking.

Paul

  parent reply	other threads:[~2009-01-21  1:50 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-19 16:26 [Qemu-devel] qemu-system-ppc seems slow today Lennart Sorensen
2009-01-19 17:09 ` Aurelien Jarno
2009-01-19 17:49   ` Lennart Sorensen
2009-01-19 18:07     ` Lennart Sorensen
2009-01-19 18:39       ` Aurelien Jarno
2009-01-19 19:42         ` Lennart Sorensen
2009-01-20  0:53           ` Lennart Sorensen
2009-01-20  1:01             ` François Revol
2009-01-20  1:33             ` [Qemu-devel] Extremely slow graphic updates (was: qemu-system-ppc seems slow today) Paul Brook
2009-01-20  1:54               ` [Qemu-devel] Re: Extremely slow graphic updates Anthony Liguori
2009-01-20 11:22               ` Stefano Stabellini
2009-01-20 11:28                 ` Stefano Stabellini
2009-01-20 14:46                   ` Lennart Sorensen
2009-01-20 14:45                 ` Lennart Sorensen
2009-01-20 15:21                   ` Stefano Stabellini
2009-01-20 16:55                     ` Lennart Sorensen
2009-01-20 17:09                       ` Samuel Thibault
2009-01-20 18:15                         ` Lennart Sorensen
2009-01-20 18:16                           ` Stefano Stabellini
2009-01-20 18:25                             ` Lennart Sorensen
2009-01-20 19:35                               ` Lennart Sorensen
2009-01-20 19:46                                 ` Jamie Lokier
2009-01-20 20:02                                   ` Lennart Sorensen
2009-01-20 20:12                                     ` Jamie Lokier
2009-01-20 20:17                                       ` Lennart Sorensen
2009-01-20 19:38                               ` Stefano Stabellini
2009-01-20 20:05                                 ` Lennart Sorensen
2009-01-20 20:30                             ` Avi Kivity
2009-01-20 18:59                           ` Samuel Thibault
2009-01-20 17:21                       ` Stefano Stabellini
2009-01-20 17:35                         ` Stefano Stabellini
2009-01-20 18:11                 ` Paul Brook
2009-01-20 18:48                   ` Re : " Sylvain Petreolle
2009-01-20 21:29                   ` Stefan Weil
2009-01-21  1:50                   ` Paul Brook [this message]
2009-01-21 15:23                     ` Lennart Sorensen
2009-01-21 20:06                       ` Stefano Stabellini
2009-01-21 21:29                         ` Lennart Sorensen
2009-01-21 21:49                           ` Lennart Sorensen
2009-01-21 21:52                             ` Stefano Stabellini
2009-01-22  0:20                             ` Paul Brook
2009-01-22 13:19                               ` Lennart Sorensen

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=200901210150.17344.paul@codesourcery.com \
    --to=paul@codesourcery.com \
    --cc=lsorense@csclub.uwaterloo.ca \
    --cc=qemu-devel@nongnu.org \
    --cc=stefano.stabellini@eu.citrix.com \
    /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).