diff options
author | Alexander Monakov <[email protected]> | 2020-08-04 23:13:13 +0300 |
---|---|---|
committer | Alex Deucher <[email protected]> | 2020-08-26 15:11:40 -0400 |
commit | 69d9f4278d0f9d24607645f10e5ac5c59c77a4ac (patch) | |
tree | dccacecc480bb07a6432431f1b75d4e7303fe27b /scripts/gcc-plugins/gcc-common.h | |
parent | ed9ab229fea24cbcab17f484297dc8344afb7ea9 (diff) |
drm/amd/display: use correct scale for actual_brightness
Documentation for sysfs backlight level interface requires that
values in both 'brightness' and 'actual_brightness' files are
interpreted to be in range from 0 to the value given in the
'max_brightness' file.
With amdgpu, max_brightness gives 255, and values written by the user
into 'brightness' are internally rescaled to a wider range. However,
reading from 'actual_brightness' gives the raw register value without
inverse rescaling. This causes issues for various userspace tools such
as PowerTop and systemd that expect the value to be in the correct
range.
Introduce a helper to retrieve internal backlight range. Use it to
reimplement 'convert_brightness' as 'convert_brightness_from_user' and
introduce 'convert_brightness_to_user'.
Bug: https://bugzilla.kernel.org/show_bug.cgi?id=203905
Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/1242
Cc: Alex Deucher <[email protected]>
Cc: Nicholas Kazlauskas <[email protected]>
Reviewed-by: Alex Deucher <[email protected]>
Signed-off-by: Alexander Monakov <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
Cc: [email protected]
Diffstat (limited to 'scripts/gcc-plugins/gcc-common.h')
0 files changed, 0 insertions, 0 deletions