From patchwork Wed Feb 10 23:29:56 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 45075 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 65A60B7CB8 for ; Thu, 11 Feb 2010 10:39:07 +1100 (EST) Received: from localhost ([127.0.0.1]:35449 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NfM7e-00041m-07 for incoming@patchwork.ozlabs.org; Wed, 10 Feb 2010 18:37:30 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NfM0b-0008M3-9o for qemu-devel@nongnu.org; Wed, 10 Feb 2010 18:30:13 -0500 Received: from [199.232.76.173] (port=46823 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NfM0a-0008Le-Uf for qemu-devel@nongnu.org; Wed, 10 Feb 2010 18:30:12 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1NfM0a-0004Ox-2P for qemu-devel@nongnu.org; Wed, 10 Feb 2010 18:30:12 -0500 Received: from mail-fx0-f223.google.com ([209.85.220.223]:41687) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NfM0Z-0004Op-Mh for qemu-devel@nongnu.org; Wed, 10 Feb 2010 18:30:11 -0500 Received: by fxm23 with SMTP id 23so607174fxm.2 for ; Wed, 10 Feb 2010 15:30:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:from:to:subject:date :message-id:x-mailer:in-reply-to:references; bh=MAhGYJ9C5cswZRHatIDWXb41ywJMGDND11N9oFvtw4k=; b=gGo/GfyS3l2rpi4Y7OJizdU87xjNpINQCJZLBW7WRL2FOZVLz9M0ptSSPfSJ4AqeuI G7p/9MajZtePkMLsDb1004WDXJ6EuwV8rWzEdkBOz8xbjGK5qFDm7aJqUCLXxRZSzk74 p1i/u27QIzxGUnsN1RFbRkAedCHF9OpHFMC3Q= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:from:to:subject:date:message-id:x-mailer:in-reply-to :references; b=fBRVnpsOeQtZlGuq7hMS3MAdCaNeKCkIV/Elo8YY+qOsmKkkM6xgP14ASbflMH1Myt x17ckU1dz/LXy0SyvuE29vfSpFL09sy1QfU/TH+PzzeubjNFQLTvKxOHkjiDC2B+9jAD gIkvp8DR6Y3B6UhlZgDAs5tZU4xpT0GxRVsOI= Received: by 10.223.164.156 with SMTP id e28mr1229558fay.27.1265844610608; Wed, 10 Feb 2010 15:30:10 -0800 (PST) Received: from localhost.localdomain ([85.93.118.17]) by mx.google.com with ESMTPS id 19sm2852341fkr.18.2010.02.10.15.30.09 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 10 Feb 2010 15:30:09 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Thu, 11 Feb 2010 00:29:56 +0100 Message-Id: <1265844597-29941-3-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.6.6 In-Reply-To: <1265844597-29941-1-git-send-email-pbonzini@redhat.com> References: <1265844597-29941-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Subject: [Qemu-devel] [PATCH 2/3] remove knowledge of defaultallocator_free_displaysurface from sdl.c X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Let register_displayallocator hand over the old width/height to the new allocator. Signed-off-by: Paolo Bonzini --- So these functions will be made static when moved to console.c. sdl.c | 4 ---- vl.c | 8 +++++++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/sdl.c b/sdl.c index cf27ad2..a9b4323 100644 --- a/sdl.c +++ b/sdl.c @@ -872,10 +872,6 @@ void sdl_display_init(DisplayState *ds, int full_screen, int no_frame) da->resize_displaysurface = sdl_resize_displaysurface; da->free_displaysurface = sdl_free_displaysurface; if (register_displayallocator(ds, da) == da) { - DisplaySurface *surf; - surf = sdl_create_displaysurface(ds_get_width(ds), ds_get_height(ds)); - defaultallocator_free_displaysurface(ds->surface); - ds->surface = surf; dpy_resize(ds); } diff --git a/vl.c b/vl.c index 94aeb5e..8e8b4d1 100644 --- a/vl.c +++ b/vl.c @@ -2598,7 +2598,13 @@ DisplayState *get_displaystate(void) DisplayAllocator *register_displayallocator(DisplayState *ds, DisplayAllocator *da) { - if(ds->allocator == &default_allocator) ds->allocator = da; + if(ds->allocator == &default_allocator) { + DisplaySurface *surf; + surf = da->create_displaysurface(ds_get_width(ds), ds_get_height(ds)); + defaultallocator_free_displaysurface(ds->surface); + ds->surface = surf; + ds->allocator = da; + } return ds->allocator; }