Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3517512pxf; Mon, 15 Mar 2021 11:18:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx6b2TJzzDRfHOKqibAS+LgWRXjsm+I8RjIIOV+JBJY43SBIK7xP+4Aiw0awHOf3Ro0DSse X-Received: by 2002:a50:ef11:: with SMTP id m17mr31517290eds.151.1615832297541; Mon, 15 Mar 2021 11:18:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615832297; cv=none; d=google.com; s=arc-20160816; b=hIPpqjA5He4fDSrPqtD1OaZCn73NetGnatYpubnjhWEIUfEnik2XmwcxzsGbztwu4L ij8sBPfTCid4xsxvdB2e9pSyHHKOgKPM7/YIN7Ease/li0OMJJ9aRSw6Vc463EohbJm5 SzOJWJfOo84xLv7TfNLmzSr1GnW+Dru2NCTRekSTBxNzfeOqaA56Qgt1v5l9suJBH03w WUZmegUws0K2ff4tjVzV5DFdL5rCoTnWLacr/49u/QoXmyspOhL93Bv3J9XnqZgarO9U YMDNPsjS0NMi7jQndY6IhuHZufaUt+pObo4tqlEFoYt02+tGfSQrdqeWGDmp/glfcByM 4qMQ== 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=O2YLmT6G7IIQ2xRcSojkNPSbRJsJ/g3UYCtSRkT2i7w=; b=KkGyT+7EPNDuHLoKZzntIRbC7Z/O/rcpwZTHLlUteOt/M8LI4jt6NXGo4KgE0/7vTE nDXOtc5WLAJopmQ7xQh35cS2BcdH+X8wdoGdk3n2MMOgwoLydntSNbs+MUhgm/8zzcE2 biACM0foSbFmPMi7PWAkY52Iluu3dRU4EKccbcRTGDIij2YuMrOJFZMDiAtOohRCPXmn VWVVebnL114SuGz+tBl6acDweoh9575HsvzkSgxEItanuDFqy11AjQCslRT0sl6bBbUg 9VYyf5Lbc87SczAOR6f2xEkqr0GWVFZTFhdixh56eiatDdIxJrtPnWu41tvy0kRokDJi DVxg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=HqkNfhkU; 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 dr7si11306184ejc.126.2021.03.15.11.17.55; Mon, 15 Mar 2021 11:18:17 -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=HqkNfhkU; 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 S231518AbhCOOQj (ORCPT + 99 others); Mon, 15 Mar 2021 10:16:39 -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 S232660AbhCON71 (ORCPT ); Mon, 15 Mar 2021 09:59:27 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id A5F1964EEC; Mon, 15 Mar 2021 13:59:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1615816742; bh=fzv0hS2tpRP+IvjwmV+vVbY3kcM+z5Dwz+AHRVWSx+U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HqkNfhkU8EO+fKW4FVt3cOrSR0B6j/pS6UsaN0ZTzzsqt1tg/CbDj3zyQ8qpVrnZ7 caYrU8noCauBjPwz85w4el1VVmLKDzfaVwd108XoCX3GcSy8t6k5dAMwgm+b8Kll4a nUXOsjp8nVfsJBeLcn45+XKA6B+LdbX/+IT52FFY= 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.11 097/306] drm/amd/display: Add a backlight module option Date: Mon, 15 Mar 2021 14:52:40 +0100 Message-Id: <20210315135510.936504116@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: 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 @@ -179,6 +179,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 @@ -777,6 +777,10 @@ uint amdgpu_dm_abm_level; 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 @@ -2209,6 +2209,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)