From patchwork Wed Sep 20 14:35:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 13392979 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 D2DF2CE79DF for ; Wed, 20 Sep 2023 14:38:17 +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:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=qs+7WyLZJVM++udSrJYt5mo3ACa2zCcC+CZwXRHr0VE=; b=nldh3LEQZh/YVB 88B36+rDUVp6Y6Y8cJPsOM+dXbeiH4HNV7qZtHgnMCyQ+taAYs7+cSnm0BG4Pku7dMquTIbCiSUrK KKlk+D2/qqJ0Rclqj329wkEODRb+l9az1FL/C6W8SO2t3Kxrb1hGcofguL7W+M2ai+roA/XditEE5 2D96Mv3/bSAS6Rkda+W5naHOv3k9kIO5WTeSShO+/ndPZ+6xHFQeaW1+T4moIf0xA1lM6PtqLMBtP ywQlBBRrfSroVKmAQpr8qGCgETSbX65NWN851GrpeDKMjwN8zeszALvEeYc8FxZ8HokvmmuSD7LNV Pzg90QymJh2pX6YLCCXw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qiyKu-003MoJ-0D; Wed, 20 Sep 2023 14:37:52 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qiyJe-003LXu-2I; Wed, 20 Sep 2023 14:36:37 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 18BC061CCE; Wed, 20 Sep 2023 14:36:34 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8C0DFC433D9; Wed, 20 Sep 2023 14:36:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695220593; bh=NPcmog8rmIBDaqZDT4O0fzD3K2AFLpEEWCR2cLRhvQQ=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=dFiXFmHUTKnj6NvyMNzPPY+oci/F+xV+LQ0BT0gzWbZry4cOvnWkTDDjCuZWWVMqp EtdRGyXIJ9qc4wczWkcRGWYYkNCh3XiREhDdrcQK2GhuvXTKeWfPiYtOv4pQFo+nSw qbgQEfKRNENbPuXMBNIQxgXCkMWZLp5Vk5sHOCRTqYtRnyV3vD2e82p7lr8DpKtTY6 9AnYw2QRvgZvQuG+AEhgpSvKlt6SFBLNTPch7XnT/CTJrmj84sYIJLF3RHFl7lWlRo 8vgL7aDa97j8/UWtg63Ta7q7t7O31eYGFDkxjXm1awk1Z/81+CZ6eZapKEUUmTvhEb ZVNJenYuT84aw== From: Maxime Ripard Date: Wed, 20 Sep 2023 16:35:33 +0200 Subject: [PATCH RFC v2 18/37] drm/rockchip: inno_hdmi: Get rid of mode_set MIME-Version: 1.0 Message-Id: <20230920-kms-hdmi-connector-state-v2-18-17932daddd7d@kernel.org> References: <20230920-kms-hdmi-connector-state-v2-0-17932daddd7d@kernel.org> In-Reply-To: <20230920-kms-hdmi-connector-state-v2-0-17932daddd7d@kernel.org> To: Maarten Lankhorst , Thomas Zimmermann , David Airlie , Daniel Vetter , Emma Anholt , Jonathan Corbet , Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland Cc: Hans Verkuil , dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-sunxi@lists.linux.dev, Maxime Ripard X-Mailer: b4 0.12.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=1884; i=mripard@kernel.org; h=from:subject:message-id; bh=NPcmog8rmIBDaqZDT4O0fzD3K2AFLpEEWCR2cLRhvQQ=; b=owGbwMvMwCX2+D1vfrpE4FHG02pJDKnczJa1O/2Y9BYrR3B9Yj+f0jvbzEo0Yc3Je48/8G05n fYp1+9tRykLgxgXg6yYIkuMsPmSuFOzXney8c2DmcPKBDKEgYtTACay6j4jwztdwXe5TeUX+ENm hx2dkF+5bsnfMLVl904urNLf8YV3vS/D//z4IuXYZ3Pc592ZqDZpmcdT843/IwyEvoZWvDQsFav ewgYA X-Developer-Key: i=mripard@kernel.org; a=openpgp; fpr=BE5675C37E818C8B5764241C254BCFC56BF6CE8D X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230920_073634_954915_20DEBDCF X-CRM114-Status: GOOD ( 15.00 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org We're not doing anything special in atomic_mode_set so we can simply merge it into atomic_enable. Signed-off-by: Maxime Ripard --- drivers/gpu/drm/rockchip/inno_hdmi.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/drivers/gpu/drm/rockchip/inno_hdmi.c b/drivers/gpu/drm/rockchip/inno_hdmi.c index cc86d273ca4a..4db18195246e 100644 --- a/drivers/gpu/drm/rockchip/inno_hdmi.c +++ b/drivers/gpu/drm/rockchip/inno_hdmi.c @@ -490,21 +490,22 @@ static int inno_hdmi_setup(struct inno_hdmi *hdmi, return 0; } -static void inno_hdmi_encoder_mode_set(struct drm_encoder *encoder, - struct drm_crtc_state *crtc_state, - struct drm_connector_state *conn_state) -{ - struct drm_display_mode *adj_mode = &crtc_state->adjusted_mode; - struct inno_hdmi *hdmi = encoder_to_inno_hdmi(encoder); - - inno_hdmi_setup(hdmi, adj_mode); -} - static void inno_hdmi_encoder_enable(struct drm_encoder *encoder, struct drm_atomic_state *state) { struct inno_hdmi *hdmi = encoder_to_inno_hdmi(encoder); + struct drm_connector_state *conn_state; + struct drm_crtc_state *crtc_state; + conn_state = drm_atomic_get_new_connector_state(state, &hdmi->connector); + if (WARN_ON(!conn_state)) + return; + + crtc_state = drm_atomic_get_new_crtc_state(state, conn_state->crtc); + if (WARN_ON(!crtc_state)) + return; + + inno_hdmi_setup(hdmi, &crtc_state->adjusted_mode); inno_hdmi_set_pwr_mode(hdmi, NORMAL); } @@ -533,7 +534,6 @@ static struct drm_encoder_helper_funcs inno_hdmi_encoder_helper_funcs = { .atomic_check = inno_hdmi_encoder_atomic_check, .atomic_enable = inno_hdmi_encoder_enable, .atomic_disable = inno_hdmi_encoder_disable, - .atomic_mode_set = inno_hdmi_encoder_mode_set, }; static enum drm_connector_status