mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Chen, Chen-Yu" <Chen-Yu.Chen@amd.com>
To: hugo@hsal.es, Harry Wentland <harry.wentland@amd.com>,
	Leo Li <sunpeng.li@amd.com>,
	Rodrigo Siqueira <siqueira@igalia.com>,
	Alex Deucher <alexander.deucher@amd.com>
Cc: "Mario Limonciello" <mario.limonciello@amd.com>,
	"Ray Wu" <ray.wu@amd.com>, "Alex Hung" <alex.hung@amd.com>,
	"Bhawanpreet Lakha" <bhawanpreet.lakha@amd.com>,
	"Ivan Lipski" <ivan.lipski@amd.com>,
	"Christian König" <christian.koenig@amd.com>,
	"David Airlie" <airlied@gmail.com>,
	"Simona Vetter" <simona@ffwll.ch>,
	amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
	linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
	"David Weber" <weber.aulendorf@gmail.com>
Subject: Re: [PATCH v2 2/5] drm/amd/display: Don't force a modeset when the ABM level changes
Date: Mon, 16 Nov 2026 17:18:50 +0800	[thread overview]
Message-ID: <b26ac838-2486-497c-abf4-f540927ffc24@amd.com> (raw)
In-Reply-To: <20261113-abm-sysfs-commit-v2-2-5808d17a7e89@hsal.es>



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@kernel.org. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
> 
> From: Hugo Sales <hugo@hsal.es>
> 
> 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@gmail.com/

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@hsal.es>
> ---
> 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@hsal.es
> 
> 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
> 
> 


  reply	other threads:[~2026-11-16  9:19 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-13 20:24 [PATCH v2 0/5] drm/amd/display: Commit panel_power_savings writes from the kernel Hugo Sales via B4 Relay
2026-11-13 20:24 ` [PATCH v2 1/5] drm/amd/display: Render the panel power savings kernel-doc Hugo Sales via B4 Relay
2026-11-13 20:24 ` [PATCH v2 2/5] drm/amd/display: Don't force a modeset when the ABM level changes Hugo Sales via B4 Relay
2026-11-16  9:18   ` Chen, Chen-Yu [this message]
2026-11-13 20:24 ` [PATCH v2 3/5] drm/amd/display: Give the panel_power_savings store tests a full pipe Hugo Sales via B4 Relay
2026-11-13 20:24 ` [PATCH v2 4/5] drm/amd/display: Commit panel_power_savings writes from the kernel Hugo Sales via B4 Relay
2026-11-16  9:07   ` Chen, Chen-Yu
2026-11-13 20:24 ` [PATCH v2 5/5] drm/amd/display: Test panel_power_savings commits Hugo Sales via B4 Relay

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=b26ac838-2486-497c-abf4-f540927ffc24@amd.com \
    --to=chen-yu.chen@amd.com \
    --cc=airlied@gmail.com \
    --cc=alex.hung@amd.com \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=bhawanpreet.lakha@amd.com \
    --cc=christian.koenig@amd.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=harry.wentland@amd.com \
    --cc=hugo@hsal.es \
    --cc=ivan.lipski@amd.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mario.limonciello@amd.com \
    --cc=ray.wu@amd.com \
    --cc=simona@ffwll.ch \
    --cc=siqueira@igalia.com \
    --cc=sunpeng.li@amd.com \
    --cc=weber.aulendorf@gmail.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

all inboxes | Powered by JetHome®