Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756586AbdLOU5o (ORCPT ); Fri, 15 Dec 2017 15:57:44 -0500 Received: from atrey.karlin.mff.cuni.cz ([195.113.26.193]:35194 "EHLO atrey.karlin.mff.cuni.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755596AbdLOU5h (ORCPT ); Fri, 15 Dec 2017 15:57:37 -0500 Date: Fri, 15 Dec 2017 21:57:35 +0100 From: Pavel Machek To: Enric Balletbo Serra Cc: Daniel Thompson , Doug Anderson , Enric Balletbo i Serra , Jingoo Han , Richard Purdie , Jacek Anaszewski , Rob Herring , Brian Norris , Guenter Roeck , Lee Jones , Alexandru Stan , linux-leds@vger.kernel.org, "devicetree@vger.kernel.org" , LKML Subject: Re: [RFC v2 2/2] backlight: pwm_bl: compute brightness of LED linearly to human eye. Message-ID: <20171215205735.GB19442@amd> References: <20171116141151.21171-1-enric.balletbo@collabora.com> <20171116141151.21171-3-enric.balletbo@collabora.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="neYutvxvOLaeuPCA" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1242 Lines: 48 --neYutvxvOLaeuPCA Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi! > Yes, I think that how you describe luminance and lightness is right, > and sounds good improve the doc. >=20 > To be clear the correction table for PWM values can be calculated with > this code. >=20 > OUTPUT_SIZE =3D 65535 # Output integer size > INPUT_SIZE =3D 2047 >=20 > def cie1931(L): > L =3D L*100.0 > if L <=3D 8: > return (L/902.3) > else: > return ((L+16.0)/116.0)**3 >=20 > x =3D range(0,int(INPUT_SIZE+1)) > y =3D [int(round(cie1931(float(L)/INPUT_SIZE)*(OUTPUT_SIZE))) for L in x] Can we just generate the table on the fly? Should not be hard to do in fixed point, right? Pavel --=20 (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blo= g.html --neYutvxvOLaeuPCA Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlo0Nz8ACgkQMOfwapXb+vLmAQCfZ/eCnsMCbiLrCZ2klKjeLoF1 1TgAnjhGLjdHwXQiirMX6DAAK4tef9Ut =LWQK -----END PGP SIGNATURE----- --neYutvxvOLaeuPCA--