From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Kchm9-0003F8-D4 for qemu-devel@nongnu.org; Mon, 08 Sep 2008 10:31:33 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Kchm5-00039o-P6 for qemu-devel@nongnu.org; Mon, 08 Sep 2008 10:31:31 -0400 Received: from [199.232.76.173] (port=38803 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Kchm4-00038J-SA for qemu-devel@nongnu.org; Mon, 08 Sep 2008 10:31:28 -0400 Received: from smtp.ctxuk.citrix.com ([62.200.22.115]:63195 helo=SMTP.EU.CITRIX.COM) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Kchle-0003iG-62 for qemu-devel@nongnu.org; Mon, 08 Sep 2008 10:31:28 -0400 Message-ID: <48C5378D.1010502@eu.citrix.com> Date: Mon, 08 Sep 2008 15:32:45 +0100 From: Stefano Stabellini 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> <48C535E2.9040703@codemonkey.ws> In-Reply-To: <48C535E2.9040703@codemonkey.ws> Content-Type: text/plain; charset=UTF-8 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: Anthony Liguori Cc: qemu-devel@nongnu.org Anthony Liguori wrote: > 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. > I understand. I went with red_max1 because we were already using this "notation" with red_shift and red_shift1. How do you suggest I should call them?