From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1L3yeQ-0001Sh-Bp for qemu-devel@nongnu.org; Sat, 22 Nov 2008 15:00:18 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1L3yeP-0001S8-Ag for qemu-devel@nongnu.org; Sat, 22 Nov 2008 15:00:17 -0500 Received: from [199.232.76.173] (port=45181 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L3yeP-0001Rt-14 for qemu-devel@nongnu.org; Sat, 22 Nov 2008 15:00:17 -0500 Received: from an-out-0708.google.com ([209.85.132.247]:27219) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1L3yeO-000596-Mj for qemu-devel@nongnu.org; Sat, 22 Nov 2008 15:00:16 -0500 Received: by an-out-0708.google.com with SMTP id c38so574989ana.37 for ; Sat, 22 Nov 2008 12:00:15 -0800 (PST) Message-ID: <492864CB.3060905@codemonkey.ws> Date: Sat, 22 Nov 2008 14:00:11 -0600 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH 4 of 5] [UPDATE] DisplayState interface change References: <4926EB0B.6040007@eu.citrix.com> In-Reply-To: <4926EB0B.6040007@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: > This patch changes the DisplayState interface adding support for > multiple frontends at the same time (sdl and vnc) and implements most > of the benefit of the shared_buf patch without the added complexity. > > Currently DisplayState is managed by sdl (or vnc) and sdl (or vnc) is > also responsible for allocating the data and setting the depth. > Vga.c (or another backend) will do any necessary conversion. > > The idea is to change it so that is vga.c (or another backend) together > with console.c that fully manage the DisplayState interface allocating > data and setting the depth (either 16 or 32 bit, if the guest uses a > different resolution or is in text mode, vga.c (or another backend) is > in charge of doing the conversion seamlessly). > > The other idea is that DisplayState supports *multiple* frontends > like sdl and vnc; each of them can register some callbacks to be called > when a display event occurs. > > The interesting changes are: > > - the new structures and related functions in console.h and console.c > > in particular the following functions are very helpful to manage a > DisplaySurface: > > qemu_createDisplaySurface > qemu_resizeDisplaySurface > qemu_createDisplaySurfaceFrom > qemu_freeDisplaySurface > > - console_select and qemu_console_resize in console.c > this two functions manage multiple consoles on a single host display > > - moving code around in hw/vga.c > as for the shared_buf patch this is necessary to be able to handle a dynamic > DisplaySurface bpp > > - changes to vga_draw_graphic in hw/vga.c > this is the place where the DisplaySurface buffer is shared with the > videoram, when possible; > > Signed-off-by: Stefano Stabellini > I think we need another intermediate step here. Right now, we have a pretty poor abstraction wrt QEMUConsole and DisplayState. QEMUConsole is known to much of the hardware emulation but DisplayState is too. I think we need a step that replaces all notions of QEMUConsole in hw/*.c with DisplayState including an appropriate creation functions. There's really no point in passing a DisplayState to the hardware devices, instead they should be allocating it and returning it to be passed to the SDL/VNC front-ends. Regards, Anthony Liguori