From patchwork Tue Feb 21 09:20:49 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 142270 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 35CDDB6FA7 for ; Tue, 21 Feb 2012 20:21:10 +1100 (EST) Received: from localhost ([::1]:36003 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RzluE-0003YR-E0 for incoming@patchwork.ozlabs.org; Tue, 21 Feb 2012 04:21:06 -0500 Received: from eggs.gnu.org ([140.186.70.92]:54329) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rzlu7-0003Y3-3y for qemu-devel@nongnu.org; Tue, 21 Feb 2012 04:21:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rzlu1-0007RU-By for qemu-devel@nongnu.org; Tue, 21 Feb 2012 04:20:59 -0500 Received: from mx1.redhat.com ([209.132.183.28]:22342) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rzlu1-0007RN-37 for qemu-devel@nongnu.org; Tue, 21 Feb 2012 04:20:53 -0500 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q1L9Kqsr013239 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 21 Feb 2012 04:20:52 -0500 Received: from rincewind.home.kraxel.org (ovpn-116-56.ams2.redhat.com [10.36.116.56]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q1L9KnHP030185; Tue, 21 Feb 2012 04:20:50 -0500 Message-ID: <4F4361F1.5000207@redhat.com> Date: Tue, 21 Feb 2012 10:20:49 +0100 From: Gerd Hoffmann User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.1) Gecko/20120210 Thunderbird/10.0.1 MIME-Version: 1.0 To: qemu-devel@nongnu.org, elmarco@redhat.com References: <1329686886-6853-1-git-send-email-alevy@redhat.com> <1329686886-6853-8-git-send-email-alevy@redhat.com> <4F423155.1010706@redhat.com> <20120220123823.GG23926@garlic.redhat.com> <4F42481B.3070605@redhat.com> <20120220173639.GJ23926@garlic.redhat.com> <4F434E82.2030401@redhat.com> <20120221082613.GD6476@garlic> In-Reply-To: <20120221082613.GD6476@garlic> X-Enigmail-Version: 1.3.5 X-Scanned-By: MIMEDefang 2.68 on 10.5.11.25 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Subject: Re: [Qemu-devel] [RFC 7/7] qxl: add allocator X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Hi, > Right now qxl_render_update checks if the displaysurface buffer is not > shared, meaning it was allocated by qemu, and in this case it replaces > it with the flipped buffer. I think we should first reqire spice-server 0.8.latest, so update_area_complete is available unconditionally. Then do any displaysurface updates in that callback (or a bh kicked by that callback). Handle both shared & non-shared cases. I think we also can get rid of the flip buffer then and just use a non-shared displaysurface in that case (and flip the upside-down qxl surface while copying to the qemu displaysurface). > But right after that surface->data gets reset, by vga_hw_screen_dump: > vga_hw_screen_dump/console_select/qemu_resize_displaysurface/ds->allocator->resize_displaysurface/defaultallocator_resize_displaysurface/qemu_alloc_display > > Hence my line of thought that replacing the allocator with my own would > prevent this. Since you have misgivings about using our own allocator > that I don't know how to resolve, I'm instead doing a second > reallocation in our dpy_resize callback qxl.c:display_resize, in affect > it means that we have three allocations and three deallocations for every > screendump. Do you still think it's less ugly then an allocator? note > that I have sdl and vnc working with spice with my allocator scheme. > (just didn't test all three together yet). IMHO that calls for a patch like this to get rid of the pointless console_select() call: } cheers, Gerd --- a/console.c +++ b/console.c @@ -181,12 +181,14 @@ void vga_hw_screen_dump(const char *filename) /* There is currently no way of specifying which screen we want to dump, so always dump the first one. */ - console_select(0); + if (previous_active_console && previous_active_console->index != 0) { + console_select(0); + } if (consoles[0] && consoles[0]->hw_screen_dump) { consoles[0]->hw_screen_dump(consoles[0]->hw, filename); } - if (previous_active_console) { + if (previous_active_console && previous_active_console->index != 0) { console_select(previous_active_console->index); }