From: Alan Cox Subject: Re: [PATCH 1/3] r600: add span support for 2D tiling Date: Thu, 27 May 2010 16:37:00 +0100 Message-ID: <20100527163700.54d3d20a@lxorguk.ukuu.org.uk> References: <1274829174-17491-1-git-send-email-alexdeucher@gmail.com> <1274829174-17491-2-git-send-email-alexdeucher@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-14" Content-Transfer-Encoding: quoted-printable Return-path: Received: from www.etchedpixels.co.uk (earthlight.etchedpixels.co.uk [81.2.110.250]) by gabe.freedesktop.org (Postfix) with ESMTP id 1B2B49EC57 for ; Thu, 27 May 2010 08:29:17 -0700 (PDT) In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org Errors-To: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org To: Alex Deucher Cc: dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org On Thu, 27 May 2010 11:20:59 -0400 Alex Deucher wrote: > On Thu, May 27, 2010 at 10:55 AM, Matt Turner wrote: > >> +static inline GLint r600_log2(GLint n) > >> +{ > >> + =A0 =A0 =A0 GLint log2 =3D 0; > >> + > >> + =A0 =A0 =A0 while (n >>=3D 1) > >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 ++log2; > >> + =A0 =A0 =A0 return log2; > >> +} > > > > Does mesa not provide something like this? > = > The only one I could find was a gallium utility function. include/linux/log2.h The original is from Red Hat so if you need it non GPL maybe Red Hat can help ?