Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3521968pxf; Mon, 15 Mar 2021 11:25:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxnscc2MrvgTGyXCeLo/J/qb/cH7IkBtBqObGODvVY1TzQ5gNXlVJ6cniYJdSSeLaroxTAA X-Received: by 2002:a05:6402:5255:: with SMTP id t21mr31621054edd.91.1615832719599; Mon, 15 Mar 2021 11:25:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615832719; cv=none; d=google.com; s=arc-20160816; b=WwwzwIDWNr+SBQVsOz4vshdI7ZKtRJjbaq4XZhhWv6Z5C8q/Z3A+bWusNLGS8ks7yz IhlCl6XRdmRoAvfdBCfbm8gOteyhwN4hhAJixejoja1Z8HRo+fddlyrUe6yezd83c+MI c+cX5svipumqx/o0Xy8qVW8PGwDfYFlAmeS8C85HIb+Ug+NsvVxOyCP8Ew94IikDKJ7s pxxsqY2EEB6MqwT4ziz/9aUoKHIgrKrGacTYsK5KOfoEU9EEX/hneOeczcOayW/y5Vwa k873dbyrzIxDcaAKO9K9riXw5eYtyxYK4+w4lktYw4e6EL4FsXGb7IZPND5hYx7WN+da gwEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=etJxyenvCX/ucdH+Rq/Gxu4VJy/NLzlAmXpafIypfHM=; b=nqRMA8iC+sbjzn/K4e3VAyBghkUeeY8g/hCgClgFGhj5YsOeOyI5CMAI8hFrcqP72O fUqAnpNJNeZUYPKb51CXGh/jifXbPKk/YK5UGW/b3hE2lGTCY94TJk2ILlaDabLlH0VH R5DGCBMVdU6figc9iC49LnwFElsMKsHIvTAJVn8zw2KhDzyulJmWoYj8iya1X3RGAynU WhP8/drvvB7uXe0uHLi0dUbBTt5tkMYempW3Y7C71v8f7R+v2FhvlFilbzLNUO8kr/Z5 +6VtnItvTT3LSCJ774qTx0IvvLw/F3aveq2BrfgNk6Xv4vHu4DFbvrj7kW+HmW5IDW7z jaFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=JCJcBBqR; 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=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id lg14si11562843ejb.6.2021.03.15.11.24.57; Mon, 15 Mar 2021 11:25:19 -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=@linuxfoundation.org header.s=korg header.b=JCJcBBqR; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234007AbhCOOZS (ORCPT + 99 others); Mon, 15 Mar 2021 10:25:18 -0400 Received: from mail.kernel.org ([198.145.29.99]:35186 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229921AbhCON72 (ORCPT ); Mon, 15 Mar 2021 09:59:28 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 7C4D864EF0; Mon, 15 Mar 2021 13:59:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1615816744; bh=06ZtyBjxsJP3AMFbEfc/g4O17r9BXDPGkX0QoBvbe7s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JCJcBBqRYSPfHcEfcc1zelGUIhsHcMVjY5PSLwK6lnhb/NSkqMpcQiM0tki0Y8XT+ jUyeSAQq4seGtViig4E9E7oTz8VPVq8KqYIFRFsr+ZIzFAuVWjKA4TJ6SlXhmQCHGI bq141UhzJev3DeycV39eVRYyHxKKWxFWAtrnDuMU= From: gregkh@linuxfoundation.org To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Nicholas Kazlauskas , Alex Deucher Subject: [PATCH 5.10 089/290] drm/amdgpu/display: simplify backlight setting Date: Mon, 15 Mar 2021 14:53:02 +0100 Message-Id: <20210315135544.926379220@linuxfoundation.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210315135541.921894249@linuxfoundation.org> References: <20210315135541.921894249@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Greg Kroah-Hartman From: Alex Deucher commit a2f8d988698d7d3645b045f4940415b045140b81 upstream. Avoid the extra wrapper function. Reviewed-by: Nicholas Kazlauskas Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -3043,19 +3043,6 @@ static void amdgpu_dm_update_backlight_c #endif } -static int set_backlight_via_aux(struct dc_link *link, uint32_t brightness) -{ - bool rc; - - if (!link) - return 1; - - rc = dc_link_set_backlight_level_nits(link, true, brightness, - AUX_BL_DEFAULT_TRANSITION_TIME_MS); - - return rc ? 0 : 1; -} - static int get_brightness_range(const struct amdgpu_dm_backlight_caps *caps, unsigned *min, unsigned *max) { @@ -3118,9 +3105,10 @@ static int amdgpu_dm_backlight_update_st brightness = convert_brightness_from_user(&caps, bd->props.brightness); // Change brightness based on AUX property if (caps.aux_support) - return set_backlight_via_aux(link, brightness); - - rc = dc_link_set_backlight_level(dm->backlight_link, brightness, 0); + rc = dc_link_set_backlight_level_nits(link, true, brightness, + AUX_BL_DEFAULT_TRANSITION_TIME_MS); + else + rc = dc_link_set_backlight_level(dm->backlight_link, brightness, 0); return rc ? 0 : 1; }