linux/drivers/gpu/drm/amd/display/amdgpu_dm
Alexander Monakov 69d9f4278d 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 <alexander.deucher@amd.com>
Cc: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alexander Monakov <amonakov@ispras.ru>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
2020-08-26 15:11:40 -04:00
..
amdgpu_dm_color.c drm/amd/display: change global buffer to local buffer 2020-07-01 01:59:21 -04:00
amdgpu_dm_crc.c drm/amd/display: Added pixel dynamic expansion control. 2019-10-10 19:24:26 -05:00
amdgpu_dm_crc.h drm/amd/display: Split out DC programming for CRC capture 2019-08-21 22:18:25 -05:00
amdgpu_dm_debugfs.c drm/amd/display: Fix naming of DSC Debugfs entry 2020-08-06 16:38:03 -04:00
amdgpu_dm_debugfs.h amdgpu_dm: no need to check return value of debugfs_create functions 2019-06-13 13:59:49 -05:00
amdgpu_dm_hdcp.c drm/amdgpu/display: Unlock mutex on error 2020-07-01 01:59:26 -04:00
amdgpu_dm_hdcp.h drm/amd/display: Add sysfs interface for set/get srm 2020-02-06 15:04:36 -05:00
amdgpu_dm_helpers.c drm/amd/display: Add DCN3 Support in DM (v2) 2020-07-01 01:59:15 -04:00
amdgpu_dm_irq.c drm/amd: use list_for_each_entry for list iteration. 2020-01-07 12:04:16 -05:00
amdgpu_dm_irq.h
amdgpu_dm_mst_types.c drm/amd/display: Call dsc related functions indirectly via dc interface 2020-07-21 15:37:39 -04:00
amdgpu_dm_mst_types.h drm/amdgpu/display: create fake mst encoders ahead of time (v4) 2020-07-14 15:11:07 -04:00
amdgpu_dm_pp_smu.c drm/amdgpu/display: properly guard the calls to swSMU functions 2020-07-01 01:59:23 -04:00
amdgpu_dm_services.c drm/amd/display: Handle persistence in DM 2020-05-28 14:00:47 -04:00
amdgpu_dm_trace.h
amdgpu_dm.c drm/amd/display: use correct scale for actual_brightness 2020-08-26 15:11:40 -04:00
amdgpu_dm.h drm/amdgpu/display: create fake mst encoders ahead of time (v4) 2020-07-14 15:11:07 -04:00
Makefile drm/amd/display: Create amdgpu_dm_hdcp 2019-10-03 09:10:58 -05:00