Received: by 10.223.164.202 with SMTP id h10csp201547wrb; Thu, 30 Nov 2017 08:58:35 -0800 (PST) X-Google-Smtp-Source: AGs4zMZUsM0kweHdDSQ65bU4EmfxMKTPyIjYGnYIFdGtqcdW/NHrWlo53c3dnXkn3PBDWN1d7MJu X-Received: by 10.84.168.37 with SMTP id e34mr3348636plb.10.1512061115615; Thu, 30 Nov 2017 08:58:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512061115; cv=none; d=google.com; s=arc-20160816; b=mQEGZCwFwm9vaj8zj7lW0De9TgrSxxghiUiwDx3Qot/p+T3g3eOd6AEP5ag8TdKX05 LTjyWO8bGUrI4Z5Cpq2zzlxc71zUAy2DGUeYhTrXdThWNdt4xL6kk6aOcYtIwhr3IzdL CZ1WqWJevCIB+Qdm2nVwriQX4bcxO0r1343Y6CktRC2pxicAxzn6R2NJZqroxz6g17WM P6KjWTtcspqRA3yT0LwIqwr7mecGK4IisR0LZ1xxOTUSxImuhx0DlN/rA1AVUG5W0wrJ 2adSyv8pKaS5Ci6wH06VXut8pMTROeypyUHC2wtKUOvmM9cxeno3XMK8/ienrt+lGMKh +xKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=a2yfA0hnak8YK9hNXscRH+TVmMr2RLy4yLeTX3QuSD0=; b=qXKy7pcnDl2m4HoyHJDGf3oZF4Ri4NRziOFqCybUM3kNiu/HFfDAXlELbgkTxeZcLn l6Xwd1V47jmttEbYVzKxz1In7A68qeX3QtZt1gv+hlvNXbpyBf/2RBnx6ncgYdbUXKPv GzyDSvgC9XfgtZEG1NL22BDzgiKv07OORgdG4nGq7MlsngvrpuqE+g6ikC+fblf/MGc7 GSteOxjSRoJCbXt2lEOodlJMW8ucoOj0jxlt/rdKnOGXTkXKPAeuosC5ft98QixO0umc pEEE3EvAA7+CLKYrvJ+FEZbMVSU5ExYP+0QAWnOgPDHpMrgUfHbBDHYVBHoqL9OYfNOG qpBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=sponL+85; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s4si3323145pgn.150.2017.11.30.08.58.22; Thu, 30 Nov 2017 08:58:35 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=sponL+85; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753125AbdK3Q5E (ORCPT + 99 others); Thu, 30 Nov 2017 11:57:04 -0500 Received: from mail-vk0-f44.google.com ([209.85.213.44]:37010 "EHLO mail-vk0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751929AbdK3Q5C (ORCPT ); Thu, 30 Nov 2017 11:57:02 -0500 Received: by mail-vk0-f44.google.com with SMTP id x140so3843424vke.4 for ; Thu, 30 Nov 2017 08:57:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=a2yfA0hnak8YK9hNXscRH+TVmMr2RLy4yLeTX3QuSD0=; b=sponL+85A2slChFpVEGSBgztr0EW5Oz3FhpI9oBFgiTSn9WzAgonFiYZz/ySXlDsxK SjiVYVjoq4+yR8IxCx0bo0JoAFgZ5vGf0UyNH9svv8x1Abi0W9+tATYl4ljVE0X0q7CL 2hUxFQLgQKbmwYW/mwyxBwv/Gae0yAEjd5+yAOpQipgE17rtbJsYBO+UQ0bhxHTf8VFh 8CuQhJk2QGMhu9xQOi1sEuKVaYpqfGwo7vrUx22lyXda/o5X0AG8naNA5gEeNw/dzZud JvBib/qmygcuF7R/RZMnUl95NUwysQkHRjXbXwRWQ253Ab/LmpXd9PZNXNjI+DhLDdeK /whw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=a2yfA0hnak8YK9hNXscRH+TVmMr2RLy4yLeTX3QuSD0=; b=GShGMcf6UmHhojhp8WidckhsqyoFeqNHSAU4eZcXMBqLuBm2ruvkzPtH/3POjmgQYc dfAZgyz2l0+DwL2xhxvtFPUoCPEYdBf8J9yjpYObOjs3mvvpvFwG59BYoFhvBvOgTQmr rMuGKwOJ24YgFUKZ3zKfDodwK4Ddp2Iab4s43hNWXmePHxfD5kUqG3EL+IZpR+ufgnQ5 ofYUu0ZnB9czHEsHgOo4a7ufTSAHHLHL/Dt93lTbOHWKaTBBbbgGBWGwpv49i3TTzhHw 8QZkZyyI2BONUkeVhwDiBymfYMmdmBijkjFs8dU1/byIjhrk8t/QpIWpmnXbJam/H9h6 UgAg== X-Gm-Message-State: AKGB3mKrfhtefZD73Hl3ryL2GPNABVjN5MUAyyeZ5RXYj6smhutVDdZe tqzzVYvsAmFNU542bBn8YBTmj+4S+AG3UlCFXp9NWg== X-Received: by 10.31.51.4 with SMTP id z4mr2059152vkz.127.1512061021172; Thu, 30 Nov 2017 08:57:01 -0800 (PST) MIME-Version: 1.0 Received: by 10.31.146.68 with HTTP; Thu, 30 Nov 2017 08:57:00 -0800 (PST) In-Reply-To: References: <20171116141151.21171-1-enric.balletbo@collabora.com> <20171116141151.21171-3-enric.balletbo@collabora.com> From: Doug Anderson Date: Thu, 30 Nov 2017 08:57:00 -0800 Message-ID: Subject: Re: [RFC v2 2/2] backlight: pwm_bl: compute brightness of LED linearly to human eye. To: Daniel Thompson Cc: Enric Balletbo i Serra , Jingoo Han , Richard Purdie , Jacek Anaszewski , Pavel Machek , Rob Herring , Brian Norris , Guenter Roeck , Lee Jones , Alexandru Stan , linux-leds@vger.kernel.org, devicetree@vger.kernel.org, LKML Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On Thu, Nov 30, 2017 at 3:27 AM, Daniel Thompson wrote: > > > On 30/11/17 00:44, Doug Anderson wrote: >> >> Hi, >> >> On Thu, Nov 16, 2017 at 6:11 AM, Enric Balletbo i Serra >> wrote: >>> >>> When you want to change the brightness using a PWM signal, one thing you >>> need to consider is how human perceive the brightness. Human perceive the >>> brightness change non-linearly, we have better sensitivity at low >>> luminance than high luminance, so to achieve perceived linear dimming, >>> the >>> brightness must be matches to the way our eyes behave. The CIE 1931 >>> lightness formula is what actually describes how we perceive light. >>> >>> This patch adds support to compute the brightness levels based on a >>> static >>> table filled with the numbers provided by the CIE 1931 algorithm, for now >>> it only supports PWM resolutions up to 65535 (16 bits) with 1024 steps. >>> Lower PWM resolutions are implemented using the same curve but with less >>> steps, e.g. For a PWM resolution of 256 (8 bits) we have 37 steps. >> >> >> Your patch assumes that the input to your formula (luminance, I think) >> scales linearly with PWM duty cycle. I don't personally know this, >> but has anyone confirmed it's common in reality, or at least is a >> close enough approximation of reality? > > > Isn't this the loop we went round for v1? > > We do know that its not linear, however the graphs from a couple of example > devices didn't look too scary and nobody has proposed a better formula. > > At this point the linear interpolation code in patch 1 allows people with > especially alinear devices to express suitable brightness curves. > > However we also know that many DT authors choose not to create good > brightness tables for their devices... and we'd rather they used allowed the > kernel to choose a model than to use no model at all. OK, cool. I didn't remember anyone actually confirming that they had checked that this was the case, but that's probably just my bad memory and failures at searching through history. I don't have any objections to the idea if people are convinced it's a good enough approximation. :) It would be kinda nice if something could go in the commit message, like: This method will work in any cases where linearly scaling the PWM duty cycle causes a roughly linear scaling of the luminance of the backlight. :) -Doug From 1585490271072406728@xxx Thu Nov 30 11:29:10 +0000 2017 X-GM-THRID: 1584241125376833263 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread