All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alex Hung <alex.hung@amd.com>
To: Misha Nasledov <misha@nasledov.com>, amd-gfx@lists.freedesktop.org
Cc: Harry Wentland <harry.wentland@amd.com>,
	Leo Li <sunpeng.li@amd.com>,
	Rodrigo Siqueira <siqueira@igalia.com>,
	Alex Deucher <alexander.deucher@amd.com>
Subject: Re: [PATCH] drm/amd/display: Drop clock requirements on DCN32 when no displays are active
Date: Fri, 30 Oct 2026 19:47:18 -0600	[thread overview]
Message-ID: <384d2df7-b031-4b4e-954e-05e5cca83ea4@amd.com> (raw)
In-Reply-To: <20261019234232.33760-1-misha@nasledov.com>

Reviewed-by: Alex Hung <alex.hung@amd.com>

On 10/19/26 17:42, Misha Nasledov wrote:
> [Some people who received this message don't often get email from misha@nasledov.com. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
> 
> amdgpu_dm builds the new dc_state as a copy of the old one. When the last
> stream is removed, dml1_validate() returns early on pipe_cnt == 0 and
> never reaches dcn32_calculate_dlg_params(), so bw.dcn.clk keeps the
> dramclk/dcfclk/fclk requirements of the display that was just turned off.
> dcn32_update_clocks() then keeps those hard minimums applied.
> 
> On an RX 7900 XTX this leaves UCLK at 456 MHz and DCFCLK at 637 MHz with
> the monitor off, and the board idles at 28.4 W. With this change they
> drop to 96 MHz and 145 MHz and board power falls to 15.3 W.
> 
> Reset the clock requirements in that case, as calculate_dlg_params()
> already does when no HUBP is active and as the DML2 path does for
> stream_count == 0.
> 
> Signed-off-by: Misha Nasledov <misha@nasledov.com>
> ---
> Tested on an RX 7900 XTX on v7.2.11, where the patch applies cleanly.
> This version is against amd-staging-drm-next.
> 
> I used an LLM to help trace the clock path and draft this change, and
> I reviewed and tested it myself.
> 
> DCN 2.0 and 2.1 (dcn20_validate_bandwidth_internal() and
> dcn21_validate_bandwidth_fp() in dml/dcn20/dcn20_fpu.c) and DCN 3.0
> (dcn30_validate_bandwidth()) take the same pipe_cnt == 0 early exit, so
> they probably keep stale clocks with all displays off as well. I've left
> them alone because I only have DCN 3.2 hardware to test on. I'm happy to
> send the same change for them if that's wanted.
> 
>   .../display/dc/resource/dcn32/dcn32_resource.c    | 15 ++++++++++++++-
>   1 file changed, 14 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/amd/display/dc/resource/dcn32/dcn32_resource.c b/drivers/gpu/drm/amd/display/dc/resource/dcn32/dcn32_resource.c
> index c9eba16ef359..c22ffbe74d9b 100644
> --- a/drivers/gpu/drm/amd/display/dc/resource/dcn32/dcn32_resource.c
> +++ b/drivers/gpu/drm/amd/display/dc/resource/dcn32/dcn32_resource.c
> @@ -1941,8 +1941,21 @@ static bool dml1_validate(struct dc *dc, struct dc_state *context, enum dc_valid
>          out = dcn32_internal_validate_bw(dc, context, pipes, &pipe_cnt, &vlevel, validate_mode);
>          DC_FP_END();
> 
> -       if (pipe_cnt == 0)
> +       if (pipe_cnt == 0) {
> +               /* The context is a copy of the previous state, so without this the
> +                * clocks the last display needed stay applied with all displays off.
> +                */
> +               context->bw_ctx.bw.dcn.clk.socclk_khz = 0;
> +               context->bw_ctx.bw.dcn.clk.dppclk_khz = 0;
> +               context->bw_ctx.bw.dcn.clk.dcfclk_khz = 0;
> +               context->bw_ctx.bw.dcn.clk.dcfclk_deep_sleep_khz = 0;
> +               context->bw_ctx.bw.dcn.clk.dramclk_khz = 0;
> +               context->bw_ctx.bw.dcn.clk.fclk_khz = 0;
> +               context->bw_ctx.bw.dcn.clk.p_state_change_support = true;
> +               context->bw_ctx.bw.dcn.clk.fclk_p_state_change_support = true;
> +               context->bw_ctx.bw.dcn.clk.num_ways = 0;
>                  goto validate_out;
> +       }
> 
>          if (!out)
>                  goto validate_fail;
> --
> 2.55.0


      reply	other threads:[~2026-10-31  1:47 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-19 23:42 [PATCH] drm/amd/display: Drop clock requirements on DCN32 when no displays are active Misha Nasledov
2026-10-31  1:47 ` Alex Hung [this message]

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=384d2df7-b031-4b4e-954e-05e5cca83ea4@amd.com \
    --to=alex.hung@amd.com \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=harry.wentland@amd.com \
    --cc=misha@nasledov.com \
    --cc=siqueira@igalia.com \
    --cc=sunpeng.li@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.