From mboxrd@z Thu Jan 1 00:00:00 1970 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 8366ECD342F for ; Mon, 4 May 2026 19:11:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=8Qn1QJNWZiD72xWNYQmZGWJdzgiE6DU0pmnsOcqRdvY=; b=3vCxW4hPjTsvds pZ8HRHJBEmBGSscZd/Xt9zTRhkMi4LQFB9SvurCU5Z8ieTCgwxWeWbL9ecaEJE62qqz9NR4hyUB5O Rc4EXjVD/bFBYull2F2Wu6Uvlk0ZvAONoFFi2V+A/ZYqLVXiXLWVWHK6rNjkeR2+CWP0M8oxGMhU3 p01cgcxCoyN5TiBmXY6ilYoWjh1MIVX3BCzN1dOPq26UBroTEyjds4ZA/w1LCYGdQxqjRYC08+IGY JgR07VpVfRIrgQ7WgVXjfPBKxBGsWDZDR1gTPD3JTWQwLha1YZoikH9Q6FrtNKHgHAU4uAhU1Qgr/ EDd4nCQwA1GKhx0boS4A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1wJyht-0000000E5W5-1F1u; Mon, 04 May 2026 19:11:53 +0000 Received: from smtp.forwardemail.net ([149.28.215.223]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1wJyhk-0000000E5GG-31I1 for linux-amlogic@lists.infradead.org; Mon, 04 May 2026 19:11:47 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kwiboo.se; h=Content-Transfer-Encoding: MIME-Version: References: In-Reply-To: Message-ID: Date: Subject: Cc: To: From; q=dns/txt; s=fe-e1b5cab7be; t=1777921904; bh=T8+R7rBEFqteq3o8WJW2MaSt/8vk9AUClKen0jZKevI=; b=z2SirwYq1AtvhdM1SO0NH0qHbSn3+g/WMTvrc28I2+20xLnfqE8oH7b512peV+TFfMs2VhWHa K0LGDyEIa2t4zIqzFKJyF/oOR76OgGf53P495CNK3l8/7N5M6bX3ycWCL0rKap5LLJ2r2DV0/15 R1vOAaaotatMNaozIYQd2SHBamvGXwhIrjNoKbwplqfy2U0t0euZZCpS29/ZxVl7Bj8byWVgqMO mAiJ/BQCMobOKs28m+EA/yAfzAVsGxiOlBiZE3QWO/56f7kLMjGOAW9aOC3HMI1S9aec1F8t1w6 uTQqAOT+BbQnUD+fN01U+I0SXS+++CELpQhB4upN68FA== X-Forward-Email-ID: 69f8ef5f04bb1dff846bb88a X-Forward-Email-Sender: rfc822; jonas@kwiboo.se, smtp.forwardemail.net, 149.28.215.223 X-Forward-Email-Version: 2.7.7 X-Forward-Email-Website: https://forwardemail.net X-Complaints-To: abuse@forwardemail.net X-Report-Abuse: abuse@forwardemail.net X-Report-Abuse-To: abuse@forwardemail.net From: Jonas Karlman To: Andrzej Hajda , Neil Armstrong , Robert Foss , Heiko Stuebner , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter Subject: [PATCH v4 05/17] drm: bridge: dw_hdmi: Fold poweron and setup functions Date: Mon, 4 May 2026 19:10:42 +0000 Message-ID: <20260504191059.275928-6-jonas@kwiboo.se> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260504191059.275928-1-jonas@kwiboo.se> References: <20260504191059.275928-1-jonas@kwiboo.se> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20260504_121144_840204_5EFBCEA6 X-CRM114-Status: GOOD ( 10.89 ) X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Dmitry Baryshkov , imx@lists.linux.dev, Liu Ying , linux-kernel@vger.kernel.org, Sandy Huang , dri-devel@lists.freedesktop.org, linux-sunxi@lists.linux.dev, Diederik de Haas , linux-rockchip@lists.infradead.org, linux-amlogic@lists.infradead.org, Andy Yan , Chen-Yu Tsai , Nicolas Frattaroli , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+linux-amlogic=archiver.kernel.org@lists.infradead.org Fold the poweron and setup functions into one function and use the adjusted_mode directly from the new crtc_state to remove the need of storing previous_mode. Reviewed-by: Neil Armstrong Signed-off-by: Jonas Karlman --- v4: No change v3: Collect r-b tag v2: No change --- drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c index f028a4b71aad..7211beffd59e 100644 --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c @@ -2254,9 +2254,9 @@ static void hdmi_disable_overflow_interrupts(struct dw_hdmi *hdmi) HDMI_IH_MUTE_FC_STAT2); } -static int dw_hdmi_setup(struct dw_hdmi *hdmi, - const struct drm_connector *connector, - const struct drm_display_mode *mode) +static int dw_hdmi_poweron(struct dw_hdmi *hdmi, + const struct drm_connector *connector, + const struct drm_display_mode *mode) { const struct drm_display_info *display = &connector->display_info; int ret; @@ -2396,15 +2396,6 @@ static void initialize_hdmi_ih_mutes(struct dw_hdmi *hdmi) hdmi_writeb(hdmi, ih_mute, HDMI_IH_MUTE); } -static void dw_hdmi_poweron(struct dw_hdmi *hdmi) -{ - /* - * The curr_conn field is guaranteed to be valid here, as this function - * is only be called when !hdmi->disabled. - */ - dw_hdmi_setup(hdmi, hdmi->curr_conn, &hdmi->previous_mode); -} - static void dw_hdmi_poweroff(struct dw_hdmi *hdmi) { if (hdmi->phy.enabled) { @@ -2969,15 +2960,19 @@ static void dw_hdmi_bridge_atomic_enable(struct drm_bridge *bridge, struct drm_atomic_state *state) { struct dw_hdmi *hdmi = bridge->driver_private; + const struct drm_display_mode *mode; struct drm_connector *connector; + struct drm_crtc *crtc; connector = drm_atomic_get_new_connector_for_encoder(state, bridge->encoder); + crtc = drm_atomic_get_new_connector_state(state, connector)->crtc; + mode = &drm_atomic_get_new_crtc_state(state, crtc)->adjusted_mode; mutex_lock(&hdmi->mutex); hdmi->disabled = false; hdmi->curr_conn = connector; - dw_hdmi_poweron(hdmi); + dw_hdmi_poweron(hdmi, connector, mode); dw_hdmi_update_phy_mask(hdmi); handle_plugged_change(hdmi, true); mutex_unlock(&hdmi->mutex); -- 2.54.0 _______________________________________________ linux-amlogic mailing list linux-amlogic@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-amlogic