summaryrefslogtreecommitdiff
path: root/rust/helpers/device.c
diff options
context:
space:
mode:
authorChristopher Obbard <christopher.obbard@linaro.org>2025-08-14 16:16:09 +0200
committerNeil Armstrong <neil.armstrong@linaro.org>2025-10-01 09:19:22 +0200
commit68a7c52fa9e778bda45ed0b2e83a0bf2ea41b88c (patch)
tree7a1185b3336403ba00e32d60a68e1cb3503a7cbb /rust/helpers/device.c
parent3684218949703ea8779aec7c3ed598a05ccb2b23 (diff)
drm/dp: clamp PWM bit count to advertised MIN and MAX capabilities
According to the eDP specification (VESA Embedded DisplayPort Standard v1.4b, Section 3.3.10.2), if the value of DP_EDP_PWMGEN_BIT_COUNT is less than DP_EDP_PWMGEN_BIT_COUNT_CAP_MIN, the sink is required to use the MIN value as the effective PWM bit count. This commit updates the logic to clamp the reported DP_EDP_PWMGEN_BIT_COUNT to the range defined by _CAP_MIN and _CAP_MAX. As part of this change, the behavior is modified such that reading both _CAP_MIN and _CAP_MAX registers is now required to succeed, otherwise bl->max value could end up being not set although drm_edp_backlight_probe_max() returned success. This ensures correct handling of eDP panels that report a zero PWM bit count but still provide valid non-zero MIN and MAX capability values. Without this clamping, brightness values may be interpreted incorrectly, leading to a dim or non-functional backlight. For example, the Samsung ATNA40YK20 OLED panel used in the Lenovo ThinkPad T14s Gen6 (Snapdragon) reports a PWM bit count of 0, but supports AUX backlight control and declares a valid 11-bit range. Clamping ensures brightness scaling works as intended on such panels. Co-developed-by: Rui Miguel Silva <rui.silva@linaro.org> Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org> Signed-off-by: Christopher Obbard <christopher.obbard@linaro.org> Tested-by: Christopher Obbard <christopher.obbard@linaro.org> Reviewed-by: Christopher Obbard <christopher.obbard@linaro.org> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com> Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org> Link: https://lore.kernel.org/r/20250814-topic-x1e80100-t14s-oled-dp-brightness-v7-1-b3d7b4dfe8c5@linaro.org
Diffstat (limited to 'rust/helpers/device.c')
0 files changed, 0 insertions, 0 deletions