This is a note to let you know that I've just added the patch titled drm/amdgpu/display: handle aux backlight in backlight_get_brightness to the 5.11-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: drm-amdgpu-display-handle-aux-backlight-in-backlight_get_brightness.patch and it can be found in the queue-5.11 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From 0ad3e64eb46d8c47de3af552e282894e3893e973 Mon Sep 17 00:00:00 2001 From: Alex Deucher <alexander.deucher@xxxxxxx> Date: Thu, 10 Dec 2020 01:45:12 -0500 Subject: drm/amdgpu/display: handle aux backlight in backlight_get_brightness From: Alex Deucher <alexander.deucher@xxxxxxx> commit 0ad3e64eb46d8c47de3af552e282894e3893e973 upstream. Need to fetch it via aux. Reviewed-by: Nicholas Kazlauskas <nicholas.kazlauskas@xxxxxxx> Signed-off-by: Alex Deucher <alexander.deucher@xxxxxxx> Cc: stable@xxxxxxxxxxxxxxx Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 24 ++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -3205,11 +3205,27 @@ static int amdgpu_dm_backlight_update_st static int amdgpu_dm_backlight_get_brightness(struct backlight_device *bd) { struct amdgpu_display_manager *dm = bl_get_data(bd); - int ret = dc_link_get_backlight_level(dm->backlight_link); + struct amdgpu_dm_backlight_caps caps; - if (ret == DC_ERROR_UNEXPECTED) - return bd->props.brightness; - return convert_brightness_to_user(&dm->backlight_caps, ret); + amdgpu_dm_update_backlight_caps(dm); + caps = dm->backlight_caps; + + if (caps.aux_support) { + struct dc_link *link = (struct dc_link *)dm->backlight_link; + u32 avg, peak; + bool rc; + + rc = dc_link_get_backlight_level_nits(link, &avg, &peak); + if (!rc) + return bd->props.brightness; + return convert_brightness_to_user(&caps, avg); + } else { + int ret = dc_link_get_backlight_level(dm->backlight_link); + + if (ret == DC_ERROR_UNEXPECTED) + return bd->props.brightness; + return convert_brightness_to_user(&caps, ret); + } } static const struct backlight_ops amdgpu_dm_backlight_ops = { Patches currently in stable-queue which might be from alexander.deucher@xxxxxxx are queue-5.11/drm-amd-display-fix-nested-fpu-context-in-dcn21_validate_bandwidth.patch queue-5.11/drm-radeon-also-init-gem-funcs-in-radeon_gem_prime_import_sg_table.patch queue-5.11/drm-amd-display-add-a-backlight-module-option.patch queue-5.11/drm-amd-pm-correct-the-watermark-settings-for-polaris.patch queue-5.11/drm-amdgpu-display-simplify-backlight-setting.patch queue-5.11/drm-amdgpu-display-use-gfp_atomic-in-dcn21_validate_bandwidth_fp.patch queue-5.11/drm-amdgpu-fix-s0ix-handling-when-the-config_amd_pmc-m.patch queue-5.11/drm-amdgpu-display-handle-aux-backlight-in-backlight_get_brightness.patch queue-5.11/drm-amdgpu-display-don-t-assert-in-set-backlight-function.patch queue-5.11/drm-amd-pm-bug-fix-for-pcie-dpm.patch