@@ -9429,6 +9429,7 @@ static void amdgpu_dm_commit_streams(struct drm_atomic_state *state,
9429
9429
bool mode_set_reset_required = false;
9430
9430
u32 i ;
9431
9431
struct dc_commit_streams_params params = {dc_state -> streams , dc_state -> stream_count };
9432
+ bool set_backlight_level = false;
9432
9433
9433
9434
/* Disable writeback */
9434
9435
for_each_old_connector_in_state (state , connector , old_con_state , i ) {
@@ -9548,6 +9549,7 @@ static void amdgpu_dm_commit_streams(struct drm_atomic_state *state,
9548
9549
acrtc -> hw_mode = new_crtc_state -> mode ;
9549
9550
crtc -> hwmode = new_crtc_state -> mode ;
9550
9551
mode_set_reset_required = true;
9552
+ set_backlight_level = true;
9551
9553
} else if (modereset_required (new_crtc_state )) {
9552
9554
drm_dbg_atomic (dev ,
9553
9555
"Atomic commit: RESET. crtc id %d:[%p]\n" ,
@@ -9599,6 +9601,19 @@ static void amdgpu_dm_commit_streams(struct drm_atomic_state *state,
9599
9601
acrtc -> otg_inst = status -> primary_otg_inst ;
9600
9602
}
9601
9603
}
9604
+
9605
+ /* During boot up and resume the DC layer will reset the panel brightness
9606
+ * to fix a flicker issue.
9607
+ * It will cause the dm->actual_brightness is not the current panel brightness
9608
+ * level. (the dm->brightness is the correct panel level)
9609
+ * So we set the backlight level with dm->brightness value after set mode
9610
+ */
9611
+ if (set_backlight_level ) {
9612
+ for (i = 0 ; i < dm -> num_of_edps ; i ++ ) {
9613
+ if (dm -> backlight_dev [i ])
9614
+ amdgpu_dm_backlight_set_level (dm , i , dm -> brightness [i ]);
9615
+ }
9616
+ }
9602
9617
}
9603
9618
9604
9619
static void dm_set_writeback (struct amdgpu_display_manager * dm ,
0 commit comments