Commit c010efb7 authored by Zhan Liu's avatar Zhan Liu Committed by Alex Deucher
Browse files

drm/amdgpu/display - only update eDP's backlight level when necessary



[Why]
The original logic is to update eDP's backlight level
on every amdgpu dm atomic commit, which causes excessive
DMUB write. As a result, when playing game or moving window
around, DMUB timeout and system lagging are observed.

[How]
We only need to update eDP's backlight level when current level
doesn't match requested level.

Signed-off-by: default avatarZhan Liu <zhan.liu@amd.com>
Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 5017bf82
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -9191,7 +9191,7 @@ static void amdgpu_dm_atomic_commit_tail(struct drm_atomic_state *state)
#if defined(CONFIG_BACKLIGHT_CLASS_DEVICE) ||		\
	defined(CONFIG_BACKLIGHT_CLASS_DEVICE_MODULE)
	/* restore the backlight level */
	if (dm->backlight_dev)
	if (dm->backlight_dev && (amdgpu_dm_backlight_get_level(dm) != dm->brightness[0]))
		amdgpu_dm_backlight_set_level(dm, dm->brightness[0]);
#endif
	/*