From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 8E73D36D510 for ; Sun, 30 Nov 2025 12:11:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764504698; cv=none; b=CrOKtXU6lHZQoCLblRiR/zNGUx7PPjJ9LkaxxuMOc1BqG2nqvnHsSIrToYY0be8xX5S2p1ERvvikj6kzSurq3BoLjmWp3PjFVkf1uyVWQysz33n8dwJeyRsYBykwDatKOOojfcExyWCdxJErV01KxONRVbP/Ak/CHwqOz8vnoHY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764504698; c=relaxed/simple; bh=bA6WkdeNYYHXuzst8YaZ8aySptbox4aWZeHMYToT0yo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=UJ7Mestlvy0yDilRkN9pYidatVHeNJx1pxa4V4qtPvmtchYOs+Egp+nIBQoNo1Gd/HWwq1A25LVj6HEJ5R5LeevQexRX0Qb9aklO5y+Sl8chi/8foOfxpUL85PBpo+0uFDAKLY5ul05HCdajbMHA3nD3qerCAIDeKJ7XBZzYnpY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=gznNw3yn; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="gznNw3yn" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7D7D1C4CEF8; Sun, 30 Nov 2025 12:11:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1764504698; bh=bA6WkdeNYYHXuzst8YaZ8aySptbox4aWZeHMYToT0yo=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=gznNw3ynm2gP4eYPzH0fRf1bwfrmSYpUKrwsbZ22ITE3wkoOOYBYhWggRJw7XKv6T 22vxy7HTBj0DUfQfETjamL0bmoDP0ef/NW9MpuV6uv3JmcwuY5UBT1l4UyHndlbf5/ kU6JM06PRVDBy7mcuYn7S8OxS4Lt/QiIT26I0XazXDkf0VHTISMPLfxA8yzsSeG8ld eMc3YgJ/+oibFrsnx51buCkTofrrWr0X/r17VSZuIiwebbtPevTl6Zimw3XYkdAOuk qvmVx0gu5KCIgnY5KBG7Uo5phTwGznkAeLTDwEa3QlAnJPVa90wEBazD9zSVvQPSM6 VquU0+dqIQXHA== From: Linus Walleij Date: Sun, 30 Nov 2025 13:11:18 +0100 Subject: [PATCH v5 2/3] drm/mcde: Create custom commit tail Precedence: bulk X-Mailing-List: linux-renesas-soc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20251130-mcde-drm-regression-thirdfix-v5-2-aed71a32981d@kernel.org> References: <20251130-mcde-drm-regression-thirdfix-v5-0-aed71a32981d@kernel.org> In-Reply-To: <20251130-mcde-drm-regression-thirdfix-v5-0-aed71a32981d@kernel.org> To: Tomi Valkeinen , Marek Vasut , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Laurent Pinchart , Tomi Valkeinen , Kieran Bingham , Geert Uytterhoeven , Magnus Damm , Aradhya Bhatia , Dmitry Baryshkov Cc: dri-devel@lists.freedesktop.org, linux-renesas-soc@vger.kernel.org, Linus Walleij X-Mailer: b4 0.14.3 commit c9b1150a68d9362a0827609fc0dc1664c0d8bfe1 "drm/atomic-helper: Re-order bridge chain pre-enable and post-disable" caused a series of regressions in all panels that send DSI commands in their .prepare() and .unprepare() callbacks when used with MCDE. As the CRTC is no longer online at bridge_pre_enable() and gone at brige_post_disable() which maps to the panel bridge .prepare()/.unprepare() callbacks, any CRTC that enable/disable the DSI transmitter in it's enable/disable callbacks will be unable to send any DSI commands in the .prepare() and .unprepare() callbacks. However the MCDE driver definitely need the CRTC to be enabled during .prepare()/.unprepare(). Solve this by implementing a custom commit tail function in the MCDE driver that always enables the CRTC first and disables it last, using the newly exported helpers. Link: https://lore.kernel.org/dri-devel/20251026-fix-mcde-drm-regression-v2-0-8d799e488cf9@linaro.org/ Link: https://lore.kernel.org/all/20251107230517.471894-1-marek.vasut%2Brenesas%40mailbox.org/ Fixes: c9b1150a68d9 ("drm/atomic-helper: Re-order bridge chain pre-enable and post-disable") Tested-by: Marek Vasut Signed-off-by: Linus Walleij --- drivers/gpu/drm/mcde/mcde_drv.c | 45 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 44 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/mcde/mcde_drv.c b/drivers/gpu/drm/mcde/mcde_drv.c index 5f2c462bad7e..eb3a8bb8766b 100644 --- a/drivers/gpu/drm/mcde/mcde_drv.c +++ b/drivers/gpu/drm/mcde/mcde_drv.c @@ -100,13 +100,56 @@ static const struct drm_mode_config_funcs mcde_mode_config_funcs = { .atomic_commit = drm_atomic_helper_commit, }; +/* + * This commit tail explicitly copies and changes the behaviour of + * the related core DRM atomic helper instead of trying to make + * the core helpers overly generic. + */ +static void mcde_atomic_commit_tail(struct drm_atomic_state *state) +{ + struct drm_device *dev = state->dev; + + /* + * Variant of drm_atomic_helper_commit_modeset_disables() + * that will disable and post-disable all bridges BEFORE + * disabling the CRTC. + */ + drm_atomic_helper_commit_encoder_bridge_disable(dev, state); + drm_atomic_helper_commit_encoder_bridge_post_disable(dev, state); + drm_atomic_helper_commit_crtc_disable(dev, state); + drm_atomic_helper_update_legacy_modeset_state(dev, state); + drm_atomic_helper_calc_timestamping_constants(state); + drm_atomic_helper_commit_crtc_set_mode(dev, state); + + /* + * Variant of drm_atomic_helper_commit_modeset_enables() + * that will enable the CRTC BEFORE pre-enabling and + * enabling the bridges. + */ + drm_atomic_helper_commit_crtc_enable(dev, state); + drm_atomic_helper_commit_encoder_bridge_pre_enable(dev, state); + drm_atomic_helper_commit_encoder_bridge_enable(dev, state); + drm_atomic_helper_commit_writebacks(dev, state); + + drm_atomic_helper_commit_planes(dev, state, + DRM_PLANE_COMMIT_ACTIVE_ONLY); + + drm_atomic_helper_fake_vblank(state); + + drm_atomic_helper_commit_hw_done(state); + + drm_atomic_helper_wait_for_vblanks(dev, state); + + drm_atomic_helper_cleanup_planes(dev, state); +} + static const struct drm_mode_config_helper_funcs mcde_mode_config_helpers = { /* * Using this function is necessary to commit atomic updates * that need the CRTC to be enabled before a commit, as is * the case with e.g. DSI displays. */ - .atomic_commit_tail = drm_atomic_helper_commit_tail_rpm, + .atomic_commit_tail = mcde_atomic_commit_tail, }; static irqreturn_t mcde_irq(int irq, void *data) -- 2.51.1