Commit 68a7c52
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.org1 parent 3684218 commit 68a7c52
1 file changed
Lines changed: 49 additions & 19 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
| |||
4136 | 4137 | | |
4137 | 4138 | | |
4138 | 4139 | | |
4139 | | - | |
| 4140 | + | |
4140 | 4141 | | |
4141 | 4142 | | |
4142 | 4143 | | |
4143 | 4144 | | |
4144 | | - | |
| 4145 | + | |
4145 | 4146 | | |
4146 | 4147 | | |
4147 | 4148 | | |
4148 | 4149 | | |
4149 | 4150 | | |
4150 | 4151 | | |
4151 | | - | |
| 4152 | + | |
| 4153 | + | |
| 4154 | + | |
| 4155 | + | |
| 4156 | + | |
| 4157 | + | |
| 4158 | + | |
| 4159 | + | |
| 4160 | + | |
| 4161 | + | |
| 4162 | + | |
| 4163 | + | |
| 4164 | + | |
| 4165 | + | |
| 4166 | + | |
| 4167 | + | |
| 4168 | + | |
| 4169 | + | |
| 4170 | + | |
| 4171 | + | |
| 4172 | + | |
| 4173 | + | |
| 4174 | + | |
| 4175 | + | |
| 4176 | + | |
| 4177 | + | |
| 4178 | + | |
| 4179 | + | |
| 4180 | + | |
| 4181 | + | |
| 4182 | + | |
| 4183 | + | |
| 4184 | + | |
| 4185 | + | |
| 4186 | + | |
| 4187 | + | |
4152 | 4188 | | |
4153 | | - | |
| 4189 | + | |
| 4190 | + | |
| 4191 | + | |
| 4192 | + | |
4154 | 4193 | | |
| 4194 | + | |
4155 | 4195 | | |
4156 | 4196 | | |
4157 | 4197 | | |
| |||
4175 | 4215 | | |
4176 | 4216 | | |
4177 | 4217 | | |
4178 | | - | |
4179 | | - | |
4180 | | - | |
4181 | | - | |
4182 | | - | |
4183 | | - | |
4184 | | - | |
4185 | | - | |
4186 | | - | |
4187 | | - | |
4188 | | - | |
4189 | | - | |
4190 | | - | |
4191 | | - | |
4192 | | - | |
4193 | 4218 | | |
4194 | 4219 | | |
4195 | 4220 | | |
| |||
4207 | 4232 | | |
4208 | 4233 | | |
4209 | 4234 | | |
| 4235 | + | |
4210 | 4236 | | |
4211 | 4237 | | |
4212 | 4238 | | |
4213 | 4239 | | |
4214 | 4240 | | |
4215 | 4241 | | |
| 4242 | + | |
| 4243 | + | |
| 4244 | + | |
| 4245 | + | |
4216 | 4246 | | |
4217 | 4247 | | |
4218 | 4248 | | |
| |||
0 commit comments