From patchwork Tue Oct 31 16:48:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 160253 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b90f:0:b0:403:3b70:6f57 with SMTP id t15csp373900vqg; Tue, 31 Oct 2023 09:51:21 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFQr1JMUhw3bb95NKMuMYdWO29Br4xJahYYau8BMGPExJyK+u8CS5h77PenfTvJ+chxSqL6 X-Received: by 2002:a17:903:1246:b0:1c5:b855:38f with SMTP id u6-20020a170903124600b001c5b855038fmr15140940plh.24.1698771080666; Tue, 31 Oct 2023 09:51:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698771080; cv=none; d=google.com; s=arc-20160816; b=ftE/eg2UeJDXtZaRL6DkFjRaMFWeAZS7vIQEp8ID03il525BiQ/cQn9hYmQfrdm+sa oMY0sDDiT0ngxI6PjbjpKzqjUpxGqei5pM1ECvjdnH74AvBtNUzbzGlg0fud+PSMSPo2 tvgWpHz7qddsJCCHO+vts7fLmnRUXcfxK8JXkUndRZ3f5KSsu4nRq2ntFunQl4od3oks NYVFdp/G0jue3sf0FQGG9yc0dgCPDNGxsOLcYB3tslk7+Jh27gT7LxuB2urRFK16Dns1 x7WfJFoC6j/Bj4lP45t/wTbUB+tZ7C/hU3hqBJqTfv4w7tVWzVpKnsG3YE6CaCe7iXOK ognw== 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=YXWKQWIxx95bdSY+e16leIWNEilIv4fg1ToEhZ3bds4=; fh=e6/uyeFf2k7v8JUtB6fPyaAS5iN3eSA1hjtg35V2Rzw=; b=akT074qTkPRrKz0/nQUl2yBC5iFCAVOXwmLaJ8+r3ZEhlp8K059V4hBMvP5pSVKwk7 ty3xGVo7HvLf/ZtzXFhzR3hZwGESh8sw+aZVyQkzLX+ukK2y0kvwqrxXJfQqyaLLGe8t wbvGQb8YThShBBKzSu1ae2I0BtG3vnUNSUKMYjUeIwY7YEmBvuPqjtsV9Q7FW0yc51kn AjqI1gzKGA39LZFR4pmM6p3fNMa43R5z0ewFs2awCH/Kx7/TzexGvd9jnJF8XU4w5ghB C/8Wnv5Y9rwwd+YUdlLJtT4yl3oJun+ulzPRNGOW6xHlre3qYb2aXFpiagUJh+dZVn67 Tqag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=MF9Q76WV; 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 jx3-20020a170903138300b001c9e890f42bsi1218661plb.78.2023.10.31.09.51.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Oct 2023 09:51:20 -0700 (PDT) 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=MF9Q76WV; 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 73805806157B; Tue, 31 Oct 2023 09:51:16 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346979AbjJaQuI (ORCPT + 33 others); Tue, 31 Oct 2023 12:50:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44358 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346915AbjJaQtl (ORCPT ); Tue, 31 Oct 2023 12:49:41 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2D43210F; Tue, 31 Oct 2023 09:49:24 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7C150C433C9; Tue, 31 Oct 2023 16:49:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1698770963; bh=M2G6LOjWKL55s6a+6IU/6bn6CB2qn7/s2odBTDcEBoM=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=MF9Q76WVyFCGRG+HxxjnR1vSjcYT3OOG1KTApDqzVLs0u7+7R398n4hkEZ+yRFVDY ouGvuTY8cMDFMV40EqkVfooI9w+1XEy9KU7waldrtn/vd5SMxpF47DlO5nylgwbraB SfIoUlnVAZNGushzvyK71hSKPoPT31tM/uigQz7BCs+ttlKLfHIel/8QODO4XR1N+K chW7NY3RwegiMn4tHuDav95WBiupWCKRptn8Yjry2On0WRQTrgqc9a4/d7SY2Ylo4v crybxRCWh9+0YeaunMKCoRGOW12IiMttrLQojsStgv87sob2VUkEwSFBeGx3ZsGpdb Oe5i4V6zMSQtg== From: Maxime Ripard Date: Tue, 31 Oct 2023 17:48:30 +0100 Subject: [PATCH RFC v3 17/37] drm/rockchip: inno_hdmi: Switch encoder hooks to atomic MIME-Version: 1.0 Message-Id: <20231031-kms-hdmi-connector-state-v3-17-328b0fae43a7@kernel.org> References: <20231031-kms-hdmi-connector-state-v3-0-328b0fae43a7@kernel.org> In-Reply-To: <20231031-kms-hdmi-connector-state-v3-0-328b0fae43a7@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=2182; i=mripard@kernel.org; h=from:subject:message-id; bh=M2G6LOjWKL55s6a+6IU/6bn6CB2qn7/s2odBTDcEBoM=; b=owGbwMvMwCX2+D1vfrpE4FHG02pJDKmO+vf2BR7oXeWQdL9AVXKe8RRpiWiTPRmmGTJCV5tuv +eUmt3UUcrCIMbFICumyBIjbL4k7tSs151sfPNg5rAygQxh4OIUgInwnGBk2Hzj5A0bTf3APtNW rrZyrZ+3OhkK23jD3r7yPfjsmnfoHYb//p3Wqd/XT5t8PrTO3eb5rXlREuus17pJWJ4Ubuz7r1X PDQA= X-Developer-Key: i=mripard@kernel.org; a=openpgp; fpr=BE5675C37E818C8B5764241C254BCFC56BF6CE8D X-Spam-Status: No, score=-1.7 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]); Tue, 31 Oct 2023 09:51:16 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781290584279209422 X-GMAIL-MSGID: 1781290584279209422 The inno_hdmi encoder still uses the !atomic variants of enable, disable and modeset. Convert to their atomic equivalents. Signed-off-by: Maxime Ripard --- drivers/gpu/drm/rockchip/inno_hdmi.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/rockchip/inno_hdmi.c b/drivers/gpu/drm/rockchip/inno_hdmi.c index 4f5844fc115a..cc86d273ca4a 100644 --- a/drivers/gpu/drm/rockchip/inno_hdmi.c +++ b/drivers/gpu/drm/rockchip/inno_hdmi.c @@ -491,22 +491,25 @@ static int inno_hdmi_setup(struct inno_hdmi *hdmi, } static void inno_hdmi_encoder_mode_set(struct drm_encoder *encoder, - struct drm_display_mode *mode, - struct drm_display_mode *adj_mode) + 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) +static void inno_hdmi_encoder_enable(struct drm_encoder *encoder, + struct drm_atomic_state *state) { struct inno_hdmi *hdmi = encoder_to_inno_hdmi(encoder); inno_hdmi_set_pwr_mode(hdmi, NORMAL); } -static void inno_hdmi_encoder_disable(struct drm_encoder *encoder) +static void inno_hdmi_encoder_disable(struct drm_encoder *encoder, + struct drm_atomic_state *state) { struct inno_hdmi *hdmi = encoder_to_inno_hdmi(encoder); @@ -527,10 +530,10 @@ inno_hdmi_encoder_atomic_check(struct drm_encoder *encoder, } static struct drm_encoder_helper_funcs inno_hdmi_encoder_helper_funcs = { - .enable = inno_hdmi_encoder_enable, - .disable = inno_hdmi_encoder_disable, - .mode_set = inno_hdmi_encoder_mode_set, - .atomic_check = inno_hdmi_encoder_atomic_check, + .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