From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LaYPV-0006Ic-4Y for qemu-devel@nongnu.org; Fri, 20 Feb 2009 11:39:33 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LaYPU-0006ID-F3 for qemu-devel@nongnu.org; Fri, 20 Feb 2009 11:39:32 -0500 Received: from [199.232.76.173] (port=59898 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LaYPU-0006I5-5q for qemu-devel@nongnu.org; Fri, 20 Feb 2009 11:39:32 -0500 Received: from smtp02.citrix.com ([66.165.176.63]:46438) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LaYPT-00058o-Kj for qemu-devel@nongnu.org; Fri, 20 Feb 2009 11:39:31 -0500 Message-ID: <499EDC54.3020508@eu.citrix.com> Date: Fri, 20 Feb 2009 16:37:40 +0000 From: Stefano Stabellini MIME-Version: 1.0 Subject: Re: [Qemu-devel] Re: Qemu 2D performance plunges below acceptable levels References: <7fac565a0902150510y1fb01c6awd1dcc3b6e7b8232d@mail.gmail.com> <7fac565a0902150911u1ed66ef0gc55663d723c76ae4@mail.gmail.com> <4999407C.5040009@eu.citrix.com> <49995266.3050707@redhat.com> <4999913F.3040108@eu.citrix.com> <499AF87C.9090703@redhat.com> <499B0965.9020007@eu.citrix.com> <7fac565a0902180046r1c0070bdrbf0af9511493c22b@mail.gmail.com> <499BE774.2070707@eu.citrix.com> <499BFB32.90806@eu.citrix.com> In-Reply-To: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit 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" malc wrote: > > It doesn't. FWIW not quite "value preserving" operation of removing call > to SDL_UpdateRect from sdl_update and putting SDL_Flip into sdl_refresh > does. > Going through the SDL documentation I found this: http://www.libsdl.org/faq.php?action=listentries&category=7 Frequently Asked Questions: Mac OS You may be able to make things faster by calling SDL_UpdateRects() instead of SDL_UpdateRect() or SDL_Flip(). With SDL_UpdateRects() you can tell SDL exactly what rectangles of the surface you painted, and they will all be handed to the window server at once. That way, the window server does the least amount of work possible. So in theory this should make sdl faster on MacOSX: diff --git a/sdl.c b/sdl.c index 266fbcc..2ce20d2 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_UpdateRect(real_screen, x, y, w, h); + SDL_UpdateRects(real_screen, 1, &rec); } static void sdl_setdata(DisplayState *ds)