From patchwork Mon Feb 12 13:13:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 199779 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:50ea:b0:106:860b:bbdd with SMTP id r10csp2425779dyd; Mon, 12 Feb 2024 05:28:08 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXMO9XlFeZtzpzI9PKh2tPOQkdJ1bWntdFWjPMfi2xBZQ/apcoDtKMqcJ3munRGIr73tTF4IZwynqFf2fgnZ2/UIXVpQw== X-Google-Smtp-Source: AGHT+IEfP68VHyXVXD0f5ZDOXvI/u4QK9T5Atd56pZDGIEGCFtZ8fprmzZIZnhg2FDLWr01fJvJ4 X-Received: by 2002:a05:6a21:3115:b0:19c:a16d:ca79 with SMTP id yz21-20020a056a21311500b0019ca16dca79mr10515338pzb.15.1707744487852; Mon, 12 Feb 2024 05:28:07 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707744487; cv=pass; d=google.com; s=arc-20160816; b=rDbxWwEdrNf2cJlT6GwOxjd6GFZ1Ti1L4GO8fePguJFbhBabDYS9Ney435VGH4vXyf tM2oyHlat+OYlwy4iOwbNbqSJfKMNiCJnbGLTd0Zyb9jVuqkJHvGQJey0vRXn11MYF2u GWJ2SjdLOiMIZfNS+gQGTtkLaE+ETEiCiurWnqBjcLORMfIXVCiEQfvjf5nq3NQi12Qd 1+5OFu7Oi5nk3hj05IhmMeBN2j1zKDMxP517HODLOyjT9DXYXUtAqy/QBrg2W/AkyLKV iIP+wCLK8ksg1w2lVhYLNGQwmXMNNGXIWUDoXAlwup8X3mTFi1Wz7YVKxZPtvzXtijEK OSOA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=eZiy1/KvNy4nBC5aJdfPAeYo+xAgQc28/dyiSDgDTlI=; fh=WK5Tx5nKZB8fhNhRL/E0ryCnBXwopvrtOfra1/IqELY=; b=f2n5CqvwnF+r7JJUMxYIWf19/dcq4Ud9cKXg4OyxlY7ARRHITpovMqB/gAyiRyvzRs R9wmVO9ESljPQZZK8Cebbj5au3ABMfdpwk6Gd8T3WoHtldbYf7lg/Fh8PjFW6pMlus4y f4zmUs3KyAlpQk85Wrrx2eOuKgSxKiWW1OHu+JMnZMUj9ZBIFK/KeRIV2K9r1ejcmZpM eORmD7tHW/xm9A1Dw+yBBOu3lbL5osV3/w03iDBrOCUTlyCFkHt7kEPprLQz1LyD2b2B aIDnMALdN/053LjUPCbf2hZBlVL/C9iyS5KyfxJ5buhEqnw52D9r2H62CL9rnxDJKC2s IFvA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=II8RWzCC; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-61657-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-61657-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=2; AJvYcCWftLYOjYFnVJoRSF4V9oFxI7dhDzMjBwpmhoa4UFq14KIQEsAcxcQDwNPooVCsp2wAphyNiHoRhVMqmpcJUKHX8zVWOg== Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id o23-20020a637e57000000b005d5c89bd684si243758pgn.414.2024.02.12.05.28.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Feb 2024 05:28:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-61657-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=II8RWzCC; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-61657-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-61657-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id A075E28B03C for ; Mon, 12 Feb 2024 13:28:07 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4F96353372; Mon, 12 Feb 2024 13:15:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="II8RWzCC" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8D8AA52F75; Mon, 12 Feb 2024 13:15:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707743700; cv=none; b=RB7JEcDPYjZpkX5Im1enAmJ76h3gc5wHll6mKpTpdZV3kuqkrCSA5PTY4/dOHkX9MJBtzgHVhhc7zihcU43YIYz79DgVIemCkqCXpa30zmOL6YgxQOoW+DMk89YaY0iQBPHJ8BWrBHlRH3sgtNBtFdcMMU8z/yn5URECyFRS4DA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707743700; c=relaxed/simple; bh=XmyfHygn/0NwHwPlcl1l0xEMP+Wb3sl9opud5sJQ1uw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=c2DLkXebVf1nFqqdUn0nuJONOZhKTvsQ26QTjpFsZOXcWnSWEafqd0zn9rztwht5QQxIjWx6je8Czm5CrHxUi9x9UV/wOWRFv6L7OIiiZHkXClvmN67zcyG7dWmzRkhoOJ+Jc0L0twWp/HYHDTZMRolzaLu8DbPu1Wj0sLcCGm0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=II8RWzCC; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id BB408C433C7; Mon, 12 Feb 2024 13:14:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1707743700; bh=XmyfHygn/0NwHwPlcl1l0xEMP+Wb3sl9opud5sJQ1uw=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=II8RWzCCQrg/YyY6R0vK3fI7RE91Th0aFgqPb/fF+/wr1y8F95U79/RZKCCAba6cj quBbB0OMcB5/WKdBO7tGFejZQ2KcBhI8XQzfyJcFNHcYeSw9PvYk5TerDeu/ieAaQr R4k6XW6DGZhLmgd12OuR3D5kGsTZvr5+tZMHo5O8cx+za8KpeQCDazbbZw8C1IyHGV sCf/1Sf1D+FxssMVZnj1HjxFdIbipBkrFwOyLosU2AVtycvaz4W3pmpDTMk0j/56XJ /Tas1Qx7UgRd08UyeVgzaqAWOpa+ax9BHWw8QoN/Ge7sutF2yfhNdGMdHjXWAWFxZT 4mIyPa0xPVCdA== From: Maxime Ripard Date: Mon, 12 Feb 2024 14:13:15 +0100 Subject: [PATCH v6 32/36] drm/sun4i: hdmi: Convert encoder to atomic Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240212-kms-hdmi-connector-state-v6-32-f4bcdc979e6f@kernel.org> References: <20240212-kms-hdmi-connector-state-v6-0-f4bcdc979e6f@kernel.org> In-Reply-To: <20240212-kms-hdmi-connector-state-v6-0-f4bcdc979e6f@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 , Sui Jingfeng X-Mailer: b4 0.12.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=2360; i=mripard@kernel.org; h=from:subject:message-id; bh=XmyfHygn/0NwHwPlcl1l0xEMP+Wb3sl9opud5sJQ1uw=; b=owGbwMvMwCX2+D1vfrpE4FHG02pJDKmnJIsT558IjGlQL4r5Ffg5I+T2jeKQTbL3Ljwvd3ZX7 im693pDRykLgxgXg6yYIkuMsPmSuFOzXney8c2DmcPKBDKEgYtTACay/hMjw4b0yXcumjEvnPlF KfLT0WUC8R/OsjdJ8rksyNV22DKloIPhf2TL5As6rTqrVDp/ftSLEo3fI/LO+tzkIqGc5w/Ffr8 sYAEA X-Developer-Key: i=mripard@kernel.org; a=openpgp; fpr=BE5675C37E818C8B5764241C254BCFC56BF6CE8D X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790699884072606448 X-GMAIL-MSGID: 1790699884072606448 The sun4i_hdmi driver still uses the non-atomic variants of the encoder hooks, so let's convert to their atomic equivalents. Acked-by: Sui Jingfeng 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, };