From patchwork Mon Jul 17 13:16:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 13315688 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 07795EB64DC for ; Mon, 17 Jul 2023 13:16:57 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2355F10E236; Mon, 17 Jul 2023 13:16:56 +0000 (UTC) Received: from xavier.telenet-ops.be (xavier.telenet-ops.be [IPv6:2a02:1800:120:4::f00:14]) by gabe.freedesktop.org (Postfix) with ESMTPS id 31C4210E236 for ; Mon, 17 Jul 2023 13:16:52 +0000 (UTC) Received: from ramsan.of.borg ([IPv6:2a02:1810:ac12:ed40:5803:2d6d:5bbc:e252]) by xavier.telenet-ops.be with bizsmtp id NDGq2A00Q0ucMBo01DGqU1; Mon, 17 Jul 2023 15:16:51 +0200 Received: from rox.of.borg ([192.168.97.57]) by ramsan.of.borg with esmtp (Exim 4.95) (envelope-from ) id 1qLO5h-001fsW-Ik; Mon, 17 Jul 2023 15:16:50 +0200 Received: from geert by rox.of.borg with local (Exim 4.95) (envelope-from ) id 1qLO5q-007QoY-Ew; Mon, 17 Jul 2023 15:16:50 +0200 From: Geert Uytterhoeven To: Dave Airlie , Sean Paul , Thomas Zimmermann , David Airlie , Daniel Vetter Subject: [PATCH v2] drm/udl: Convert to drm_crtc_helper_atomic_check() Date: Mon, 17 Jul 2023 15:16:49 +0200 Message-Id: X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sui Jingfeng , Geert Uytterhoeven , dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Use the drm_crtc_helper_atomic_check() helper instead of open-coding the same operation. Signed-off-by: Geert Uytterhoeven Reviewed-by: Thomas Zimmermann Reviewed-by: Sui Jingfeng --- Compile-tested only. v2: - Add Reviewed-by. --- drivers/gpu/drm/udl/udl_modeset.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/drivers/gpu/drm/udl/udl_modeset.c b/drivers/gpu/drm/udl/udl_modeset.c index aa02fd2789c3f885..40876bcdd79a47ac 100644 --- a/drivers/gpu/drm/udl/udl_modeset.c +++ b/drivers/gpu/drm/udl/udl_modeset.c @@ -12,6 +12,7 @@ #include #include +#include #include #include #include @@ -310,16 +311,6 @@ static const struct drm_plane_funcs udl_primary_plane_funcs = { * CRTC */ -static int udl_crtc_helper_atomic_check(struct drm_crtc *crtc, struct drm_atomic_state *state) -{ - struct drm_crtc_state *new_crtc_state = drm_atomic_get_new_crtc_state(state, crtc); - - if (!new_crtc_state->enable) - return 0; - - return drm_atomic_helper_check_crtc_primary_plane(new_crtc_state); -} - static void udl_crtc_helper_atomic_enable(struct drm_crtc *crtc, struct drm_atomic_state *state) { struct drm_device *dev = crtc->dev; @@ -381,7 +372,7 @@ static void udl_crtc_helper_atomic_disable(struct drm_crtc *crtc, struct drm_ato } static const struct drm_crtc_helper_funcs udl_crtc_helper_funcs = { - .atomic_check = udl_crtc_helper_atomic_check, + .atomic_check = drm_crtc_helper_atomic_check, .atomic_enable = udl_crtc_helper_atomic_enable, .atomic_disable = udl_crtc_helper_atomic_disable, };