mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "CK Hu (胡俊光)" <ck.hu@mediatek.com>
To: "p.zabel@pengutronix.de" <p.zabel@pengutronix.de>,
	"chunkuang.hu@kernel.org" <chunkuang.hu@kernel.org>,
	"seanwascoding@gmail.com" <seanwascoding@gmail.com>,
	"tzimmermann@suse.de" <tzimmermann@suse.de>
Cc: "simona@ffwll.ch" <simona@ffwll.ch>,
	"dri-devel@lists.freedesktop.org"
	<dri-devel@lists.freedesktop.org>,
	AngeloGioacchino Del Regno
	<angelogioacchino.delregno@collabora.com>,
	"airlied@gmail.com" <airlied@gmail.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"matthias.bgg@gmail.com" <matthias.bgg@gmail.com>,
	"linux-mediatek@lists.infradead.org"
	<linux-mediatek@lists.infradead.org>
Subject: Re: [PATCH v1] drm/mediatek: mtk_dsi: Open-code drm_simple_encoder_init()
Date: Tue, 25 Aug 2026 08:06:32 +0000	[thread overview]
Message-ID: <dbd9a0904d89c2101afffbf302166bcf766e80d0.camel@mediatek.com> (raw)
In-Reply-To: <20260813175517.156893-1-seanwascoding@gmail.com>

Hi, Sean:

On Fri, 2026-08-14 at 01:55 +0800, Sean Chang wrote:
> External email : Please do not click links or open attachments until you have verified the sender or the content.
> 
> 
> The drm_simple_encoder_init() helper is deprecated because it adds an
> intermediate abstraction layer that only wraps drm_encoder_init() with
> an empty or minimal drm_encoder_funcs struct.
> 
> Replace drm_simple_encoder_init() with explicit calls to drm_encoder_init()
> and define driver-specific drm_encoder_funcs carrying the cleanup callback.

Because Diogo Silva has send similar patch before you and it looks good,
so I would like to apply his patch.

Regards,
CK

> 
> Signed-off-by: Sean Chang <seanwascoding@gmail.com>
> ---
>  drivers/gpu/drm/mediatek/mtk_dsi.c | 9 +++++++--
>  1 file changed, 7 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/mediatek/mtk_dsi.c b/drivers/gpu/drm/mediatek/mtk_dsi.c
> index 49dfc0f825cb..276d57f8407b 100644
> --- a/drivers/gpu/drm/mediatek/mtk_dsi.c
> +++ b/drivers/gpu/drm/mediatek/mtk_dsi.c
> @@ -226,6 +226,10 @@ struct mtk_dsi {
>         const struct mtk_dsi_driver_data *driver_data;
>  };
> 
> +static const struct drm_encoder_funcs mtk_dsi_encoder_funcs = {
> +       .destroy = drm_encoder_cleanup,
> +};
> +
>  static inline struct mtk_dsi *bridge_to_dsi(struct drm_bridge *b)
>  {
>         return container_of(b, struct mtk_dsi, bridge);
> @@ -918,8 +922,9 @@ 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.43.0
> 
> 


      parent reply	other threads:[~2026-08-25  8:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-13 17:55 Sean Chang
2026-08-25  7:52 ` CK Hu (胡俊光)
2026-08-25  8:06 ` CK Hu (胡俊光) [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=dbd9a0904d89c2101afffbf302166bcf766e80d0.camel@mediatek.com \
    --to=ck.hu@mediatek.com \
    --cc=airlied@gmail.com \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=chunkuang.hu@kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=matthias.bgg@gmail.com \
    --cc=p.zabel@pengutronix.de \
    --cc=seanwascoding@gmail.com \
    --cc=simona@ffwll.ch \
    --cc=tzimmermann@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®