On 11/1/2024 14:48, Mohamed, Zaeem wrote:
[AMD Official Use Only - AMD Internal Distribution Only]

Hi Mario,

Do I need to re-send the patch to amd-gfx after the tags have been added or is 
sending upstream enough?

Zaeem

Zaeem,

No need to resend to amd-gfx, they can be added when they're committed.

If you use "b4" [1] to apply them it will automatically pick them up. If they're applied manually then the person applying them can manually apply the tags too.

[1] https://b4.docs.kernel.org/en/latest/

-----Original Message-----
From: Limonciello, Mario <mario.limoncie...@amd.com>
Sent: Friday, November 1, 2024 11:43 AM
To: Mohamed, Zaeem <zaeem.moha...@amd.com>; amd-gfx@lists.freedesktop.org
Cc: Wentland, Harry <harry.wentl...@amd.com>; Li, Sun peng (Leo) <sunpeng...@amd.com>; Siqueira, Rodrigo 
<rodrigo.sique...@amd.com>; Mahfooz, Hamza <hamza.mahf...@amd.com>; Pillai, Aurabindo <aurabindo.pil...@amd.com>; Li, Roman 
<roman...@amd.com>; Lin, Wayne <wayne....@amd.com>; Chung, ChiaHsuan (Tom) <chiahsuan.ch...@amd.com>; Zuo, Jerry 
<jerry....@amd.com>; Chiu, Solomon <solomon.c...@amd.com>; Wheeler, Daniel <daniel.whee...@amd.com>; mark.herber...@gmail.com
Subject: Re: [PATCH 07/17] drm/amd/display: Fix brightness level not retained 
over reboot

On 11/1/2024 08:49, Zaeem Mohamed wrote:
From: Tom Chung <chiahsuan.ch...@amd.com>

[Why]
During boot up and resume the DC layer will reset the panel brightness
to fix a flicker issue.

It will cause the dm->actual_brightness is not the current panel
brightness level. (the dm->brightness is the correct panel level)

[How]
Set the backlight level after do the set mode.

Reviewed-by: Sun peng Li <sunpeng...@amd.com>
Signed-off-by: Tom Chung <chiahsuan.ch...@amd.com>
Signed-off-by: Zaeem Mohamed <zaeem.moha...@amd.com>

Some more tags, please explicitly add these while merging.

Cc: sta...@vger.kernel.org
Fixes: d9e865826c20 ("drm/amd/display: Simplify brightness initialization")
Reported-by: Mark Herbert <mark.herber...@gmail.com>
Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/3655

---
   drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 15 +++++++++++++++
   1 file changed, 15 insertions(+)

diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
index bbfc47f6595f..2599a99509de 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -9411,6 +9411,7 @@ static void amdgpu_dm_commit_streams(struct 
drm_atomic_state *state,
       bool mode_set_reset_required = false;
       u32 i;
       struct dc_commit_streams_params params = {dc_state->streams,
dc_state->stream_count};
+     bool set_backlight_level = false;

       /* Disable writeback */
       for_each_old_connector_in_state(state, connector, old_con_state, i)
{ @@ -9530,6 +9531,7 @@ static void amdgpu_dm_commit_streams(struct 
drm_atomic_state *state,
                       acrtc->hw_mode = new_crtc_state->mode;
                       crtc->hwmode = new_crtc_state->mode;
                       mode_set_reset_required = true;
+                     set_backlight_level = true;
               } else if (modereset_required(new_crtc_state)) {
                       drm_dbg_atomic(dev,
                                      "Atomic commit: RESET. crtc id 
%d:[%p]\n", @@ -9581,6
+9583,19 @@ static void amdgpu_dm_commit_streams(struct drm_atomic_state *state,
                               acrtc->otg_inst = status->primary_otg_inst;
               }
       }
+
+     /* During boot up and resume the DC layer will reset the panel brightness
+      * to fix a flicker issue.
+      * It will cause the dm->actual_brightness is not the current panel 
brightness
+      * level. (the dm->brightness is the correct panel level)
+      * So we set the backlight level with dm->brightness value after set mode
+      */
+     if (set_backlight_level) {
+             for (i = 0; i < dm->num_of_edps; i++) {
+                     if (dm->backlight_dev[i])
+                             amdgpu_dm_backlight_set_level(dm, i, 
dm->brightness[i]);
+             }
+     }
   }

   static void dm_set_writeback(struct amdgpu_display_manager *dm,


Reply via email to