Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1219428ybl; Fri, 16 Aug 2019 10:53:08 -0700 (PDT) X-Google-Smtp-Source: APXvYqwxbDVRR/iyV7KZqkb6uc4Syo7mkx1+IR/lPgMNenwK+fQOQ0YecZuMU/Y+uI2fRULEf286 X-Received: by 2002:a17:90a:ca0f:: with SMTP id x15mr8183781pjt.82.1565977988179; Fri, 16 Aug 2019 10:53:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565977988; cv=none; d=google.com; s=arc-20160816; b=iZzNbQ7deazUXQyMsEFGNIQPbMLkCHy5qIZ8r7lYQ8D2uN/N+TwDEe4zgpq0Q10wHv FydDvYuvq6U92xf3lqS3h8UAG2CQRkZeS20G9Crb2WFCSVWWab2fHJkuXz1o+ZjmBBZa J585HO7y7Mie7NAuUgiVKp1d0kHkpwV0MsBgooOCvHZhnRI2Yte9guKPAwCQSaaGfTzp YRb48idJSADSkCFfWeV4d2xvfqI2lJYFhbF8GO48DvuNzFM6G2bkv7t5e2OmL/gzR+CX pK0zML31lAUyg5RG2f5digJKnFkZXEdtOFSaiNUDMvFOVosN3A5S4K/WkUDkIGyejI3e kcpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=xjxlB0B/JZnHNwu9yzdxZFE3he1ESE8+7aIO3e2RkyQ=; b=ZUMuvGoWIdJBvbU8s4+CKPr6IYYVvJBEX1gGjDg9Lx4BpQwmHhTMehcevZG7YOKrtE PUYqs5mRrMHo9wCpmBSj+AIEvKvgXG2JjTsg0YSSJ7CNWmfUYjfSWHYIO75EHkWQBEnl E/oXhoWttWJvorzicroZWlrABEKu+ssMRL9MH73MTC/TDLHjCFKlZws99Qh8pTSJAeKF Yg7+xFKPOFNUhFRaLGoC+4PlfeUlFPLpwuEfwpfmHDoiR2o5FrYAf7sbMXItvLoKhd80 T0Dsdz38p4e8tw01zlkHNI1bxjkHiEIezwkb71fLmyOiaI4H20ZG9hs8CKfJYGwIKj55 QOKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=NWmOxTml; 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=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t4si4500922plb.366.2019.08.16.10.52.53; Fri, 16 Aug 2019 10:53:08 -0700 (PDT) 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=@chromium.org header.s=google header.b=NWmOxTml; 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=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727545AbfHPRwG (ORCPT + 99 others); Fri, 16 Aug 2019 13:52:06 -0400 Received: from mail-pg1-f193.google.com ([209.85.215.193]:40181 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727503AbfHPRwG (ORCPT ); Fri, 16 Aug 2019 13:52:06 -0400 Received: by mail-pg1-f193.google.com with SMTP id w10so3291862pgj.7 for ; Fri, 16 Aug 2019 10:52:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=xjxlB0B/JZnHNwu9yzdxZFE3he1ESE8+7aIO3e2RkyQ=; b=NWmOxTmlwuqvYepW/pFP8VjWfNcBSeaFJiXDcL0o6v7Rvz8TLVtdKnwCd8I/2FMoMs 78S4FIuhOe1aIEuZ/RxhcqKOfVuhGptQBHAw3i/dj3GvfGe2XVrRPMoi1FV9rxsP40Gi aOcF7Niwzy0kmnSzlnHcurkXlpMbOhRfTDSyQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=xjxlB0B/JZnHNwu9yzdxZFE3he1ESE8+7aIO3e2RkyQ=; b=DDJn/TjziiH95hHSxBxoN36uxESGYWx+x51H0xtDXRBw+uaXCLcN8Y3DL2wB5uQqmt mI/A+L7J2ktmvRXkuCoeYEZDTklL5WAA4PyLj6xFVW4kKoReXMXWlbRjXl8Um5/KNMBz O5rRrzfVgTb1Hht/8BgwgMjkdvONgDLfoLoTQKDy+sM6XXK2sUMKHfyvpxRk+X/Gxi9B ODuXQjZK+KWkTzdIbSQAqZU75bmknyH8Rb9fZgW2COpBZOldv3hrdlFbB0auKRHdzyoL pkYXNh7mtHJFKXPYSK3NyzQMT9j6s7sY9WTST4rCybaIJS0ZDLeBtAEJLVN0GSYdmKt1 ooSg== X-Gm-Message-State: APjAAAV7XQPkGgSNBPcIjyASUKotVjxwsIrnReZJT37454eQjAhwtNE5 ZHpJ6kgrrcpqJxv5p3OdW/9jfQ== X-Received: by 2002:aa7:8102:: with SMTP id b2mr12049391pfi.105.1565977925626; Fri, 16 Aug 2019 10:52:05 -0700 (PDT) Received: from localhost ([2620:15c:202:1:75a:3f6e:21d:9374]) by smtp.gmail.com with ESMTPSA id 16sm10735880pfc.66.2019.08.16.10.52.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 16 Aug 2019 10:52:05 -0700 (PDT) Date: Fri, 16 Aug 2019 10:51:57 -0700 From: Matthias Kaehlcke To: Uwe =?utf-8?Q?Kleine-K=C3=B6nig?= Cc: Thierry Reding , Lee Jones , Daniel Thompson , Jingoo Han , Bartlomiej Zolnierkiewicz , linux-pwm@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org, Enric Balletbo i Serra , Douglas Anderson , Brian Norris , Pavel Machek , Jacek Anaszewski Subject: Re: [PATCH v3 2/4] backlight: Expose brightness curve type through sysfs Message-ID: <20190816175157.GT250418@google.com> References: <20190709190007.91260-1-mka@chromium.org> <20190709190007.91260-3-mka@chromium.org> <20190816165148.7keg45fmlndr22fl@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20190816165148.7keg45fmlndr22fl@pengutronix.de> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Uwe, On Fri, Aug 16, 2019 at 06:51:48PM +0200, Uwe Kleine-König wrote: > On Tue, Jul 09, 2019 at 12:00:05PM -0700, Matthias Kaehlcke wrote: > > Backlight brightness curves can have different shapes. The two main > > types are linear and non-linear curves. The human eye doesn't > > perceive linearly increasing/decreasing brightness as linear (see > > also 88ba95bedb79 "backlight: pwm_bl: Compute brightness of LED > > linearly to human eye"), hence many backlights use non-linear (often > > logarithmic) brightness curves. The type of curve currently is opaque > > to userspace, so userspace often uses more or less reliable heuristics > > (like the number of brightness levels) to decide whether to treat a > > backlight device as linear or non-linear. > > > > Export the type of the brightness curve via the new sysfs attribute > > 'scale'. The value of the attribute can be 'linear', 'non-linear' or > > 'unknown'. For devices that don't provide information about the scale > > of their brightness curve the value of the 'scale' attribute is 'unknown'. > > > > Signed-off-by: Matthias Kaehlcke > > I wonder what kind of problem you are solving here. Can you describe > that in a few words? The human eye perceives brightness in a logarithmic manner. For backlights with a linear brightness curve brightness controls like sliders need to use a mapping to achieve a behavior that is perceived as linear-ish (more details: http://www.pathwaylighting.com/products/downloads/brochure/technical_materials_1466797044_Linear+vs+Logarithmic+Dimming+White+Paper.pdf) As of now userspace doesn't have information about the type of the brightness curve, and often uses heuristics to make a guess, which may be right most of the time, but not always. The new attribute eliminates the need to guess.