From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.1 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 21E05C433E0 for ; Mon, 1 Jun 2020 12:27:19 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E664C2077D for ; Mon, 1 Jun 2020 12:27:18 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=ti.com header.i=@ti.com header.b="waA3i6o3" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E664C2077D Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=ti.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id DFD476E25B; Mon, 1 Jun 2020 12:27:17 +0000 (UTC) Received: from fllv0016.ext.ti.com (fllv0016.ext.ti.com [198.47.19.142]) by gabe.freedesktop.org (Postfix) with ESMTPS id AC8006E25B for ; Mon, 1 Jun 2020 12:27:16 +0000 (UTC) Received: from lelv0266.itg.ti.com ([10.180.67.225]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id 051CR0K4029209; Mon, 1 Jun 2020 07:27:01 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1591014421; bh=fnRSqzP9pGzMUFokqiGLP0liVqECd6XBGgxZlqCodso=; h=Subject:To:CC:References:From:Date:In-Reply-To; b=waA3i6o3Ub0anbCZq9x3lP2hQuGwqEUuGmKCMfjKTdqFsb29Rcp2zgJcSK2l4o3L6 OIUuycYz4N77jXfkD7RCHGQWKxx+yyJAJnjaStNOIb0rDajf1k2rovY2BcodrOvcEw rDV3q2dMBdvJS7jnurdFSiEM7wBwYx4Nw43AW8c8= Received: from DFLE112.ent.ti.com (dfle112.ent.ti.com [10.64.6.33]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 051CR0gC019260 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 1 Jun 2020 07:27:00 -0500 Received: from DFLE112.ent.ti.com (10.64.6.33) by DFLE112.ent.ti.com (10.64.6.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3; Mon, 1 Jun 2020 07:26:59 -0500 Received: from fllv0040.itg.ti.com (10.64.41.20) by DFLE112.ent.ti.com (10.64.6.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3 via Frontend Transport; Mon, 1 Jun 2020 07:26:59 -0500 Received: from [192.168.2.6] (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0040.itg.ti.com (8.15.2/8.15.2) with ESMTP id 051CQsJR001831; Mon, 1 Jun 2020 07:26:55 -0500 Subject: Re: [PATCH v3 02/13] backlight: add backlight_is_blank() To: Sam Ravnborg , , Jingoo Han , Lee Jones , Daniel Thompson References: <20200601065207.492614-1-sam@ravnborg.org> <20200601065207.492614-3-sam@ravnborg.org> From: Peter Ujfalusi X-Pep-Version: 2.0 Message-ID: <36c42682-c17c-b5d9-8401-89eadd325bf4@ti.com> Date: Mon, 1 Jun 2020 15:27:39 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.1 MIME-Version: 1.0 In-Reply-To: <20200601065207.492614-3-sam@ravnborg.org> Content-Type: multipart/mixed; boundary="------------1E3414A7F514C84FE965C9A3" Content-Language: en-US X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-pwm@vger.kernel.org, Support Opensource , Michael Hennerich , Bartlomiej Zolnierkiewicz , David Airlie , Daniel Vetter , Tomi Valkeinen , Jonathan Corbet , Emil Velikov , Bjorn Andersson , Andy Gross , Thierry Reding , Thomas Zimmermann , linux-arm-msm@vger.kernel.org, Uwe Kleine-Konig , patches@opensource.cirrus.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" --------------1E3414A7F514C84FE965C9A3 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable On 01/06/2020 9.51, Sam Ravnborg wrote: > The backlight support has two properties that express the state: > - power > - state >=20 > It is un-documented and easy to get wrong. > Add backlight_is_blank() helper to make it simpler > for drivers to get the check of the state correct. >=20 > A lot of drivers also includes checks for fb_blank. > This check is redundant when the state is checked > and thus not needed in this helper function. > But added anyway to avoid introducing subtle bugs > due to the creative use of fb_blank in some drivers. > Introducing this helper will for some drivers results in > added support for fb_blank. This will be a change in > functionality, which will improve the backlight driver. >=20 > Rolling out this helper to all relevant backlight drivers > will eliminate almost all accesses to fb_blank. Reviewed-by: Peter Ujfalusi >=20 > v3: > - Clarified that the fb_blank support in > backlight_is_blank() may result in functionality > changes for the users (Emil) >=20 > v2: > - Added fb_blank condition (Daniel) >=20 > Signed-off-by: Sam Ravnborg > Reviewed-by: Daniel Thompson > Cc: Emil Velikov > Cc: Daniel Vetter > Cc: Lee Jones > Cc: Daniel Thompson > Cc: Jingoo Han > --- > include/linux/backlight.h | 19 +++++++++++++++++++ > 1 file changed, 19 insertions(+) >=20 > diff --git a/include/linux/backlight.h b/include/linux/backlight.h > index c7d6b2e8c3b5..a0a083b35c47 100644 > --- a/include/linux/backlight.h > +++ b/include/linux/backlight.h > @@ -175,6 +175,25 @@ static inline void backlight_put(struct backlight_= device *bd) > put_device(&bd->dev); > } > =20 > +/** > + * backlight_is_blank - Return true if display is expected to be blank= > + * @bd: the backlight device > + * > + * Display is expected to be blank if any of these is true:: > + * > + * 1) if power in not UNBLANK > + * 2) if fb_blank is not UNBLANK > + * 3) if state indicate BLANK or SUSPENDED > + * > + * Returns true if display is expected to be blank, false otherwise. > + */ > +static inline bool backlight_is_blank(struct backlight_device *bd) > +{ > + return bd->props.power !=3D FB_BLANK_UNBLANK || > + bd->props.fb_blank !=3D FB_BLANK_UNBLANK || > + bd->props.state & (BL_CORE_SUSPENDED | BL_CORE_FBBLANK); > +} > + > extern struct backlight_device *backlight_device_register(const char *= name, > struct device *dev, void *devdata, const struct backlight_ops *ops, > const struct backlight_properties *props); >=20 - P=C3=A9ter Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki --------------1E3414A7F514C84FE965C9A3 Content-Type: application/pgp-keys; name="pEpkey.asc" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="pEpkey.asc" -----BEGIN PGP PUBLIC KEY BLOCK----- mQENBFki4nsBCAD3BM+Ogt951JlaDloruEjoZk/Z+/37CjP0fY2mqLhBOzkpx95u X1Fquf0KfVk+ZzCd25XGOZEtpZNlXfbxRr2iRWPS5RW2FeLYGvg2TTJCpSr+ugKu OOec6KECCUotGbGhpYwBrbarJNEwDcAzPK7UJYa1rhWOmkpZJ1hXF1hUghB84q35 8DmN4sGLcsIbVdRF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oy9r3ZQfJNOXO1q/YQfpEELHn0p8LpwliSDUS1xL sswyxtZS8LlW8PjlTXuBLu38Vfr0vGav7oyV7TkhnKT3oBOLXanyZqwgyZSKNEGB PB4v3Fo7YTzpfSofiwuz03uyfjTxiMGjonxSb+YxM7HBHfzjrOKKlg02fK+lWNZo m5lXugeWD7U6JJguNdYfr+U4zYIblelUImcIE+wnR0oLzUEVDIWSpVrl/OqS3Rzo mw8wBsHksTHrbgUnKL0SCzYc90BTeKbyjEBnVDr+dlfbxRxkB8h9RMPMdjodvXzS Gfsa9V/k4XAsh7iX9EUVBbnmjA61ySxU/w98h96jMuteTg=3D=3D =3DeQmw -----END PGP PUBLIC KEY BLOCK----- --------------1E3414A7F514C84FE965C9A3 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel --------------1E3414A7F514C84FE965C9A3--