From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796306871; b=qX9I8kQfSjZtZKIwlSf6E1i47T95SlljIBvTYedp/9pZw5m/a+HOLaLDTvrinXdi2HRK cSNKtOcb8JnkHhFQKQK/oah6WsSKeOg7KF3ASTdckuJnuEXPzb627V0tQMQpj+kW/RJrJ We7Ax5IqRmCkeYDfwAPA2yTovLO0kcf5uDnHSi7XnJ10YXrHEDv+9hyLps7LwA4luwktc eLRFQLRW9vMCc9cn5QSPyMbx06r1+1WSPSOgP3QuyTKjby2pQ89yf564Y03oWRt7h/U8D mHTdBhcIwB0bgs3uu5U60ZKuV2Z2C9ih0OOOYpVPS61bqbDKcrekRVAopATmJiw7m1w== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796306871; h=Received:DKIM-Signature:From:Date:Subject:MIME-Version:Content-Type: Content-Transfer-Encoding:Message-Id:References:In-Reply-To:To:Cc: X-Mailer:X-Developer-Signature:X-Developer-Key; bh=U+hegRIy/xY+dpQTnd+QgneMyrjorR6EiSVKHDOG3Sw=; b=22++w6Q903gyiZswxnPjXDXbR567pMR0/gguBN0UOrnAVw0OOP3K2GQW2DnypWfZs6MO ggWV6QQo96cfe7tdgJc6JVcGxR5zR2+K0d+tbYYFoISJ26BCwipPzAiJ/w3B/jYqii5ys kxtlOd1/5eNRw0nCUBNjzEqLWaKopwXSKLVLxLLQI4SRslFckbDfMOMiuWr1C6Ui2hd0E o1KuFiHIHjxmBfGK8UHN7wrWGCmflusvwjGRwykcmrbATTUVEC6rqJ6snRalFBLx0GLEx R1Y0Ntz/h6X2ZXnk6Zi2K5G+jxWJeSabQ7gl3+tHlUhsQksxduVZ/RZiGw22d+AZ3PQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=kNC72H3K; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 336CD606A330 for ; Thu, 3 Dec 2026 14:07:50 +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=kNC72H3K Received: by smtp.kernel.org (Postfix) with ESMTPSA id 473591F00893; Thu, 3 Dec 2026 14:07:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796306870; bh=U+hegRIy/xY+dpQTnd+QgneMyrjorR6EiSVKHDOG3Sw=; h=From:Date:Subject:References:In-Reply-To:To:Cc; b=kNC72H3Ke17CSZ4FsZSRQBWHtf50jeaLWgtboMRd2/KBj0MgdbQbsFWZcuQ5l0qEe m1zPYcYnBSv75eukp2GFX07rMBmXLo+z+6JJYjXgiFPooBe+MZTTOvpjAk5QEy3hU5 OW7RFmLTuX7wtLZCkDfBV8xaZ9BvlukmiLxMtICwJUbuqnzkGy6ol9cCO0WbCSZ4el jec7ibAqaiG7w9vpbDGkReu3q4dlQPliL3xtgpr7Lp1c32ZMux4K4X+rFNuWyO9B4k XV8aOUcarVgci8bMR3ubZGT0UksHMTDJZ2YrkBrD7XkYr7fOhz1rEOuo8GsbDocpGI ufCNVY0KpT8fg== From: Maxime Ripard Date: Thu, 03 Dec 2026 15:07:25 +0100 Subject: [PATCH v13 7/9] drm/msm/dpu1: Carry the mixers over to created CRTC states X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20261203-drm-reset-state-flag-v13-7-b09f19f64e64@kernel.org> References: <20261203-drm-reset-state-flag-v13-0-b09f19f64e64@kernel.org> In-Reply-To: <20261203-drm-reset-state-flag-v13-0-b09f19f64e64@kernel.org> To: Maarten Lankhorst , Thomas Zimmermann , David Airlie , Simona Vetter , Louis Chauvet , Haneen Mohammed , Melissa Wen Cc: Daniel Stone , Harry Wentland , Jocelyn Falempe , =?utf-8?q?Jonas_=C3=85dahl?= , =?utf-8?q?Michel_D=C3=A4nzer?= , Pekka Paalanen , Sebastian Wick , Simon Ser , Victoria Brekenfeld , Xaver Hugl , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Maxime Ripard , Rob Clark , Dmitry Baryshkov , Abhinav Kumar , Jessica Zhang , freedreno@lists.freedesktop.org X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=3090; i=mripard@kernel.org; h=from:subject:message-id; bh=VOsWcDdoQhmil64ZECFvPndZo8/WP7wCswM7Ex/ZBaE=; b=owGbwMvMwCmsHn9OcpHtvjLG02pJDNmC5XPi10kmCIiWb6u4Yfdq7dk/hj6qCm/m21+6Fy04R ydHMcq7YyoLgzAng6yYIssTmbDTy9sXVznYr/wBM4eVCWQIAxenAEzksxdjnW3q8voPiqYH1zTX vCqVLTX/a3c7bFWYrHlT07UQ2ZlbEg+X6/6SvlTyo66k7/E042xLxobV84tEt06sNA9+3se4dYe lAtOjjKaM78fXcxm2Jn84w8K6gknnT1Js3Hb1nw+Z1visVQUA X-Developer-Key: i=mripard@kernel.org; a=openpgp; fpr=BE5675C37E818C8B5764241C254BCFC56BF6CE8D drm_atomic_commit_fill_with_defaults() builds its commits out of states created through atomic_create_state() instead of duplicating the current state. A created CRTC state comes with no mixers, while a duplicated state carries the ones currently assigned, since the duplication copies the whole state. dpu_crtc_atomic_check() only goes through dpu_crtc_assign_resources() when the mode, the connectors or the color management properties changed, so a CRTC that keeps its configuration with a created state runs with no mixers at all. Copy the mixers of the current state over when the new state has none, like a duplicated state would have carried them. This is a no-op for duplicated states, which already have them. Only do so for a CRTC that stays enabled. dpu_crtc_assign_resources() returns right after dpu_rm_release() for a disabled one, leaving the mixers it just released behind in the state it was given, and those must not be handed over to a new state where the consumers that don't check the CRTC enablement could reach hardware reassigned since. Signed-off-by: Maxime Ripard --- To: Rob Clark To: Dmitry Baryshkov Cc: Abhinav Kumar Cc: Jessica Zhang Cc: freedreno@lists.freedesktop.org --- drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c index 77a2d1f6700d..a99f6761035f 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c @@ -1538,10 +1538,33 @@ static int dpu_crtc_atomic_check(struct drm_crtc *crtc, if (crtc_state->mode_changed || crtc_state->connectors_changed || crtc_state->color_mgmt_changed) { rc = dpu_crtc_assign_resources(crtc, crtc_state); if (rc < 0) return rc; + } else if (crtc_state->enable && !cstate->num_mixers) { + struct dpu_crtc_state *old_cstate = + to_dpu_crtc_state(drm_atomic_get_old_crtc_state(state, + crtc)); + + /* + * A CRTC that keeps its configuration keeps its mixers. + * A duplicated state carries them over, but a state + * created through atomic_create_state() comes with + * none, so copy them from the current state like a + * duplicated state would, to make sure the checks and + * the commit see the mixers in use. + * + * Only do so for a CRTC that stays enabled: + * dpu_crtc_assign_resources() returns right after + * dpu_rm_release() for a disabled one, leaving the mixers + * it just released behind in the state it was given. + */ + if (old_cstate->num_mixers) { + cstate->num_mixers = old_cstate->num_mixers; + memcpy(cstate->mixers, old_cstate->mixers, + sizeof(cstate->mixers)); + } } if (crtc_state->planes_changed || crtc_state->zpos_changed) { if (dpu_use_virtual_planes) rc = dpu_crtc_reassign_planes(crtc, crtc_state); -- 2.56.1