mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Hugo Sales via B4 Relay <devnull+hugo.hsal.es@kernel.org>
To: Harry Wentland <harry.wentland@amd.com>,
	Leo Li <sunpeng.li@amd.com>,
	 Rodrigo Siqueira <siqueira@igalia.com>,
	 Alex Deucher <alexander.deucher@amd.com>,
	 Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	 Maxime Ripard <mripard@kernel.org>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	 Jonathan Corbet <corbet@lwn.net>,
	Shuah Khan <skhan@linuxfoundation.org>
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>,
	"Chenyu Chen" <chen-yu.chen@amd.com>,
	"David Weber" <weber.aulendorf@gmail.com>,
	"Shivam Kalra" <shivamkalra98@zohomail.in>,
	"Hamza Mahfooz" <hamzamahfooz@linux.microsoft.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,
	"Hugo Sales" <hugo@hsal.es>
Subject: [PATCH v3 2/6] drm/amd/display: Add the CRTC's planes when the ABM level changes
Date: Mon, 16 Nov 2026 14:01:04 +0000	[thread overview]
Message-ID: <20261116-abm-sysfs-commit-v3-2-7a3d84a5328e@hsal.es> (raw)
In-Reply-To: <20261116-abm-sysfs-commit-v3-0-7a3d84a5328e@hsal.es>

From: Hugo Sales <hugo@hsal.es>

An upcoming patch stops a change of the connector's ABM level from
forcing a modeset. The modeset adds every plane on the CRTC to the
commit. Without it, a commit that changes only the level carries the
planes the CRTC check pulls in, which with VRR active is the primary
plane alone. DC then updates the stream with that one surface and drops
an active overlay plane until the next flip

Add the CRTC's planes when the level changes, as atomic check already
does for color management and VRR changes

Signed-off-by: Hugo Sales <hugo@hsal.es>
---
This was reported on v2 [1]. On my laptop (GV301QH, DCN 2.1), with v2
and VRR active, a panel_power_savings write took the overlay off the
screen. The DTN log went from four pipes, primary and overlay each split
over two, to the two primary ones, and a flip of both planes brought the
overlay back. With VRR off, the overlay stayed. With this patch, it
stayed with VRR on too, and all four pipes were still there after the
write

This only covers commits that change the ABM level. From my reading,
other commits that add the CRTC but no planes, like a change of the HDR
metadata, can drop an overlay the same way while VRR is active. That
needs a fix in the CRTC check that pulls in only the primary plane, which
I'll send as a separate series

[1] https://lore.kernel.org/all/sashiko-outbox-213691@kernel.org/
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 14 ++++++++++++++
 1 file changed, 14 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 dfbc384fbbdb4..cf75450066451 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -6307,6 +6307,20 @@ STATIC_IFN_KUNIT int amdgpu_dm_atomic_check(struct drm_device *dev,
 		if (dm_old_con_state->abm_level != dm_new_con_state->abm_level ||
 		    dm_old_con_state->scaling != dm_new_con_state->scaling)
 			new_crtc_state->connectors_changed = true;
+
+		/*
+		 * With VRR active, the CRTC check adds only the primary plane,
+		 * and DC would drop any other plane from the stream
+		 */
+		if (dm_old_con_state->abm_level != dm_new_con_state->abm_level) {
+			ret = drm_atomic_add_affected_planes(state, new_con_state->crtc);
+			if (ret) {
+				drm_dbg_atomic(dev,
+					       "drm_atomic_add_affected_planes() failed: %pe\n",
+					       ERR_PTR(ret));
+				goto fail;
+			}
+		}
 	}
 
 	if (dc_resource_is_dsc_encoding_supported(dc)) {

-- 
2.56.0



  parent reply	other threads:[~2026-11-16 14:01 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-16 14:01 [PATCH v3 0/6] drm/amd/display: Commit panel_power_savings writes from the kernel Hugo Sales via B4 Relay
2026-11-16 14:01 ` [PATCH v3 1/6] drm/amd/display: Render the panel power savings kernel-doc Hugo Sales via B4 Relay
2026-11-16 14:02   ` Mario Limonciello
2026-11-16 14:01 ` Hugo Sales via B4 Relay [this message]
2026-11-16 14:01 ` [PATCH v3 3/6] drm/amd/display: Don't force a modeset when the ABM level changes Hugo Sales via B4 Relay
2026-11-16 14:01 ` [PATCH v3 4/6] drm/amd/display: Give the panel_power_savings store tests a full pipe Hugo Sales via B4 Relay
2026-11-16 14:01 ` [PATCH v3 5/6] drm/amd/display: Commit panel_power_savings writes from the kernel Hugo Sales via B4 Relay
2026-11-16 14:01 ` [PATCH v3 6/6] 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=20261116-abm-sysfs-commit-v3-2-7a3d84a5328e@hsal.es \
    --to=devnull+hugo.hsal.es@kernel.org \
    --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=chen-yu.chen@amd.com \
    --cc=christian.koenig@amd.com \
    --cc=corbet@lwn.net \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=hamzamahfooz@linux.microsoft.com \
    --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=maarten.lankhorst@linux.intel.com \
    --cc=mario.limonciello@amd.com \
    --cc=mripard@kernel.org \
    --cc=ray.wu@amd.com \
    --cc=shivamkalra98@zohomail.in \
    --cc=simona@ffwll.ch \
    --cc=siqueira@igalia.com \
    --cc=skhan@linuxfoundation.org \
    --cc=sunpeng.li@amd.com \
    --cc=tzimmermann@suse.de \
    --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®