Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3517388pxf; Mon, 15 Mar 2021 11:18:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJww9U1PepfzRfOPrKlLWxIMD9xBiYQ0tyAJG3CrxjrSFhqOGmGWlxZ1RpxmIwayCTPlNLdh X-Received: by 2002:a17:906:5e55:: with SMTP id b21mr9151272eju.289.1615832286154; Mon, 15 Mar 2021 11:18:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615832286; cv=none; d=google.com; s=arc-20160816; b=XQBNJ/f0VpKzEhf9DQ9BGUk02+kpa24Ndk7T1OVADE6LfbPzIqANInSAA9Xk3qRM2K j6fm5Nvx6cUDsAsOH2eXr40bC4TeEByPdBZUhjyxsH5OvJEWEIlTrzOszuV8zEHtULCX NQCbeyjepal/vLcnPJXXB9W2hUXztfSyJ+sNvFj7VpPnbSFpsfgItBK1b29/Bzd1iS9d 9WJFPYdmtuOa8Q8oKz68K2g0phkx+Pk4UwR/nj0c5g1/M4jNhSZNVCZd8Q+Dvz7L9s/O RjAHOYOHSQtPNBAusFHJEKOz3g4CZx3/4Ts0R3nKptgZO1UWAbHj8eWQOr+EzJgDcaVX 50pA== 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=Qr7NUHVfDs7siM/nOB0rjQhHKwN7EyfjgyKvNIv7Exc=; b=i3r1aQ6F0M085Aycmj5VfdPHgFRSmi6235vk2iS2jSr3vgiEUn02VjByvZROv6WgPd jPLeNzoV6I2z08tG+Y/eTbE34wESQRdKoa8JXZs3fMnymNEeJSI3rlhk63VxvlzVGn8z r5n/ALSMjb5GbnibY51+aM7MVHaqrSTA2VtUF1tndf2Pin02dEZTlPN1wvJBC0e4GS5l Jiz+XwRDD7hXqDf/9d4zKoRpGfAY0fzRNCRo763alVj7YTInShWOqZCRFoo4cyZNNu4r w2PIjffMm/fjH6o2QUUpc3V0BrKDLLfRSuAaF3EWcRXEdoJ/4DzE2iqPRwslP+bXAvLx rovg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Mht6CeBP; 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 q16si11575999ejd.145.2021.03.15.11.17.44; Mon, 15 Mar 2021 11:18:06 -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=Mht6CeBP; 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 S236939AbhCOOQ5 (ORCPT + 99 others); Mon, 15 Mar 2021 10:16:57 -0400 Received: from mail.kernel.org ([198.145.29.99]:37820 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232086AbhCON7M (ORCPT ); Mon, 15 Mar 2021 09:59:12 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 82C2D64F60; Mon, 15 Mar 2021 13:58:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1615816738; bh=1Rhy1SGKFluUeX/Ya9lJjumMOaFbfp6VWF5vLrT3N28=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Mht6CeBPliYEQHR8C1IxmXUz4M9ZHiDGbglaeQnBhRudMNkKmHTU+EEPyXSXOKnAT 8MBkl+xeCs0Jcp2fzxfe5I+srvmT5lOluPHlK9rk3mvdmaTA88jTv5pdBqbU9cUI3K XjOV2ldUe2UmIuMI6QI2ZAXW/VpbXyIV1btrIBRc= From: gregkh@linuxfoundation.org To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Nicholas Kazlauskas , Takashi Iwai , Alex Deucher Subject: [PATCH 5.10 085/290] drm/amd/display: Add a backlight module option Date: Mon, 15 Mar 2021 14:52:58 +0100 Message-Id: <20210315135544.796764353@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: Takashi Iwai commit 7a46f05e5e163c00e41892e671294286e53fe15c upstream. There seem devices that don't work with the aux channel backlight control. For allowing such users to test with the other backlight control method, provide a new module option, aux_backlight, to specify enabling or disabling the aux backport support explicitly. As default, the aux support is detected by the hardware capability. v2: make the backlight option generic in case we add future backlight types (Alex) BugLink: https://bugzilla.opensuse.org/show_bug.cgi?id=1180749 BugLink: https://gitlab.freedesktop.org/drm/amd/-/issues/1438 Reviewed-by: Nicholas Kazlauskas Signed-off-by: Takashi Iwai Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 1 + drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 4 ++++ drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 5 +++++ 3 files changed, 10 insertions(+) --- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h @@ -178,6 +178,7 @@ extern uint amdgpu_smu_memory_pool_size; extern uint amdgpu_dc_feature_mask; extern uint amdgpu_dc_debug_mask; extern uint amdgpu_dm_abm_level; +extern int amdgpu_backlight; extern struct amdgpu_mgpu_info mgpu_info; extern int amdgpu_ras_enable; extern uint amdgpu_ras_mask; --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c @@ -768,6 +768,10 @@ uint amdgpu_dm_abm_level = 0; MODULE_PARM_DESC(abmlevel, "ABM level (0 = off (default), 1-4 = backlight reduction level) "); module_param_named(abmlevel, amdgpu_dm_abm_level, uint, 0444); +int amdgpu_backlight = -1; +MODULE_PARM_DESC(backlight, "Backlight control (0 = pwm, 1 = aux, -1 auto (default))"); +module_param_named(backlight, amdgpu_backlight, bint, 0444); + /** * DOC: tmz (int) * Trusted Memory Zone (TMZ) is a method to protect data being written --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -2140,6 +2140,11 @@ static void update_connector_ext_caps(st caps->ext_caps->bits.hdr_aux_backlight_control == 1) caps->aux_support = true; + if (amdgpu_backlight == 0) + caps->aux_support = false; + else if (amdgpu_backlight == 1) + caps->aux_support = true; + /* From the specification (CTA-861-G), for calculating the maximum * luminance we need to use: * Luminance = 50*2**(CV/32)