Skip to content

Commit 9858ea4

Browse files
matte-schwartzalexdeucher
authored andcommitted
Revert "drm/amd/display: Only restore backlight after amdgpu_dm_init or dm_resume"
This fix regressed the original issue that commit 7875afa ("drm/amd/display: Fix brightness level not retained over reboot") solved, so revert it until a different approach to solve the regression that it caused with AMD_PRIVATE_COLOR is found. Fixes: a490c8d ("drm/amd/display: Only restore backlight after amdgpu_dm_init or dm_resume") Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/4620 Cc: stable@vger.kernel.org Signed-off-by: Matthew Schwartz <matthew.schwartz@linux.dev> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
1 parent 3a86608 commit 9858ea4

2 files changed

Lines changed: 4 additions & 15 deletions

File tree

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

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2085,8 +2085,6 @@ static int amdgpu_dm_init(struct amdgpu_device *adev)
20852085

20862086
dc_hardware_init(adev->dm.dc);
20872087

2088-
adev->dm.restore_backlight = true;
2089-
20902088
adev->dm.hpd_rx_offload_wq = hpd_rx_irq_create_workqueue(adev);
20912089
if (!adev->dm.hpd_rx_offload_wq) {
20922090
drm_err(adev_to_drm(adev), "failed to create hpd rx offload workqueue.\n");
@@ -3442,7 +3440,6 @@ static int dm_resume(struct amdgpu_ip_block *ip_block)
34423440
dc_set_power_state(dm->dc, DC_ACPI_CM_POWER_STATE_D0);
34433441

34443442
dc_resume(dm->dc);
3445-
adev->dm.restore_backlight = true;
34463443

34473444
amdgpu_dm_irq_resume_early(adev);
34483445

@@ -9969,6 +9966,7 @@ static void amdgpu_dm_commit_streams(struct drm_atomic_state *state,
99699966
bool mode_set_reset_required = false;
99709967
u32 i;
99719968
struct dc_commit_streams_params params = {dc_state->streams, dc_state->stream_count};
9969+
bool set_backlight_level = false;
99729970

99739971
/* Disable writeback */
99749972
for_each_old_connector_in_state(state, connector, old_con_state, i) {
@@ -10088,6 +10086,7 @@ static void amdgpu_dm_commit_streams(struct drm_atomic_state *state,
1008810086
acrtc->hw_mode = new_crtc_state->mode;
1008910087
crtc->hwmode = new_crtc_state->mode;
1009010088
mode_set_reset_required = true;
10089+
set_backlight_level = true;
1009110090
} else if (modereset_required(new_crtc_state)) {
1009210091
drm_dbg_atomic(dev,
1009310092
"Atomic commit: RESET. crtc id %d:[%p]\n",
@@ -10144,16 +10143,13 @@ static void amdgpu_dm_commit_streams(struct drm_atomic_state *state,
1014410143
* to fix a flicker issue.
1014510144
* It will cause the dm->actual_brightness is not the current panel brightness
1014610145
* level. (the dm->brightness is the correct panel level)
10147-
* So we set the backlight level with dm->brightness value after initial
10148-
* set mode. Use restore_backlight flag to avoid setting backlight level
10149-
* for every subsequent mode set.
10146+
* So we set the backlight level with dm->brightness value after set mode
1015010147
*/
10151-
if (dm->restore_backlight) {
10148+
if (set_backlight_level) {
1015210149
for (i = 0; i < dm->num_of_edps; i++) {
1015310150
if (dm->backlight_dev[i])
1015410151
amdgpu_dm_backlight_set_level(dm, i, dm->brightness[i]);
1015510152
}
10156-
dm->restore_backlight = false;
1015710153
}
1015810154
}
1015910155

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

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -630,13 +630,6 @@ struct amdgpu_display_manager {
630630
*/
631631
u32 actual_brightness[AMDGPU_DM_MAX_NUM_EDP];
632632

633-
/**
634-
* @restore_backlight:
635-
*
636-
* Flag to indicate whether to restore backlight after modeset.
637-
*/
638-
bool restore_backlight;
639-
640633
/**
641634
* @aux_hpd_discon_quirk:
642635
*

0 commit comments

Comments
 (0)