Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3519706pxf; Mon, 15 Mar 2021 11:21:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxAAfTXPqVeDeN+9N+MVy22XyNnSYSJjIfnnHRRcTnbFlKvTO0dEYoRrF/e/3zC/nod0pgf X-Received: by 2002:a17:906:4410:: with SMTP id x16mr25343778ejo.446.1615832510596; Mon, 15 Mar 2021 11:21:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615832510; cv=none; d=google.com; s=arc-20160816; b=N0IKtOnLVeP5/F5Ien9Z+hBzcJTs4f+SwEAHnmvFFY1JbsWIdfeAnKcMsxOBoWr9dy 0NnZf8EjPePzTwSsUsfPPXM5zSzyg+ZcQ4K8Vhd/64tt3JhZD+mBlFHDuFlVEu0xcKHh msypNyjMKvqw7wcrGRXglJ9B2Yg+lzaLhUTn49Gen9Lg536uU+BufUecrmyvS+brXq4r ddd2BvH8impsJb5QQ3IF2b4m+bF7d4uvWaGTNRVJZcJfLd6U1JNiG+uFQw+4wPAUKVAD FaQ9VcO1AKcyFefRrW7cfCq3yIBmjoKvdsmAkMPYKBw5S2XUEeG9x85Bn6wMTwmgqIMC w9Tg== 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=ZyWcrkZvj+YEDYQxwNg/62m807nI951HUSx6uZrqEEs=; b=IQ/o7zYTwmHGXzmEuRH+VR8F5/PMCqCs7q0I4Lpag4qcZhPH+T/cIGH6RhoDn6TlOa nMD5X/bw5/NtBbJX0+GDen6fqtaPoT31C+zpuDwoo35ZaeJNg3IxEBrQCH2yczGuhJzP 2FIPSYJsxy/Efva2zjJD7fy/tzvoG2WahoZZnhB0GzCz5V+E6L0iV64/yVM+2HRbgjj9 FHGSpkyUepbmT19YFwy7AJ6QLx4+5d2BbmB8w8ZfuFJ1zkMtzR0KkbxA/pFGWvBj/5QU Y4O/Lf7ka4p/vZ828cPXL37MqlKMZmqy5+ShyHo18oAOkZI/RkERZ2bZnrUP5qw1s/iR P69w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=M7MJRDJz; 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 n23si11623936ejr.458.2021.03.15.11.21.28; Mon, 15 Mar 2021 11:21:50 -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=M7MJRDJz; 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 S237557AbhCOOSm (ORCPT + 99 others); Mon, 15 Mar 2021 10:18:42 -0400 Received: from mail.kernel.org ([198.145.29.99]:36622 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231758AbhCON7e (ORCPT ); Mon, 15 Mar 2021 09:59:34 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 47C9564F33; Mon, 15 Mar 2021 13:59:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1615816750; bh=c3OWMHyUmE3iqfapPvYjuoCblnfxxTaXmBBJ486zzn4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=M7MJRDJzQIYfPzBV+y5/c0/kdxJ8PLKachRGmRw2GjXIthlSRu2qDsC2DQTgZpWe/ 8hA9QdT7fovedjc/Bwnub7AAXeGwwnSmKAcHkQ/ptJxtmEb1LX+swTqv/+mUnJAs2R R3bMwq7Bv5iapbYlv+IcVOOiwMcxLGuV5O8fRHM0= 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.11 102/306] drm/amdgpu/display: simplify backlight setting Date: Mon, 15 Mar 2021 14:52:45 +0100 Message-Id: <20210315135511.091118188@linuxfoundation.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210315135507.611436477@linuxfoundation.org> References: <20210315135507.611436477@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 @@ -3132,19 +3132,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) { @@ -3207,9 +3194,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; }