Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C12D4606A322 for ; Thu, 3 Dec 2026 15:40:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=JnHTAgQI Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 520C91129A8; Thu, 3 Dec 2026 15:40:33 +0000 (UTC) Received: from tor.source.kernel.org (tor.source.kernel.org [172.105.4.254]) by gabe.freedesktop.org (Postfix) with ESMTPS id 95F441129C0; Thu, 3 Dec 2026 15:40:26 +0000 (UTC) Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by tor.source.kernel.org (Postfix) with ESMTP id BF4AA62A1E; Thu, 3 Dec 2026 15:40:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5B4781F00931; Thu, 3 Dec 2026 15:40:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796312425; bh=GZMZ5kdSuTTU8cvpbqRQoUEckcVnl27OBGb92GCIEcc=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=JnHTAgQIXl+pYBRqzilRyruKLayq6sfLWT2WHEOaBANWRjmqVbdNJ6tl0ZeTL8wIj ZiQaVp7JZ28lp7AU06GwpQWpJqQfn3IBaiJkOrhZ2j0/12w8YSI4WD5voF52onEEu4 0Ze4PMdNFVgAsPI8NIcFaRcseJL/GVjuSQio0+wyVrk3tjvnH9dS4W/dckxeg2yn09 +daHoGSyi9MWw9mYbVmFBoiU/PN5EhT9+hCnSCOvLd5gC03v0sVss2J69Fi8UEpBRn Xk6RVCXmHWbfscCisFxrenutOvzNAihngumzmYeXYdeJOsE1WbMnPZ+gx04BrSSQ6W DJGp2ReNCUeNQ== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v13 5/9] drm/amd/display: Take over the current stream and dc_state To: "Maxime Ripard" Cc: dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org In-Reply-To: <20261203-drm-reset-state-flag-v13-5-b09f19f64e64@kernel.org> References: <20261203-drm-reset-state-flag-v13-0-b09f19f64e64@kernel.org> <20261203-drm-reset-state-flag-v13-5-b09f19f64e64@kernel.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Thu, 03 Dec 2026 15:40:25 +0000 X-BeenThere: amd-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion list for AMD gfx List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: sashiko-reviews@lists.linux.dev Sender: "amd-gfx" X-Spam-Status: No, score=-10.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 X-Archived-By: Thank you for your contribution! Sashiko AI review found 4 potential issues to consider: - [High] drm/amd/display: amdgpu_dm_atomic_check() drops connector freesync_capable - [Medium] drm/amd/display: amdgpu_dm_atomic_check() drops CRTC mpo_requested flag - [Medium] drm/amd/display: amdgpu_dm_atomic_check() zeroes MST pbn and vcpi_slots - [Medium] drm/amd/display: amdgpu_dm_atomic_check() drops freesync_config and crc_skip -- commit bd2a6eec10d32cb9ed251de4423a0475cf93f1eb Author: Maxime Ripard drm/amd/display: Take over the current stream and dc_state This commit copies dm_old_crtc_state->stream and dm_old_plane_state->dc_state (with their references) into newly created atomic states at the start of amdgpu_dm_atomic_check(). > 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 019022fba6f1e..91d0ce7830f01 100644 > --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c > +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c > @@ -6281,6 +6281,56 @@ STATIC_IFN_KUNIT int amdgpu_dm_atomic_check(struct= drm_device *dev, > =20 > trace_amdgpu_dm_atomic_check_begin(state); > =20 [ ... ] > + for_each_oldnew_crtc_in_state(state, crtc, old_crtc_state, new_crtc_sta= te, i) { > + dm_old_crtc_state =3D to_dm_crtc_state(old_crtc_state); > + dm_new_crtc_state =3D to_dm_crtc_state(new_crtc_state); > + > + if (!dm_new_crtc_state->stream && dm_old_crtc_state->stream) { > + dm_new_crtc_state->stream =3D dm_old_crtc_state->stream; > + dc_stream_retain(dm_new_crtc_state->stream); > + } > + } [Severity: Medium] Should this loop also preserve dm_old_crtc_state->mpo_requested? amdgpu_dm_crtc_create_state() leaves mpo_requested false. When a reset commit keeps an active overlay plane without a plane reset, dm_update_plane_state() returns early before setting mpo_requested, so the flag stays false on the swapped-in CRTC state and later commits. fill_dc_dirty_rects() then skips MPO bounding-box dirty rectangles and PSR-SU pause handling, causing display artifacts on PSR-SU and Panel Replay panels. [Severity: Medium] Does this also drop dm_crtc_state->freesync_config and crc_skip_count? On a non-modeset reset commit with FreeSync Video Mode active, amdgpu_dm_get_freesync_config_for_crtc() sees a zeroed freesync_config instead of VRR_STATE_ACTIVE_FIXED, disabling FreeSync Video Mode and making amdgpu_dm_handle_vrr_transition() drop the VRR vblank reference. Zeroing crc_skip_count also causes amdgpu_dm_crtc_handle_crc_irq() to drop the next two frames during active CRC capture. > + > + for_each_oldnew_plane_in_state(state, plane, old_plane_state, new_plane= _state, i) { > + struct dm_plane_state *dm_old_plane_state =3D to_dm_plane_state(old_pl= ane_state); > + struct dm_plane_state *dm_new_plane_state =3D to_dm_plane_state(new_pl= ane_state); > + > + if (!dm_new_plane_state->dc_state && dm_old_plane_state->dc_state) { > + dm_new_plane_state->dc_state =3D dm_old_plane_state->dc_state; > + dc_plane_state_retain(dm_new_plane_state->dc_state); > + } > + } [Severity: High] Does omitting a connector takeover loop clear dm_connector_state->freesync_capable? freesync_capable is sink capability metadata populated during EDID probing by amdgpu_dm_update_freesync_caps(), so amdgpu_dm_connector_atomic_create_state() leaves it false. On any reset commit, amdgpu_dm_get_freesync_config_for_crtc() then disables VRR. Once that state is swapped in, subsequent duplicated commits inherit freesync_capable as false, permanently disabling FreeSync and Panel Replay (in amdgpu_dm_link_supports_replay()) until the next hotplug or reprobe. [Severity: Medium] Can a non-modeset reset commit also zero dm_connector_state->pbn and vcpi_slots on active DP-MST connectors? amdgpu_dm_connector_atomic_create_state() zeroes both fields, and dm_encoder_helper_atomic_check() returns early without recomputing them when neither connectors_changed nor mode_changed is set. On a later suspend/resume, drm_atomic_helper_suspend() saves that zeroed state with state->duplicated set, so dm_encoder_helper_atomic_check() skips recalculating pbn and passes 0 to drm_dp_atomic_find_time_slots(), breaking DP-MST resume. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261203-drm-reset-= state-flag-v13-0-b09f19f64e64@kernel.org?part=3D5