From nobody Sat Nov 23 20:53:00 2024 Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 843B21AA1C4; Mon, 11 Nov 2024 18:10:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=159.69.126.157 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731348631; cv=none; b=beJ4DSL4nSJ1Wg9bI3G65/0CItQQGv/uWIspXGpSgxcQAs0naJgpksOQ6tVLoX+t8tFEiyhHKu4N8YaOnswQtXf7M7lNHH5bZZXrIa2SoXPg+pZcFcohwVjnQvs/vtKqGXP+fFfbqAlCtK+q6Hej+mfra8oKSxhrlYbgWnIaKD8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731348631; c=relaxed/simple; bh=Ij7WrOwbX4+J8efDi9hsvP8ax5mhRWdjQ6nHoo28gzE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=EGsbo9kDdbD8mnnTawCvipdDtda2zOcjtzLHBe8pGBHdlCNR8e8O1boyDfjUiL6ENLXZCSlUuXghtq1SCB+hN8VZz7AtLzJyV6mAexdb9T3GjQcU+nTJodYnsPQZbBwtgpQAqbOTdvVhb1Ali+crOYQQLdO7+RHLpsBw+HoYuWA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=weissschuh.net; spf=pass smtp.mailfrom=weissschuh.net; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b=CetmhQNd; arc=none smtp.client-ip=159.69.126.157 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=weissschuh.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=weissschuh.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b="CetmhQNd" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1731348626; bh=Ij7WrOwbX4+J8efDi9hsvP8ax5mhRWdjQ6nHoo28gzE=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=CetmhQNdsZECXWJrRT/UoPheFvOur/9Vb+BD4Vk/ZxTtiwaXo7wkg4Sn1rBQvHcaG FXEBDXt/YLFu7KbP4Fw4sUXeNrv227Bgc6rg4++9+WsvTe/T+/tXHbXQ3u2o0qiBlF +7Yi7UbT8QJLs9P0aj3ZRNEDZb2uDmZZKksrM73c= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Mon, 11 Nov 2024 19:09:36 +0100 Subject: [PATCH v7 2/4] drm/amd/display: Add support for minimum backlight quirk Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20241111-amdgpu-min-backlight-quirk-v7-2-f662851fda69@weissschuh.net> References: <20241111-amdgpu-min-backlight-quirk-v7-0-f662851fda69@weissschuh.net> In-Reply-To: <20241111-amdgpu-min-backlight-quirk-v7-0-f662851fda69@weissschuh.net> To: Alex Deucher , =?utf-8?q?Christian_K=C3=B6nig?= , David Airlie , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Harry Wentland , Leo Li , Rodrigo Siqueira , Mario Limonciello , Matt Hartley , Kieran Levin , Hans de Goede , Jani Nikula , Xinhui Pan , Jonathan Corbet , Simona Vetter , Simona Vetter Cc: amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Dustin Howett , linux-doc@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1731348626; l=2774; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=Ij7WrOwbX4+J8efDi9hsvP8ax5mhRWdjQ6nHoo28gzE=; b=N1/hwP+f25Iyb2hUfrGmymSai8h22mMgwriToXROom+skaWGq3S8XP6usBZvkb547mrEu517Q 2T55qArHRzVAgP6MuWidTheLHzcR3k7VuDE67Ml3CsEn/grMqQvB5jg X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= Not all platforms provide the full range of PWM backlight capabilities supported by the hardware through ATIF. Use the generic drm panel minimum backlight quirk infrastructure to override the capabilities where necessary. Testing the backlight quirk together with the "panel_power_savings" sysfs file has not shown any negative impact. One quirk seems to be that 0% at panel_power_savings=3D0 seems to be slightly darker than at panel_power_savings=3D4. Signed-off-by: Thomas Wei=C3=9Fschuh Tested-by: Dustin L. Howett Reviewed-by: Mario Limonciello Reviewed-by: Harry Wentland --- drivers/gpu/drm/amd/amdgpu/Kconfig | 1 + drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/Kconfig b/drivers/gpu/drm/amd/amdgp= u/Kconfig index 41fa3377d9cf566294c6f86eedd8b31a22c77510..1a11cab741aca4483673f8e7794= b4d3022d269e6 100644 --- a/drivers/gpu/drm/amd/amdgpu/Kconfig +++ b/drivers/gpu/drm/amd/amdgpu/Kconfig @@ -26,6 +26,7 @@ config DRM_AMDGPU select DRM_BUDDY select DRM_SUBALLOC_HELPER select DRM_EXEC + select DRM_PANEL_BACKLIGHT_QUIRKS # amdgpu depends on ACPI_VIDEO when ACPI is enabled, for select to work # ACPI_VIDEO's dependencies must also be selected. select INPUT if ACPI diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gp= u/drm/amd/display/amdgpu_dm/amdgpu_dm.c index f0a6816709ca7dad6415d16f9806f18065026cf7..19a58630e774029767bf2a27eb4= ddf17e3c21129 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -93,6 +93,7 @@ #include #include #include +#include #include #include #include @@ -3457,6 +3458,7 @@ static void update_connector_ext_caps(struct amdgpu_d= m_connector *aconnector) struct drm_connector *conn_base; struct amdgpu_device *adev; struct drm_luminance_range_info *luminance_range; + int min_input_signal_override; =20 if (aconnector->bl_idx =3D=3D -1 || aconnector->dc_link->connector_signal !=3D SIGNAL_TYPE_EDP) @@ -3491,6 +3493,10 @@ static void update_connector_ext_caps(struct amdgpu_= dm_connector *aconnector) caps->aux_min_input_signal =3D 0; caps->aux_max_input_signal =3D 512; } + + min_input_signal_override =3D drm_get_panel_min_brightness_quirk(aconnect= or->drm_edid); + if (min_input_signal_override >=3D 0) + caps->min_input_signal =3D min_input_signal_override; } =20 void amdgpu_dm_update_connector_after_detect( --=20 2.47.0