* [PATCH v1] drm/mediatek: mtk_dsi: Open-code drm_simple_encoder_init()
@ 2026-08-13 17:55 Sean Chang
0 siblings, 0 replies; only message in thread
From: Sean Chang @ 2026-08-13 17:55 UTC (permalink / raw)
To: Chun-Kuang Hu, Philipp Zabel, Thomas Zimmermann
Cc: David Airlie, Simona Vetter, Matthias Brugger,
AngeloGioacchino Del Regno, dri-devel, linux-mediatek,
linux-arm-kernel, linux-kernel, Sean Chang
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.
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
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-08-13 17:55 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-13 17:55 [PATCH v1] drm/mediatek: mtk_dsi: Open-code drm_simple_encoder_init() Sean Chang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox