From: Mario Limonciello <mario.limonciello@amd.com>
To: Zaeem Mohamed <zaeem.mohamed@amd.com>, amd-gfx@lists.freedesktop.org
Cc: Harry Wentland <harry.wentland@amd.com>,
Leo Li <sunpeng.li@amd.com>,
Rodrigo Siqueira <rodrigo.siqueira@amd.com>,
Hamza Mahfooz <hamza.mahfooz@amd.com>,
Aurabindo Pillai <aurabindo.pillai@amd.com>,
Roman Li <roman.li@amd.com>, Wayne Lin <wayne.lin@amd.com>,
Tom Chung <chiahsuan.chung@amd.com>,
Fangzhi Zuo <jerry.zuo@amd.com>,
Solomon Chiu <solomon.chiu@amd.com>,
Daniel Wheeler <daniel.wheeler@amd.com>,
mark.herbert42@gmail.com
Subject: Re: [PATCH 07/17] drm/amd/display: Fix brightness level not retained over reboot
Date: Fri, 1 Nov 2024 10:43:27 -0500 [thread overview]
Message-ID: <4b624213-1187-4c1e-a37f-644cf3ca1703@amd.com> (raw)
In-Reply-To: <20241101134940.1426653-8-zaeem.mohamed@amd.com>
On 11/1/2024 08:49, Zaeem Mohamed wrote:
> From: Tom Chung <chiahsuan.chung@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.li@amd.com>
> Signed-off-by: Tom Chung <chiahsuan.chung@amd.com>
> Signed-off-by: Zaeem Mohamed <zaeem.mohamed@amd.com>
Some more tags, please explicitly add these while merging.
Cc: stable@vger.kernel.org
Fixes: d9e865826c20 ("drm/amd/display: Simplify brightness initialization")
Reported-by: Mark Herbert <mark.herbert42@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,
next prev parent reply other threads:[~2024-11-01 15:43 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-01 13:49 [PATCH 00/17] DC Patches October 28, 2024 Zaeem Mohamed
2024-11-01 13:49 ` [PATCH 01/17] drm/amd/display: Do Not Fallback To SW Cursor If HW Cursor Required Zaeem Mohamed
2024-11-01 13:49 ` [PATCH 02/17] drm/amd/display: avoid divided by zero Zaeem Mohamed
2024-11-01 13:49 ` [PATCH 03/17] Revert "drm/amd/display: Block UHBR Based On USB-C PD Cable ID" Zaeem Mohamed
2024-11-01 13:49 ` [PATCH 04/17] drm/amd/display: fix rxstatus_msg_sz type narrowing Zaeem Mohamed
2024-11-01 13:49 ` [PATCH 05/17] drm/amd/display: Remove inaccessible registers from DMU diagnostics Zaeem Mohamed
2024-11-01 13:49 ` [PATCH 06/17] drm/amd/display: fix asserts in SPL during bootup Zaeem Mohamed
2024-11-01 13:49 ` [PATCH 07/17] drm/amd/display: Fix brightness level not retained over reboot Zaeem Mohamed
2024-11-01 15:43 ` Mario Limonciello [this message]
2024-11-01 19:48 ` Mohamed, Zaeem
2024-11-02 0:43 ` Mario Limonciello
2024-11-01 13:49 ` [PATCH 08/17] drm/amd/display: SPL cleanup Zaeem Mohamed
2024-11-01 13:49 ` [PATCH 09/17] drm/amd/display: Remove hw w/a toggle if on DP2/HPO Zaeem Mohamed
2024-11-01 13:49 ` [PATCH 10/17] drm/amd/display: Remove otg w/a toggling on HPO interfaces Zaeem Mohamed
2024-11-01 13:49 ` [PATCH 11/17] drm/amd/display: parse umc_info or vram_info based on ASIC Zaeem Mohamed
2024-11-01 13:49 ` [PATCH 12/17] drm/amd/display: Minimize wait for pending updates Zaeem Mohamed
2024-11-01 13:49 ` [PATCH 13/17] drm/amd/display: Don't write DP_MSTM_CTRL after LT Zaeem Mohamed
2024-11-01 13:49 ` [PATCH 14/17] drm/amd/display: [FW Promotion] Release 0.0.241.0 Zaeem Mohamed
2024-11-01 13:49 ` [PATCH 15/17] drm/amd/display: Implement new backlight_level_params structure Zaeem Mohamed
2024-11-01 13:49 ` [PATCH 16/17] drm/amd/display: Prune Invalid Modes For HDMI Output Zaeem Mohamed
2024-11-01 13:49 ` [PATCH 17/17] drm/amd/display: 3.2.308 Zaeem Mohamed
2024-11-01 14:47 ` [PATCH 00/17] DC Patches October 28, 2024 Wheeler, Daniel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4b624213-1187-4c1e-a37f-644cf3ca1703@amd.com \
--to=mario.limonciello@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=aurabindo.pillai@amd.com \
--cc=chiahsuan.chung@amd.com \
--cc=daniel.wheeler@amd.com \
--cc=hamza.mahfooz@amd.com \
--cc=harry.wentland@amd.com \
--cc=jerry.zuo@amd.com \
--cc=mark.herbert42@gmail.com \
--cc=rodrigo.siqueira@amd.com \
--cc=roman.li@amd.com \
--cc=solomon.chiu@amd.com \
--cc=sunpeng.li@amd.com \
--cc=wayne.lin@amd.com \
--cc=zaeem.mohamed@amd.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox