From patchwork Tue Nov 28 10:24:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 170703 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce62:0:b0:403:3b70:6f57 with SMTP id o2csp3814678vqx; Tue, 28 Nov 2023 02:28:27 -0800 (PST) X-Google-Smtp-Source: AGHT+IHqDcPir5wZlG3rS8PuKUztDwPgTNsTz+Da+yJKVyGWqy88jsf5HMtjF4KvmReFcnDIM51A X-Received: by 2002:a05:6a00:2d1b:b0:6c6:1648:5ac6 with SMTP id fa27-20020a056a002d1b00b006c616485ac6mr15363048pfb.5.1701167306728; Tue, 28 Nov 2023 02:28:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701167306; cv=none; d=google.com; s=arc-20160816; b=GgXsyuoj0m8rHwYeytJV1lbo4oHRZI6IciDjbCl4IFmPGkCDWI+w/v0uDQl4XwNPP2 I2Evpe5IlIvcPK+T3jaIco68BEqk84YRSP1LM99HjI+mVy++DP4yeQDk1Lk+MnHfc6MN loZ8DldNVT2sBgqj7p4GURMfrNF2P/XzAU7WSng6U8BnUcgYN3NHg9ZHiqCeKkJ0sh+B 8yf0eKqgQeUvhd8g31uiMK20R0LZuAO4yq54AaYxnegKCOnWdul16mWkG8ytHObWlz9V EjjxoW+D3X8a98Ij8ROMRC1iOKVtHV8tRDGEjVT0WkWaGV47IU1vb6jgod9i+HPmPsws B9kA== 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=M/HoPZqw39z9huK60Q/f0JC9e5e+C+9zf4VBDwMrCwFvBSQElAughu3vxJCpT3JqFE bbbxaOlNy1gXAo2DWM+cKDeIesKtj5lXUTmnmezAmI+7ERE/mL8eRqAAQW+onN+ZW/yJ 2/YZuYHg5UPJDfiZv9aDoGB5IjPCg2841yvqOLEAAv5pobL4+FgMoXWXrgwSqxOH64w1 qifyDAyyVpEksv6F0c5Q6kvSTIsw2b2g1S6BRi9L5JmbsQt1hNx++x5ReOp/E6x2tijJ E7TDLcnqSvku+AxfXGJhWAHgRmgO/ukcoSOCHofIr5DCoKINQ3MsyzpIOYqQgxxP1UN6 2K9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=MgX6Dpp1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 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 fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id y31-20020a056a00181f00b006c4ddeb9694si12411315pfa.229.2023.11.28.02.28.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Nov 2023 02:28:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=MgX6Dpp1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 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 fry.vger.email (Postfix) with ESMTP id 23445805CF3E; Tue, 28 Nov 2023 02:28:23 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234931AbjK1K1x (ORCPT + 99 others); Tue, 28 Nov 2023 05:27:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48502 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234837AbjK1K1R (ORCPT ); Tue, 28 Nov 2023 05:27:17 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D2D3010D7 for ; Tue, 28 Nov 2023 02:25:34 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1F22AC433CD; Tue, 28 Nov 2023 10:25:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1701167134; bh=M2G6LOjWKL55s6a+6IU/6bn6CB2qn7/s2odBTDcEBoM=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=MgX6Dpp1E/nQbEgbyx4iqBmoKRk4n6MBJGBC62SWL/V1N8dJRf4d0fk6BCxncRG1N lwYeDBoZRPRF5rbzJvwpD59Wgxa0gG8qu63cEOIprCdpqY5sf+r1PXirgMQncGW/V/ NRX89qCFCGZYuHFNpvDDk3gVXtNaSbsfRzaEOXIjnxuQ2fcXAT63JS5N51v7wwIHNp obcHvSrAT89jE3iePjt01evwpW+9aHmdh7JXXGrjYJ/uK5ATzDL4yx35TR52XNBeFa WgswNW+m2j/vIMH1wTYt4UoAXZlOo7WWqbD+r7oQwF0cvKeDAixsD36aUUEo+R2IJU hcGGLLJky6WxA== From: Maxime Ripard Date: Tue, 28 Nov 2023 11:24:36 +0100 Subject: [PATCH v4 25/45] drm/rockchip: inno_hdmi: Switch encoder hooks to atomic MIME-Version: 1.0 Message-Id: <20231128-kms-hdmi-connector-state-v4-25-c7602158306e@kernel.org> References: <20231128-kms-hdmi-connector-state-v4-0-c7602158306e@kernel.org> In-Reply-To: <20231128-kms-hdmi-connector-state-v4-0-c7602158306e@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+D1vfrpE4FHG02pJDKmp+y9VG59/HVe+rE2nIaHqEVP24tvZ8g71YQuWSO7Mb pp7LOZiRykLgxgXg6yYIkuMsPmSuFOzXney8c2DmcPKBDKEgYtTACYSYcfIsID9RbdLQu4sbqe8 mP3FCn0nxAQPJV5affuEfwxTkbG4OiNDo1bIcql5C+88d+Z0rcmaPtPkvXep1D+tHfldZu6vtf9 wAAA= 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 fry.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 (fry.vger.email [0.0.0.0]); Tue, 28 Nov 2023 02:28:23 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783803209525174125 X-GMAIL-MSGID: 1783803209525174125 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