From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HUkIS-0007bN-6f for qemu-devel@nongnu.org; Fri, 23 Mar 2007 09:59:12 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HUkIL-0007b8-TQ for qemu-devel@nongnu.org; Fri, 23 Mar 2007 09:59:10 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HUkIL-0007b5-PQ for qemu-devel@nongnu.org; Fri, 23 Mar 2007 08:59:05 -0500 Received: from ug-out-1314.google.com ([66.249.92.168]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1HUkGQ-00023C-Tk for qemu-devel@nongnu.org; Fri, 23 Mar 2007 09:57:07 -0400 Received: by ug-out-1314.google.com with SMTP id j40so1146099ugd for ; Fri, 23 Mar 2007 06:57:05 -0700 (PDT) Message-ID: Date: Fri, 23 Mar 2007 14:57:01 +0100 From: "andrzej zaborowski" Sender: balrogg@gmail.com Subject: Re: [Qemu-devel] [PATCH] Guest mouse cursor drawing in SDL In-Reply-To: <46008A46.3070902@codemonkey.ws> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <20070320150848.GC2311@networkno.de> <45FFFFF2.3090702@codemonkey.ws> <46008A46.3070902@codemonkey.ws> Reply-To: balrogg@gmail.com, qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: qemu-devel@nongnu.org Hi, sorry for late reply. On 21/03/07, Anthony Liguori wrote: > andrzej zaborowski wrote: > >> > (the pixel format of the cursor was the same as the pixel format of > >> DisplayState). > > > > I'm not sure if we want to always use the same pixel format - for > > example with VMware SVGA and SDL in 16 bit mode, the cursor pixel > > format reported by guest Xorg was 8 bpp. This would mean two > > conversions instead of one: first VMware SVGA would have to convert 8 > > -> 16 bpp then SDL 16 -> 1 bpp. > > VNC expects the cursor data to be in the current pixel format. The nice > thing about this approach is you don't need to pass a bunch of pixel > info (for instance, you don't need to pass the depth, endianness, etc.). True. Maybe it's worth doing the double conversion (in the VGA and another one in SDL). > > The Cirrus hardware cursor also has to be copied anyway and doing the > conversion is really straight forward. > > >> One question in my mind is what the alpha mask should look like. All > >> that VNC (and SDL) can use is a 1-bit alpha depth. That's all Cirrus > >> supports too. VMware SVGA supports an 8-bit alpha channel though so it > >> may make sense to design the interface now to support that. > > > > VMware SVGA without CAP_ALPHA_CURSOR also does only 1-bit alpha. Maybe > > we should keep two masks - if the frontend (e.g SDL) supports only > > 1-bit alpha it would use only this basic mask - if the emulated VGA > > supports only 1-bit alpha it would leave the other mask opaque. > > I thought about that. Right now with my patch, the cursor mask is > always 1-bit deep. I was thinking that perhaps the right thing to do is > to make it always 8-bits deep and then convert in VNC. > > Do you think using the SDL cursor is all that useful? As soon as gtk > widgets get involved, the cursor becomes ARGB so in practice, I'm not > sure that it's all that helpful. It's pretty cool that you have only one cursor and that it's either "in the VM" or outside, and it's full hardware drawn. In addition without it, I think you can't get cursor refreshes between the SDL refresh callbacks. So with the patch the cursor movement is really smooth and responsive, eliminating the SDL latency. I find it amazing that it works :p I think VNC support is not a reason to drop this couple of lines in sdl.c (cause there's no API changes related). > > BTW, I've got the ALPHA_CURSOR working with VNC.. it's very sweet :-) Awesome! Are there screenshots? Regards, Andrew