From mboxrd@z Thu Jan 1 00:00:00 1970 From: Pavel Machek Subject: Re: [RFC v2 2/2] backlight: pwm_bl: compute brightness of LED linearly to human eye. Date: Fri, 15 Dec 2017 21:57:35 +0100 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" Return-path: Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org 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 List-Id: devicetree@vger.kernel.org --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--