From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LPQJ6-0006sw-T8 for qemu-devel@nongnu.org; Tue, 20 Jan 2009 18:46:56 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LPQJ4-0006rc-Td for qemu-devel@nongnu.org; Tue, 20 Jan 2009 18:46:55 -0500 Received: from [199.232.76.173] (port=50926 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LPQJ4-0006rO-Ov for qemu-devel@nongnu.org; Tue, 20 Jan 2009 18:46:54 -0500 Received: from smtp.eu.citrix.com ([62.200.22.115]:42071) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LPQJ4-0003Pq-Ec for qemu-devel@nongnu.org; Tue, 20 Jan 2009 18:46:54 -0500 Message-ID: <49766186.7020202@eu.citrix.com> Date: Tue, 20 Jan 2009 23:43:02 +0000 From: Stefano Stabellini MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] [PATCH] Extremely slow graphic updates Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Hi all, as you may be already aware of, the last displaystate interface change slowed down the qemu monitor and the text vga text mode in general much more then expected. The reason for this is that to update the sdl window we are calling SDL_Flip instead of SDL_UpdateRect. SDL_Flip is necessary to update the SDL window when using double buffering, when double buffering is disable it just falls back to SDL_UpdateRect updating the whole screen. So in our case we do not use double buffering so we are updating the whole screen every time for no reason. This patch fixes that. Signed-off-by: Stefano Stabellini diff --git a/sdl.c b/sdl.c index 73396e8..0c4a3e1 100644 --- a/sdl.c +++ b/sdl.c @@ -62,7 +62,7 @@ static void sdl_update(DisplayState *ds, int x, int y, int w, int h) // printf("updating x=%d y=%d w=%d h=%d\n", x, y, w, h); SDL_BlitSurface(guest_screen, &rec, real_screen, &rec); - SDL_Flip(real_screen); + SDL_UpdateRect(real_screen, x, y, w, h); } static void sdl_setdata(DisplayState *ds)