From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KchhG-00042a-HT for qemu-devel@nongnu.org; Mon, 08 Sep 2008 10:26:30 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KchhE-0003zQ-IY for qemu-devel@nongnu.org; Mon, 08 Sep 2008 10:26:29 -0400 Received: from [199.232.76.173] (port=59710 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KchhE-0003z3-C7 for qemu-devel@nongnu.org; Mon, 08 Sep 2008 10:26:28 -0400 Received: from wx-out-0506.google.com ([66.249.82.230]:38261) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KchhE-0002x6-Av for qemu-devel@nongnu.org; Mon, 08 Sep 2008 10:26:28 -0400 Received: by wx-out-0506.google.com with SMTP id h27so166306wxd.4 for ; Mon, 08 Sep 2008 07:26:27 -0700 (PDT) Message-ID: <48C535E2.9040703@codemonkey.ws> Date: Mon, 08 Sep 2008 09:25:38 -0500 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH 1 of 3] [UPDATE] vnc dynamic resolution References: <48BFF02F.2000803@eu.citrix.com> <48C474FC.70608@codemonkey.ws> <48C5310E.5090506@eu.citrix.com> In-Reply-To: <48C5310E.5090506@eu.citrix.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefano Stabellini Cc: qemu-devel@nongnu.org Stefano Stabellini wrote: > Anthony Liguori wrote: > >> "Red-max is the maximum red value (= 2n − 1 where n is the number of >> bits used for red)." >> >> Is this just overzealous checks or was a fix for a broken client? >> > > > This code is meant to convert pixels from the vnc server internal pixel > format to the vnc client pixel format. > red_max refers to the vnc client red max, while red_max1 refers to the > vnc server internal red max. > Before we were just handling the case red_max1 = 0xff, this code should > be able to handle other cases as well (necessary for handling the shared > buffer). > Does this answer your question? May be with the assumption that red_max > = 2^n - 1 is still possible to simplify the conversion code... > Perhaps the source of my confusion is the use of red_max and red_max1. Could you try some more descriptive names? I understand what the code is doing now but it's very easy to confuse the two masks. Regards, Anthony Liguori