Skip to content

Commit b5a981e

Browse files
superm1alexdeucher
authored andcommitted
drm/amd/display: fix default brightness
[Why] To avoid flickering during boot default brightness level set by BIOS should be maintained for as much of the boot as feasible. commit 2fe87f5 ("drm/amd/display: Set default brightness according to ACPI") attempted to set the right levels for AC vs DC, but brightness still got reset to maximum level in initialization code for setup_backlight_device(). [How] Remove the hardcoded initialization in setup_backlight_device() and instead program brightness value to match BIOS (AC or DC). This avoids a brightness flicker from kernel changing the value. Userspace may however still change it during boot. Fixes: 2fe87f5 ("drm/amd/display: Set default brightness according to ACPI") Acked-by: Wayne Lin <Wayne.Lin@amd.com> Signed-off-by: Mario Limonciello <mario.limonciello@amd.com> Signed-off-by: Tom Chung <chiahsuan.chung@amd.com> Tested-by: Daniel Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> (cherry picked from commit 0747acf) Cc: stable@vger.kernel.org
1 parent 40b8c14 commit b5a981e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4911,6 +4911,7 @@ amdgpu_dm_register_backlight_device(struct amdgpu_dm_connector *aconnector)
49114911
dm->backlight_dev[aconnector->bl_idx] =
49124912
backlight_device_register(bl_name, aconnector->base.kdev, dm,
49134913
&amdgpu_dm_backlight_ops, &props);
4914+
dm->brightness[aconnector->bl_idx] = props.brightness;
49144915

49154916
if (IS_ERR(dm->backlight_dev[aconnector->bl_idx])) {
49164917
DRM_ERROR("DM: Backlight registration failed!\n");
@@ -4978,7 +4979,6 @@ static void setup_backlight_device(struct amdgpu_display_manager *dm,
49784979
aconnector->bl_idx = bl_idx;
49794980

49804981
amdgpu_dm_update_backlight_caps(dm, bl_idx);
4981-
dm->brightness[bl_idx] = AMDGPU_MAX_BL_LEVEL;
49824982
dm->backlight_link[bl_idx] = link;
49834983
dm->num_of_edps++;
49844984

0 commit comments

Comments
 (0)