From patchwork Thu Feb 22 18:14:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 204978 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp130344dyb; Thu, 22 Feb 2024 10:30:27 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXQVszwENrM2X5i3sSTkUi+JWLaiphCxCWLUnChKV4NDYo3uL2VIdzI5me8AU2QPdwzTz20MzxYst3UtTMyiDM4xTqYsA== X-Google-Smtp-Source: AGHT+IFhy7VBTFdPqCflXJHq9MNS5LPl9GR7bWhZytpGrlOXLXZrxCxIUuKA7dI6Ccc9qP8WsF97 X-Received: by 2002:a05:6808:1b07:b0:3c1:78a7:9935 with SMTP id bx7-20020a0568081b0700b003c178a79935mr3430956oib.39.1708626627714; Thu, 22 Feb 2024 10:30:27 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708626627; cv=pass; d=google.com; s=arc-20160816; b=zUeiJsmmSCXLQ/HJKfY3dJIpEVU2TOR+kSGEPQAI3RW8wav7nllcibZMvO6v1qsnpM bel2GbZ1kbaOz5GC2Q/jCX59LYAuhkuSnGlxUoZBcmA7mjYRWQqCFMCejEpsuOVxIMYH l4ahOEJfevaEINy3RE+iv3j8CVZcdvwHXqaYmZd1F1aKXnV/dfUE/qB4rpihQAdHDcOh njGZDBeHC4+pbDIfK9QDIQRGfvXd8eaQe/I6mt2DQ3sdHKtYW8uAF+R09EgQ0XLPwjrK 5mBkA1mKKnui4CAsu7X4gw2TVOOregu+irzO4As+xpq2BVgLU6xvMlNkP2tf8jUCO0v/ GqQQ== 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=MTnUbfrhclbgZ2tzIZVZD82l9kS0u0j0Zhzjq8Q5sGw=; fh=jHlABrYnApVt5KJlrthitgyo0hqpWWrdlN0oFT+yLLg=; b=1Fzph6Nlm7E8UkYPdSxonGLjxDd+j5f3++n658awJ34O28OxgizayaRSYglvVg40oW oQuMBoZ/D73jn2tpFzmP4Kk5M05sV3nKYylnRdLIYtvOhR423IZjrQrJO9X2sPQmiumj zdF3wwNOc9DmIJ3k+6PB7aBZ4jFkpc8/WZD6wIsRGliJeSGjGLTn+KCDbUizLSV9UBOo VNs2O/swwUWApTQZL98YFjDU0d6A3NeCS/6oi8LVRf7JH3AzC9Uz6TBdga+m7MDBEYY/ FTAvNpQ6VyGCd8n/MYSocSV4URpwm5EYbNw4OfuiTVrfYt5WyFnnOkuo4PieVdqrYOAb 4Byg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="qmT/rE2r"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-77111-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-77111-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id v12-20020ac8728c000000b0042e088b2789si9570183qto.544.2024.02.22.10.30.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 10:30:27 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-77111-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="qmT/rE2r"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-77111-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-77111-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id C1FDF1C2300B for ; Thu, 22 Feb 2024 18:30:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DB8F1140385; Thu, 22 Feb 2024 18:16:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="qmT/rE2r" 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 2101A14CABF; Thu, 22 Feb 2024 18:15:58 +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=1708625758; cv=none; b=eqdLA7E/d55GE68pWZHmFm6EHiKq82z6DZDX9Bhl9GJOA5ubh02otCAK5iP5wEvFrJJOLkSLWUqGJYLPubWLLzp/mYQLDjMZ60SD8G1/qK+OluddHaXf1v7TWBZISB+t+KGsFpdBifXR4+QtHgQlGN4Jo/WNJz4TZeLyLFvY2rQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708625758; c=relaxed/simple; bh=HwA8pHzZqVdQyHV/A0cE4sshsUXIMq0spgAC4b0SoHc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=N38usgn8fj4X/uf119U+0RkM3xQIrrRlLDs+m4HCLCGgfqGGKMvqjGCeVAv6hBPMNooL7Yp/7rTtzXyFqf7+DJrxBBHXPKfFzB+B6imovBQbJHjJSN6HMRRMQc7B3KksW4qY+VVTAqhAFx+Ny/xdfLDe0OERGf0QwFxwE7JzL3k= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=qmT/rE2r; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id A1E27C433F1; Thu, 22 Feb 2024 18:15:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708625758; bh=HwA8pHzZqVdQyHV/A0cE4sshsUXIMq0spgAC4b0SoHc=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=qmT/rE2rhMFDIHrJCGBxP+N9iYDNev4YbiCdQ1llWH1TWCYk+Ial8qXGuWGm3zEZp h/SDvGDs+mp9KiSkdkvqRyY4ns6TBhMn00Z7IFt+qn/ty2LbBLnw2hmPzdUJ8so7to hFK7qgI2FGauNYfYYMtOG/bbGd5GwIhw5bVx8OJFgcYoA073Klg2IfL6a+CgHQhgwV VJDGd6KRhc2OgM/YD3y/ePUSkEFxJ4NprmsVwNmn6Jkc6z/mKcRptQtv7UUGCRChhl j1aKoXCAdPo9Ks/vBSuU8eJKdg1bJqpH2a37Cb1Eyr2ae6+MslxwiHuyoYZ0v75r2I vThmaF4lzrdqw== From: Maxime Ripard Date: Thu, 22 Feb 2024 19:14:18 +0100 Subject: [PATCH v7 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: <20240222-kms-hdmi-connector-state-v7-32-8f4af575fce2@kernel.org> References: <20240222-kms-hdmi-connector-state-v7-0-8f4af575fce2@kernel.org> In-Reply-To: <20240222-kms-hdmi-connector-state-v7-0-8f4af575fce2@kernel.org> To: Maarten Lankhorst , Thomas Zimmermann , David Airlie , Daniel Vetter , Jonathan Corbet , Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland Cc: Hans Verkuil , Sebastian Wick , =?utf-8?b?VmlsbGUgU3lyasOkbMOk?= , 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=HwA8pHzZqVdQyHV/A0cE4sshsUXIMq0spgAC4b0SoHc=; b=owGbwMvMwCX2+D1vfrpE4FHG02pJDKnX+/5e5Ev7lbvnxKZUft0ONiGLa4p+WsJN3fEVjf8dt aPUHn3vKGVhEONikBVTZIkRNl8Sd2rW6042vnkwc1iZQIYwcHEKwETW2DAyvFW67JV4+cM3dvn9 n48pzH5/KWOy18UPFzoErJ84XfVes5Thr/gBXvZl29JP3dK4srGK7+q8DdaHV8cuVBKfMneGocQ FGRYA X-Developer-Key: i=mripard@kernel.org; a=openpgp; fpr=BE5675C37E818C8B5764241C254BCFC56BF6CE8D X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791624875174518386 X-GMAIL-MSGID: 1791624875174518386 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 Reviewed-by: Jernej Skrabec --- 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, };