Skip to content

Commit 5760388

Browse files
superm1alexdeucher
authored andcommitted
drm/amd/display: Restore correct backlight brightness after a GPU reset
[Why] GPU reset will attempt to restore cached state, but brightness doesn't get restored. It will come back at 100% brightness, but userspace thinks it's the previous value. [How] When running resume sequence if GPU is in reset restore brightness to previous value. 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 5e19e2b) Cc: stable@vger.kernel.org
1 parent b5a981e commit 5760388

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,10 @@ static int amdgpu_dm_atomic_check(struct drm_device *dev,
245245
static void handle_hpd_irq_helper(struct amdgpu_dm_connector *aconnector);
246246
static void handle_hpd_rx_irq(void *param);
247247

248+
static void amdgpu_dm_backlight_set_level(struct amdgpu_display_manager *dm,
249+
int bl_idx,
250+
u32 user_brightness);
251+
248252
static bool
249253
is_timing_unchanged_for_freesync(struct drm_crtc_state *old_crtc_state,
250254
struct drm_crtc_state *new_crtc_state);
@@ -3371,6 +3375,12 @@ static int dm_resume(struct amdgpu_ip_block *ip_block)
33713375

33723376
mutex_unlock(&dm->dc_lock);
33733377

3378+
/* set the backlight after a reset */
3379+
for (i = 0; i < dm->num_of_edps; i++) {
3380+
if (dm->backlight_dev[i])
3381+
amdgpu_dm_backlight_set_level(dm, i, dm->brightness[i]);
3382+
}
3383+
33743384
return 0;
33753385
}
33763386

0 commit comments

Comments
 (0)