Re: [PATCH v2 09/15] drm/mediatek: remove dependency on DRM simple helpers

CK Hu (胡俊光) <[email protected]>
Newsgroups dev.linux.lists.virtualization,dev.linux.lists.imx,org.freedesktop.lists.dri-devel,org.infradead.lists.linux-amlogic,org.infradead.lists.linux-mediatek,org.kernel.vger.linux-doc,org.kernel.vger.linux-kernel,org.kernel.vger.linux-renesas-soc,org.kernel.vger.linux-samsung-soc,org.kernel.vger.linux-tegra
Message-ID <[email protected]>
On Mon, 2026-07-20 at 17:40 +0200, Diogo Silva wrote:
> External email : Please do not click links or open attachments until you have verified the sender or the content.
> 
> 
> 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.

Reviewed-by: CK Hu <[email protected]>

> 
> Signed-off-by: Diogo Silva <[email protected]>
> ---
>  drivers/gpu/drm/mediatek/mtk_dsi.c | 10 +++++++---
>  1 file changed, 7 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/mediatek/mtk_dsi.c b/drivers/gpu/drm/mediatek/mtk_dsi.c
> index 3f3f56eed3f9..7cd136bd9605 100644
> --- a/drivers/gpu/drm/mediatek/mtk_dsi.c
> +++ b/drivers/gpu/drm/mediatek/mtk_dsi.c
> @@ -21,12 +21,12 @@
>  #include <drm/drm_atomic_helper.h>
>  #include <drm/drm_bridge.h>
>  #include <drm/drm_bridge_connector.h>
> +#include <drm/drm_encoder.h>
>  #include <drm/drm_mipi_dsi.h>
>  #include <drm/drm_of.h>
>  #include <drm/drm_panel.h>
>  #include <drm/drm_print.h>
>  #include <drm/drm_probe_helper.h>
> -#include <drm/drm_simple_kms_helper.h>
> 
>  #include "mtk_ddp_comp.h"
>  #include "mtk_disp_drv.h"
> @@ -913,12 +913,16 @@ void mtk_dsi_ddp_stop(struct device *dev)
>         mtk_dsi_poweroff(dsi);
>  }
> 
> +static const struct drm_encoder_funcs mtk_dsi_encoder_funcs = {
> +       .destroy = drm_encoder_cleanup,
> +};
> +
>  static int mtk_dsi_encoder_init(struct drm_device *drm, struct mtk_dsi *dsi)
>  {
>         int ret;
> 
> -       ret = drm_simple_encoder_init(drm, &dsi->encoder,
> -                                     DRM_MODE_ENCODER_DSI);
> +       ret = drm_encoder_init(drm, &dsi->encoder, &mtk_dsi_encoder_funcs,
> +                              DRM_MODE_ENCODER_DSI, NULL);
>         if (ret) {
>                 drm_err(drm, "Failed to encoder init to drm\n");
>                 return ret;
> 
> --
> 2.54.0
> 
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.