Hi Diogo,
On 6/7/2026 2:37 PM, Diogo Silva wrote:
> Simple KMS helper are deprecated since they only add an intermediate
> layer between drivers and the atomic modesetting.
> This patch removes the dependency on drm_simple_encoder_init from rockchip
> DRM drivers by inlining this helper.
>
> Signed-off-by: Diogo Silva <[email protected]>
> ---
> drivers/gpu/drm/rockchip/analogix_dp-rockchip.c | 9 ++++++---
> drivers/gpu/drm/rockchip/cdn-dp-core.c | 9 ++++++---
> drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c | 9 +++++++--
> drivers/gpu/drm/rockchip/dw-mipi-dsi2-rockchip.c | 8 ++++++--
> drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c | 8 ++++++--
> drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c | 8 ++++++--
> drivers/gpu/drm/rockchip/rk3066_hdmi.c | 8 ++++++--
> drivers/gpu/drm/rockchip/rockchip_lvds.c | 9 +++++++--
> drivers/gpu/drm/rockchip/rockchip_rgb.c | 8 ++++++--
> 9 files changed, 56 insertions(+), 20 deletions(-)
[snip]
> diff --git a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c
> b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c
> index 0dc1eb5d2ae3..906264d65db3 100644
> --- a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c
> +++ b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c
> @@ -16,7 +16,6 @@
> #include <drm/drm_edid.h>
> #include <drm/drm_of.h>
> #include <drm/drm_probe_helper.h>
> -#include <drm/drm_simple_kms_helper.h>
>
> #include "rockchip_drm_drv.h"
>
> @@ -322,6 +321,10 @@ dw_hdmi_rockchip_encoder_atomic_check(struct drm_encoder
> *encoder,
> return 0;
> }
>
> +static const struct drm_encoder_funcs dw_hdmi_rockchip_encoder_funcs = {
> + .destroy = drm_encoder_cleanup,
> +};
> +
> static const struct drm_encoder_helper_funcs
> dw_hdmi_rockchip_encoder_helper_funcs = {
> .mode_fixup = dw_hdmi_rockchip_encoder_mode_fixup,
> .mode_set = dw_hdmi_rockchip_encoder_mode_set,
> @@ -604,7 +607,8 @@ static int dw_hdmi_rockchip_bind(struct device *dev,
> struct device *master,
> }
>
> drm_encoder_helper_add(encoder, &dw_hdmi_rockchip_encoder_helper_funcs);
> - drm_simple_encoder_init(drm, encoder, DRM_MODE_ENCODER_TMDS);
> + drm_encoder_init(drm, encoder, &dw_hdmi_rockchip_encoder_funcs,
> + DRM_MODE_ENCODER_TMDS, NULL);
Please base your work on latest drm-misc tree, this has already been
addressed in commit 3de723684be5 ("drm/rockchip: dw_hdmi: Use drmres
helpers for encoder resources") [1].
Also instead of open-code, maybe a change to use drmm_encoder_init() is
more appropriate for some of the other drivers?
[1]
https://cgit.freedesktop.org/drm/drm-misc/commit/?id=3de723684be5c13517dea3dba287d06e12678c86
Regards,
Jonas
>
> platform_set_drvdata(pdev, hdmi);
>
[snip]