From nobody Fri Dec 19 15:48:03 2025 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6554331A55F; Fri, 5 Dec 2025 09:52:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=213.167.242.64 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764928370; cv=none; b=fAwRzWAGgRrzJLT835y27q87UAFiDXOUkHorMdnqA8JJFAY4uv2y77hP6mKhhf/bA1id8LnVCTWeFPhcKR4VPgZbKP91MkmUmjCwVRmua5PHycZm0GdbfrYgfdKfw5GZsi4lGiffgUj4/xOStsvYB84T6VyAVS3PPXh0qUSORLI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764928370; c=relaxed/simple; bh=+ymyio3eA+DYlmRJI9W1XgVmwy5/B3PG90stDf9BFHk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=FwDfNsO5AXHchfgRMFF6tI5nNfpr9e5KUbLtDDsksaEzl6+E3Xn3L8KNkPy/YzprrdxrYN3WbJ0dSlwJxEFg7pTJcSQ6nJikc6m/AplKCsdc7+jDUL0bwdtnkjIalbJsLFxTNDdWLqSa0vxHrO2X0deGPsXjqUxT5cyW2JLC+qQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ideasonboard.com; spf=pass smtp.mailfrom=ideasonboard.com; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b=HPCE1hrp; arc=none smtp.client-ip=213.167.242.64 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ideasonboard.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ideasonboard.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="HPCE1hrp" Received: from [127.0.1.1] (91-158-153-178.elisa-laajakaista.fi [91.158.153.178]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id C10FC11EF; Fri, 5 Dec 2025 10:50:08 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1764928210; bh=+ymyio3eA+DYlmRJI9W1XgVmwy5/B3PG90stDf9BFHk=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=HPCE1hrpDv12tDiTdPw6hNHZN7y2Bemr0Q/tT/rqbI8Nd6g5HeH9Nh8o/Aj1jtpN2 NaWqECU+jF/emCI4tJh3ocUMmz7gT3Vcj5tK/1c6M4zVr1I3Q8Jo8rY7YNWmknWFc2 zqqLZiCgSq868LtamJn66/aF9gwvANEAyS1JRfIk= From: Tomi Valkeinen Date: Fri, 05 Dec 2025 11:51:48 +0200 Subject: [PATCH 1/4] Revert "drm/atomic-helper: Re-order bridge chain pre-enable and post-disable" Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20251205-drm-seq-fix-v1-1-fda68fa1b3de@ideasonboard.com> References: <20251205-drm-seq-fix-v1-0-fda68fa1b3de@ideasonboard.com> In-Reply-To: <20251205-drm-seq-fix-v1-0-fda68fa1b3de@ideasonboard.com> To: Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Dmitry Baryshkov , Chun-Kuang Hu , Philipp Zabel , Matthias Brugger , AngeloGioacchino Del Regno , Jyri Sarha Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, Marek Szyprowski , Louis-Alexis Eyraud , Aradhya Bhatia , Linus Walleij , Chaoyi Chen , Vicente Bergas , Marek Vasut , Tomi Valkeinen , stable@vger.kernel.org X-Mailer: b4 0.15-dev-c25d1 X-Developer-Signature: v=1; a=openpgp-sha256; l=15709; i=tomi.valkeinen@ideasonboard.com; h=from:subject:message-id; bh=+ymyio3eA+DYlmRJI9W1XgVmwy5/B3PG90stDf9BFHk=; b=owEBbQKS/ZANAwAIAfo9qoy8lh71AcsmYgBpMqtVMxyofo+pk0fUCqHAhIUnHAjWKXUvxnj2p fn8zsG2WvGJAjMEAAEIAB0WIQTEOAw+ll79gQef86f6PaqMvJYe9QUCaTKrVQAKCRD6PaqMvJYe 9eQ1D/955qRo5DUhVivaV9qn/ywyAe8jSOTEmcU7FW6Xvo2tKQtXMUW2O2jaGPWqulXroi/8Nui DhF++yKo405cyuKemE+VcxzKjsqrWLrK2kB30vyJp5aZHrK73BotHcu/QAV9sQXPqrEI1a9763b 5h/16PAATPHoIe1dKZZCz4wHuIdtmOoFLgV4OJ6TjFqmlx4pqdJ/K5KhBHoRfvqbAdT5DSE08EQ 554hSq2lpPXBbba1PFSjDdcr0Icuu02/0Adg4sDaQcpXSuMxYvSQC/JXd3f7+n+JOEF61sW+K0h 3FhMnl+Ai3CHLn/DyadoF5O2aDZh1Qjq2iJGZO9dBYmDhvZ8HrJ2Mc+ugHViyC7rLg0Ug2sUQxu ordKS2CRW/enj0vwlr9Mq4Q6bdugfPPndWI5jMS6IzmQBp09H4JY/1kWKVl69B544ES+cGPcpJ2 nJjZ8Lat/QVfU65ottYfi0MbHmxzgABUnqB4MJLGZojYy+eljUELZMDsJ4vrv0EidHZ1+tRD6v4 V4CukJgE1wdnETKxGqC3DgD/oKcAahDat+AWLag3IJvB4y8utoffC90F44fLRXA5O1vaDMCVyFP tmzcXYsp2zy/cO33N9vMXYGVeRiI+I8pe1KQdhHBb5tGC1IK/JXUj0eN+LpsHBD/G6SV0JTB/e6 MVnD/SPfP7tAygg== X-Developer-Key: i=tomi.valkeinen@ideasonboard.com; a=openpgp; fpr=C4380C3E965EFD81079FF3A7FA3DAA8CBC961EF5 This reverts commit c9b1150a68d9362a0827609fc0dc1664c0d8bfe1. Changing the enable/disable sequence has caused regressions on multiple platforms: R-Car, MCDE, Rockchip. A series (see link below) was sent to fix these, but it was decided that it's better to revert the original patch and change the enable/disable sequence only in the tidss driver. Reverting this commit breaks tidss's DSI and OLDI outputs, which will be fixed in the following commits. Signed-off-by: Tomi Valkeinen Link: https://lore.kernel.org/all/20251202-mcde-drm-regression-thirdfix-v6-= 0-f1bffd4ec0fa%40kernel.org/ Fixes: c9b1150a68d9 ("drm/atomic-helper: Re-order bridge chain pre-enable a= nd post-disable") Cc: stable@vger.kernel.org # v6.17+ Reviewed-by: Aradhya Bhatia Reviewed-by: Linus Walleij Reviewed-by: Maxime Ripard Tested-by: Linus Walleij --- drivers/gpu/drm/drm_atomic_helper.c | 8 +- include/drm/drm_bridge.h | 249 ++++++++++----------------------= ---- 2 files changed, 70 insertions(+), 187 deletions(-) diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atom= ic_helper.c index 10adac9397cf..ef97f37560b2 100644 --- a/drivers/gpu/drm/drm_atomic_helper.c +++ b/drivers/gpu/drm/drm_atomic_helper.c @@ -1341,9 +1341,9 @@ disable_outputs(struct drm_device *dev, struct drm_at= omic_state *state) { encoder_bridge_disable(dev, state); =20 - crtc_disable(dev, state); - encoder_bridge_post_disable(dev, state); + + crtc_disable(dev, state); } =20 /** @@ -1682,10 +1682,10 @@ encoder_bridge_enable(struct drm_device *dev, struc= t drm_atomic_state *state) void drm_atomic_helper_commit_modeset_enables(struct drm_device *dev, struct drm_atomic_state *state) { - encoder_bridge_pre_enable(dev, state); - crtc_enable(dev, state); =20 + encoder_bridge_pre_enable(dev, state); + encoder_bridge_enable(dev, state); =20 drm_atomic_helper_commit_writebacks(dev, state); diff --git a/include/drm/drm_bridge.h b/include/drm/drm_bridge.h index 0ff7ab4aa868..dbafe136833f 100644 --- a/include/drm/drm_bridge.h +++ b/include/drm/drm_bridge.h @@ -176,33 +176,17 @@ struct drm_bridge_funcs { /** * @disable: * - * The @disable callback should disable the bridge. + * This callback should disable the bridge. It is called right before + * the preceding element in the display pipe is disabled. If the + * preceding element is a bridge this means it's called before that + * bridge's @disable vfunc. If the preceding element is a &drm_encoder + * it's called right before the &drm_encoder_helper_funcs.disable, + * &drm_encoder_helper_funcs.prepare or &drm_encoder_helper_funcs.dpms + * hook. * * The bridge can assume that the display pipe (i.e. clocks and timing * signals) feeding it is still running when this callback is called. * - * - * If the preceding element is a &drm_bridge, then this is called before - * that bridge is disabled via one of: - * - * - &drm_bridge_funcs.disable - * - &drm_bridge_funcs.atomic_disable - * - * If the preceding element of the bridge is a display controller, then - * this callback is called before the encoder is disabled via one of: - * - * - &drm_encoder_helper_funcs.atomic_disable - * - &drm_encoder_helper_funcs.prepare - * - &drm_encoder_helper_funcs.disable - * - &drm_encoder_helper_funcs.dpms - * - * and the CRTC is disabled via one of: - * - * - &drm_crtc_helper_funcs.prepare - * - &drm_crtc_helper_funcs.atomic_disable - * - &drm_crtc_helper_funcs.disable - * - &drm_crtc_helper_funcs.dpms. - * * The @disable callback is optional. * * NOTE: @@ -215,34 +199,17 @@ struct drm_bridge_funcs { /** * @post_disable: * - * The bridge must assume that the display pipe (i.e. clocks and timing - * signals) feeding this bridge is no longer running when the - * @post_disable is called. + * This callback should disable the bridge. It is called right after the + * preceding element in the display pipe is disabled. If the preceding + * element is a bridge this means it's called after that bridge's + * @post_disable function. If the preceding element is a &drm_encoder + * it's called right after the encoder's + * &drm_encoder_helper_funcs.disable, &drm_encoder_helper_funcs.prepare + * or &drm_encoder_helper_funcs.dpms hook. * - * This callback should perform all the actions required by the hardware - * after it has stopped receiving signals from the preceding element. - * - * If the preceding element is a &drm_bridge, then this is called after - * that bridge is post-disabled (unless marked otherwise by the - * @pre_enable_prev_first flag) via one of: - * - * - &drm_bridge_funcs.post_disable - * - &drm_bridge_funcs.atomic_post_disable - * - * If the preceding element of the bridge is a display controller, then - * this callback is called after the encoder is disabled via one of: - * - * - &drm_encoder_helper_funcs.atomic_disable - * - &drm_encoder_helper_funcs.prepare - * - &drm_encoder_helper_funcs.disable - * - &drm_encoder_helper_funcs.dpms - * - * and the CRTC is disabled via one of: - * - * - &drm_crtc_helper_funcs.prepare - * - &drm_crtc_helper_funcs.atomic_disable - * - &drm_crtc_helper_funcs.disable - * - &drm_crtc_helper_funcs.dpms + * The bridge must assume that the display pipe (i.e. clocks and timing + * signals) feeding it is no longer running when this callback is + * called. * * The @post_disable callback is optional. * @@ -285,30 +252,18 @@ struct drm_bridge_funcs { /** * @pre_enable: * - * The display pipe (i.e. clocks and timing signals) feeding this bridge - * will not yet be running when the @pre_enable is called. - * - * This callback should perform all the necessary actions to prepare the - * bridge to accept signals from the preceding element. - * - * If the preceding element is a &drm_bridge, then this is called before - * that bridge is pre-enabled (unless marked otherwise by - * @pre_enable_prev_first flag) via one of: - * - * - &drm_bridge_funcs.pre_enable - * - &drm_bridge_funcs.atomic_pre_enable - * - * If the preceding element of the bridge is a display controller, then - * this callback is called before the CRTC is enabled via one of: - * - * - &drm_crtc_helper_funcs.atomic_enable - * - &drm_crtc_helper_funcs.commit - * - * and the encoder is enabled via one of: + * This callback should enable the bridge. It is called right before + * the preceding element in the display pipe is enabled. If the + * preceding element is a bridge this means it's called before that + * bridge's @pre_enable function. If the preceding element is a + * &drm_encoder it's called right before the encoder's + * &drm_encoder_helper_funcs.enable, &drm_encoder_helper_funcs.commit or + * &drm_encoder_helper_funcs.dpms hook. * - * - &drm_encoder_helper_funcs.atomic_enable - * - &drm_encoder_helper_funcs.enable - * - &drm_encoder_helper_funcs.commit + * The display pipe (i.e. clocks and timing signals) feeding this bridge + * will not yet be running when this callback is called. The bridge must + * not enable the display link feeding the next bridge in the chain (if + * there is one) when this callback is called. * * The @pre_enable callback is optional. * @@ -322,31 +277,19 @@ struct drm_bridge_funcs { /** * @enable: * - * The @enable callback should enable the bridge. + * This callback should enable the bridge. It is called right after + * the preceding element in the display pipe is enabled. If the + * preceding element is a bridge this means it's called after that + * bridge's @enable function. If the preceding element is a + * &drm_encoder it's called right after the encoder's + * &drm_encoder_helper_funcs.enable, &drm_encoder_helper_funcs.commit or + * &drm_encoder_helper_funcs.dpms hook. * * The bridge can assume that the display pipe (i.e. clocks and timing * signals) feeding it is running when this callback is called. This * callback must enable the display link feeding the next bridge in the * chain if there is one. * - * If the preceding element is a &drm_bridge, then this is called after - * that bridge is enabled via one of: - * - * - &drm_bridge_funcs.enable - * - &drm_bridge_funcs.atomic_enable - * - * If the preceding element of the bridge is a display controller, then - * this callback is called after the CRTC is enabled via one of: - * - * - &drm_crtc_helper_funcs.atomic_enable - * - &drm_crtc_helper_funcs.commit - * - * and the encoder is enabled via one of: - * - * - &drm_encoder_helper_funcs.atomic_enable - * - &drm_encoder_helper_funcs.enable - * - drm_encoder_helper_funcs.commit - * * The @enable callback is optional. * * NOTE: @@ -359,30 +302,17 @@ struct drm_bridge_funcs { /** * @atomic_pre_enable: * - * The display pipe (i.e. clocks and timing signals) feeding this bridge - * will not yet be running when the @atomic_pre_enable is called. - * - * This callback should perform all the necessary actions to prepare the - * bridge to accept signals from the preceding element. - * - * If the preceding element is a &drm_bridge, then this is called before - * that bridge is pre-enabled (unless marked otherwise by - * @pre_enable_prev_first flag) via one of: - * - * - &drm_bridge_funcs.pre_enable - * - &drm_bridge_funcs.atomic_pre_enable + * This callback should enable the bridge. It is called right before + * the preceding element in the display pipe is enabled. If the + * preceding element is a bridge this means it's called before that + * bridge's @atomic_pre_enable or @pre_enable function. If the preceding + * element is a &drm_encoder it's called right before the encoder's + * &drm_encoder_helper_funcs.atomic_enable hook. * - * If the preceding element of the bridge is a display controller, then - * this callback is called before the CRTC is enabled via one of: - * - * - &drm_crtc_helper_funcs.atomic_enable - * - &drm_crtc_helper_funcs.commit - * - * and the encoder is enabled via one of: - * - * - &drm_encoder_helper_funcs.atomic_enable - * - &drm_encoder_helper_funcs.enable - * - &drm_encoder_helper_funcs.commit + * The display pipe (i.e. clocks and timing signals) feeding this bridge + * will not yet be running when this callback is called. The bridge must + * not enable the display link feeding the next bridge in the chain (if + * there is one) when this callback is called. * * The @atomic_pre_enable callback is optional. */ @@ -392,31 +322,18 @@ struct drm_bridge_funcs { /** * @atomic_enable: * - * The @atomic_enable callback should enable the bridge. + * This callback should enable the bridge. It is called right after + * the preceding element in the display pipe is enabled. If the + * preceding element is a bridge this means it's called after that + * bridge's @atomic_enable or @enable function. If the preceding element + * is a &drm_encoder it's called right after the encoder's + * &drm_encoder_helper_funcs.atomic_enable hook. * * The bridge can assume that the display pipe (i.e. clocks and timing * signals) feeding it is running when this callback is called. This * callback must enable the display link feeding the next bridge in the * chain if there is one. * - * If the preceding element is a &drm_bridge, then this is called after - * that bridge is enabled via one of: - * - * - &drm_bridge_funcs.enable - * - &drm_bridge_funcs.atomic_enable - * - * If the preceding element of the bridge is a display controller, then - * this callback is called after the CRTC is enabled via one of: - * - * - &drm_crtc_helper_funcs.atomic_enable - * - &drm_crtc_helper_funcs.commit - * - * and the encoder is enabled via one of: - * - * - &drm_encoder_helper_funcs.atomic_enable - * - &drm_encoder_helper_funcs.enable - * - drm_encoder_helper_funcs.commit - * * The @atomic_enable callback is optional. */ void (*atomic_enable)(struct drm_bridge *bridge, @@ -424,32 +341,16 @@ struct drm_bridge_funcs { /** * @atomic_disable: * - * The @atomic_disable callback should disable the bridge. + * This callback should disable the bridge. It is called right before + * the preceding element in the display pipe is disabled. If the + * preceding element is a bridge this means it's called before that + * bridge's @atomic_disable or @disable vfunc. If the preceding element + * is a &drm_encoder it's called right before the + * &drm_encoder_helper_funcs.atomic_disable hook. * * The bridge can assume that the display pipe (i.e. clocks and timing * signals) feeding it is still running when this callback is called. * - * If the preceding element is a &drm_bridge, then this is called before - * that bridge is disabled via one of: - * - * - &drm_bridge_funcs.disable - * - &drm_bridge_funcs.atomic_disable - * - * If the preceding element of the bridge is a display controller, then - * this callback is called before the encoder is disabled via one of: - * - * - &drm_encoder_helper_funcs.atomic_disable - * - &drm_encoder_helper_funcs.prepare - * - &drm_encoder_helper_funcs.disable - * - &drm_encoder_helper_funcs.dpms - * - * and the CRTC is disabled via one of: - * - * - &drm_crtc_helper_funcs.prepare - * - &drm_crtc_helper_funcs.atomic_disable - * - &drm_crtc_helper_funcs.disable - * - &drm_crtc_helper_funcs.dpms. - * * The @atomic_disable callback is optional. */ void (*atomic_disable)(struct drm_bridge *bridge, @@ -458,34 +359,16 @@ struct drm_bridge_funcs { /** * @atomic_post_disable: * - * The bridge must assume that the display pipe (i.e. clocks and timing - * signals) feeding this bridge is no longer running when the - * @atomic_post_disable is called. - * - * This callback should perform all the actions required by the hardware - * after it has stopped receiving signals from the preceding element. + * This callback should disable the bridge. It is called right after the + * preceding element in the display pipe is disabled. If the preceding + * element is a bridge this means it's called after that bridge's + * @atomic_post_disable or @post_disable function. If the preceding + * element is a &drm_encoder it's called right after the encoder's + * &drm_encoder_helper_funcs.atomic_disable hook. * - * If the preceding element is a &drm_bridge, then this is called after - * that bridge is post-disabled (unless marked otherwise by the - * @pre_enable_prev_first flag) via one of: - * - * - &drm_bridge_funcs.post_disable - * - &drm_bridge_funcs.atomic_post_disable - * - * If the preceding element of the bridge is a display controller, then - * this callback is called after the encoder is disabled via one of: - * - * - &drm_encoder_helper_funcs.atomic_disable - * - &drm_encoder_helper_funcs.prepare - * - &drm_encoder_helper_funcs.disable - * - &drm_encoder_helper_funcs.dpms - * - * and the CRTC is disabled via one of: - * - * - &drm_crtc_helper_funcs.prepare - * - &drm_crtc_helper_funcs.atomic_disable - * - &drm_crtc_helper_funcs.disable - * - &drm_crtc_helper_funcs.dpms + * The bridge must assume that the display pipe (i.e. clocks and timing + * signals) feeding it is no longer running when this callback is + * called. * * The @atomic_post_disable callback is optional. */ --=20 2.43.0 From nobody Fri Dec 19 15:48:03 2025 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 910D3242D91; Fri, 5 Dec 2025 09:52:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=213.167.242.64 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764928371; cv=none; b=r85usWTEQM8cnVczWblAGtfb/qqYwXjZlXgR1WWy1HHZyoZmbLUgHj70VNdAKujjR1LW7dfvsoTtNb/1aLJKNT30+iHBEHsEBrQxc4KxBXWghgUvAqEiDBBQuVWYPA1JOkQAYeanZBU4lys3s5GEoE23B+fD9RspepfhVMv/3aA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764928371; c=relaxed/simple; bh=RzSq2b7h3pXJJqHtjfZMXpUK9z6SZ1dKteyFwNFQZAs=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=jMvQWdDPH5LtXVm863Gd/zMBLIleQHhwRNmL38et/UkxSir3jOYEM09SG3vE2ewyrV9GRXRymu6vuDEYsAl8T4Zvq8l+H0d9W5f8XxuJY/CD+725J4jxOYJDgiPhO4i6LQHtqJhD3VLwn7yz3t84AhbwcGr+Jmf7R/ltHTMdZQs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ideasonboard.com; spf=pass smtp.mailfrom=ideasonboard.com; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b=gkwjp2IA; arc=none smtp.client-ip=213.167.242.64 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ideasonboard.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ideasonboard.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="gkwjp2IA" Received: from [127.0.1.1] (91-158-153-178.elisa-laajakaista.fi [91.158.153.178]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 66F3F1340; Fri, 5 Dec 2025 10:50:10 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1764928211; bh=RzSq2b7h3pXJJqHtjfZMXpUK9z6SZ1dKteyFwNFQZAs=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=gkwjp2IAdh2jZ5E7vLLh4PMPn8r4TSJDnPuwKgZyGUDMaLaDIRNQ9lA/CG9L8Z50Y gKwfpjwznXi2bXvzMCNsUK42CFR3jbQwwOEjBGevv3jTImTHZ+cPqgTC7edVPVakKq QOg6Ncwrtko+dgTewQ9G/77axGYuONVvuEhBj6Sk= From: Tomi Valkeinen Date: Fri, 05 Dec 2025 11:51:49 +0200 Subject: [PATCH 2/4] Revert "drm/mediatek: dsi: Fix DSI host and panel bridge pre-enable order" Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20251205-drm-seq-fix-v1-2-fda68fa1b3de@ideasonboard.com> References: <20251205-drm-seq-fix-v1-0-fda68fa1b3de@ideasonboard.com> In-Reply-To: <20251205-drm-seq-fix-v1-0-fda68fa1b3de@ideasonboard.com> To: Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Dmitry Baryshkov , Chun-Kuang Hu , Philipp Zabel , Matthias Brugger , AngeloGioacchino Del Regno , Jyri Sarha Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, Marek Szyprowski , Louis-Alexis Eyraud , Aradhya Bhatia , Linus Walleij , Chaoyi Chen , Vicente Bergas , Marek Vasut , Tomi Valkeinen , stable@vger.kernel.org X-Mailer: b4 0.15-dev-c25d1 X-Developer-Signature: v=1; a=openpgp-sha256; l=1126; i=tomi.valkeinen@ideasonboard.com; h=from:subject:message-id; bh=RzSq2b7h3pXJJqHtjfZMXpUK9z6SZ1dKteyFwNFQZAs=; b=owEBbQKS/ZANAwAIAfo9qoy8lh71AcsmYgBpMqtV1Bz5YLupAlqCBVQfV0Mb8hNkfkNlmb4RE 8M28qdYt6+JAjMEAAEIAB0WIQTEOAw+ll79gQef86f6PaqMvJYe9QUCaTKrVQAKCRD6PaqMvJYe 9YAND/92tsJW0TaalpvTYvqAmYF3JK82lYKeIh0n3ljbzoYQWOF0dQwLi3Fgw5CAcvJgNmhdLb1 bTGtcMk2CrFsb/4dmaSBGsdRA5i6tn0IlToo4Rc5xk+JnY6NmsNJCn/+gPvLY0CBaCl1wxL+Z9H LxY+kyTWuw7zqTh2/FbQDdSNMxcp5SwHWJTdLQkoISnFDlQ8ElEtkjJ7GD8i3GUDseWYRGokDc5 FAbdx7/f0KBBc0i0hcz0ruBEsN+dkex/EPt5ZRswQhm7G853gEZtgIE5vZ9bMc4EYsr5ok+kXBm 3DfwhATiXByEjJhyPZug+jl+kGowPoSeRNPQSNbtd2NmTnGUxvKTqz0Tiw6ZsMVIG7pDj4oDS7r coN/IzcPwJTMIRBWufEPTRDF5Nu/BDj3D106qUgsZ6LQCMQwL0+wd+Pu2vokbbZ3c21bI/Xh7f9 uNzEPs1Eict9x+0y716f8sst5eyvCP0froqSwOuOLcU7UXoRf0fix0Y7zzYNt4KTdFZZbUSLFGS 8CfTLBaPIdl8AwIOFUdoFQnJTup0qAHlFqmuldUotdmj5mk/XBFJrsXQtHaamfPrcZP77wJHO6S S6C364XUBDfRltXP2ftIq3NdfU3tya8Jf0/6N/r3lvfZgN2P7zNK5LzsMBPRFbCGtUYSRV+uDlD otnLqA/gy60hWkQ== X-Developer-Key: i=tomi.valkeinen@ideasonboard.com; a=openpgp; fpr=C4380C3E965EFD81079FF3A7FA3DAA8CBC961EF5 This reverts commit f5b1819193667bf62c3c99d3921b9429997a14b2. As the original commit (c9b1150a68d9 ("drm/atomic-helper: Re-order bridge chain pre-enable and post-disable")) causing the issue has been reverted, let's revert the fix for mediatek. Signed-off-by: Tomi Valkeinen Cc: stable@vger.kernel.org # v6.17+ Reviewed-by: Linus Walleij Reviewed-by: Maxime Ripard Tested-by: Linus Walleij --- drivers/gpu/drm/mediatek/mtk_dsi.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/drivers/gpu/drm/mediatek/mtk_dsi.c b/drivers/gpu/drm/mediatek/= mtk_dsi.c index 0e2bcd5f67b7..d7726091819c 100644 --- a/drivers/gpu/drm/mediatek/mtk_dsi.c +++ b/drivers/gpu/drm/mediatek/mtk_dsi.c @@ -1002,12 +1002,6 @@ static int mtk_dsi_host_attach(struct mipi_dsi_host = *host, return PTR_ERR(dsi->next_bridge); } =20 - /* - * set flag to request the DSI host bridge be pre-enabled before device b= ridge - * in the chain, so the DSI host is ready when the device bridge is pre-e= nabled - */ - dsi->next_bridge->pre_enable_prev_first =3D true; - drm_bridge_add(&dsi->bridge); =20 ret =3D component_add(host->dev, &mtk_dsi_component_ops); --=20 2.43.0 From nobody Fri Dec 19 15:48:03 2025 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EF6063148C1; Fri, 5 Dec 2025 09:52:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=213.167.242.64 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764928387; cv=none; b=ejS339LQMBNetrKmzy5MM6fJM9QoNoO1LwKCAT4M31hwmoTqRxM0z+s01XPwMdXs+/Jhhnm5mDSKwADKREeSYe9p1UvpBNktS46taFc/eWC5UZROzJKYC3gPDP7q+4dv4c6bo4n7IuhoiFQfQ5xCbI/usTFqTIwzfQDTPW4DLu0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764928387; c=relaxed/simple; bh=H3iYoV2u9r8Jk4Es7Q8H1ijV4oQjUUL3oWEdE+IWF8Y=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=CGkoaAoaSQaZ2v6X3sFqpP1M4q9DVaFUBqy/M1Z4B7edAILITXWbpYb4BjkkNSiOv6L5dOh1i6qe8TlklL9ALGS56+cV2rMmwtBHrvdxtEjacGuWnOeXfhtywy5yPxVDPzGo1zBC5G3c1wLxPnMGCLNmIZMwzqYR48iLvzm+8io= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ideasonboard.com; spf=pass smtp.mailfrom=ideasonboard.com; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b=t+Pobx3k; arc=none smtp.client-ip=213.167.242.64 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ideasonboard.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ideasonboard.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="t+Pobx3k" Received: from [127.0.1.1] (91-158-153-178.elisa-laajakaista.fi [91.158.153.178]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 019281698; Fri, 5 Dec 2025 10:50:11 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1764928213; bh=H3iYoV2u9r8Jk4Es7Q8H1ijV4oQjUUL3oWEdE+IWF8Y=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=t+Pobx3kWZWMt/3iPVjse+cvhwXCnHnZpzWU+hyTGXOBYs8yPG53Z1DqYRIWUPCNM FrcTw6jPw3mKIhhgP36dIh/aOirHRPV51KTDhk68K+Z/a3YxsFIQ4PCcqb0TXk4SpB 8ZfnaRqMLFqTFV6mOAEGRvCHpz4lNrHt3bDFHoO4= From: Tomi Valkeinen Date: Fri, 05 Dec 2025 11:51:50 +0200 Subject: [PATCH 3/4] drm/atomic-helper: Export and namespace some functions Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20251205-drm-seq-fix-v1-3-fda68fa1b3de@ideasonboard.com> References: <20251205-drm-seq-fix-v1-0-fda68fa1b3de@ideasonboard.com> In-Reply-To: <20251205-drm-seq-fix-v1-0-fda68fa1b3de@ideasonboard.com> To: Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Dmitry Baryshkov , Chun-Kuang Hu , Philipp Zabel , Matthias Brugger , AngeloGioacchino Del Regno , Jyri Sarha Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, Marek Szyprowski , Louis-Alexis Eyraud , Aradhya Bhatia , Linus Walleij , Chaoyi Chen , Vicente Bergas , Marek Vasut , Tomi Valkeinen , stable@vger.kernel.org X-Mailer: b4 0.15-dev-c25d1 X-Developer-Signature: v=1; a=openpgp-sha256; l=10930; i=tomi.valkeinen@ideasonboard.com; h=from:subject:message-id; bh=F5H0/6LPFd3VrdUCkl9TQQyakRyv9LISoY+KgS2MwLA=; b=owEBbQKS/ZANAwAIAfo9qoy8lh71AcsmYgBpMqtWaJNXojh3c+Ewaz+pFtky4IV5bYpYBocWO kPXpLijOauJAjMEAAEIAB0WIQTEOAw+ll79gQef86f6PaqMvJYe9QUCaTKrVgAKCRD6PaqMvJYe 9Y60EACrZv4FojLk5Y7t5enoqig0Hgz/HdhYosA2II+6nNilUBS9lP/OAg9+qOVdNVudJwPVqeX CwjSNT4YSflCDKkfJ2/IYwdjTV1m/qGmWZlznMS8VLeSKJLfLYqeZySRBcRGwRWmVRCErieMUkg nxtHmxbyo1/qfbB6JUkJRytwf144bK12v/X7FHAjnpwVcVfKB1CNgrpctfH05741rkl0oUlHwIy zAse1ZQPK8N3WQHBGw+06kYNhzR+2FdB2/AwTrarPoI8x6dDc9ImyBthsszprfFwIgVZ0ewXXd7 t+3q8fM2Cs/QDNBdpSRkGWHr7yEqNcVTt77OqTj1Pam/TzsbyqtshD7c5djEqaDzBr96bApBP/R 9rFUd6E/01vq4gqHcYuc1Qzzk1kup3t4ZgkJuhjlL9FVqDwU9yARCjBFn6FN6BaZ4gBFcOtS54b cyeJVqz3UvPW9IsatN3AFxHf2cfW4B1PUPK0Xy73NVtILGgMrfzYV9yA2jZaLoSgn1tbTpLaybF FXGBUMtomHdEhOmqIXSvCaY8OsxmNIRpoSu0311OqjjwLe3UIMlbqa90rxRf6jAJWXQuTd4P/8x 4Q5hCpvIfhTtuUMm5u/Gb5THP4g8aP2LYSZf3p4DFQf166yrmybKXzdBQI8Yzdia2e5ZvjFJoP8 yxbsgfLSjtP3mjw== X-Developer-Key: i=tomi.valkeinen@ideasonboard.com; a=openpgp; fpr=C4380C3E965EFD81079FF3A7FA3DAA8CBC961EF5 From: Linus Walleij Export and namespace those not prefixed with drm_* so it becomes possible to write custom commit tail functions in individual drivers using the helper infrastructure. Tested-by: Marek Vasut Reviewed-by: Maxime Ripard Signed-off-by: Linus Walleij [Tomi: Resolved conflicts, fixed indentation] Signed-off-by: Tomi Valkeinen Cc: stable@vger.kernel.org # v6.17+ Reviewed-by: Aradhya Bhatia Reviewed-by: Linus Walleij Tested-by: Linus Walleij --- drivers/gpu/drm/drm_atomic_helper.c | 122 +++++++++++++++++++++++++++++---= ---- include/drm/drm_atomic_helper.h | 22 +++++++ 2 files changed, 121 insertions(+), 23 deletions(-) diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atom= ic_helper.c index ef97f37560b2..5beea645035f 100644 --- a/drivers/gpu/drm/drm_atomic_helper.c +++ b/drivers/gpu/drm/drm_atomic_helper.c @@ -1162,8 +1162,18 @@ crtc_needs_disable(struct drm_crtc_state *old_state, new_state->self_refresh_active; } =20 -static void -encoder_bridge_disable(struct drm_device *dev, struct drm_atomic_state *st= ate) +/** + * drm_atomic_helper_commit_encoder_bridge_disable - disable bridges and e= ncoder + * @dev: DRM device + * @state: the driver state object + * + * Loops over all connectors in the current state and if the CRTC needs + * it, disables the bridge chain all the way, then disables the encoder + * afterwards. + */ +void +drm_atomic_helper_commit_encoder_bridge_disable(struct drm_device *dev, + struct drm_atomic_state *state) { struct drm_connector *connector; struct drm_connector_state *old_conn_state, *new_conn_state; @@ -1229,9 +1239,18 @@ encoder_bridge_disable(struct drm_device *dev, struc= t drm_atomic_state *state) } } } +EXPORT_SYMBOL(drm_atomic_helper_commit_encoder_bridge_disable); =20 -static void -crtc_disable(struct drm_device *dev, struct drm_atomic_state *state) +/** + * drm_atomic_helper_commit_crtc_disable - disable CRTSs + * @dev: DRM device + * @state: the driver state object + * + * Loops over all CRTCs in the current state and if the CRTC needs + * it, disables it. + */ +void +drm_atomic_helper_commit_crtc_disable(struct drm_device *dev, struct drm_a= tomic_state *state) { struct drm_crtc *crtc; struct drm_crtc_state *old_crtc_state, *new_crtc_state; @@ -1282,9 +1301,18 @@ crtc_disable(struct drm_device *dev, struct drm_atom= ic_state *state) drm_crtc_vblank_put(crtc); } } +EXPORT_SYMBOL(drm_atomic_helper_commit_crtc_disable); =20 -static void -encoder_bridge_post_disable(struct drm_device *dev, struct drm_atomic_stat= e *state) +/** + * drm_atomic_helper_commit_encoder_bridge_post_disable - post-disable enc= oder bridges + * @dev: DRM device + * @state: the driver state object + * + * Loops over all connectors in the current state and if the CRTC needs + * it, post-disables all encoder bridges. + */ +void +drm_atomic_helper_commit_encoder_bridge_post_disable(struct drm_device *de= v, struct drm_atomic_state *state) { struct drm_connector *connector; struct drm_connector_state *old_conn_state, *new_conn_state; @@ -1335,15 +1363,16 @@ encoder_bridge_post_disable(struct drm_device *dev,= struct drm_atomic_state *sta drm_bridge_put(bridge); } } +EXPORT_SYMBOL(drm_atomic_helper_commit_encoder_bridge_post_disable); =20 static void disable_outputs(struct drm_device *dev, struct drm_atomic_state *state) { - encoder_bridge_disable(dev, state); + drm_atomic_helper_commit_encoder_bridge_disable(dev, state); =20 - encoder_bridge_post_disable(dev, state); + drm_atomic_helper_commit_encoder_bridge_post_disable(dev, state); =20 - crtc_disable(dev, state); + drm_atomic_helper_commit_crtc_disable(dev, state); } =20 /** @@ -1446,8 +1475,17 @@ void drm_atomic_helper_calc_timestamping_constants(s= truct drm_atomic_state *stat } EXPORT_SYMBOL(drm_atomic_helper_calc_timestamping_constants); =20 -static void -crtc_set_mode(struct drm_device *dev, struct drm_atomic_state *state) +/** + * drm_atomic_helper_commit_crtc_set_mode - set the new mode + * @dev: DRM device + * @state: the driver state object + * + * Loops over all connectors in the current state and if the mode has + * changed, change the mode of the CRTC, then call down the bridge + * chain and change the mode in all bridges as well. + */ +void +drm_atomic_helper_commit_crtc_set_mode(struct drm_device *dev, struct drm_= atomic_state *state) { struct drm_crtc *crtc; struct drm_crtc_state *new_crtc_state; @@ -1508,6 +1546,7 @@ crtc_set_mode(struct drm_device *dev, struct drm_atom= ic_state *state) drm_bridge_put(bridge); } } +EXPORT_SYMBOL(drm_atomic_helper_commit_crtc_set_mode); =20 /** * drm_atomic_helper_commit_modeset_disables - modeset commit to disable o= utputs @@ -1531,12 +1570,21 @@ void drm_atomic_helper_commit_modeset_disables(stru= ct drm_device *dev, drm_atomic_helper_update_legacy_modeset_state(dev, state); drm_atomic_helper_calc_timestamping_constants(state); =20 - crtc_set_mode(dev, state); + drm_atomic_helper_commit_crtc_set_mode(dev, state); } EXPORT_SYMBOL(drm_atomic_helper_commit_modeset_disables); =20 -static void drm_atomic_helper_commit_writebacks(struct drm_device *dev, - struct drm_atomic_state *state) +/** + * drm_atomic_helper_commit_writebacks - issue writebacks + * @dev: DRM device + * @state: atomic state object being committed + * + * This loops over the connectors, checks if the new state requires + * a writeback job to be issued and in that case issues an atomic + * commit on each connector. + */ +void drm_atomic_helper_commit_writebacks(struct drm_device *dev, + struct drm_atomic_state *state) { struct drm_connector *connector; struct drm_connector_state *new_conn_state; @@ -1555,9 +1603,18 @@ static void drm_atomic_helper_commit_writebacks(stru= ct drm_device *dev, } } } +EXPORT_SYMBOL(drm_atomic_helper_commit_writebacks); =20 -static void -encoder_bridge_pre_enable(struct drm_device *dev, struct drm_atomic_state = *state) +/** + * drm_atomic_helper_commit_encoder_bridge_pre_enable - pre-enable bridges + * @dev: DRM device + * @state: atomic state object being committed + * + * This loops over the connectors and if the CRTC needs it, pre-enables + * the entire bridge chain. + */ +void +drm_atomic_helper_commit_encoder_bridge_pre_enable(struct drm_device *dev,= struct drm_atomic_state *state) { struct drm_connector *connector; struct drm_connector_state *new_conn_state; @@ -1588,9 +1645,18 @@ encoder_bridge_pre_enable(struct drm_device *dev, st= ruct drm_atomic_state *state drm_bridge_put(bridge); } } +EXPORT_SYMBOL(drm_atomic_helper_commit_encoder_bridge_pre_enable); =20 -static void -crtc_enable(struct drm_device *dev, struct drm_atomic_state *state) +/** + * drm_atomic_helper_commit_crtc_enable - enables the CRTCs + * @dev: DRM device + * @state: atomic state object being committed + * + * This loops over CRTCs in the new state, and of the CRTC needs + * it, enables it. + */ +void +drm_atomic_helper_commit_crtc_enable(struct drm_device *dev, struct drm_at= omic_state *state) { struct drm_crtc *crtc; struct drm_crtc_state *old_crtc_state; @@ -1619,9 +1685,18 @@ crtc_enable(struct drm_device *dev, struct drm_atomi= c_state *state) } } } +EXPORT_SYMBOL(drm_atomic_helper_commit_crtc_enable); =20 -static void -encoder_bridge_enable(struct drm_device *dev, struct drm_atomic_state *sta= te) +/** + * drm_atomic_helper_commit_encoder_bridge_enable - enables the bridges + * @dev: DRM device + * @state: atomic state object being committed + * + * This loops over all connectors in the new state, and of the CRTC needs + * it, enables the entire bridge chain. + */ +void +drm_atomic_helper_commit_encoder_bridge_enable(struct drm_device *dev, str= uct drm_atomic_state *state) { struct drm_connector *connector; struct drm_connector_state *new_conn_state; @@ -1664,6 +1739,7 @@ encoder_bridge_enable(struct drm_device *dev, struct = drm_atomic_state *state) drm_bridge_put(bridge); } } +EXPORT_SYMBOL(drm_atomic_helper_commit_encoder_bridge_enable); =20 /** * drm_atomic_helper_commit_modeset_enables - modeset commit to enable out= puts @@ -1682,11 +1758,11 @@ encoder_bridge_enable(struct drm_device *dev, struc= t drm_atomic_state *state) void drm_atomic_helper_commit_modeset_enables(struct drm_device *dev, struct drm_atomic_state *state) { - crtc_enable(dev, state); + drm_atomic_helper_commit_crtc_enable(dev, state); =20 - encoder_bridge_pre_enable(dev, state); + drm_atomic_helper_commit_encoder_bridge_pre_enable(dev, state); =20 - encoder_bridge_enable(dev, state); + drm_atomic_helper_commit_encoder_bridge_enable(dev, state); =20 drm_atomic_helper_commit_writebacks(dev, state); } diff --git a/include/drm/drm_atomic_helper.h b/include/drm/drm_atomic_helpe= r.h index 53382fe93537..e154ee4f0696 100644 --- a/include/drm/drm_atomic_helper.h +++ b/include/drm/drm_atomic_helper.h @@ -60,6 +60,12 @@ int drm_atomic_helper_check_plane_state(struct drm_plane= _state *plane_state, int drm_atomic_helper_check_planes(struct drm_device *dev, struct drm_atomic_state *state); int drm_atomic_helper_check_crtc_primary_plane(struct drm_crtc_state *crtc= _state); +void drm_atomic_helper_commit_encoder_bridge_disable(struct drm_device *de= v, + struct drm_atomic_state *state); +void drm_atomic_helper_commit_crtc_disable(struct drm_device *dev, + struct drm_atomic_state *state); +void drm_atomic_helper_commit_encoder_bridge_post_disable(struct drm_devic= e *dev, + struct drm_atomic_state *state); int drm_atomic_helper_check(struct drm_device *dev, struct drm_atomic_state *state); void drm_atomic_helper_commit_tail(struct drm_atomic_state *state); @@ -89,8 +95,24 @@ drm_atomic_helper_update_legacy_modeset_state(struct drm= _device *dev, void drm_atomic_helper_calc_timestamping_constants(struct drm_atomic_state *sta= te); =20 +void drm_atomic_helper_commit_crtc_set_mode(struct drm_device *dev, + struct drm_atomic_state *state); + void drm_atomic_helper_commit_modeset_disables(struct drm_device *dev, struct drm_atomic_state *state); + +void drm_atomic_helper_commit_writebacks(struct drm_device *dev, + struct drm_atomic_state *state); + +void drm_atomic_helper_commit_encoder_bridge_pre_enable(struct drm_device = *dev, + struct drm_atomic_state *state); + +void drm_atomic_helper_commit_crtc_enable(struct drm_device *dev, + struct drm_atomic_state *state); + +void drm_atomic_helper_commit_encoder_bridge_enable(struct drm_device *dev, + struct drm_atomic_state *state); + void drm_atomic_helper_commit_modeset_enables(struct drm_device *dev, struct drm_atomic_state *old_state); =20 --=20 2.43.0 From nobody Fri Dec 19 15:48:03 2025 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 88E01301491; Fri, 5 Dec 2025 09:52:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=213.167.242.64 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764928386; cv=none; b=ZsHxFxuXSIRpo6YT4fdgk5JG5YhLkWYke6Njhmrz7D4y0zPBfFMCeDYEmbm7tylXEDoiidv3yDplGSCPVjt0ApYnIYFxdFUu3MUb/o5z6NvNTIUo/V6gHdGZ64Y1vhdGTK2+9Y710ZMQbj6kjRe/wrJb+ZU6q/wFm+GLqsXPlO8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764928386; c=relaxed/simple; bh=tk41aXJM1hAnommQL/yZ5bKIvn8A1Y3535egq0jrEXs=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=fIYw64OnoNjFjoiLNnNyb3RRyuWFc2vtM26KZdevm8L9x4B3MzVavuh7kimUUfVxYh7QxT2SP+Bk4RIGL4LDiziVuFmX17YguzGqJp5DWnpMPPhG7PTEfXDx3C9oXPMKLtuNPDXDpbl8ti0vJ4UM0Lu0s0f6LLndgTzEMSbaQio= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ideasonboard.com; spf=pass smtp.mailfrom=ideasonboard.com; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b=dDozfNOw; arc=none smtp.client-ip=213.167.242.64 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ideasonboard.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ideasonboard.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="dDozfNOw" Received: from [127.0.1.1] (91-158-153-178.elisa-laajakaista.fi [91.158.153.178]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 992781776; Fri, 5 Dec 2025 10:50:13 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1764928215; bh=tk41aXJM1hAnommQL/yZ5bKIvn8A1Y3535egq0jrEXs=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=dDozfNOw0kPmG5KSLNrZMNRxUH1xcCssnfVhWxGCOvmEgCkuPW6O+l6+/X7XySbjb g0Mauy1M5GGEPC1Z5vzpfIbZLyrKS7/fCfaNoSsdPhWXIYilfCMZQBLeTdPwQUDSix O8D0SNfXvZjTKBPh48X2Ch5gvtKOy3Yx6uvYcxK0= From: Tomi Valkeinen Date: Fri, 05 Dec 2025 11:51:51 +0200 Subject: [PATCH 4/4] drm/tidss: Fix enable/disable order Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20251205-drm-seq-fix-v1-4-fda68fa1b3de@ideasonboard.com> References: <20251205-drm-seq-fix-v1-0-fda68fa1b3de@ideasonboard.com> In-Reply-To: <20251205-drm-seq-fix-v1-0-fda68fa1b3de@ideasonboard.com> To: Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Dmitry Baryshkov , Chun-Kuang Hu , Philipp Zabel , Matthias Brugger , AngeloGioacchino Del Regno , Jyri Sarha Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, Marek Szyprowski , Louis-Alexis Eyraud , Aradhya Bhatia , Linus Walleij , Chaoyi Chen , Vicente Bergas , Marek Vasut , Tomi Valkeinen , stable@vger.kernel.org X-Mailer: b4 0.15-dev-c25d1 X-Developer-Signature: v=1; a=openpgp-sha256; l=2817; i=tomi.valkeinen@ideasonboard.com; h=from:subject:message-id; bh=tk41aXJM1hAnommQL/yZ5bKIvn8A1Y3535egq0jrEXs=; b=owEBbQKS/ZANAwAIAfo9qoy8lh71AcsmYgBpMqtWv5wZpSaeF7nzdL79PpuSJS+G7FkUG1S7F CjPbI7L85yJAjMEAAEIAB0WIQTEOAw+ll79gQef86f6PaqMvJYe9QUCaTKrVgAKCRD6PaqMvJYe 9dFZD/43MtWBz4xkH5Go8fDRvOeAMN3nMetCypyzpaYU8SDCxiHW3R4cvCQCBz5ptVjtBmY2soo j6TbcKyMormmah0v5qlbSm5cdRC6ewqdO40MrJD25s1iMMI4striFD/Rbz+h/cBoVMthXCKFKcU SYgA8Vm0hdvQRTgXN1H6X1zUGaJ3wWeO/bodZnATIJO2FMxmcczJ7LX+xnCbmSrl11Wss7jOJoY 17pQPD0R8dgMmIO3KOKDrtodE6a9M1mLPqdN0Go6WvpD68UGiaUZ2ogyA5lAd54XGP3Y0fskIu+ l07xPUfRTajLrS7P2AHHwjModBlLAZF+2QaI4JyxJq9laAFPJLJLOOXjsBHHYYB3T3Lk3dAo9G+ y5D653lz2jZ2qyxfezh9QHATtYAOIz+H7Sf8PDF2NIMd2jjMOKdsdBduxMt1uSpIoHyjK4bXRb5 uwgvIp+c0bGaNgVTVUgnVLAhkHIhNodsWXuWt2YupEvCp1nH8oDjCdCW2iCsAuEy+8JAKE+TKsa mqPoEzWuMu0NB0LGR08Av5ZE/ajflmmSUcJG7BW5nc2vWZBTvm19zf5L+5sBjbz/wo+417eu+oG kpE6f0Sz2HrYLdCAsRystA9O0ko0oMc3myR9YWc5VzfTltcxkaZSlYYxz7BAeSJkNUUvMUmLiWt 1I1wsU3rnpVQTrg== X-Developer-Key: i=tomi.valkeinen@ideasonboard.com; a=openpgp; fpr=C4380C3E965EFD81079FF3A7FA3DAA8CBC961EF5 TI's OLDI and DSI encoders need to be set up before the crtc is enabled, but the DRM helpers will enable the crtc first. This causes various issues on TI platforms, like visual artifacts or crtc sync lost warnings. Thus drm_atomic_helper_commit_modeset_enables() and drm_atomic_helper_commit_modeset_disables() cannot be used, as they enable the crtc before bridges' pre-enable, and disable the crtc after bridges' post-disable. Open code the drm_atomic_helper_commit_modeset_enables() and drm_atomic_helper_commit_modeset_disables(), and first call the bridges' pre-enables, then crtc enable, then bridges' post-enable (and vice versa for disable). Signed-off-by: Tomi Valkeinen Cc: stable@vger.kernel.org # v6.17+ Reviewed-by: Aradhya Bhatia Reviewed-by: Linus Walleij Reviewed-by: Maxime Ripard Tested-by: Linus Walleij --- drivers/gpu/drm/tidss/tidss_kms.c | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/tidss/tidss_kms.c b/drivers/gpu/drm/tidss/tids= s_kms.c index 86eb5d97410b..8bb93194e5ac 100644 --- a/drivers/gpu/drm/tidss/tidss_kms.c +++ b/drivers/gpu/drm/tidss/tidss_kms.c @@ -26,9 +26,33 @@ static void tidss_atomic_commit_tail(struct drm_atomic_s= tate *old_state) =20 tidss_runtime_get(tidss); =20 - drm_atomic_helper_commit_modeset_disables(ddev, old_state); - drm_atomic_helper_commit_planes(ddev, old_state, DRM_PLANE_COMMIT_ACTIVE_= ONLY); - drm_atomic_helper_commit_modeset_enables(ddev, old_state); + /* + * TI's OLDI and DSI encoders need to be set up before the crtc is + * enabled. Thus drm_atomic_helper_commit_modeset_enables() and + * drm_atomic_helper_commit_modeset_disables() cannot be used here, as + * they enable the crtc before bridges' pre-enable, and disable the crtc + * after bridges' post-disable. + * + * Open code the functions here and first call the bridges' pre-enables, + * then crtc enable, then bridges' post-enable (and vice versa for + * disable). + */ + + drm_atomic_helper_commit_encoder_bridge_disable(ddev, old_state); + drm_atomic_helper_commit_crtc_disable(ddev, old_state); + drm_atomic_helper_commit_encoder_bridge_post_disable(ddev, old_state); + + drm_atomic_helper_update_legacy_modeset_state(ddev, old_state); + drm_atomic_helper_calc_timestamping_constants(old_state); + drm_atomic_helper_commit_crtc_set_mode(ddev, old_state); + + drm_atomic_helper_commit_planes(ddev, old_state, + DRM_PLANE_COMMIT_ACTIVE_ONLY); + + drm_atomic_helper_commit_encoder_bridge_pre_enable(ddev, old_state); + drm_atomic_helper_commit_crtc_enable(ddev, old_state); + drm_atomic_helper_commit_encoder_bridge_enable(ddev, old_state); + drm_atomic_helper_commit_writebacks(ddev, old_state); =20 drm_atomic_helper_commit_hw_done(old_state); drm_atomic_helper_wait_for_flip_done(ddev, old_state); --=20 2.43.0