Re: [PATCH v2 2/5] drm/amd/display: Don't force a modeset when the ABM level changes
From: Chen, Chen-Yu
Date: Mon Nov 16 2026 - 04:19:08 EST
On 11/14/2026 4:24 AM, Hugo Sales via B4 Relay wrote:
> [Some people who received this message don't often get email from devnull+hugo.hsal.es@xxxxxxxxxx. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
>
> From: Hugo Sales <hugo@xxxxxxx>
>
> An upcoming patch commits panel_power_savings writes from the kernel
> without a modeset. amdgpu_dm_atomic_check() sets connectors_changed on the
> CRTC when the connector's ABM level changes, so that commit would fail
> with -EINVAL
>
> The flag came in with commit c5892a102182 ("drm/amd/display: Fix dmesg
> warning from setting abm level"), which also added the CRTC to the commit.
> Setting the level alone left the CRTC out, so no stream update reached DC.
> Adding the CRTC is enough for that. Since commit b05e2c5e81f9
David Weber sent the same atomic check change in August [1]. Since his
came first, could you credit him in the commit message, for example
with a sentence and a Link: to his patch?
[1] https://lore.kernel.org/amd-gfx/20260813112634.11455-3-weber.aulendorf@xxxxxxxxx/
Regards,
Chenyu
> ("drm/amd/display: Update ABM crtc state on non-modeset"),
> dm_update_crtc_state() copies the level from the connector to the CRTC
> state on the non-modeset path, and the commit tail sends a changed level
> as stream_update.abm_level. Neither needs the planes in the commit. The
> commit tail walks the connectors and takes the surfaces from the stream
> status in DC
>
> This applies to every commit that changes the level. A compositor that
> sets the "adaptive backlight modulation" KMS property no longer gets a
> modeset either
>
> The forced modeset also took the panel out of PSR or Panel Replay before
> the level reached DC. The non-modeset path relies on "drm/amd/display:
> Leave self-refresh before an ABM level update" for that, so it has to be
> applied first
>
> Keep the flag for scaling changes, which move the stream's source and
> destination rectangles
>
> Signed-off-by: Hugo Sales <hugo@xxxxxxx>
> ---
> This needs "drm/amd/display: Leave self-refresh before an ABM level
> update" [1] applied first. Without it, a level change on the
> non-modeset path reaches DC while PSR or Panel Replay is active
>
> [1] https://lore.kernel.org/r/20261113-amdgpu-psr-abm-update-next-v2-0-27ce790856ea@xxxxxxx
>
> Upstream, a level already reaches DC this way when a compositor commits
> the connector after a panel_power_savings write. The store has already
> written the level into the current connector state, so the old and new
> connector states match and atomic check doesn't ask for a modeset. Only
> the CRTC state, which still holds the old level, sees the change. With
> this series, the hardware tests in the cover letter apply every level this
> way
>
> When a commit changes the level and also has planes on that CRTC, for
> example a compositor that sets the property and flips in the same
> commit, upstream sends the level to DC twice: from the connector loop in
> the commit tail and from amdgpu_dm_commit_planes(). The same already
> happens upstream after a panel_power_savings write, when the
> compositor's next commit has both the connector and planes. [1] sends it
> from the connector loop only
>
> If a level change through the KMS property should still force a modeset,
> the store could flag its own commits instead. It would set a flag in
> dm_connector_state that atomic check reads to skip connectors_changed.
> duplicate_state wouldn't copy the flag, so it only lasts for that one
> commit. I think it's simpler to treat the change the same way whoever made
> it, but I can send that version
>
> Scaling has been in the same check since commit 3c6d1aeb4342
> ("drm/amd/display: Fix set scaling doesn's work"). From my reading the
> non-modeset path handles it too, as a src/dst stream update, but it
> changes the scaler ratio and I can't tell whether DC needs the full
> validation for that. Could it go as well?
> ---
> drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> 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 dfbc384fbbdb4..256699cdd0b5c 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> @@ -6304,8 +6304,7 @@ STATIC_IFN_KUNIT int amdgpu_dm_atomic_check(struct drm_device *dev,
> goto fail;
> }
>
> - if (dm_old_con_state->abm_level != dm_new_con_state->abm_level ||
> - dm_old_con_state->scaling != dm_new_con_state->scaling)
> + if (dm_old_con_state->scaling != dm_new_con_state->scaling)
> new_crtc_state->connectors_changed = true;
> }
>
>
> --
> 2.56.0
>
>