From: Hugo Sales <[email protected]> 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 <[email protected]> --- 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/[email protected]/ --- 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
