From patchwork Wed Sep 20 14:35:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 142468 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp4199999vqi; Wed, 20 Sep 2023 07:56:49 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH98qPoTY98G53saqlTDAAJtiuhA7bilB4pk4bm7CVVQBi8VPEvCPvne+5vhQrsOygGHMTM X-Received: by 2002:a05:6a21:1f25:b0:14c:4deb:7120 with SMTP id ry37-20020a056a211f2500b0014c4deb7120mr2264967pzb.62.1695221809566; Wed, 20 Sep 2023 07:56:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695221809; cv=none; d=google.com; s=arc-20160816; b=Yg8WA6CJKrzyr4tL82I+sr2Y9zSNzbn4C62SsdFkOoiyxOz6C3J0s5q/O5xcBlq4P0 7RjZ7AQ56wfgGwvtCVhjm6948sEvNYYUiXtg9XKgF5Qy7g5R1VHXbFWf6V0WIeiFJ6RS kU38A6a0XuDF2ZrmKJs0LL1+CwzNokcCN7RfP5oQKEQe+ykkSa/sNpxK6UWjRTeSGG7W IQyvRvCFwjbleKpAmHRZbLbP4I6LZLDZweY7HTKoE95BndZZXGuwSDxrVMbd46324kLx 8gAWH8UxIVwtkimAlO8Cfx36UCVFj5m7ZnE10YO2hzexrjrOfA8a5wE2j+pHi//G4V26 8Wog== 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=dARMRX2UVHVhPyfp1O9/6tqXYeyrAGhVtZcmGISzBWQ=; fh=e6/uyeFf2k7v8JUtB6fPyaAS5iN3eSA1hjtg35V2Rzw=; b=E/ux3Cb4gj4+HOg6DGJIbF02B8EpUOsgcfRmGYNpUsSnf2rDhsedU2jBCGSDWbXqzJ XUVFD3oEhLb7wGpKzWIo5Q7qzHGdLz49FEKzFujKSxVhEgZszmVWqwtyWOGDlhMwtVeJ WK9yKJwoS8+bmNwx1Po0wwC4vhNM5NHb8xy1+TV62JaAAl5lFnTSt3/jSf5kFgPsjMMx UwsPuTQrhx7gOqkKpyfJ1KHoTtfk2AJvDpo7np0UULi7TBQgtJn2e/jqvRWKSTCaljo4 /J27hIhCgTo5tLU5BwpoQZnPHLlesSUaqGlfhL0klXAF5Lwr7105+At/xSQxT0Mk5NCm MS2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=YEHMZuIx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id k23-20020aa79737000000b0068fdc320483si3758943pfg.225.2023.09.20.07.56.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Sep 2023 07:56:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=YEHMZuIx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (Postfix) with ESMTP id 61D59827C186; Wed, 20 Sep 2023 07:39:01 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236644AbjITOim (ORCPT + 27 others); Wed, 20 Sep 2023 10:38:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53166 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236747AbjITOiM (ORCPT ); Wed, 20 Sep 2023 10:38:12 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EE0A319D; Wed, 20 Sep 2023 07:37:15 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 32429C433C8; Wed, 20 Sep 2023 14:37:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695220635; bh=c0jADGC6TjAEj2UIRZa0xYYM+pIDgthxehFYDaZ1tpk=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=YEHMZuIxfUCYu+qfpqbo6g41ytV6KAGJEOO+FOV8BzK4yyl4/LO+8KNDHFTuCBAZ1 gxA3YVI9DgdXfcjspkqv7+y+Hzz9MLCBaGNvY2GnxI8/eNQ/YcJpXjtfKu2epNqDGG lJYpPEQ/GNMvW0vSWN/InHDd/rSTUk40wfrHLXFJHd//+7jJ9xZ3tG7Ne3+pTJqFH5 uLJ26/zidx5A9AcqSrUctXh2qPdv2CP9ppNTPU8AiCiz+F10xuqbG+6XOXsWDABsek hJ9JyT7V3uJboOKW687Zk70FMCr3pxOmjY1AcDZf/b4DhwByaaqEcLledvOLGrmVy0 3zbcqY8eayfvA== From: Maxime Ripard Date: Wed, 20 Sep 2023 16:35:48 +0200 Subject: [PATCH RFC v2 33/37] drm/sun4i: hdmi: Convert encoder to atomic MIME-Version: 1.0 Message-Id: <20230920-kms-hdmi-connector-state-v2-33-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=2311; i=mripard@kernel.org; h=from:subject:message-id; bh=c0jADGC6TjAEj2UIRZa0xYYM+pIDgthxehFYDaZ1tpk=; b=owGbwMvMwCX2+D1vfrpE4FHG02pJDKnczFaMjeoPhZ5/Fm66Nqvme8q6+/N33NHQ/hPK9i73V U3My1OdHaUsDGJcDLJiiiwxwuZL4k7Net3JxjcPZg4rE8gQBi5OAZjI23eMDOsc5J0Z7tvtaOMI FVEo3HJFyl5iQdqtI/5fSiUVeIOPijEynGTuX1boeV37D+Pj6f+UJJsPM7lVBD1Y6SYoNy/Kb8E jFgA= X-Developer-Key: i=mripard@kernel.org; a=openpgp; fpr=BE5675C37E818C8B5764241C254BCFC56BF6CE8D X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 (snail.vger.email [0.0.0.0]); Wed, 20 Sep 2023 07:39:01 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777568904262303616 X-GMAIL-MSGID: 1777568904262303616 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 --- 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, };