From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Lqq1I-0003hp-24 for qemu-devel@nongnu.org; Mon, 06 Apr 2009 10:41:53 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Lqq1B-0003fS-VE for qemu-devel@nongnu.org; Mon, 06 Apr 2009 10:41:50 -0400 Received: from [199.232.76.173] (port=34564 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Lqq1A-0003fK-VI for qemu-devel@nongnu.org; Mon, 06 Apr 2009 10:41:45 -0400 Received: from mx2.redhat.com ([66.187.237.31]:56008) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Lqq1A-0001VU-G1 for qemu-devel@nongnu.org; Mon, 06 Apr 2009 10:41:44 -0400 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n36EfhFx015530 for ; Mon, 6 Apr 2009 10:41:43 -0400 Message-ID: <49DA14A5.4060301@redhat.com> Date: Mon, 06 Apr 2009 17:41:41 +0300 From: Avi Kivity MIME-Version: 1.0 Subject: Re: [Qemu-devel] [6989] Fix display breakage when resizing the screen (v2) (Avi Kivity) References: <49DA0FFD.1060600@eu.citrix.com> In-Reply-To: <49DA0FFD.1060600@eu.citrix.com> Content-Type: text/plain; charset=UTF-8; format=flowed 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 Stefano Stabellini wrote: > Anthony Liguori wrote: > > >> Revision: 6989 >> http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=6989 >> Author: aliguori >> Date: 2009-04-05 18:41:18 +0000 (Sun, 05 Apr 2009) >> Log Message: >> ----------- >> Fix display breakage when resizing the screen (v2) (Avi Kivity) >> >> When the vga resolution changes, a new display surface is not allocated >> immediately; instead that is deferred until the next update. However, >> if we're running without a display client attached, that won't happen >> and the next bitblt is likely to cause a segfault by overflowing the >> display surface. >> >> Fix by reallocating the display immediately when the resolution changes. >> >> Tested with (Windows|Linux) x (cirrus|std) x (curses|sdl). >> >> Changes from v1: >> - fix segfault when switching virtual consoles with curses >> >> Signed-off-by: Avi Kivity >> Signed-off-by: Anthony Liguori >> >> > > While I understand the problem this patch tries to fix I think the way > it fixes it is wrong. > > First of all this patch breaks the VC switching mechanism in qemu: just > execute sleep 2; startx; in the first VC, then switch to the monitor and > wait. > I guess, this can be fixed by not reallocating the display surface if vga is not the active console? > Secondly it doesn't follow the basic idea behind the DisplayState > surface: it is supposed to be a pixel surface provided by the vga > emulator to the frontends, cirrus shouldn't have to care what size it is. > In fact cirrus emulates bitblit operations on the emulated framebuffer, > not on the DisplayState surface; if it does so is a bug and should be fixed. > This happens through cirrus_do_copy(), which implies that the display surface is involved. Is that wrong? > For these reasons I think this patch should be reverted Can you suggest a better fix? The failure (without the patch) is pretty disastrous from my point of view. -- error compiling committee.c: too many arguments to function