From 3cc8eee9f3460b5b1366155ef31b3193a381fe30 Mon Sep 17 00:00:00 2001 From: Diogo Silva Date: Mon, 20 Jul 2026 17:40:33 +0200 Subject: [PATCH] drm/exynos: remove dependency on DRM simple helpers The simple KMS helpers are deprecated because they only add an intermediate layer between drivers and atomic modesetting. Open-code drm_simple_encoder_init() by calling drm_encoder_init() directly and providing driver-local drm_encoder_funcs. Also check the return value from drm_encoder_init() to avoid silent failures. Signed-off-by: Diogo Silva Signed-off-by: Thomas Zimmermann Reviewed-by: Thomas Zimmermann Link: https://patch.msgid.link/20260720-drm_simple_encoder_init-v2-1-5020b630668a@gmail.com --- drivers/gpu/drm/exynos/exynos_dp.c | 13 +++++++++++-- drivers/gpu/drm/exynos/exynos_drm_dpi.c | 13 +++++++++++-- drivers/gpu/drm/exynos/exynos_drm_dsi.c | 11 +++++++++-- drivers/gpu/drm/exynos/exynos_drm_vidi.c | 13 +++++++++++-- drivers/gpu/drm/exynos/exynos_hdmi.c | 14 ++++++++++++-- 5 files changed, 54 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_dp.c b/drivers/gpu/drm/exynos/exynos_dp.c index a418011f7d4d..e57d4da43300 100644 --- a/drivers/gpu/drm/exynos/exynos_dp.c +++ b/drivers/gpu/drm/exynos/exynos_dp.c @@ -24,11 +24,11 @@ #include #include #include +#include #include #include #include #include -#include #include #include "exynos_drm_crtc.h" @@ -79,6 +79,10 @@ static void exynos_dp_nop(struct drm_encoder *encoder) /* do nothing */ } +static const struct drm_encoder_funcs exynos_dp_encoder_funcs = { + .destroy = drm_encoder_cleanup, +}; + static const struct drm_encoder_helper_funcs exynos_dp_encoder_helper_funcs = { .mode_set = exynos_dp_mode_set, .enable = exynos_dp_nop, @@ -95,7 +99,12 @@ static int exynos_dp_bind(struct device *dev, struct device *master, void *data) dp->drm_dev = drm_dev; - drm_simple_encoder_init(drm_dev, encoder, DRM_MODE_ENCODER_TMDS); + ret = drm_encoder_init(drm_dev, encoder, &exynos_dp_encoder_funcs, + DRM_MODE_ENCODER_TMDS, NULL); + if (ret) { + drm_err(drm_dev, "Failed to initialize encoder\n"); + return ret; + } drm_encoder_helper_add(encoder, &exynos_dp_encoder_helper_funcs); diff --git a/drivers/gpu/drm/exynos/exynos_drm_dpi.c b/drivers/gpu/drm/exynos/exynos_drm_dpi.c index 9d15a0035ea9..74d3a2bebb74 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_dpi.c +++ b/drivers/gpu/drm/exynos/exynos_drm_dpi.c @@ -12,10 +12,10 @@ #include #include +#include #include #include #include -#include #include