From patchwork Thu Dec 7 15:49:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 175235 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp4875676vqy; Thu, 7 Dec 2023 07:52:27 -0800 (PST) X-Google-Smtp-Source: AGHT+IGPgEAbeZRFsn+oU87Fa7NX8fTxtJNc9MsfQRPTIRUi3uy6pLBWdMpyv6fnBowsZi99jZUS X-Received: by 2002:a05:6a20:760a:b0:18b:950d:de3b with SMTP id m10-20020a056a20760a00b0018b950dde3bmr1872926pze.38.1701964346873; Thu, 07 Dec 2023 07:52:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701964346; cv=none; d=google.com; s=arc-20160816; b=LCON4Yj/8JpkK3VtUNvAxOkhPxCU6TGMqMi4ry2lwZZe/2EjaJsRXjzozTd0zVV7o+ I0r/T/cC8VDZyoOiwXizRJXk8tK1qyIey0bhLHSernt5bSHFGNDPGXGovbRFLfor4pzT IxbkhyUf/7PNOLezfT5GILKsh/kl1a0I97Am41lzjX9LQ1qQwABUUZlq9ArCjBeZyEo/ jT4NiKiiHccPnNKgOyvwMt0LWmkuMLjSmcUZnCJXmnSXV9Hrt17KXz49jiT1G9jxWd6N FRdTftbc7NhbZjMgvjEW3Kp9CHlS+y7zK4y5dqYBUtJ1rY2t0SazpL1GqP+OjHVWjkIw TfBQ== 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=u8STevAKg/77cPhpA6up+DhR+bDS/q88Ok3w3iYDMp0=; fh=e6/uyeFf2k7v8JUtB6fPyaAS5iN3eSA1hjtg35V2Rzw=; b=MIqrEtyjTcfdLxf5gRY1jbt5SFZszRU+prZtI62ub9N8cEycnwVdop37nQwMG8fEae Jn67EK6oOYdtnwnNJ+C/7UEL5h6McC4WGEhhOrcaocu8/MvCOfG8z1X2KnAtbgoywzoN zn12p4mn3rg2hSrZ9j0Vwcu3z7EB3skHu6DsjkmNKxsEODNEkYkMCPBSGFuBkQj6kIIy pZ6ug+t9yWPNybjbr1thYQIFB5fqoaxFJ5Ghso+ZPQdk1WgBNTnzMcNNr7GVnJLEkKgF /Y+IB3k3syQPYI6Kx48/W+is1MEuZqXFMhIxmM0N2L8JhmVwDjGS7d/PF+ckx7crCTxw T3Gw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=hMS+0Vqt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 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. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id u12-20020a63f64c000000b005c6763c2ff8si1324199pgj.760.2023.12.07.07.52.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Dec 2023 07:52:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=hMS+0Vqt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 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 807C880C3A11; Thu, 7 Dec 2023 07:52:05 -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 S1443666AbjLGPvs (ORCPT + 99 others); Thu, 7 Dec 2023 10:51:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50538 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1443705AbjLGPvW (ORCPT ); Thu, 7 Dec 2023 10:51:22 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 92D271BCD for ; Thu, 7 Dec 2023 07:50:41 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2F9BFC433B7; Thu, 7 Dec 2023 15:50:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1701964240; bh=zO46BEH/qfu0CixrowksluYDZc217GLndsOE/KC1EdM=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=hMS+0Vqt+qR+tob/ei3PXa4k1sWLRiOz/xAniL7zz3kmt0XcgvIxb3+u6OrJprL0l gzpb9o9ikIGNi39tytp671JuL2X5u3aEp5De5BudQ91H7sYeHzv5ujZhRO2/GKRhGb siozNngD9OXULyyHeL0dJttcn2lltNs8PDc0qDuogs6Sd8850MnYaSdYq57fJUYfIQ ZueYQeYPPbWfj/noqgVerMJqbT9iySwJmHG/y5mm2nRvYHMQx6xz2FJQAJOSTT43u0 IGi/GUiGfCl7qz2gN89VsN/S/+Pa/yui9WC5amkYPG/LIqspfh8bD9S2Y2y8OqNOtY lF6FO6IrPCiTA== From: Maxime Ripard Date: Thu, 07 Dec 2023 16:49:47 +0100 Subject: [PATCH v5 24/44] drm/rockchip: inno_hdmi: Switch encoder hooks to atomic MIME-Version: 1.0 Message-Id: <20231207-kms-hdmi-connector-state-v5-24-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=2182; i=mripard@kernel.org; h=from:subject:message-id; bh=zO46BEH/qfu0CixrowksluYDZc217GLndsOE/KC1EdM=; b=owGbwMvMwCX2+D1vfrpE4FHG02pJDKmFL9sCNuq3Hbny/sDSv5npaUfMGcoN9KetZDQ8E6P1u EJawCygo5SFQYyLQVZMkSVG2HxJ3KlZrzvZ+ObBzGFlAhnCwMUpABPZ+Y+R4ZFLBOPt1EC7oJiz +2uX7d62evNhv6Dlf/90fi+rW6770I/hf0Dn71NRNyb9O8pwdvOdC8dz5fSsC3fVXswJFPvZsHV bCxMA 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:52:05 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1784638966916150858 X-GMAIL-MSGID: 1784638966916150858 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