Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp540289pxk; Wed, 9 Sep 2020 11:52:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx64fJjbG2L7Qu8vOtRhnB5FTOnn7h6uxYujXAmgoYvMawKxdxlDu+c8U1o9pEuk3T7QdvB X-Received: by 2002:aa7:d697:: with SMTP id d23mr5770008edr.13.1599677551759; Wed, 09 Sep 2020 11:52:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599677551; cv=none; d=google.com; s=arc-20160816; b=J4vR7/SRWUYrVCuR9wM/LPbAcfcFlmqUHtx6V1Tvtt76Rqm2at7wls6JCT+3pAeUZd LHLHxct/f/Vi/CtkDcpKHaf1hFaBsVb4ieeNQTDHvxhc1nPkx+AhY8V3CQ9bfTfPhry2 ym/+Hzd77DXw4DBcDPb045pbu8yqFeGog5KuUMkgfeDEh5oAWDSBcpXl/3BT0H3LVCAf bb/USGT8msGtrfNFAc+t3yFQ7empJlLPQF0U1ntwRwgMRGjGiFtwNZfw3zPGZtRxWXT2 67WEm8TrFBIC6xD9xcsWJbUVdUx/bPBHkSxCa8VWKl/p3AuAdpxUGU1rJTrXCu6x/+xY a75A== 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 :in-reply-to:references:mime-version:dkim-signature; bh=VfN64tSOGeP7ex6MQ1qLJK62hgHjPavCUX84aVCHqYU=; b=y6uHGNXL4201vJXkhfmudn/hesrRmugCpo4HkJ5ZnKxoDKlS80tGaJf4Uu0gCze2Ya 15pJNMHZL2LeM/6mIEREMH5e3YaQBYoGRtfQ+SUSI+hkvlzYkdXwEwkCswdC0aUZN9+S SRyNMkNZ8yBIYutccEdgnCHt6DIRonJDBep9e9U3BqeebXwsdZiWOcn5GK5gqDTG1dAR tDzMbno+3bAkIE0ziTZ8OCzo8dvYwP0atxcNSMBa+GB5Mn1Eg9ZGflJUDSxWdlvVbuAH 1ewbytw8EzISEtQLazfd4ELuWvmBsaf0W4pGZYxoFJ6k3RqK4IIAktQW1JhukPoeTfxR FWuw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=ggEyuPM2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id a8si2153190ejx.387.2020.09.09.11.52.08; Wed, 09 Sep 2020 11:52:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=ggEyuPM2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1726414AbgIISvj (ORCPT + 99 others); Wed, 9 Sep 2020 14:51:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50632 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725826AbgIISvh (ORCPT ); Wed, 9 Sep 2020 14:51:37 -0400 Received: from mail-ed1-x543.google.com (mail-ed1-x543.google.com [IPv6:2a00:1450:4864:20::543]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3E80DC061573 for ; Wed, 9 Sep 2020 11:51:35 -0700 (PDT) Received: by mail-ed1-x543.google.com with SMTP id c10so3745225edk.6 for ; Wed, 09 Sep 2020 11:51:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=VfN64tSOGeP7ex6MQ1qLJK62hgHjPavCUX84aVCHqYU=; b=ggEyuPM2at4cZym3o7YnP1kWeACf1A6Gzyf6R67Do2SkEc2O4Is3QDDRCJP5ee5H5s dqlEbhjuIJRjrKi25j6Mc8DUJ5Sz0mo5RxmSanuYmQTrFXKhj7t3w4Oh9DP6K6qOJPAX lzxxI9BQ4WLYaCt6rXfLNN1Nu66pUQK7u39vc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=VfN64tSOGeP7ex6MQ1qLJK62hgHjPavCUX84aVCHqYU=; b=MQBATjzFdByCuJV1orrvwTGOoGOYTcyKh8so6418bns3s0OlLErjb9kX8IhHPHGzx9 aCxNLRtukYIxGt2oPxq3e+w+u5oXAgzhSXeeEbEi2RlQfFAbor/wtCp+nA74LT+xswI/ Xg3g6WWt1yg8V9A1errD1qAiqb3wDkSioiMVXfD8+VCD7k01NzEYXuDPh9Lub5UuAupR HIN48ie1fZEHzhqkHtp4DF+ME/iFt6aRzYZ55A5IxmUKv+7yPwC4u18wDXE7V98ZBBQT lGRgQvsvrzHPms8jSjycZb4Ift3gEaEPfcrpaL+kO9n2IQM2xZ4AeVc6laP3YwDvbk9N LlBQ== X-Gm-Message-State: AOAM533rbqD6Bekr3LJJi476N0+Fk0kK9ElBJqjf1B16J/FktZmPbIZM m9X5r45YzgpLZTqPy9V6RnNCXiflIq98qw== X-Received: by 2002:a50:8f45:: with SMTP id 63mr5761834edy.52.1599677490229; Wed, 09 Sep 2020 11:51:30 -0700 (PDT) Received: from mail-ed1-f46.google.com (mail-ed1-f46.google.com. [209.85.208.46]) by smtp.gmail.com with ESMTPSA id bt14sm3376241ejb.2.2020.09.09.11.51.30 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 09 Sep 2020 11:51:30 -0700 (PDT) Received: by mail-ed1-f46.google.com with SMTP id n22so3757791edt.4 for ; Wed, 09 Sep 2020 11:51:30 -0700 (PDT) X-Received: by 2002:a17:906:bb0e:: with SMTP id jz14mr5218995ejb.525.1599677012842; Wed, 09 Sep 2020 11:43:32 -0700 (PDT) MIME-Version: 1.0 References: <20200721042522.2403410-1-amstan@chromium.org> <20200720212502.2.Iab4d2192e4cf50226e0a58d58df7d90ef92713ce@changeid> <20200904113822.xoyt4w5x7vwvh7cr@holly.lan> In-Reply-To: <20200904113822.xoyt4w5x7vwvh7cr@holly.lan> From: Alexandru M Stan Date: Wed, 9 Sep 2020 11:42:56 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 2/3] backlight: pwm_bl: Artificially add 0% during interpolation To: Daniel Thompson Cc: Thierry Reding , =?UTF-8?Q?Uwe_Kleine=2DK=C3=B6nig?= , Lee Jones , Jingoo Han , Bartlomiej Zolnierkiewicz , Heiko Stuebner , Rob Herring , Matthias Kaehlcke , Douglas Anderson , Enric Balletbo i Serra , dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, linux-kernel , linux-pwm@vger.kernel.org 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 On Fri, Sep 4, 2020 at 4:38 AM Daniel Thompson wrote: > > On Mon, Jul 20, 2020 at 09:25:21PM -0700, Alexandru Stan wrote: > > Some displays need the low end of the curve cropped in order to make > > them happy. In that case we still want to have the 0% point, even though > > anything between 0% and 5%(example) would be skipped. > > For backlights it is not defined that 0 means off and, to be honest, 0 > means off is actually rather weird for anything except transflexive > or front lit reflective displays[1]. There is a problem on several > systems that when the backlight slider is reduced to zero you can't > see the screen properly to turn it back up. This patch looks like it > would make that problem worse by hurting systems with will written > device trees. > > There is some nasty legacy here: some backlight displays that are off > at zero and that sucks because userspace doesn't know whether zero is > off or lowest possible setting. > > Nevertheless perhaps a better way to handle this case is for 0 to map to > 5% power and for the userspace to turn the backlight on/off as final > step in an animated backlight fade out (and one again for a fade in). Hello Apologies for my delay. Thanks for the responses! Yeah, I felt pretty sketchy about this 0% patch as well. But I figured it's better to send my suggestion and get corrected than lose the fixed interpolation patch. Turns out there's no reason to need 2/3. I was mistaken: echo "4" > /sys/devices/platform/backlight/backlight/backlight/bl_power seems to work just fine to turn the backlight off, nothing special about my device (pwm comes from cros_ec). Chrome OS user space already makes full use of that knob (https://source.chromium.org/chromiumos/chromiumos/codesearch/+/master:src/platform2/power_manager/powerd/system/internal_backlight.cc;l=169) I wanted to try X11 on the same device but I haven't gotten to it yet, perhaps I'll post my results in the next cover letter. So it seems I didn't have to worry about "not breaking userspace" on the existing devices. I'll respin this patch set: keep 1/3 and 3/3, remove 2/3, and potentially add another one to update trogdor's dtsi (since that's where I want this fixed linear interpolation to happen). Thank you, Alexandru Stan