From nobody Sat Nov 23 17:33:08 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 399931A76CB; 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=CkQYGu5F0lv43tMzvqJMyRwzgm5QuSPlr8udTXDknusEAbpoBl1lTUCWYJWuwVOIrh+/40hw6tZx8ipPOxkORiRAo68jnrDEWMRW6JD4WcNkzagWVkuX4p2Zw3V4kTIkVrdKctsWw2g7vhO7RhV+Ynb2EQNAPIw1D575qCe4LkE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731348631; c=relaxed/simple; bh=gewAwPO3qh+Y2D06hY+c1ZA4Hu3N5AEkx64t58yChhM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=i9GgTt7WEGsYDEXf/Xr6kDe8wMe6xL+Ca2LO1f28V054lHheBfKdY49uJW3Tea2CD4gZ/jtapiEJaZtoZhh0tHL7fm7O+Ft7+ymCi9/1Ikoy8AAapslXSzTj3v/ek1tfDks2L3eiIstdBOUwX4sMlks7j+P8CnPVU6l3H1XEdDQ= 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=epNCb3Hc; 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="epNCb3Hc" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1731348626; bh=gewAwPO3qh+Y2D06hY+c1ZA4Hu3N5AEkx64t58yChhM=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=epNCb3HcWya8/k6UgupdIzbxQy82pH1heFJLvO4WW2MfeH3NWW5ReW8871AmNvzfP qWevV1OGGL/202xTojJxz6M7cfwELsJEgxld7SzSyjriM4g/TRaqd36E5ZUfTcbQEX QcVFqBZFxwGhidV9TmJbdgU6XqSHlFrGcLpzqTBY= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Mon, 11 Nov 2024 19:09:35 +0100 Subject: [PATCH v7 1/4] drm: Add panel backlight quirks 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-1-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=5343; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=gewAwPO3qh+Y2D06hY+c1ZA4Hu3N5AEkx64t58yChhM=; b=hLG1EO9WPBkOmEDx9wct4UzFPecXrB0Ab7ovzP1gQPbF8nRt5Qwf4fp/+m+3Wx3sXU2VEt4Co kYY0JomVu6kCDwjjDv8iF7Xk+Ls/7LBtX0U5Zg7PkalOQCO6rDHO6tJ X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= Panels using a PWM-controlled backlight source do not have a standard way to communicate their valid PWM ranges. On x86 the ranges are read from ACPI through driver-specific tables. The built-in ranges are not necessarily correct, or may grow stale if an older device can be retrofitted with newer panels. Add a quirk infrastructure with which the minimum valid backlight value can be maintained as part of the kernel. Signed-off-by: Thomas Wei=C3=9Fschuh Tested-by: Dustin L. Howett Reviewed-by: Mario Limonciello Reviewed-by: Harry Wentland --- Documentation/gpu/drm-kms-helpers.rst | 3 ++ drivers/gpu/drm/Kconfig | 4 ++ drivers/gpu/drm/Makefile | 1 + drivers/gpu/drm/drm_panel_backlight_quirks.c | 70 ++++++++++++++++++++++++= ++++ include/drm/drm_utils.h | 4 ++ 5 files changed, 82 insertions(+) diff --git a/Documentation/gpu/drm-kms-helpers.rst b/Documentation/gpu/drm-= kms-helpers.rst index 8cf2f041af4704875910ce8228ae04615d0f21bd..b4ee25af1702b0019e0de5f9ee6= 6d2dbdac2c664 100644 --- a/Documentation/gpu/drm-kms-helpers.rst +++ b/Documentation/gpu/drm-kms-helpers.rst @@ -221,6 +221,9 @@ Panel Helper Reference .. kernel-doc:: drivers/gpu/drm/drm_panel_orientation_quirks.c :export: =20 +.. kernel-doc:: drivers/gpu/drm/drm_panel_backlight_quirks.c + :export: + Panel Self Refresh Helper Reference =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =20 diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig index 5504721007cc190e7d768d42aa9633baa0115f5e..7cf9aa476b4745419f1002a7866= fe974d852a2be 100644 --- a/drivers/gpu/drm/Kconfig +++ b/drivers/gpu/drm/Kconfig @@ -526,6 +526,10 @@ config DRM_HYPERV config DRM_EXPORT_FOR_TESTS bool =20 +# Separate option as not all DRM drivers use it +config DRM_PANEL_BACKLIGHT_QUIRKS + tristate + config DRM_LIB_RANDOM bool default n diff --git a/drivers/gpu/drm/Makefile b/drivers/gpu/drm/Makefile index 463afad1b5ca6275e61223adc8ca036c3d4d6b03..06b73068d2483045f819b35095c= 7dc83d6fcbd53 100644 --- a/drivers/gpu/drm/Makefile +++ b/drivers/gpu/drm/Makefile @@ -95,6 +95,7 @@ drm-$(CONFIG_DRM_PANIC_SCREEN_QR_CODE) +=3D drm_panic_qr.o obj-$(CONFIG_DRM) +=3D drm.o =20 obj-$(CONFIG_DRM_PANEL_ORIENTATION_QUIRKS) +=3D drm_panel_orientation_quir= ks.o +obj-$(CONFIG_DRM_PANEL_BACKLIGHT_QUIRKS) +=3D drm_panel_backlight_quirks.o =20 # # Memory-management helpers diff --git a/drivers/gpu/drm/drm_panel_backlight_quirks.c b/drivers/gpu/drm= /drm_panel_backlight_quirks.c new file mode 100644 index 0000000000000000000000000000000000000000..6b8bbed77c7f1f3570a6e68c276= 244cfe4386f6c --- /dev/null +++ b/drivers/gpu/drm/drm_panel_backlight_quirks.c @@ -0,0 +1,70 @@ +// SPDX-License-Identifier: GPL-2.0 + +#include +#include +#include +#include +#include +#include + +struct drm_panel_min_backlight_quirk { + struct { + enum dmi_field field; + const char * const value; + } dmi_match; + struct drm_edid_ident ident; + u8 min_brightness; +}; + +static const struct drm_panel_min_backlight_quirk drm_panel_min_backlight_= quirks[] =3D { +}; + +static bool drm_panel_min_backlight_quirk_matches(const struct drm_panel_m= in_backlight_quirk *quirk, + const struct drm_edid *edid) +{ + if (!dmi_match(quirk->dmi_match.field, quirk->dmi_match.value)) + return false; + + if (!drm_edid_match(edid, &quirk->ident)) + return false; + + return true; +} + +/** + * drm_get_panel_min_brightness_quirk - Get minimum supported brightness l= evel for a panel. + * @edid: EDID of the panel to check + * + * This function checks for platform specific (e.g. DMI based) quirks + * providing info on the minimum backlight brightness for systems where th= is + * cannot be probed correctly from the hard-/firm-ware. + * + * Returns: + * A negative error value or + * an override value in the range [0, 255] representing 0-100% to be scale= d to + * the drivers target range. + */ +int drm_get_panel_min_brightness_quirk(const struct drm_edid *edid) +{ + const struct drm_panel_min_backlight_quirk *quirk; + size_t i; + + if (!IS_ENABLED(CONFIG_DMI)) + return -ENODATA; + + if (!edid) + return -EINVAL; + + for (i =3D 0; i < ARRAY_SIZE(drm_panel_min_backlight_quirks); i++) { + quirk =3D &drm_panel_min_backlight_quirks[i]; + + if (drm_panel_min_backlight_quirk_matches(quirk, edid)) + return quirk->min_brightness; + } + + return -ENODATA; +} +EXPORT_SYMBOL(drm_get_panel_min_brightness_quirk); + +MODULE_DESCRIPTION("Quirks for panel backlight overrides"); +MODULE_LICENSE("GPL"); diff --git a/include/drm/drm_utils.h b/include/drm/drm_utils.h index 70775748d243b0fd6e13a088d05c45f31cf34a4a..15fa9b6865f448cc8338c935874= 015fd74cb7bb2 100644 --- a/include/drm/drm_utils.h +++ b/include/drm/drm_utils.h @@ -12,8 +12,12 @@ =20 #include =20 +struct drm_edid; + int drm_get_panel_orientation_quirk(int width, int height); =20 +int drm_get_panel_min_brightness_quirk(const struct drm_edid *edid); + signed long drm_timeout_abs_to_jiffies(int64_t timeout_nsec); =20 #endif --=20 2.47.0 From nobody Sat Nov 23 17:33:08 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 From nobody Sat Nov 23 17:33:08 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 D7CBD1AA1FC; 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=1731348632; cv=none; b=mDa3pXu3oXVdq9O2XCDz+w/gDbUrPgH+08FLSrlAYprzDbaeI6f0RsyOZcS6xowclBWnhvnaxiO/8zAt8youqCCb22aNY6Ej7QacQ/qSMwlsK9twv5schpPGnV85wCJaP5AWlnY1VxTWR4Le34Ud31Jji/ZmsfGvtBhCtCgOYX0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731348632; c=relaxed/simple; bh=8H8xBXK1HgMOQ+vsSlHOZrCpBpOh7Wa+WddZuG0gJME=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=XlmCNbqG2ArbxK/BtT1xjWKnIM/5MYeGRJtK8Yrpk72VqXl0f/mlNghqQfzrjYlVvdlpgAv4s/HUCOCGIX8zgKWqdh6SXqjTwUlpYWKIQyxhRpkLiPB7594utBETHD/KrYk+JIs2+GG2mYS3GWYA5grQe1C9OKS7c5jLu5M92jk= 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=Dz6gdD3K; 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="Dz6gdD3K" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1731348626; bh=8H8xBXK1HgMOQ+vsSlHOZrCpBpOh7Wa+WddZuG0gJME=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=Dz6gdD3K2TBD9RO43ZUaklQcdPxzwQMa4ug7LVTRJ02Lbr3/moDFSw5s05MvXBEAa Rt5A+Xmo4smMhHABQYjGLZVle3qVBWM53ENB44ohqfilLnoIR5zGtQfun+N9OaszF9 rNflUchacH3heP9fwzo8KTh5vNELxOqNzGCQ0RjU= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Mon, 11 Nov 2024 19:09:37 +0100 Subject: [PATCH v7 3/4] drm: panel-backlight-quirks: Add Framework 13 matte panel 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-3-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=1592; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=8H8xBXK1HgMOQ+vsSlHOZrCpBpOh7Wa+WddZuG0gJME=; b=SsWiSHcju57hPOqWYpNBRHXQOeyPsQ0H9go2sfjMDozSoFIbgmJ1DHFx/wRLqrgHQzaugrCF2 r5+YMI1pVNGBGKhAvDw4fihbwJaBcJfXVbOKeTXG2mW4CX+IPW+ofoQ X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= The value of "min_input_signal" returned from ATIF on a Framework AMD 13 is "12". This leads to a fairly bright minimum display backlight. Add a quirk to override that the minimum backlight PWM to "0" which leads to a much lower minimum brightness, which is still visible. Tested on a Framework AMD 13 BIOS 3.05 with the matte panel. Link: https://community.frame.work/t/25711/9 Link: https://community.frame.work/t/47036 Signed-off-by: Thomas Wei=C3=9Fschuh Tested-by: Dustin L. Howett Reviewed-by: Mario Limonciello Reviewed-by: Harry Wentland --- drivers/gpu/drm/drm_panel_backlight_quirks.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/gpu/drm/drm_panel_backlight_quirks.c b/drivers/gpu/drm= /drm_panel_backlight_quirks.c index 6b8bbed77c7f1f3570a6e68c276244cfe4386f6c..f2aefff618ddbb6c2170db5c9f5= 35f3b6a465d1d 100644 --- a/drivers/gpu/drm/drm_panel_backlight_quirks.c +++ b/drivers/gpu/drm/drm_panel_backlight_quirks.c @@ -17,6 +17,14 @@ struct drm_panel_min_backlight_quirk { }; =20 static const struct drm_panel_min_backlight_quirk drm_panel_min_backlight_= quirks[] =3D { + /* 13 inch matte panel */ + { + .dmi_match.field =3D DMI_BOARD_VENDOR, + .dmi_match.value =3D "Framework", + .ident.panel_id =3D drm_edid_encode_panel_id('B', 'O', 'E', 0x0bca), + .ident.name =3D "NE135FBM-N41", + .min_brightness =3D 0, + }, }; =20 static bool drm_panel_min_backlight_quirk_matches(const struct drm_panel_m= in_backlight_quirk *quirk, --=20 2.47.0 From nobody Sat Nov 23 17:33:08 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 403231AA788; Mon, 11 Nov 2024 18:10:30 +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=1731348632; cv=none; b=BtZAxbX5hseh9xJ78P03WDh+KzCoPp2JoUoyArZwD74s3gztPZ4it6sO7SdKB3/iRT3FmCumFbHAVWyasr8p2NTUpaJcC5FRtFndLVPA5HsGOZL0LlZlj42fIoMniXH2nD50tVAy2vKBrP72UQEEaXhlmBef4W14Wz09Qq/LCVw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731348632; c=relaxed/simple; bh=MI2iFMI5An6EgbYmS5WZjVZcL7OiZNeX5hsm8wgEhfQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ubXRdL46hV9oxJ507IfSXBkmfScyzvRLT+iyC3qeptwXgk5K3NfN08FrC/A3HsFkvuK84iXSSLgW4rmAtdVS+iQUZH49O0aYEruOydH/VmNzCkK4pJBkw83ln1Me1tnW5hrv+++DALyChUlOI+QPrM9iCAICqSxXHvpizbyPbiE= 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=bpYaCKR/; 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="bpYaCKR/" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1731348626; bh=MI2iFMI5An6EgbYmS5WZjVZcL7OiZNeX5hsm8wgEhfQ=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=bpYaCKR/ti753hGae9vVGVXskE4lgZBY59QptDMTD37pYrEVMb7p1XqF5x7vnENoI f9YPeaDEWLOEeLcP/HRl3kJz7aWaqOwlLSMkDvPD6ynQ5Oy2yIESvgODKLaP2hCJBz H60sBkaz8fugZYjKSzVIzPz9XoC+uWpNafXgEL4Y= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Mon, 11 Nov 2024 19:09:38 +0100 Subject: [PATCH v7 4/4] drm: panel-backlight-quirks: Add Framework 13 glossy and 2.8k panels 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-4-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=1550; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=C5Ys8GE15MeKqVacQaK1KCVt6nQBigVpuprfdOPO5K4=; b=/YkPFAPlCsFMyBCs1GWM9MsNLQIinCIm6SZTJTQwCilQi7+QWSO8uGcuabC+6CPLmdKmhyR2S IjHqYHneHjkDPsk0E5X3ac6LzlZsjOZdVwgRlJWAog/h/H+EfQ6h4Z9 X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= From: "Dustin L. Howett" I have tested these panels on the Framework Laptop 13 AMD with firmware revision 3.05 (latest at time of submission). Signed-off-by: Dustin L. Howett Signed-off-by: Thomas Wei=C3=9Fschuh Reviewed-by: Mario Limonciello Reviewed-by: Harry Wentland --- drivers/gpu/drm/drm_panel_backlight_quirks.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/drivers/gpu/drm/drm_panel_backlight_quirks.c b/drivers/gpu/drm= /drm_panel_backlight_quirks.c index f2aefff618ddbb6c2170db5c9f535f3b6a465d1d..c477d98ade2b41314d4218281ce= d7d3c4d087769 100644 --- a/drivers/gpu/drm/drm_panel_backlight_quirks.c +++ b/drivers/gpu/drm/drm_panel_backlight_quirks.c @@ -25,6 +25,22 @@ static const struct drm_panel_min_backlight_quirk drm_pa= nel_min_backlight_quirks .ident.name =3D "NE135FBM-N41", .min_brightness =3D 0, }, + /* 13 inch glossy panel */ + { + .dmi_match.field =3D DMI_BOARD_VENDOR, + .dmi_match.value =3D "Framework", + .ident.panel_id =3D drm_edid_encode_panel_id('B', 'O', 'E', 0x095f), + .ident.name =3D "NE135FBM-N41", + .min_brightness =3D 0, + }, + /* 13 inch 2.8k panel */ + { + .dmi_match.field =3D DMI_BOARD_VENDOR, + .dmi_match.value =3D "Framework", + .ident.panel_id =3D drm_edid_encode_panel_id('B', 'O', 'E', 0x0cb4), + .ident.name =3D "NE135A1M-NY1", + .min_brightness =3D 0, + }, }; =20 static bool drm_panel_min_backlight_quirk_matches(const struct drm_panel_m= in_backlight_quirk *quirk, --=20 2.47.0