From patchwork Thu Dec 7 15:50:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 175262 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp4877020vqy; Thu, 7 Dec 2023 07:54:59 -0800 (PST) X-Google-Smtp-Source: AGHT+IFGT20jnwU7jHMlRDW0olLQxcZt+iqT6vfQbipfoktRKBwoOSIQEV2ZQyLpWaeBDJckJVKZ X-Received: by 2002:a05:6a20:2444:b0:18f:97c:b9ed with SMTP id t4-20020a056a20244400b0018f097cb9edmr2434154pzc.71.1701964498772; Thu, 07 Dec 2023 07:54:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701964498; cv=none; d=google.com; s=arc-20160816; b=itc9GIKPmqxd1wo3aV7FvthDv3owcqS7F+57DKs05LKLwbXzBQys0WOIx+w+AvDSM7 XvXGZoN2mKQTiDVmApcRHN9bnaEU11iWGZGAk0C4dq6s+H2P4t7SprDjQJQK1NkPNtpk 9Paf0pTgiQ8h0gcsIeUhvQCcSdTmThtQBmfC5lxbvmV8HKX3osWEMMYZEGt6wwLfaAg4 5u6YO36hoKBiJ7Ibm2wkd0kJRw0R4gha6BGI7nar/QIkhfwgpo/FuqirCUPAe+AthRXx D68ENiOnar5sgwRIYRv/cd+vc1I4zpFsQxeR1xiracsaS1osRE/3AaxxjgY7qBxUQ7Vu TUOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=vHajT3DqEwuIiKHsRFmVcHzp7Tp+65QNNw2avwNBVZA=; fh=e6/uyeFf2k7v8JUtB6fPyaAS5iN3eSA1hjtg35V2Rzw=; b=S3Y4yvEZ5rgI25fS79uR6/fez0BELZaMVKgm23CGprJXcpBhbcs3lx4pA8UN0ucNGB rNAAs1/uh+LpDycuyRtbmd4Y51T9b0pym425C3aC2JZXMntmzbybfcK/CPLVItdqYl2l 20y94O/SL5nzBeypqbIjLFRVW9dWh2zA3I8jdX1mKMq3blImz9DVVvLnyPr68j39sYwY UTnMOFpZHza3E5IECBaAX+PxdTZCoZC6IkM185kAP+XvX6Vu1fD0kxQAn1JiAT67jPYC +DS+y81dR3eX9amqHRkmHB6Ffq2XHmkGtlB8EHJzUYwLHLcQLA/70TAB+Qh7BVdHe/pS DCcw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=s4vx+BdL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id y196-20020a62cecd000000b006cdfd6cc930si1397995pfg.82.2023.12.07.07.54.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Dec 2023 07:54:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=s4vx+BdL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 9EE5F80C3A17; Thu, 7 Dec 2023 07:54:48 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1443737AbjLGPyX (ORCPT + 99 others); Thu, 7 Dec 2023 10:54:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51252 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1443838AbjLGPyC (ORCPT ); Thu, 7 Dec 2023 10:54:02 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5945B2D67 for ; Thu, 7 Dec 2023 07:51:25 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D1F20C433BC; Thu, 7 Dec 2023 15:51:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1701964285; bh=vzTj2xWyVDoRk4/yFhRSXoPgPfohv4UZDN5Z/gYWFtw=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=s4vx+BdLv6gfrKiQBBuQiiwuTKgpMSHz+kxwYZv6vz4nUku0WFIzS5WJmkScAfY55 f4RL/BQEmmkRAkrQawQ2h2+MS+TVX8Cp9BBNr8f73YKaL8dOrN8UcHLB1/LnSddqfh bTaVvShl44U+nrAkzbSS1Z7o/xuE2cwk/CQCsbd/crJBnNv3sapf42DZxvTDGZT8lA rnU/6DLYTt29rJ4fTYkqlqxhxEVLRaBiZ1wCdlAk4fv810g4qpnTZZvEJIpK3L1uUW pvV7sLV0D/jfdqv977Gwc/jcYTgJjkOubKFcfvwByHydo39L76D/VDdH2n6D9T2BnJ ejVdcd49X+seA== From: Maxime Ripard Date: Thu, 07 Dec 2023 16:50:03 +0100 Subject: [PATCH v5 40/44] drm/sun4i: hdmi: Convert encoder to atomic MIME-Version: 1.0 Message-Id: <20231207-kms-hdmi-connector-state-v5-40-6538e19d634d@kernel.org> References: <20231207-kms-hdmi-connector-state-v5-0-6538e19d634d@kernel.org> In-Reply-To: <20231207-kms-hdmi-connector-state-v5-0-6538e19d634d@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=2311; i=mripard@kernel.org; h=from:subject:message-id; bh=vzTj2xWyVDoRk4/yFhRSXoPgPfohv4UZDN5Z/gYWFtw=; b=owGbwMvMwCX2+D1vfrpE4FHG02pJDKmFL9uNip8Y3fwp9ijPoe2lX7jUy0bnAw9nhhSx6/uIN BX/K2fvKGVhEONikBVTZIkRNl8Sd2rW6042vnkwc1iZQIYwcHEKwETusDD8U1dYb8WwbOdj1hrp e77reX+whOxqt3EzOqI8seVn0PE5kxkZDnseDhHYccCPx511W9w0PoFmKd7FDaWP5m//zaW2+dA WVgA= X-Developer-Key: i=mripard@kernel.org; a=openpgp; fpr=BE5675C37E818C8B5764241C254BCFC56BF6CE8D X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Thu, 07 Dec 2023 07:54:49 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1784639126093575886 X-GMAIL-MSGID: 1784639126093575886 The sun4i_hdmi driver still uses the non-atomic variants of the encoder hooks, so let's convert to their atomic equivalents. Signed-off-by: Maxime Ripard Acked-by: Sui Jingfeng --- drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c b/drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c index 152375f3de2e..799a26215cc2 100644 --- a/drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c +++ b/drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c @@ -82,7 +82,8 @@ static int sun4i_hdmi_atomic_check(struct drm_encoder *encoder, return 0; } -static void sun4i_hdmi_disable(struct drm_encoder *encoder) +static void sun4i_hdmi_disable(struct drm_encoder *encoder, + struct drm_atomic_state *state) { struct sun4i_hdmi *hdmi = drm_encoder_to_sun4i_hdmi(encoder); u32 val; @@ -96,7 +97,8 @@ static void sun4i_hdmi_disable(struct drm_encoder *encoder) clk_disable_unprepare(hdmi->tmds_clk); } -static void sun4i_hdmi_enable(struct drm_encoder *encoder) +static void sun4i_hdmi_enable(struct drm_encoder *encoder, + struct drm_atomic_state *state) { struct drm_display_mode *mode = &encoder->crtc->state->adjusted_mode; struct sun4i_hdmi *hdmi = drm_encoder_to_sun4i_hdmi(encoder); @@ -120,9 +122,10 @@ static void sun4i_hdmi_enable(struct drm_encoder *encoder) } static void sun4i_hdmi_mode_set(struct drm_encoder *encoder, - struct drm_display_mode *mode, - struct drm_display_mode *adjusted_mode) + struct drm_crtc_state *crtc_state, + struct drm_connector_state *conn_state) { + const struct drm_display_mode *mode = &crtc_state->mode; struct sun4i_hdmi *hdmi = drm_encoder_to_sun4i_hdmi(encoder); unsigned int x, y; u32 val; @@ -201,9 +204,9 @@ static enum drm_mode_status sun4i_hdmi_mode_valid(struct drm_encoder *encoder, static const struct drm_encoder_helper_funcs sun4i_hdmi_helper_funcs = { .atomic_check = sun4i_hdmi_atomic_check, - .disable = sun4i_hdmi_disable, - .enable = sun4i_hdmi_enable, - .mode_set = sun4i_hdmi_mode_set, + .atomic_disable = sun4i_hdmi_disable, + .atomic_enable = sun4i_hdmi_enable, + .atomic_mode_set = sun4i_hdmi_mode_set, .mode_valid = sun4i_hdmi_mode_valid, };