Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MTEt4-00038Y-FQ for qemu-devel@nongnu.org; Tue, 21 Jul 2009 08:56:06 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MTEsz-00035m-IH for qemu-devel@nongnu.org; Tue, 21 Jul 2009 08:56:05 -0400 Received: from [199.232.76.173] (port=50558 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MTEsx-00035e-Rj for qemu-devel@nongnu.org; Tue, 21 Jul 2009 08:56:00 -0400 Received: from smtp.eu.citrix.com ([62.200.22.115]:4348) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MTEsw-0005LD-Sy for qemu-devel@nongnu.org; Tue, 21 Jul 2009 08:55:59 -0400 Date: Tue, 21 Jul 2009 13:56:07 +0100 From: Stefano Stabellini Subject: Re: [Qemu-devel] Re: [PATCH] update server bits on vnc_update In-Reply-To: <4A6577A1.9010509@redhat.com> Message-ID: References: <1247892434-21209-1-git-send-email-glommer@redhat.com> <4A6577A1.9010509@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gerd Hoffmann Cc: Glauber Costa , "aliguori@us.ibm.com" , "qemu-devel@nongnu.org" On Tue, 21 Jul 2009, Gerd Hoffmann wrote: > On 07/18/09 06:47, Glauber Costa wrote: > > Since the server/guest split in vnc architecture, we > > no longer update the server bits on large updates. Result > > is screen gets garbled, specially on scroll actions. > > > > I must admit I don't fully understand our vnc code, but after > > a careful reading, it seemed to me the proposed patch would fix > > it, and it indeed, works. > > NAK. > > VNC screen update workflow is this: > > (1) vnc_update() is called to mark a region as dirty, > the guest bitmap is updated accordingly. May happen > multiple times. > (2) vnc_update_client() is called by timer. It walks > the guest bitmap. For dirty regions it checks whenever > guest and server bitmap are *really* different, if so > it does a guest->server copy and updates the server > dirty bitmap. > (3) vnc_update_client() walks the server dirty map and sends > over the changes to the client. > As a side note: I was reading the new vnc multiclient code to understand how the refresh works now, and I have just noticed something that I think is wrong: we call vga_hw_update in vnc_update_client, that means we call it once per vnc client connected! We should call it only once, probably in a separate timer, that is enabled only if at least one client is connect. I also don't like the fact that we are allocating a server surface per client connected, this can become a problem very fast: I think we could probably get away with just one server surface for all the clients.