From 48c5c68fdeddcca43a06b22f522784f1284e7a0c Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Mon, 17 Jul 2023 15:16:49 +0200 Subject: [PATCH] drm/udl: Convert to drm_crtc_helper_atomic_check() 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 Signed-off-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/dcb09c0c7bed1baee39a72caba098a399ce7f063.1689599767.git.geert+renesas@glider.be --- 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 aa02fd2789c3..40876bcdd79a 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 @@ out: } 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, }; -- 2.39.5