From patchwork Sat Feb 19 00:28:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Vasut X-Patchwork-Id: 12752027 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id EDD81C433EF for ; Sat, 19 Feb 2022 00:29:28 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0BDF110EABB; Sat, 19 Feb 2022 00:29:28 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8260D10EA7E for ; Sat, 19 Feb 2022 00:29:06 +0000 (UTC) Received: from tr.lan (ip-89-176-112-137.net.upcbroadband.cz [89.176.112.137]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: marex@denx.de) by phobos.denx.de (Postfix) with ESMTPSA id D7E9683BA2; Sat, 19 Feb 2022 01:29:04 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1645230545; bh=omuqhxDL60Kp051Ey9wmAuH7K5IB+pkShX1jBNb3Vao=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TIYSbxV1r3DfljFY2Rt94D2wpAV0yEX5LGZF8Jyqu2y5aG92IdnCPT7CBVrtsgG2L FyKavkPO8089UbveBGZvG6O1dBKtFjHT29GfFQnTOcbuq9MZHlrMRsFqI2anciqij/ Qhu5K8PCzjr55rUYmz3f2m/lpZE8FBpjXsdA5jgaVWb/Gz41J7dWnEtXcM6JnAYyJw X/NZF0WFgXUaE1ROUmBdzZqpMhXZY28vylKNNNfdnJWlNnHrnD0mnFgNwaLXznbH+c jYNBdt71Pom6lvvAWicoBsXkqA7dBlxNo55+P7zuhmZsQZ4Mdqd5+sDEbT5ysTEBV2 /pJOL0zRKrFEg== From: Marek Vasut To: dri-devel@lists.freedesktop.org Subject: [PATCH 4/7] drm/bridge: dw-mipi-dsi: Move PLL setup into atomic_enable Date: Sat, 19 Feb 2022 01:28:41 +0100 Message-Id: <20220219002844.362157-5-marex@denx.de> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220219002844.362157-1-marex@denx.de> References: <20220219002844.362157-1-marex@denx.de> MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 0.103.5 at phobos.denx.de X-Virus-Status: Clean X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Marek Vasut , Neil Armstrong , Sam Ravnborg , Laurent Pinchart , Maxime Ripard Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The bridge clock configuration should happen in atomic_enable instead of mode_set callback, since that is where the current state of the bridge is available. Move the clock configuration into atomic_enable callback. Signed-off-by: Marek Vasut Cc: Laurent Pinchart Cc: Maxime Ripard Cc: Neil Armstrong Cc: Sam Ravnborg --- drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c b/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c index f4a6e4da903ca..7a2ea21dc0554 100644 --- a/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c +++ b/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c @@ -267,6 +267,8 @@ struct dw_mipi_dsi { u32 format; unsigned long mode_flags; + struct drm_display_mode mode; + #ifdef CONFIG_DEBUG_FS struct dentry *debugfs; struct debugfs_entries *debugfs_vpg; @@ -1045,15 +1047,18 @@ static void dw_mipi_dsi_bridge_mode_set(struct drm_bridge *bridge, { struct dw_mipi_dsi *dsi = bridge_to_dsi(bridge); - dw_mipi_dsi_mode_set(dsi, adjusted_mode); - if (dsi->slave) - dw_mipi_dsi_mode_set(dsi->slave, adjusted_mode); + drm_mode_copy(&dsi->mode, adjusted_mode); } static void dw_mipi_dsi_bridge_atomic_enable(struct drm_bridge *bridge, struct drm_bridge_state *old_bridge_state) { struct dw_mipi_dsi *dsi = bridge_to_dsi(bridge); + const struct drm_display_mode *adjusted_mode = &dsi->mode; + + dw_mipi_dsi_mode_set(dsi, adjusted_mode); + if (dsi->slave) + dw_mipi_dsi_mode_set(dsi->slave, adjusted_mode); /* Switch to video mode for panel-bridge enable & panel enable */ dw_mipi_dsi_set_mode(dsi, MIPI_DSI_MODE_VIDEO);