From patchwork Thu Jun 9 20:48:17 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sasha Levin X-Patchwork-Id: 862672 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p58KmYh5005205 for ; Wed, 8 Jun 2011 20:48:34 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755280Ab1FHUsa (ORCPT ); Wed, 8 Jun 2011 16:48:30 -0400 Received: from mail-qw0-f46.google.com ([209.85.216.46]:59438 "EHLO mail-qw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755025Ab1FHUs2 (ORCPT ); Wed, 8 Jun 2011 16:48:28 -0400 Received: by qwk3 with SMTP id 3so424314qwk.19 for ; Wed, 08 Jun 2011 13:48:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references; bh=/HORzQolRbdyEgZ69x7+AhUv3FNwJJ248F9ELhoBf5I=; b=WkZItQZ+n0FwmZFEEtlq7doE0xm5IId+MYLuM2JyooYlM/2T7IiL2WzkcVg9im8CGF 2wbJycdMVd18NIv8L4DEyYNH8LCO2uOsQHNfHPUadMyWVC+9biIIumAlf83VuBiNUuLx 2dJKBNUIBvM2ThlDzGBb9Stqe6YVaUDj4tZu8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; b=TgxF4h6PtF6KgVQILeFQhaj60b9brJoVtfTlFtO9rsrSn8eYOs4TiVHdSIA9zApqk/ GetsX24pY3VCVCwUOWKF6eEioSLmbWpbR7qAs8OSbVPD2wRlF2KQXmDfUAzjIgZZfxB/ rKOVI0z/EopL5Fm0aLpFKJaOtTD5egGS3dMJo= Received: by 10.224.177.15 with SMTP id bg15mr4246403qab.199.1307566107542; Wed, 08 Jun 2011 13:48:27 -0700 (PDT) Received: from localhost.localdomain (cpe-74-68-106-119.nyc.res.rr.com [74.68.106.119]) by mx.google.com with ESMTPS id mz7sm698982qcb.23.2011.06.08.13.48.26 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 08 Jun 2011 13:48:26 -0700 (PDT) From: Sasha Levin To: penberg@kernel.org Cc: kvm@vger.kernel.org, mingo@elte.hu, asias.hejun@gmail.com, gorcunov@gmail.com, prasadjoshi124@gmail.com, Sasha Levin Subject: [PATCH 2/2] kvm tools: Use double buffering with SDL Date: Thu, 9 Jun 2011 16:48:17 -0400 Message-Id: <1307652497-4629-2-git-send-email-levinsasha928@gmail.com> X-Mailer: git-send-email 1.7.5.3 In-Reply-To: <1307652497-4629-1-git-send-email-levinsasha928@gmail.com> References: <1307652497-4629-1-git-send-email-levinsasha928@gmail.com> Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Wed, 08 Jun 2011 20:48:34 +0000 (UTC) Page flip every time we copy the buffer over instead of invalidating rects. This should improve performance by letting hardware do the page flipping. Signed-off-by: Sasha Levin --- tools/kvm/ui/sdl.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/kvm/ui/sdl.c b/tools/kvm/ui/sdl.c index 30fd511..59a6aa6 100644 --- a/tools/kvm/ui/sdl.c +++ b/tools/kvm/ui/sdl.c @@ -91,7 +91,7 @@ static void *sdl__thread(void *p) if (!guest_screen) die("Unable to create SDL RBG surface"); - flags = SDL_HWSURFACE | SDL_ASYNCBLIT | SDL_HWACCEL; + flags = SDL_HWSURFACE | SDL_ASYNCBLIT | SDL_HWACCEL | SDL_DOUBLEBUF; screen = SDL_SetVideoMode(fb->width, fb->height, fb->depth, flags); if (!screen) @@ -99,7 +99,7 @@ static void *sdl__thread(void *p) for (;;) { SDL_BlitSurface(guest_screen, NULL, screen, NULL); - SDL_UpdateRect(screen, 0, 0, 0, 0); + SDL_Flip(screen); while (SDL_PollEvent(&ev)) { switch (ev.type) {