Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp3787895iog; Tue, 21 Jun 2022 06:07:24 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vACcVA4ALk/Xt0d9Dzeo5ZaRJd3iKTxoTVHhiI5paXh4jC/E1bAttOHcMbSPMthSs79U2l X-Received: by 2002:a17:906:4ccc:b0:6fe:9155:47ae with SMTP id q12-20020a1709064ccc00b006fe915547aemr24904887ejt.246.1655816843762; Tue, 21 Jun 2022 06:07:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655816843; cv=none; d=google.com; s=arc-20160816; b=lpVHjHID3aKSVn0gxlHSqWeSMvp0CS4aVwu3Qiql3UrZsvMav+62TAWjlH5JpndQmO DpMKl2P3fRaxjajpVwc233dN/VA6ShYe2jCQAH4ijthmTMlos5dIrz/m28tOyBGrA1Xo uQSBLqyse0XPD0WJikWIRCKHneaOVdoawxSqce5x0jYWkeLjTgjsQFdfCysh9vU+O1F/ MgV94qFgRe7XN82WBMS8Y44Eykoe5H5ROE8bxOt+QmJrKcYhctWlOs1yr8MGmB4mZQ3r jUnVeBZMyydTrSX8TK+7a8mVpegUx2BSckMWaErTzMnpu5VjMAhJ8jJpWKAlX/SIf3yK 32sA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:message-id:date:to:cc:from:subject :references:in-reply-to:content-transfer-encoding:mime-version :dkim-signature; bh=VacTFJlkEPIb2d77hXfx5pL5WkInGQSe4TlX3ljHVTE=; b=lyOjYnH24WLKqDGbLStRETZ6XSBr/PpKaf9AosDmTJ1DRfviIgQkaY+55AJFkSQPNn DbNp+PLKYZjtc3pp0FIMhsoxzWEhCRsLz1fBZca2aSWBZG9k30w4tZVUR0KegPfHtWSM A1KZ9715Cwd5OX2kn1/7s5DUFxhHMPpCCUX4sWRNjMoQdkUSwMEkvqHcXcl9QvSedkDV BdX6PA8orWGQS6zfdVWCX4C+lqNIvDD362vwcXHf3GY/m1tN4LOZKVDyoG+Y/DUKmTZ4 9plaUwHMne+DAaOwbDYBXRe/B4JSoQDggLYiWxPlX36wIoDvf0li4aFjD9BhpRk9/FTR RKVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b="OO5/5+9Y"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b23-20020aa7c917000000b004357330a3a9si684884edt.70.2022.06.21.06.06.57; Tue, 21 Jun 2022 06:07:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b="OO5/5+9Y"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351104AbiFUM7F (ORCPT + 99 others); Tue, 21 Jun 2022 08:59:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56968 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351153AbiFUM6g (ORCPT ); Tue, 21 Jun 2022 08:58:36 -0400 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ED7312A2; Tue, 21 Jun 2022 05:58:34 -0700 (PDT) Received: from pendragon.ideasonboard.com (cpc89244-aztw30-2-0-cust3082.18-1.cable.virginm.net [86.31.172.11]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 6800B104; Tue, 21 Jun 2022 14:58:32 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1655816312; bh=QeBzIO+U3oKdldlfZMcuLeVK7EiSrArkPksFp8cBSkM=; h=In-Reply-To:References:Subject:From:Cc:To:Date:From; b=OO5/5+9Yhc4qSTux6Py6LT4Iy9hqrC9FAcbdk89g+PfRJ9mfNx/9LXQfiVqPfMl6B l/HtiR7/BVJjXnB3PuCTdJ9rho2pL2COKVqdaXTmuizWOt9m7IN1wjsDio7LVg3ePB sCpnfC6Tove2EPl7XyJUAFnmnCL1okn8xaSvBPgs= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable In-Reply-To: <20220616170821.1348169-1-steve@sk2.org> References: <20220616170821.1348169-1-steve@sk2.org> Subject: Re: [PATCH v2] drm: shmobile: Use backlight helper From: Kieran Bingham Cc: Stephen Kitt , David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org To: Laurent Pinchart , Stephen Kitt Date: Tue, 21 Jun 2022 13:58:29 +0100 Message-ID: <165581630958.18145.12909267841116831017@Monstersaurus> User-Agent: alot/0.10 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Quoting Stephen Kitt (2022-06-16 18:08:21) > This started with work on the removal of backlight_properties' > deprecated fb_blank field, much of which can be taken care of by using > helper functions provided by backlight.h instead of directly accessing > fields in backlight_properties. This patch series doesn't involve > fb_blank, but it still seems useful to use helper functions where > appropriate. >=20 > Instead of retrieving the backlight brightness in struct > backlight_properties manually, and then checking whether the backlight > should be on at all, use backlight_get_brightness() which does all > this and insulates this from future changes. >=20 > Signed-off-by: Stephen Kitt > Cc: Laurent Pinchart > Cc: Kieran Bingham Hi Stephen, This looks reasonable to me too. Reviewed-by: Kieran Bingham > Cc: David Airlie > Cc: Daniel Vetter > Cc: dri-devel@lists.freedesktop.org > --- > Changes since v1: clarified commit message, this doesn't touch fb_blank > --- > drivers/gpu/drm/shmobile/shmob_drm_backlight.c | 6 +----- > 1 file changed, 1 insertion(+), 5 deletions(-) >=20 > diff --git a/drivers/gpu/drm/shmobile/shmob_drm_backlight.c b/drivers/gpu= /drm/shmobile/shmob_drm_backlight.c > index f6628a5ee95f..794573badfe8 100644 > --- a/drivers/gpu/drm/shmobile/shmob_drm_backlight.c > +++ b/drivers/gpu/drm/shmobile/shmob_drm_backlight.c > @@ -18,11 +18,7 @@ static int shmob_drm_backlight_update(struct backlight= _device *bdev) > struct shmob_drm_connector *scon =3D bl_get_data(bdev); > struct shmob_drm_device *sdev =3D scon->connector.dev->dev_privat= e; > const struct shmob_drm_backlight_data *bdata =3D &sdev->pdata->ba= cklight; > - int brightness =3D bdev->props.brightness; > - > - if (bdev->props.power !=3D FB_BLANK_UNBLANK || > - bdev->props.state & BL_CORE_SUSPENDED) > - brightness =3D 0; > + int brightness =3D backlight_get_brightness(bdev); > =20 > return bdata->set_brightness(brightness); > } >=20 > base-commit: f2906aa863381afb0015a9eb7fefad885d4e5a56 > --=20 > 2.30.2 >