* [PATCH 01/10] drm/panel/visionox-g2647fb105: Use refcounted allocation in place of devm_kzalloc()
2026-05-07 11:52 [PATCH 00/10] drm/panel: Use refcounted allocation for remaining panel drivers Albert Esteve
@ 2026-05-07 11:52 ` Albert Esteve
2026-05-07 15:34 ` Neil Armstrong
2026-05-07 11:53 ` [PATCH 02/10] drm/panel/samsung-s6e63m0: " Albert Esteve
` (9 subsequent siblings)
10 siblings, 1 reply; 25+ messages in thread
From: Albert Esteve @ 2026-05-07 11:52 UTC (permalink / raw)
To: Neil Armstrong, Jessica Zhang, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Michael Tretter,
Michael Walle, Dario Binacchi
Cc: dri-devel, linux-kernel, Albert Esteve
Move to using the new API devm_drm_panel_alloc() to allocate the
panel. In the call to the new API, avoid using explicit type and use
__typeof() for more type safety. Also deduplicate the prepare_prev_first
assignment that was set both before and after drm_panel_init().
Signed-off-by: Albert Esteve <aesteve@redhat.com>
---
drivers/gpu/drm/panel/panel-visionox-g2647fb105.c | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/drivers/gpu/drm/panel/panel-visionox-g2647fb105.c b/drivers/gpu/drm/panel/panel-visionox-g2647fb105.c
index 413849f7b4dec..d5555a1731575 100644
--- a/drivers/gpu/drm/panel/panel-visionox-g2647fb105.c
+++ b/drivers/gpu/drm/panel/panel-visionox-g2647fb105.c
@@ -207,9 +207,12 @@ static int visionox_g2647fb105_probe(struct mipi_dsi_device *dsi)
struct visionox_g2647fb105 *ctx;
int ret;
- ctx = devm_kzalloc(dev, sizeof(*ctx), GFP_KERNEL);
- if (!ctx)
- return -ENOMEM;
+ ctx = devm_drm_panel_alloc(dev, __typeof(*ctx), panel,
+ &visionox_g2647fb105_panel_funcs,
+ DRM_MODE_CONNECTOR_DSI);
+
+ if (IS_ERR(ctx))
+ return PTR_ERR(ctx);
ret = devm_regulator_bulk_get_const(dev,
ARRAY_SIZE(visionox_g2647fb105_supplies),
@@ -233,10 +236,6 @@ static int visionox_g2647fb105_probe(struct mipi_dsi_device *dsi)
ctx->panel.prepare_prev_first = true;
- drm_panel_init(&ctx->panel, dev, &visionox_g2647fb105_panel_funcs,
- DRM_MODE_CONNECTOR_DSI);
- ctx->panel.prepare_prev_first = true;
-
ctx->panel.backlight = visionox_g2647fb105_create_backlight(dsi);
if (IS_ERR(ctx->panel.backlight))
return dev_err_probe(dev, PTR_ERR(ctx->panel.backlight),
--
2.53.0
^ permalink raw reply related [flat|nested] 25+ messages in thread* Re: [PATCH 01/10] drm/panel/visionox-g2647fb105: Use refcounted allocation in place of devm_kzalloc()
2026-05-07 11:52 ` [PATCH 01/10] drm/panel/visionox-g2647fb105: Use refcounted allocation in place of devm_kzalloc() Albert Esteve
@ 2026-05-07 15:34 ` Neil Armstrong
0 siblings, 0 replies; 25+ messages in thread
From: Neil Armstrong @ 2026-05-07 15:34 UTC (permalink / raw)
To: Albert Esteve, Jessica Zhang, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Michael Tretter,
Michael Walle, Dario Binacchi
Cc: dri-devel, linux-kernel
On 5/7/26 13:52, Albert Esteve wrote:
> Move to using the new API devm_drm_panel_alloc() to allocate the
> panel. In the call to the new API, avoid using explicit type and use
> __typeof() for more type safety. Also deduplicate the prepare_prev_first
> assignment that was set both before and after drm_panel_init().
>
> Signed-off-by: Albert Esteve <aesteve@redhat.com>
> ---
> drivers/gpu/drm/panel/panel-visionox-g2647fb105.c | 13 ++++++-------
> 1 file changed, 6 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/gpu/drm/panel/panel-visionox-g2647fb105.c b/drivers/gpu/drm/panel/panel-visionox-g2647fb105.c
> index 413849f7b4dec..d5555a1731575 100644
> --- a/drivers/gpu/drm/panel/panel-visionox-g2647fb105.c
> +++ b/drivers/gpu/drm/panel/panel-visionox-g2647fb105.c
> @@ -207,9 +207,12 @@ static int visionox_g2647fb105_probe(struct mipi_dsi_device *dsi)
> struct visionox_g2647fb105 *ctx;
> int ret;
>
> - ctx = devm_kzalloc(dev, sizeof(*ctx), GFP_KERNEL);
> - if (!ctx)
> - return -ENOMEM;
> + ctx = devm_drm_panel_alloc(dev, __typeof(*ctx), panel,
> + &visionox_g2647fb105_panel_funcs,
> + DRM_MODE_CONNECTOR_DSI);
> +
> + if (IS_ERR(ctx))
> + return PTR_ERR(ctx);
>
> ret = devm_regulator_bulk_get_const(dev,
> ARRAY_SIZE(visionox_g2647fb105_supplies),
> @@ -233,10 +236,6 @@ static int visionox_g2647fb105_probe(struct mipi_dsi_device *dsi)
>
> ctx->panel.prepare_prev_first = true;
>
> - drm_panel_init(&ctx->panel, dev, &visionox_g2647fb105_panel_funcs,
> - DRM_MODE_CONNECTOR_DSI);
> - ctx->panel.prepare_prev_first = true;
> -
> ctx->panel.backlight = visionox_g2647fb105_create_backlight(dsi);
> if (IS_ERR(ctx->panel.backlight))
> return dev_err_probe(dev, PTR_ERR(ctx->panel.backlight),
>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Thanks,
Neil
^ permalink raw reply [flat|nested] 25+ messages in thread
* [PATCH 02/10] drm/panel/samsung-s6e63m0: Use refcounted allocation in place of devm_kzalloc()
2026-05-07 11:52 [PATCH 00/10] drm/panel: Use refcounted allocation for remaining panel drivers Albert Esteve
2026-05-07 11:52 ` [PATCH 01/10] drm/panel/visionox-g2647fb105: Use refcounted allocation in place of devm_kzalloc() Albert Esteve
@ 2026-05-07 11:53 ` Albert Esteve
2026-05-07 15:35 ` Neil Armstrong
2026-05-07 11:53 ` [PATCH 03/10] drm/panel/novatek-nt37700f: " Albert Esteve
` (8 subsequent siblings)
10 siblings, 1 reply; 25+ messages in thread
From: Albert Esteve @ 2026-05-07 11:53 UTC (permalink / raw)
To: Neil Armstrong, Jessica Zhang, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Michael Tretter,
Michael Walle, Dario Binacchi
Cc: dri-devel, linux-kernel, Albert Esteve
Move to using the new API devm_drm_panel_alloc() to allocate the
panel. In the call to the new API, avoid using explicit type and use
__typeof() for more type safety.
Signed-off-by: Albert Esteve <aesteve@redhat.com>
---
drivers/gpu/drm/panel/panel-samsung-s6e63m0.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/drivers/gpu/drm/panel/panel-samsung-s6e63m0.c b/drivers/gpu/drm/panel/panel-samsung-s6e63m0.c
index ea241c89593b6..997115b1e541d 100644
--- a/drivers/gpu/drm/panel/panel-samsung-s6e63m0.c
+++ b/drivers/gpu/drm/panel/panel-samsung-s6e63m0.c
@@ -677,9 +677,13 @@ int s6e63m0_probe(struct device *dev, void *trsp,
u32 max_brightness;
int ret;
- ctx = devm_kzalloc(dev, sizeof(struct s6e63m0), GFP_KERNEL);
- if (!ctx)
- return -ENOMEM;
+ ctx = devm_drm_panel_alloc(dev, __typeof(*ctx), panel,
+ &s6e63m0_drm_funcs,
+ dsi_mode ? DRM_MODE_CONNECTOR_DSI :
+ DRM_MODE_CONNECTOR_DPI);
+
+ if (IS_ERR(ctx))
+ return PTR_ERR(ctx);
ctx->transport_data = trsp;
ctx->dsi_mode = dsi_mode;
@@ -712,10 +716,6 @@ int s6e63m0_probe(struct device *dev, void *trsp,
return PTR_ERR(ctx->reset_gpio);
}
- drm_panel_init(&ctx->panel, dev, &s6e63m0_drm_funcs,
- dsi_mode ? DRM_MODE_CONNECTOR_DSI :
- DRM_MODE_CONNECTOR_DPI);
-
ret = s6e63m0_backlight_register(ctx, max_brightness);
if (ret < 0)
return ret;
--
2.53.0
^ permalink raw reply related [flat|nested] 25+ messages in thread* Re: [PATCH 02/10] drm/panel/samsung-s6e63m0: Use refcounted allocation in place of devm_kzalloc()
2026-05-07 11:53 ` [PATCH 02/10] drm/panel/samsung-s6e63m0: " Albert Esteve
@ 2026-05-07 15:35 ` Neil Armstrong
0 siblings, 0 replies; 25+ messages in thread
From: Neil Armstrong @ 2026-05-07 15:35 UTC (permalink / raw)
To: Albert Esteve, Jessica Zhang, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Michael Tretter,
Michael Walle, Dario Binacchi
Cc: dri-devel, linux-kernel
On 5/7/26 13:53, Albert Esteve wrote:
> Move to using the new API devm_drm_panel_alloc() to allocate the
> panel. In the call to the new API, avoid using explicit type and use
> __typeof() for more type safety.
>
> Signed-off-by: Albert Esteve <aesteve@redhat.com>
> ---
> drivers/gpu/drm/panel/panel-samsung-s6e63m0.c | 14 +++++++-------
> 1 file changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/gpu/drm/panel/panel-samsung-s6e63m0.c b/drivers/gpu/drm/panel/panel-samsung-s6e63m0.c
> index ea241c89593b6..997115b1e541d 100644
> --- a/drivers/gpu/drm/panel/panel-samsung-s6e63m0.c
> +++ b/drivers/gpu/drm/panel/panel-samsung-s6e63m0.c
> @@ -677,9 +677,13 @@ int s6e63m0_probe(struct device *dev, void *trsp,
> u32 max_brightness;
> int ret;
>
> - ctx = devm_kzalloc(dev, sizeof(struct s6e63m0), GFP_KERNEL);
> - if (!ctx)
> - return -ENOMEM;
> + ctx = devm_drm_panel_alloc(dev, __typeof(*ctx), panel,
> + &s6e63m0_drm_funcs,
> + dsi_mode ? DRM_MODE_CONNECTOR_DSI :
> + DRM_MODE_CONNECTOR_DPI);
> +
> + if (IS_ERR(ctx))
> + return PTR_ERR(ctx);
>
> ctx->transport_data = trsp;
> ctx->dsi_mode = dsi_mode;
> @@ -712,10 +716,6 @@ int s6e63m0_probe(struct device *dev, void *trsp,
> return PTR_ERR(ctx->reset_gpio);
> }
>
> - drm_panel_init(&ctx->panel, dev, &s6e63m0_drm_funcs,
> - dsi_mode ? DRM_MODE_CONNECTOR_DSI :
> - DRM_MODE_CONNECTOR_DPI);
> -
> ret = s6e63m0_backlight_register(ctx, max_brightness);
> if (ret < 0)
> return ret;
>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Thanks,
Neil
^ permalink raw reply [flat|nested] 25+ messages in thread
* [PATCH 03/10] drm/panel/novatek-nt37700f: Use refcounted allocation in place of devm_kzalloc()
2026-05-07 11:52 [PATCH 00/10] drm/panel: Use refcounted allocation for remaining panel drivers Albert Esteve
2026-05-07 11:52 ` [PATCH 01/10] drm/panel/visionox-g2647fb105: Use refcounted allocation in place of devm_kzalloc() Albert Esteve
2026-05-07 11:53 ` [PATCH 02/10] drm/panel/samsung-s6e63m0: " Albert Esteve
@ 2026-05-07 11:53 ` Albert Esteve
2026-05-07 15:35 ` Neil Armstrong
2026-05-07 15:35 ` Neil Armstrong
2026-05-07 11:53 ` [PATCH 04/10] drm/panel/lxd-m9189a: " Albert Esteve
` (7 subsequent siblings)
10 siblings, 2 replies; 25+ messages in thread
From: Albert Esteve @ 2026-05-07 11:53 UTC (permalink / raw)
To: Neil Armstrong, Jessica Zhang, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Michael Tretter,
Michael Walle, Dario Binacchi
Cc: dri-devel, linux-kernel, Albert Esteve
Move to using the new API devm_drm_panel_alloc() to allocate the
panel. In the call to the new API, avoid using explicit type and use
__typeof() for more type safety.
Signed-off-by: Albert Esteve <aesteve@redhat.com>
---
drivers/gpu/drm/panel/panel-novatek-nt37700f.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/drivers/gpu/drm/panel/panel-novatek-nt37700f.c b/drivers/gpu/drm/panel/panel-novatek-nt37700f.c
index 74f46a268c0f6..c221dd498fed4 100644
--- a/drivers/gpu/drm/panel/panel-novatek-nt37700f.c
+++ b/drivers/gpu/drm/panel/panel-novatek-nt37700f.c
@@ -225,9 +225,12 @@ static int nt37700f_tianma_probe(struct mipi_dsi_device *dsi)
struct nt37700f_tianma *ctx;
int ret;
- ctx = devm_kzalloc(dev, sizeof(*ctx), GFP_KERNEL);
- if (!ctx)
- return -ENOMEM;
+ ctx = devm_drm_panel_alloc(dev, __typeof(*ctx), panel,
+ &nt37700f_tianma_panel_funcs,
+ DRM_MODE_CONNECTOR_DSI);
+
+ if (IS_ERR(ctx))
+ return PTR_ERR(ctx);
ctx->supply = devm_regulator_get(dev, "power");
if (IS_ERR(ctx->supply))
@@ -247,8 +250,6 @@ static int nt37700f_tianma_probe(struct mipi_dsi_device *dsi)
dsi->mode_flags = MIPI_DSI_MODE_VIDEO_BURST |
MIPI_DSI_CLOCK_NON_CONTINUOUS | MIPI_DSI_MODE_LPM;
- drm_panel_init(&ctx->panel, dev, &nt37700f_tianma_panel_funcs,
- DRM_MODE_CONNECTOR_DSI);
ctx->panel.prepare_prev_first = true;
ctx->panel.backlight = nt37700f_tianma_create_backlight(dsi);
--
2.53.0
^ permalink raw reply related [flat|nested] 25+ messages in thread* Re: [PATCH 03/10] drm/panel/novatek-nt37700f: Use refcounted allocation in place of devm_kzalloc()
2026-05-07 11:53 ` [PATCH 03/10] drm/panel/novatek-nt37700f: " Albert Esteve
@ 2026-05-07 15:35 ` Neil Armstrong
2026-05-07 15:35 ` Neil Armstrong
1 sibling, 0 replies; 25+ messages in thread
From: Neil Armstrong @ 2026-05-07 15:35 UTC (permalink / raw)
To: Albert Esteve, Jessica Zhang, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Michael Tretter,
Michael Walle, Dario Binacchi
Cc: dri-devel, linux-kernel
On 5/7/26 13:53, Albert Esteve wrote:
> Move to using the new API devm_drm_panel_alloc() to allocate the
> panel. In the call to the new API, avoid using explicit type and use
> __typeof() for more type safety.
>
> Signed-off-by: Albert Esteve <aesteve@redhat.com>
> ---
> drivers/gpu/drm/panel/panel-novatek-nt37700f.c | 11 ++++++-----
> 1 file changed, 6 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/gpu/drm/panel/panel-novatek-nt37700f.c b/drivers/gpu/drm/panel/panel-novatek-nt37700f.c
> index 74f46a268c0f6..c221dd498fed4 100644
> --- a/drivers/gpu/drm/panel/panel-novatek-nt37700f.c
> +++ b/drivers/gpu/drm/panel/panel-novatek-nt37700f.c
> @@ -225,9 +225,12 @@ static int nt37700f_tianma_probe(struct mipi_dsi_device *dsi)
> struct nt37700f_tianma *ctx;
> int ret;
>
> - ctx = devm_kzalloc(dev, sizeof(*ctx), GFP_KERNEL);
> - if (!ctx)
> - return -ENOMEM;
> + ctx = devm_drm_panel_alloc(dev, __typeof(*ctx), panel,
> + &nt37700f_tianma_panel_funcs,
> + DRM_MODE_CONNECTOR_DSI);
> +
> + if (IS_ERR(ctx))
> + return PTR_ERR(ctx);
>
> ctx->supply = devm_regulator_get(dev, "power");
> if (IS_ERR(ctx->supply))
> @@ -247,8 +250,6 @@ static int nt37700f_tianma_probe(struct mipi_dsi_device *dsi)
> dsi->mode_flags = MIPI_DSI_MODE_VIDEO_BURST |
> MIPI_DSI_CLOCK_NON_CONTINUOUS | MIPI_DSI_MODE_LPM;
>
> - drm_panel_init(&ctx->panel, dev, &nt37700f_tianma_panel_funcs,
> - DRM_MODE_CONNECTOR_DSI);
> ctx->panel.prepare_prev_first = true;
>
> ctx->panel.backlight = nt37700f_tianma_create_backlight(dsi);
>
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH 03/10] drm/panel/novatek-nt37700f: Use refcounted allocation in place of devm_kzalloc()
2026-05-07 11:53 ` [PATCH 03/10] drm/panel/novatek-nt37700f: " Albert Esteve
2026-05-07 15:35 ` Neil Armstrong
@ 2026-05-07 15:35 ` Neil Armstrong
1 sibling, 0 replies; 25+ messages in thread
From: Neil Armstrong @ 2026-05-07 15:35 UTC (permalink / raw)
To: Albert Esteve, Jessica Zhang, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Michael Tretter,
Michael Walle, Dario Binacchi
Cc: dri-devel, linux-kernel
On 5/7/26 13:53, Albert Esteve wrote:
> Move to using the new API devm_drm_panel_alloc() to allocate the
> panel. In the call to the new API, avoid using explicit type and use
> __typeof() for more type safety.
>
> Signed-off-by: Albert Esteve <aesteve@redhat.com>
> ---
> drivers/gpu/drm/panel/panel-novatek-nt37700f.c | 11 ++++++-----
> 1 file changed, 6 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/gpu/drm/panel/panel-novatek-nt37700f.c b/drivers/gpu/drm/panel/panel-novatek-nt37700f.c
> index 74f46a268c0f6..c221dd498fed4 100644
> --- a/drivers/gpu/drm/panel/panel-novatek-nt37700f.c
> +++ b/drivers/gpu/drm/panel/panel-novatek-nt37700f.c
> @@ -225,9 +225,12 @@ static int nt37700f_tianma_probe(struct mipi_dsi_device *dsi)
> struct nt37700f_tianma *ctx;
> int ret;
>
> - ctx = devm_kzalloc(dev, sizeof(*ctx), GFP_KERNEL);
> - if (!ctx)
> - return -ENOMEM;
> + ctx = devm_drm_panel_alloc(dev, __typeof(*ctx), panel,
> + &nt37700f_tianma_panel_funcs,
> + DRM_MODE_CONNECTOR_DSI);
> +
> + if (IS_ERR(ctx))
> + return PTR_ERR(ctx);
>
> ctx->supply = devm_regulator_get(dev, "power");
> if (IS_ERR(ctx->supply))
> @@ -247,8 +250,6 @@ static int nt37700f_tianma_probe(struct mipi_dsi_device *dsi)
> dsi->mode_flags = MIPI_DSI_MODE_VIDEO_BURST |
> MIPI_DSI_CLOCK_NON_CONTINUOUS | MIPI_DSI_MODE_LPM;
>
> - drm_panel_init(&ctx->panel, dev, &nt37700f_tianma_panel_funcs,
> - DRM_MODE_CONNECTOR_DSI);
> ctx->panel.prepare_prev_first = true;
>
> ctx->panel.backlight = nt37700f_tianma_create_backlight(dsi);
>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Thanks,
Neil
^ permalink raw reply [flat|nested] 25+ messages in thread
* [PATCH 04/10] drm/panel/lxd-m9189a: Use refcounted allocation in place of devm_kzalloc()
2026-05-07 11:52 [PATCH 00/10] drm/panel: Use refcounted allocation for remaining panel drivers Albert Esteve
` (2 preceding siblings ...)
2026-05-07 11:53 ` [PATCH 03/10] drm/panel/novatek-nt37700f: " Albert Esteve
@ 2026-05-07 11:53 ` Albert Esteve
2026-05-07 15:35 ` Neil Armstrong
2026-05-07 11:53 ` [PATCH 05/10] drm/panel/ilitek-ili9806e: " Albert Esteve
` (6 subsequent siblings)
10 siblings, 1 reply; 25+ messages in thread
From: Albert Esteve @ 2026-05-07 11:53 UTC (permalink / raw)
To: Neil Armstrong, Jessica Zhang, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Michael Tretter,
Michael Walle, Dario Binacchi
Cc: dri-devel, linux-kernel, Albert Esteve
Move to using the new API devm_drm_panel_alloc() to allocate the
panel. In the call to the new API, avoid using explicit type and use
__typeof() for more type safety.
Signed-off-by: Albert Esteve <aesteve@redhat.com>
---
drivers/gpu/drm/panel/panel-lxd-m9189a.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/drivers/gpu/drm/panel/panel-lxd-m9189a.c b/drivers/gpu/drm/panel/panel-lxd-m9189a.c
index 68019e1e43a96..baaf170779e03 100644
--- a/drivers/gpu/drm/panel/panel-lxd-m9189a.c
+++ b/drivers/gpu/drm/panel/panel-lxd-m9189a.c
@@ -165,9 +165,12 @@ static int lxd_m9189_probe(struct mipi_dsi_device *dsi)
struct m9189_panel *m9189;
int ret;
- m9189 = devm_kzalloc(dev, sizeof(*m9189), GFP_KERNEL);
- if (!m9189)
- return -ENOMEM;
+ m9189 = devm_drm_panel_alloc(dev, __typeof(*m9189), panel,
+ &m9189_panel_funcs,
+ DRM_MODE_CONNECTOR_DSI);
+
+ if (IS_ERR(m9189))
+ return PTR_ERR(m9189);
m9189->supply = devm_regulator_get(dev, "power");
if (IS_ERR(m9189->supply))
@@ -191,8 +194,6 @@ static int lxd_m9189_probe(struct mipi_dsi_device *dsi)
dsi->format = MIPI_DSI_FMT_RGB888;
dsi->mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST;
- drm_panel_init(&m9189->panel, dev, &m9189_panel_funcs,
- DRM_MODE_CONNECTOR_DSI);
m9189->panel.prepare_prev_first = true;
ret = drm_panel_of_backlight(&m9189->panel);
--
2.53.0
^ permalink raw reply related [flat|nested] 25+ messages in thread* Re: [PATCH 04/10] drm/panel/lxd-m9189a: Use refcounted allocation in place of devm_kzalloc()
2026-05-07 11:53 ` [PATCH 04/10] drm/panel/lxd-m9189a: " Albert Esteve
@ 2026-05-07 15:35 ` Neil Armstrong
0 siblings, 0 replies; 25+ messages in thread
From: Neil Armstrong @ 2026-05-07 15:35 UTC (permalink / raw)
To: Albert Esteve, Jessica Zhang, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Michael Tretter,
Michael Walle, Dario Binacchi
Cc: dri-devel, linux-kernel
On 5/7/26 13:53, Albert Esteve wrote:
> Move to using the new API devm_drm_panel_alloc() to allocate the
> panel. In the call to the new API, avoid using explicit type and use
> __typeof() for more type safety.
>
> Signed-off-by: Albert Esteve <aesteve@redhat.com>
> ---
> drivers/gpu/drm/panel/panel-lxd-m9189a.c | 11 ++++++-----
> 1 file changed, 6 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/gpu/drm/panel/panel-lxd-m9189a.c b/drivers/gpu/drm/panel/panel-lxd-m9189a.c
> index 68019e1e43a96..baaf170779e03 100644
> --- a/drivers/gpu/drm/panel/panel-lxd-m9189a.c
> +++ b/drivers/gpu/drm/panel/panel-lxd-m9189a.c
> @@ -165,9 +165,12 @@ static int lxd_m9189_probe(struct mipi_dsi_device *dsi)
> struct m9189_panel *m9189;
> int ret;
>
> - m9189 = devm_kzalloc(dev, sizeof(*m9189), GFP_KERNEL);
> - if (!m9189)
> - return -ENOMEM;
> + m9189 = devm_drm_panel_alloc(dev, __typeof(*m9189), panel,
> + &m9189_panel_funcs,
> + DRM_MODE_CONNECTOR_DSI);
> +
> + if (IS_ERR(m9189))
> + return PTR_ERR(m9189);
>
> m9189->supply = devm_regulator_get(dev, "power");
> if (IS_ERR(m9189->supply))
> @@ -191,8 +194,6 @@ static int lxd_m9189_probe(struct mipi_dsi_device *dsi)
> dsi->format = MIPI_DSI_FMT_RGB888;
> dsi->mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST;
>
> - drm_panel_init(&m9189->panel, dev, &m9189_panel_funcs,
> - DRM_MODE_CONNECTOR_DSI);
> m9189->panel.prepare_prev_first = true;
>
> ret = drm_panel_of_backlight(&m9189->panel);
>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Thanks,
Neil
^ permalink raw reply [flat|nested] 25+ messages in thread
* [PATCH 05/10] drm/panel/ilitek-ili9806e: Use refcounted allocation in place of devm_kzalloc()
2026-05-07 11:52 [PATCH 00/10] drm/panel: Use refcounted allocation for remaining panel drivers Albert Esteve
` (3 preceding siblings ...)
2026-05-07 11:53 ` [PATCH 04/10] drm/panel/lxd-m9189a: " Albert Esteve
@ 2026-05-07 11:53 ` Albert Esteve
2026-05-07 15:35 ` Neil Armstrong
2026-05-07 11:53 ` [PATCH 06/10] drm/panel/tdo-tl070wsh30: " Albert Esteve
` (5 subsequent siblings)
10 siblings, 1 reply; 25+ messages in thread
From: Albert Esteve @ 2026-05-07 11:53 UTC (permalink / raw)
To: Neil Armstrong, Jessica Zhang, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Michael Tretter,
Michael Walle, Dario Binacchi
Cc: dri-devel, linux-kernel, Albert Esteve
Move to using the new API devm_drm_panel_alloc() to allocate the
panel. In the call to the new API, avoid using explicit type and use
__typeof() for more type safety.
Signed-off-by: Albert Esteve <aesteve@redhat.com>
---
drivers/gpu/drm/panel/panel-ilitek-ili9806e-core.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/gpu/drm/panel/panel-ilitek-ili9806e-core.c b/drivers/gpu/drm/panel/panel-ilitek-ili9806e-core.c
index be2cf14401553..53e25d1086db8 100644
--- a/drivers/gpu/drm/panel/panel-ilitek-ili9806e-core.c
+++ b/drivers/gpu/drm/panel/panel-ilitek-ili9806e-core.c
@@ -78,9 +78,11 @@ int ili9806e_probe(struct device *dev, void *transport,
bool set_prepare_prev_first = false;
int ret;
- ctx = devm_kzalloc(dev, sizeof(struct ili9806e), GFP_KERNEL);
- if (!ctx)
- return -ENOMEM;
+ ctx = devm_drm_panel_alloc(dev, __typeof(*ctx), panel,
+ funcs, connector_type);
+
+ if (IS_ERR(ctx))
+ return PTR_ERR(ctx);
dev_set_drvdata(dev, ctx);
ctx->transport = transport;
@@ -103,8 +105,6 @@ int ili9806e_probe(struct device *dev, void *transport,
return dev_err_probe(dev, PTR_ERR(ctx->reset_gpio),
"Failed to get reset-gpios\n");
- drm_panel_init(&ctx->panel, dev, funcs, connector_type);
-
ret = drm_panel_of_backlight(&ctx->panel);
if (ret)
return dev_err_probe(dev, ret, "Failed to get backlight\n");
--
2.53.0
^ permalink raw reply related [flat|nested] 25+ messages in thread* Re: [PATCH 05/10] drm/panel/ilitek-ili9806e: Use refcounted allocation in place of devm_kzalloc()
2026-05-07 11:53 ` [PATCH 05/10] drm/panel/ilitek-ili9806e: " Albert Esteve
@ 2026-05-07 15:35 ` Neil Armstrong
0 siblings, 0 replies; 25+ messages in thread
From: Neil Armstrong @ 2026-05-07 15:35 UTC (permalink / raw)
To: Albert Esteve, Jessica Zhang, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Michael Tretter,
Michael Walle, Dario Binacchi
Cc: dri-devel, linux-kernel
On 5/7/26 13:53, Albert Esteve wrote:
> Move to using the new API devm_drm_panel_alloc() to allocate the
> panel. In the call to the new API, avoid using explicit type and use
> __typeof() for more type safety.
>
> Signed-off-by: Albert Esteve <aesteve@redhat.com>
> ---
> drivers/gpu/drm/panel/panel-ilitek-ili9806e-core.c | 10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/gpu/drm/panel/panel-ilitek-ili9806e-core.c b/drivers/gpu/drm/panel/panel-ilitek-ili9806e-core.c
> index be2cf14401553..53e25d1086db8 100644
> --- a/drivers/gpu/drm/panel/panel-ilitek-ili9806e-core.c
> +++ b/drivers/gpu/drm/panel/panel-ilitek-ili9806e-core.c
> @@ -78,9 +78,11 @@ int ili9806e_probe(struct device *dev, void *transport,
> bool set_prepare_prev_first = false;
> int ret;
>
> - ctx = devm_kzalloc(dev, sizeof(struct ili9806e), GFP_KERNEL);
> - if (!ctx)
> - return -ENOMEM;
> + ctx = devm_drm_panel_alloc(dev, __typeof(*ctx), panel,
> + funcs, connector_type);
> +
> + if (IS_ERR(ctx))
> + return PTR_ERR(ctx);
>
> dev_set_drvdata(dev, ctx);
> ctx->transport = transport;
> @@ -103,8 +105,6 @@ int ili9806e_probe(struct device *dev, void *transport,
> return dev_err_probe(dev, PTR_ERR(ctx->reset_gpio),
> "Failed to get reset-gpios\n");
>
> - drm_panel_init(&ctx->panel, dev, funcs, connector_type);
> -
> ret = drm_panel_of_backlight(&ctx->panel);
> if (ret)
> return dev_err_probe(dev, ret, "Failed to get backlight\n");
>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Thanks,
Neil
^ permalink raw reply [flat|nested] 25+ messages in thread
* [PATCH 06/10] drm/panel/tdo-tl070wsh30: Use refcounted allocation in place of devm_kzalloc()
2026-05-07 11:52 [PATCH 00/10] drm/panel: Use refcounted allocation for remaining panel drivers Albert Esteve
` (4 preceding siblings ...)
2026-05-07 11:53 ` [PATCH 05/10] drm/panel/ilitek-ili9806e: " Albert Esteve
@ 2026-05-07 11:53 ` Albert Esteve
2026-05-07 15:36 ` Neil Armstrong
2026-05-07 11:53 ` [PATCH 07/10] drm/panel/sharp-ls043t1le01: " Albert Esteve
` (4 subsequent siblings)
10 siblings, 1 reply; 25+ messages in thread
From: Albert Esteve @ 2026-05-07 11:53 UTC (permalink / raw)
To: Neil Armstrong, Jessica Zhang, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Michael Tretter,
Michael Walle, Dario Binacchi
Cc: dri-devel, linux-kernel, Albert Esteve
Move to using the new API devm_drm_panel_alloc() to allocate the
panel. In the call to the new API, avoid using explicit type and use
__typeof() for more type safety.
Signed-off-by: Albert Esteve <aesteve@redhat.com>
---
drivers/gpu/drm/panel/panel-tdo-tl070wsh30.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/drivers/gpu/drm/panel/panel-tdo-tl070wsh30.c b/drivers/gpu/drm/panel/panel-tdo-tl070wsh30.c
index 227f97f9b136f..13cfe252a838d 100644
--- a/drivers/gpu/drm/panel/panel-tdo-tl070wsh30.c
+++ b/drivers/gpu/drm/panel/panel-tdo-tl070wsh30.c
@@ -162,9 +162,6 @@ static int tdo_tl070wsh30_panel_add(struct tdo_tl070wsh30_panel *tdo_tl070wsh30)
return err;
}
- drm_panel_init(&tdo_tl070wsh30->base, &tdo_tl070wsh30->link->dev,
- &tdo_tl070wsh30_panel_funcs, DRM_MODE_CONNECTOR_DSI);
-
err = drm_panel_of_backlight(&tdo_tl070wsh30->base);
if (err)
return err;
@@ -183,10 +180,13 @@ static int tdo_tl070wsh30_panel_probe(struct mipi_dsi_device *dsi)
dsi->format = MIPI_DSI_FMT_RGB888;
dsi->mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST | MIPI_DSI_MODE_LPM;
- tdo_tl070wsh30 = devm_kzalloc(&dsi->dev, sizeof(*tdo_tl070wsh30),
- GFP_KERNEL);
- if (!tdo_tl070wsh30)
- return -ENOMEM;
+ tdo_tl070wsh30 = devm_drm_panel_alloc(&dsi->dev,
+ __typeof(*tdo_tl070wsh30), base,
+ &tdo_tl070wsh30_panel_funcs,
+ DRM_MODE_CONNECTOR_DSI);
+
+ if (IS_ERR(tdo_tl070wsh30))
+ return PTR_ERR(tdo_tl070wsh30);
mipi_dsi_set_drvdata(dsi, tdo_tl070wsh30);
tdo_tl070wsh30->link = dsi;
--
2.53.0
^ permalink raw reply related [flat|nested] 25+ messages in thread* Re: [PATCH 06/10] drm/panel/tdo-tl070wsh30: Use refcounted allocation in place of devm_kzalloc()
2026-05-07 11:53 ` [PATCH 06/10] drm/panel/tdo-tl070wsh30: " Albert Esteve
@ 2026-05-07 15:36 ` Neil Armstrong
0 siblings, 0 replies; 25+ messages in thread
From: Neil Armstrong @ 2026-05-07 15:36 UTC (permalink / raw)
To: Albert Esteve, Jessica Zhang, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Michael Tretter,
Michael Walle, Dario Binacchi
Cc: dri-devel, linux-kernel
On 5/7/26 13:53, Albert Esteve wrote:
> Move to using the new API devm_drm_panel_alloc() to allocate the
> panel. In the call to the new API, avoid using explicit type and use
> __typeof() for more type safety.
>
> Signed-off-by: Albert Esteve <aesteve@redhat.com>
> ---
> drivers/gpu/drm/panel/panel-tdo-tl070wsh30.c | 14 +++++++-------
> 1 file changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/gpu/drm/panel/panel-tdo-tl070wsh30.c b/drivers/gpu/drm/panel/panel-tdo-tl070wsh30.c
> index 227f97f9b136f..13cfe252a838d 100644
> --- a/drivers/gpu/drm/panel/panel-tdo-tl070wsh30.c
> +++ b/drivers/gpu/drm/panel/panel-tdo-tl070wsh30.c
> @@ -162,9 +162,6 @@ static int tdo_tl070wsh30_panel_add(struct tdo_tl070wsh30_panel *tdo_tl070wsh30)
> return err;
> }
>
> - drm_panel_init(&tdo_tl070wsh30->base, &tdo_tl070wsh30->link->dev,
> - &tdo_tl070wsh30_panel_funcs, DRM_MODE_CONNECTOR_DSI);
> -
> err = drm_panel_of_backlight(&tdo_tl070wsh30->base);
> if (err)
> return err;
> @@ -183,10 +180,13 @@ static int tdo_tl070wsh30_panel_probe(struct mipi_dsi_device *dsi)
> dsi->format = MIPI_DSI_FMT_RGB888;
> dsi->mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST | MIPI_DSI_MODE_LPM;
>
> - tdo_tl070wsh30 = devm_kzalloc(&dsi->dev, sizeof(*tdo_tl070wsh30),
> - GFP_KERNEL);
> - if (!tdo_tl070wsh30)
> - return -ENOMEM;
> + tdo_tl070wsh30 = devm_drm_panel_alloc(&dsi->dev,
> + __typeof(*tdo_tl070wsh30), base,
> + &tdo_tl070wsh30_panel_funcs,
> + DRM_MODE_CONNECTOR_DSI);
> +
> + if (IS_ERR(tdo_tl070wsh30))
> + return PTR_ERR(tdo_tl070wsh30);
>
> mipi_dsi_set_drvdata(dsi, tdo_tl070wsh30);
> tdo_tl070wsh30->link = dsi;
>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Thanks,
Neil
^ permalink raw reply [flat|nested] 25+ messages in thread
* [PATCH 07/10] drm/panel/sharp-ls043t1le01: Use refcounted allocation in place of devm_kzalloc()
2026-05-07 11:52 [PATCH 00/10] drm/panel: Use refcounted allocation for remaining panel drivers Albert Esteve
` (5 preceding siblings ...)
2026-05-07 11:53 ` [PATCH 06/10] drm/panel/tdo-tl070wsh30: " Albert Esteve
@ 2026-05-07 11:53 ` Albert Esteve
2026-05-07 15:36 ` Neil Armstrong
2026-05-07 11:53 ` [PATCH 08/10] drm/panel/truly-nt35597: " Albert Esteve
` (3 subsequent siblings)
10 siblings, 1 reply; 25+ messages in thread
From: Albert Esteve @ 2026-05-07 11:53 UTC (permalink / raw)
To: Neil Armstrong, Jessica Zhang, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Michael Tretter,
Michael Walle, Dario Binacchi
Cc: dri-devel, linux-kernel, Albert Esteve
Move to using the new API devm_drm_panel_alloc() to allocate the
panel. In the call to the new API, avoid using explicit type and use
__typeof() for more type safety.
Signed-off-by: Albert Esteve <aesteve@redhat.com>
---
drivers/gpu/drm/panel/panel-sharp-ls043t1le01.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/drivers/gpu/drm/panel/panel-sharp-ls043t1le01.c b/drivers/gpu/drm/panel/panel-sharp-ls043t1le01.c
index dd1eaba23ad3c..989b030ea22de 100644
--- a/drivers/gpu/drm/panel/panel-sharp-ls043t1le01.c
+++ b/drivers/gpu/drm/panel/panel-sharp-ls043t1le01.c
@@ -199,8 +199,6 @@ static int sharp_nt_panel_add(struct sharp_nt_panel *sharp_nt)
gpiod_set_value(sharp_nt->reset_gpio, 0);
}
- drm_panel_init(&sharp_nt->base, &sharp_nt->dsi->dev,
- &sharp_nt_panel_funcs, DRM_MODE_CONNECTOR_DSI);
sharp_nt->base.prepare_prev_first = true;
ret = drm_panel_of_backlight(&sharp_nt->base);
@@ -231,9 +229,12 @@ static int sharp_nt_panel_probe(struct mipi_dsi_device *dsi)
MIPI_DSI_CLOCK_NON_CONTINUOUS |
MIPI_DSI_MODE_NO_EOT_PACKET;
- sharp_nt = devm_kzalloc(&dsi->dev, sizeof(*sharp_nt), GFP_KERNEL);
- if (!sharp_nt)
- return -ENOMEM;
+ sharp_nt = devm_drm_panel_alloc(&dsi->dev, __typeof(*sharp_nt), base,
+ &sharp_nt_panel_funcs,
+ DRM_MODE_CONNECTOR_DSI);
+
+ if (IS_ERR(sharp_nt))
+ return PTR_ERR(sharp_nt);
mipi_dsi_set_drvdata(dsi, sharp_nt);
--
2.53.0
^ permalink raw reply related [flat|nested] 25+ messages in thread* Re: [PATCH 07/10] drm/panel/sharp-ls043t1le01: Use refcounted allocation in place of devm_kzalloc()
2026-05-07 11:53 ` [PATCH 07/10] drm/panel/sharp-ls043t1le01: " Albert Esteve
@ 2026-05-07 15:36 ` Neil Armstrong
0 siblings, 0 replies; 25+ messages in thread
From: Neil Armstrong @ 2026-05-07 15:36 UTC (permalink / raw)
To: Albert Esteve, Jessica Zhang, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Michael Tretter,
Michael Walle, Dario Binacchi
Cc: dri-devel, linux-kernel
On 5/7/26 13:53, Albert Esteve wrote:
> Move to using the new API devm_drm_panel_alloc() to allocate the
> panel. In the call to the new API, avoid using explicit type and use
> __typeof() for more type safety.
>
> Signed-off-by: Albert Esteve <aesteve@redhat.com>
> ---
> drivers/gpu/drm/panel/panel-sharp-ls043t1le01.c | 11 ++++++-----
> 1 file changed, 6 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/gpu/drm/panel/panel-sharp-ls043t1le01.c b/drivers/gpu/drm/panel/panel-sharp-ls043t1le01.c
> index dd1eaba23ad3c..989b030ea22de 100644
> --- a/drivers/gpu/drm/panel/panel-sharp-ls043t1le01.c
> +++ b/drivers/gpu/drm/panel/panel-sharp-ls043t1le01.c
> @@ -199,8 +199,6 @@ static int sharp_nt_panel_add(struct sharp_nt_panel *sharp_nt)
> gpiod_set_value(sharp_nt->reset_gpio, 0);
> }
>
> - drm_panel_init(&sharp_nt->base, &sharp_nt->dsi->dev,
> - &sharp_nt_panel_funcs, DRM_MODE_CONNECTOR_DSI);
> sharp_nt->base.prepare_prev_first = true;
>
> ret = drm_panel_of_backlight(&sharp_nt->base);
> @@ -231,9 +229,12 @@ static int sharp_nt_panel_probe(struct mipi_dsi_device *dsi)
> MIPI_DSI_CLOCK_NON_CONTINUOUS |
> MIPI_DSI_MODE_NO_EOT_PACKET;
>
> - sharp_nt = devm_kzalloc(&dsi->dev, sizeof(*sharp_nt), GFP_KERNEL);
> - if (!sharp_nt)
> - return -ENOMEM;
> + sharp_nt = devm_drm_panel_alloc(&dsi->dev, __typeof(*sharp_nt), base,
> + &sharp_nt_panel_funcs,
> + DRM_MODE_CONNECTOR_DSI);
> +
> + if (IS_ERR(sharp_nt))
> + return PTR_ERR(sharp_nt);
>
> mipi_dsi_set_drvdata(dsi, sharp_nt);
>
>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Thanks,
Neil
^ permalink raw reply [flat|nested] 25+ messages in thread
* [PATCH 08/10] drm/panel/truly-nt35597: Use refcounted allocation in place of devm_kzalloc()
2026-05-07 11:52 [PATCH 00/10] drm/panel: Use refcounted allocation for remaining panel drivers Albert Esteve
` (6 preceding siblings ...)
2026-05-07 11:53 ` [PATCH 07/10] drm/panel/sharp-ls043t1le01: " Albert Esteve
@ 2026-05-07 11:53 ` Albert Esteve
2026-05-07 15:37 ` Neil Armstrong
2026-05-07 11:53 ` [PATCH 09/10] drm/panel/startek-kd070fhfid015: " Albert Esteve
` (2 subsequent siblings)
10 siblings, 1 reply; 25+ messages in thread
From: Albert Esteve @ 2026-05-07 11:53 UTC (permalink / raw)
To: Neil Armstrong, Jessica Zhang, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Michael Tretter,
Michael Walle, Dario Binacchi
Cc: dri-devel, linux-kernel, Albert Esteve
Move to using the new API devm_drm_panel_alloc() to allocate the
panel. In the call to the new API, avoid using explicit type and use
__typeof() for more type safety.
Signed-off-by: Albert Esteve <aesteve@redhat.com>
---
drivers/gpu/drm/panel/panel-truly-nt35597.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/gpu/drm/panel/panel-truly-nt35597.c b/drivers/gpu/drm/panel/panel-truly-nt35597.c
index d447db912a61e..f740b9257c09c 100644
--- a/drivers/gpu/drm/panel/panel-truly-nt35597.c
+++ b/drivers/gpu/drm/panel/panel-truly-nt35597.c
@@ -476,8 +476,6 @@ static int truly_nt35597_panel_add(struct truly_nt35597 *ctx)
/* dual port */
gpiod_set_value(ctx->mode_gpio, 0);
- drm_panel_init(&ctx->panel, dev, &truly_nt35597_drm_funcs,
- DRM_MODE_CONNECTOR_DSI);
drm_panel_add(&ctx->panel);
return 0;
@@ -523,10 +521,12 @@ static int truly_nt35597_probe(struct mipi_dsi_device *dsi)
.node = NULL,
};
- ctx = devm_kzalloc(dev, sizeof(*ctx), GFP_KERNEL);
+ ctx = devm_drm_panel_alloc(dev, __typeof(*ctx), panel,
+ &truly_nt35597_drm_funcs,
+ DRM_MODE_CONNECTOR_DSI);
- if (!ctx)
- return -ENOMEM;
+ if (IS_ERR(ctx))
+ return PTR_ERR(ctx);
/*
* This device represents itself as one with two input ports which are
--
2.53.0
^ permalink raw reply related [flat|nested] 25+ messages in thread* Re: [PATCH 08/10] drm/panel/truly-nt35597: Use refcounted allocation in place of devm_kzalloc()
2026-05-07 11:53 ` [PATCH 08/10] drm/panel/truly-nt35597: " Albert Esteve
@ 2026-05-07 15:37 ` Neil Armstrong
0 siblings, 0 replies; 25+ messages in thread
From: Neil Armstrong @ 2026-05-07 15:37 UTC (permalink / raw)
To: Albert Esteve, Jessica Zhang, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Michael Tretter,
Michael Walle, Dario Binacchi
Cc: dri-devel, linux-kernel
On 5/7/26 13:53, Albert Esteve wrote:
> Move to using the new API devm_drm_panel_alloc() to allocate the
> panel. In the call to the new API, avoid using explicit type and use
> __typeof() for more type safety.
>
> Signed-off-by: Albert Esteve <aesteve@redhat.com>
> ---
> drivers/gpu/drm/panel/panel-truly-nt35597.c | 10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/gpu/drm/panel/panel-truly-nt35597.c b/drivers/gpu/drm/panel/panel-truly-nt35597.c
> index d447db912a61e..f740b9257c09c 100644
> --- a/drivers/gpu/drm/panel/panel-truly-nt35597.c
> +++ b/drivers/gpu/drm/panel/panel-truly-nt35597.c
> @@ -476,8 +476,6 @@ static int truly_nt35597_panel_add(struct truly_nt35597 *ctx)
> /* dual port */
> gpiod_set_value(ctx->mode_gpio, 0);
>
> - drm_panel_init(&ctx->panel, dev, &truly_nt35597_drm_funcs,
> - DRM_MODE_CONNECTOR_DSI);
> drm_panel_add(&ctx->panel);
>
> return 0;
> @@ -523,10 +521,12 @@ static int truly_nt35597_probe(struct mipi_dsi_device *dsi)
> .node = NULL,
> };
>
> - ctx = devm_kzalloc(dev, sizeof(*ctx), GFP_KERNEL);
> + ctx = devm_drm_panel_alloc(dev, __typeof(*ctx), panel,
> + &truly_nt35597_drm_funcs,
> + DRM_MODE_CONNECTOR_DSI);
>
> - if (!ctx)
> - return -ENOMEM;
> + if (IS_ERR(ctx))
> + return PTR_ERR(ctx);
>
> /*
> * This device represents itself as one with two input ports which are
>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Thanks,
Neil
^ permalink raw reply [flat|nested] 25+ messages in thread
* [PATCH 09/10] drm/panel/startek-kd070fhfid015: Use refcounted allocation in place of devm_kzalloc()
2026-05-07 11:52 [PATCH 00/10] drm/panel: Use refcounted allocation for remaining panel drivers Albert Esteve
` (7 preceding siblings ...)
2026-05-07 11:53 ` [PATCH 08/10] drm/panel/truly-nt35597: " Albert Esteve
@ 2026-05-07 11:53 ` Albert Esteve
2026-05-07 15:37 ` Neil Armstrong
2026-05-07 11:53 ` [PATCH 10/10] drm/panel: Make drm_panel_init() static Albert Esteve
2026-05-07 14:57 ` [PATCH 00/10] drm/panel: Use refcounted allocation for remaining panel drivers Maxime Ripard
10 siblings, 1 reply; 25+ messages in thread
From: Albert Esteve @ 2026-05-07 11:53 UTC (permalink / raw)
To: Neil Armstrong, Jessica Zhang, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Michael Tretter,
Michael Walle, Dario Binacchi
Cc: dri-devel, linux-kernel, Albert Esteve
Move to using the new API devm_drm_panel_alloc() to allocate the
panel. In the call to the new API, avoid using explicit type and use
__typeof() for more type safety.
Signed-off-by: Albert Esteve <aesteve@redhat.com>
---
drivers/gpu/drm/panel/panel-startek-kd070fhfid015.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/gpu/drm/panel/panel-startek-kd070fhfid015.c b/drivers/gpu/drm/panel/panel-startek-kd070fhfid015.c
index c0c95355b7435..7f04b7b404e7d 100644
--- a/drivers/gpu/drm/panel/panel-startek-kd070fhfid015.c
+++ b/drivers/gpu/drm/panel/panel-startek-kd070fhfid015.c
@@ -286,9 +286,6 @@ static int stk_panel_add(struct stk_panel *stk)
return ret;
}
- drm_panel_init(&stk->base, &stk->dsi->dev, &stk_panel_funcs,
- DRM_MODE_CONNECTOR_DSI);
-
drm_panel_add(&stk->base);
return 0;
@@ -303,9 +300,12 @@ static int stk_panel_probe(struct mipi_dsi_device *dsi)
dsi->format = MIPI_DSI_FMT_RGB888;
dsi->mode_flags = (MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_LPM);
- stk = devm_kzalloc(&dsi->dev, sizeof(*stk), GFP_KERNEL);
- if (!stk)
- return -ENOMEM;
+ stk = devm_drm_panel_alloc(&dsi->dev, __typeof(*stk), base,
+ &stk_panel_funcs,
+ DRM_MODE_CONNECTOR_DSI);
+
+ if (IS_ERR(stk))
+ return PTR_ERR(stk);
mipi_dsi_set_drvdata(dsi, stk);
--
2.53.0
^ permalink raw reply related [flat|nested] 25+ messages in thread* Re: [PATCH 09/10] drm/panel/startek-kd070fhfid015: Use refcounted allocation in place of devm_kzalloc()
2026-05-07 11:53 ` [PATCH 09/10] drm/panel/startek-kd070fhfid015: " Albert Esteve
@ 2026-05-07 15:37 ` Neil Armstrong
0 siblings, 0 replies; 25+ messages in thread
From: Neil Armstrong @ 2026-05-07 15:37 UTC (permalink / raw)
To: Albert Esteve, Jessica Zhang, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Michael Tretter,
Michael Walle, Dario Binacchi
Cc: dri-devel, linux-kernel
On 5/7/26 13:53, Albert Esteve wrote:
> Move to using the new API devm_drm_panel_alloc() to allocate the
> panel. In the call to the new API, avoid using explicit type and use
> __typeof() for more type safety.
>
> Signed-off-by: Albert Esteve <aesteve@redhat.com>
> ---
> drivers/gpu/drm/panel/panel-startek-kd070fhfid015.c | 12 ++++++------
> 1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/panel/panel-startek-kd070fhfid015.c b/drivers/gpu/drm/panel/panel-startek-kd070fhfid015.c
> index c0c95355b7435..7f04b7b404e7d 100644
> --- a/drivers/gpu/drm/panel/panel-startek-kd070fhfid015.c
> +++ b/drivers/gpu/drm/panel/panel-startek-kd070fhfid015.c
> @@ -286,9 +286,6 @@ static int stk_panel_add(struct stk_panel *stk)
> return ret;
> }
>
> - drm_panel_init(&stk->base, &stk->dsi->dev, &stk_panel_funcs,
> - DRM_MODE_CONNECTOR_DSI);
> -
> drm_panel_add(&stk->base);
>
> return 0;
> @@ -303,9 +300,12 @@ static int stk_panel_probe(struct mipi_dsi_device *dsi)
> dsi->format = MIPI_DSI_FMT_RGB888;
> dsi->mode_flags = (MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_LPM);
>
> - stk = devm_kzalloc(&dsi->dev, sizeof(*stk), GFP_KERNEL);
> - if (!stk)
> - return -ENOMEM;
> + stk = devm_drm_panel_alloc(&dsi->dev, __typeof(*stk), base,
> + &stk_panel_funcs,
> + DRM_MODE_CONNECTOR_DSI);
> +
> + if (IS_ERR(stk))
> + return PTR_ERR(stk);
>
> mipi_dsi_set_drvdata(dsi, stk);
>
>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Thanks,
Neil
^ permalink raw reply [flat|nested] 25+ messages in thread
* [PATCH 10/10] drm/panel: Make drm_panel_init() static
2026-05-07 11:52 [PATCH 00/10] drm/panel: Use refcounted allocation for remaining panel drivers Albert Esteve
` (8 preceding siblings ...)
2026-05-07 11:53 ` [PATCH 09/10] drm/panel/startek-kd070fhfid015: " Albert Esteve
@ 2026-05-07 11:53 ` Albert Esteve
2026-05-07 14:57 ` Maxime Ripard
2026-05-07 14:57 ` [PATCH 00/10] drm/panel: Use refcounted allocation for remaining panel drivers Maxime Ripard
10 siblings, 1 reply; 25+ messages in thread
From: Albert Esteve @ 2026-05-07 11:53 UTC (permalink / raw)
To: Neil Armstrong, Jessica Zhang, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Michael Tretter,
Michael Walle, Dario Binacchi
Cc: dri-devel, linux-kernel, Albert Esteve
Now that all panel drivers use devm_drm_panel_alloc(),
there are no external callers of drm_panel_init().
Make it static to prevent new users from bypassing the
refcounted allocation path.
Remove stale references to drm_panel_init() in kdocs.
Signed-off-by: Albert Esteve <aesteve@redhat.com>
---
drivers/gpu/drm/display/drm_dp_helper.c | 2 +-
drivers/gpu/drm/drm_panel.c | 8 ++++----
include/drm/drm_panel.h | 4 ----
3 files changed, 5 insertions(+), 9 deletions(-)
diff --git a/drivers/gpu/drm/display/drm_dp_helper.c b/drivers/gpu/drm/display/drm_dp_helper.c
index a697cc227e289..380ebf0fad2be 100644
--- a/drivers/gpu/drm/display/drm_dp_helper.c
+++ b/drivers/gpu/drm/display/drm_dp_helper.c
@@ -4626,7 +4626,7 @@ static const struct backlight_ops dp_aux_bl_ops = {
* Backlight will then be handled transparently without requiring
* any intervention from the driver.
*
- * drm_panel_dp_aux_backlight() must be called after the call to drm_panel_init().
+ * drm_panel_dp_aux_backlight() must be called after devm_drm_panel_alloc().
*
* Return: 0 on success or a negative error code on failure.
*/
diff --git a/drivers/gpu/drm/drm_panel.c b/drivers/gpu/drm/drm_panel.c
index d1e6598ea3bc0..e3e1c5ceb8ff8 100644
--- a/drivers/gpu/drm/drm_panel.c
+++ b/drivers/gpu/drm/drm_panel.c
@@ -56,8 +56,9 @@ static LIST_HEAD(panel_list);
* Initialize the panel structure for subsequent registration with
* drm_panel_add().
*/
-void drm_panel_init(struct drm_panel *panel, struct device *dev,
- const struct drm_panel_funcs *funcs, int connector_type)
+static void drm_panel_init(struct drm_panel *panel, struct device *dev,
+ const struct drm_panel_funcs *funcs,
+ int connector_type)
{
if (connector_type == DRM_MODE_CONNECTOR_Unknown)
DRM_WARN("%s: %s: a valid connector type is required!\n", __func__, dev_name(dev));
@@ -69,7 +70,6 @@ void drm_panel_init(struct drm_panel *panel, struct device *dev,
panel->funcs = funcs;
panel->connector_type = connector_type;
}
-EXPORT_SYMBOL(drm_panel_init);
/**
* drm_panel_add - add a panel to the global registry
@@ -708,7 +708,7 @@ EXPORT_SYMBOL(devm_drm_panel_add_follower);
* A typical implementation for a panel driver supporting device tree
* will call this function at probe time. Backlight will then be handled
* transparently without requiring any intervention from the driver.
- * drm_panel_of_backlight() must be called after the call to drm_panel_init().
+ * drm_panel_of_backlight() must be called after devm_drm_panel_alloc().
*
* Return: 0 on success or a negative error code on failure.
*/
diff --git a/include/drm/drm_panel.h b/include/drm/drm_panel.h
index 2407bfa60236f..55cbc51512240 100644
--- a/include/drm/drm_panel.h
+++ b/include/drm/drm_panel.h
@@ -320,10 +320,6 @@ void *__devm_drm_panel_alloc(struct device *dev, size_t size, size_t offset,
offsetof(type, member), funcs, \
connector_type))
-void drm_panel_init(struct drm_panel *panel, struct device *dev,
- const struct drm_panel_funcs *funcs,
- int connector_type);
-
struct drm_panel *drm_panel_get(struct drm_panel *panel);
void drm_panel_put(struct drm_panel *panel);
--
2.53.0
^ permalink raw reply related [flat|nested] 25+ messages in thread* Re: [PATCH 10/10] drm/panel: Make drm_panel_init() static
2026-05-07 11:53 ` [PATCH 10/10] drm/panel: Make drm_panel_init() static Albert Esteve
@ 2026-05-07 14:57 ` Maxime Ripard
2026-05-07 15:11 ` Albert Esteve
0 siblings, 1 reply; 25+ messages in thread
From: Maxime Ripard @ 2026-05-07 14:57 UTC (permalink / raw)
To: Albert Esteve
Cc: Neil Armstrong, Jessica Zhang, Maarten Lankhorst,
Thomas Zimmermann, David Airlie, Simona Vetter, Michael Tretter,
Michael Walle, Dario Binacchi, dri-devel, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 3050 bytes --]
Hi,
On Thu, May 07, 2026 at 01:53:08PM +0200, Albert Esteve wrote:
> Now that all panel drivers use devm_drm_panel_alloc(),
> there are no external callers of drm_panel_init().
> Make it static to prevent new users from bypassing the
> refcounted allocation path.
>
> Remove stale references to drm_panel_init() in kdocs.
>
> Signed-off-by: Albert Esteve <aesteve@redhat.com>
> ---
> drivers/gpu/drm/display/drm_dp_helper.c | 2 +-
> drivers/gpu/drm/drm_panel.c | 8 ++++----
> include/drm/drm_panel.h | 4 ----
> 3 files changed, 5 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/gpu/drm/display/drm_dp_helper.c b/drivers/gpu/drm/display/drm_dp_helper.c
> index a697cc227e289..380ebf0fad2be 100644
> --- a/drivers/gpu/drm/display/drm_dp_helper.c
> +++ b/drivers/gpu/drm/display/drm_dp_helper.c
> @@ -4626,7 +4626,7 @@ static const struct backlight_ops dp_aux_bl_ops = {
> * Backlight will then be handled transparently without requiring
> * any intervention from the driver.
> *
> - * drm_panel_dp_aux_backlight() must be called after the call to drm_panel_init().
> + * drm_panel_dp_aux_backlight() must be called after devm_drm_panel_alloc().
> *
> * Return: 0 on success or a negative error code on failure.
> */
> diff --git a/drivers/gpu/drm/drm_panel.c b/drivers/gpu/drm/drm_panel.c
> index d1e6598ea3bc0..e3e1c5ceb8ff8 100644
> --- a/drivers/gpu/drm/drm_panel.c
> +++ b/drivers/gpu/drm/drm_panel.c
> @@ -56,8 +56,9 @@ static LIST_HEAD(panel_list);
> * Initialize the panel structure for subsequent registration with
> * drm_panel_add().
> */
> -void drm_panel_init(struct drm_panel *panel, struct device *dev,
> - const struct drm_panel_funcs *funcs, int connector_type)
> +static void drm_panel_init(struct drm_panel *panel, struct device *dev,
> + const struct drm_panel_funcs *funcs,
> + int connector_type)
> {
> if (connector_type == DRM_MODE_CONNECTOR_Unknown)
> DRM_WARN("%s: %s: a valid connector type is required!\n", __func__, dev_name(dev));
> @@ -69,7 +70,6 @@ void drm_panel_init(struct drm_panel *panel, struct device *dev,
> panel->funcs = funcs;
> panel->connector_type = connector_type;
> }
> -EXPORT_SYMBOL(drm_panel_init);
>
> /**
> * drm_panel_add - add a panel to the global registry
> @@ -708,7 +708,7 @@ EXPORT_SYMBOL(devm_drm_panel_add_follower);
> * A typical implementation for a panel driver supporting device tree
> * will call this function at probe time. Backlight will then be handled
> * transparently without requiring any intervention from the driver.
> - * drm_panel_of_backlight() must be called after the call to drm_panel_init().
> + * drm_panel_of_backlight() must be called after devm_drm_panel_alloc().
I think we can drop that sentence entirely. Now that we can only get a
panel structure through devm_drm_panel_alloc, and that it also
initializes it, we can't call drm_panel_of_backlight before having an
initialized drm_panel.
Maxime
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 273 bytes --]
^ permalink raw reply [flat|nested] 25+ messages in thread* Re: [PATCH 10/10] drm/panel: Make drm_panel_init() static
2026-05-07 14:57 ` Maxime Ripard
@ 2026-05-07 15:11 ` Albert Esteve
2026-05-07 15:29 ` Maxime Ripard
0 siblings, 1 reply; 25+ messages in thread
From: Albert Esteve @ 2026-05-07 15:11 UTC (permalink / raw)
To: Maxime Ripard
Cc: Neil Armstrong, Jessica Zhang, Maarten Lankhorst,
Thomas Zimmermann, David Airlie, Simona Vetter, Michael Tretter,
Michael Walle, Dario Binacchi, dri-devel, linux-kernel
On Thu, May 7, 2026 at 4:57 PM Maxime Ripard <mripard@kernel.org> wrote:
>
> Hi,
>
> On Thu, May 07, 2026 at 01:53:08PM +0200, Albert Esteve wrote:
> > Now that all panel drivers use devm_drm_panel_alloc(),
> > there are no external callers of drm_panel_init().
> > Make it static to prevent new users from bypassing the
> > refcounted allocation path.
> >
> > Remove stale references to drm_panel_init() in kdocs.
> >
> > Signed-off-by: Albert Esteve <aesteve@redhat.com>
> > ---
> > drivers/gpu/drm/display/drm_dp_helper.c | 2 +-
> > drivers/gpu/drm/drm_panel.c | 8 ++++----
> > include/drm/drm_panel.h | 4 ----
> > 3 files changed, 5 insertions(+), 9 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/display/drm_dp_helper.c b/drivers/gpu/drm/display/drm_dp_helper.c
> > index a697cc227e289..380ebf0fad2be 100644
> > --- a/drivers/gpu/drm/display/drm_dp_helper.c
> > +++ b/drivers/gpu/drm/display/drm_dp_helper.c
> > @@ -4626,7 +4626,7 @@ static const struct backlight_ops dp_aux_bl_ops = {
> > * Backlight will then be handled transparently without requiring
> > * any intervention from the driver.
> > *
> > - * drm_panel_dp_aux_backlight() must be called after the call to drm_panel_init().
> > + * drm_panel_dp_aux_backlight() must be called after devm_drm_panel_alloc().
> > *
> > * Return: 0 on success or a negative error code on failure.
> > */
> > diff --git a/drivers/gpu/drm/drm_panel.c b/drivers/gpu/drm/drm_panel.c
> > index d1e6598ea3bc0..e3e1c5ceb8ff8 100644
> > --- a/drivers/gpu/drm/drm_panel.c
> > +++ b/drivers/gpu/drm/drm_panel.c
> > @@ -56,8 +56,9 @@ static LIST_HEAD(panel_list);
> > * Initialize the panel structure for subsequent registration with
> > * drm_panel_add().
> > */
> > -void drm_panel_init(struct drm_panel *panel, struct device *dev,
> > - const struct drm_panel_funcs *funcs, int connector_type)
> > +static void drm_panel_init(struct drm_panel *panel, struct device *dev,
> > + const struct drm_panel_funcs *funcs,
> > + int connector_type)
> > {
> > if (connector_type == DRM_MODE_CONNECTOR_Unknown)
> > DRM_WARN("%s: %s: a valid connector type is required!\n", __func__, dev_name(dev));
> > @@ -69,7 +70,6 @@ void drm_panel_init(struct drm_panel *panel, struct device *dev,
> > panel->funcs = funcs;
> > panel->connector_type = connector_type;
> > }
> > -EXPORT_SYMBOL(drm_panel_init);
> >
> > /**
> > * drm_panel_add - add a panel to the global registry
> > @@ -708,7 +708,7 @@ EXPORT_SYMBOL(devm_drm_panel_add_follower);
> > * A typical implementation for a panel driver supporting device tree
> > * will call this function at probe time. Backlight will then be handled
> > * transparently without requiring any intervention from the driver.
> > - * drm_panel_of_backlight() must be called after the call to drm_panel_init().
> > + * drm_panel_of_backlight() must be called after devm_drm_panel_alloc().
>
> I think we can drop that sentence entirely. Now that we can only get a
> panel structure through devm_drm_panel_alloc, and that it also
> initializes it, we can't call drm_panel_of_backlight before having an
> initialized drm_panel.
Makes sense, I will remove the sentence and send a v2. It probably
follows the same reasoning, but just to ensure you did not miss it:
does that apply to drm_panel_dp_aux_backlight() above too?
>
> Maxime
^ permalink raw reply [flat|nested] 25+ messages in thread* Re: [PATCH 10/10] drm/panel: Make drm_panel_init() static
2026-05-07 15:11 ` Albert Esteve
@ 2026-05-07 15:29 ` Maxime Ripard
0 siblings, 0 replies; 25+ messages in thread
From: Maxime Ripard @ 2026-05-07 15:29 UTC (permalink / raw)
To: Albert Esteve
Cc: Neil Armstrong, Jessica Zhang, Maarten Lankhorst,
Thomas Zimmermann, David Airlie, Simona Vetter, Michael Tretter,
Michael Walle, Dario Binacchi, dri-devel, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 3741 bytes --]
On Thu, May 07, 2026 at 05:11:15PM +0200, Albert Esteve wrote:
> On Thu, May 7, 2026 at 4:57 PM Maxime Ripard <mripard@kernel.org> wrote:
> >
> > Hi,
> >
> > On Thu, May 07, 2026 at 01:53:08PM +0200, Albert Esteve wrote:
> > > Now that all panel drivers use devm_drm_panel_alloc(),
> > > there are no external callers of drm_panel_init().
> > > Make it static to prevent new users from bypassing the
> > > refcounted allocation path.
> > >
> > > Remove stale references to drm_panel_init() in kdocs.
> > >
> > > Signed-off-by: Albert Esteve <aesteve@redhat.com>
> > > ---
> > > drivers/gpu/drm/display/drm_dp_helper.c | 2 +-
> > > drivers/gpu/drm/drm_panel.c | 8 ++++----
> > > include/drm/drm_panel.h | 4 ----
> > > 3 files changed, 5 insertions(+), 9 deletions(-)
> > >
> > > diff --git a/drivers/gpu/drm/display/drm_dp_helper.c b/drivers/gpu/drm/display/drm_dp_helper.c
> > > index a697cc227e289..380ebf0fad2be 100644
> > > --- a/drivers/gpu/drm/display/drm_dp_helper.c
> > > +++ b/drivers/gpu/drm/display/drm_dp_helper.c
> > > @@ -4626,7 +4626,7 @@ static const struct backlight_ops dp_aux_bl_ops = {
> > > * Backlight will then be handled transparently without requiring
> > > * any intervention from the driver.
> > > *
> > > - * drm_panel_dp_aux_backlight() must be called after the call to drm_panel_init().
> > > + * drm_panel_dp_aux_backlight() must be called after devm_drm_panel_alloc().
> > > *
> > > * Return: 0 on success or a negative error code on failure.
> > > */
> > > diff --git a/drivers/gpu/drm/drm_panel.c b/drivers/gpu/drm/drm_panel.c
> > > index d1e6598ea3bc0..e3e1c5ceb8ff8 100644
> > > --- a/drivers/gpu/drm/drm_panel.c
> > > +++ b/drivers/gpu/drm/drm_panel.c
> > > @@ -56,8 +56,9 @@ static LIST_HEAD(panel_list);
> > > * Initialize the panel structure for subsequent registration with
> > > * drm_panel_add().
> > > */
> > > -void drm_panel_init(struct drm_panel *panel, struct device *dev,
> > > - const struct drm_panel_funcs *funcs, int connector_type)
> > > +static void drm_panel_init(struct drm_panel *panel, struct device *dev,
> > > + const struct drm_panel_funcs *funcs,
> > > + int connector_type)
> > > {
> > > if (connector_type == DRM_MODE_CONNECTOR_Unknown)
> > > DRM_WARN("%s: %s: a valid connector type is required!\n", __func__, dev_name(dev));
> > > @@ -69,7 +70,6 @@ void drm_panel_init(struct drm_panel *panel, struct device *dev,
> > > panel->funcs = funcs;
> > > panel->connector_type = connector_type;
> > > }
> > > -EXPORT_SYMBOL(drm_panel_init);
> > >
> > > /**
> > > * drm_panel_add - add a panel to the global registry
> > > @@ -708,7 +708,7 @@ EXPORT_SYMBOL(devm_drm_panel_add_follower);
> > > * A typical implementation for a panel driver supporting device tree
> > > * will call this function at probe time. Backlight will then be handled
> > > * transparently without requiring any intervention from the driver.
> > > - * drm_panel_of_backlight() must be called after the call to drm_panel_init().
> > > + * drm_panel_of_backlight() must be called after devm_drm_panel_alloc().
> >
> > I think we can drop that sentence entirely. Now that we can only get a
> > panel structure through devm_drm_panel_alloc, and that it also
> > initializes it, we can't call drm_panel_of_backlight before having an
> > initialized drm_panel.
>
> Makes sense, I will remove the sentence and send a v2. It probably
> follows the same reasoning, but just to ensure you did not miss it:
> does that apply to drm_panel_dp_aux_backlight() above too?
Yep, thanks!
Maxime
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 273 bytes --]
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH 00/10] drm/panel: Use refcounted allocation for remaining panel drivers
2026-05-07 11:52 [PATCH 00/10] drm/panel: Use refcounted allocation for remaining panel drivers Albert Esteve
` (9 preceding siblings ...)
2026-05-07 11:53 ` [PATCH 10/10] drm/panel: Make drm_panel_init() static Albert Esteve
@ 2026-05-07 14:57 ` Maxime Ripard
10 siblings, 0 replies; 25+ messages in thread
From: Maxime Ripard @ 2026-05-07 14:57 UTC (permalink / raw)
To: Albert Esteve
Cc: Neil Armstrong, Jessica Zhang, Maarten Lankhorst,
Thomas Zimmermann, David Airlie, Simona Vetter, Michael Tretter,
Michael Walle, Dario Binacchi, dri-devel, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 1406 bytes --]
Hi,
On Thu, May 07, 2026 at 01:52:58PM +0200, Albert Esteve wrote:
> This series converts 9 remaining panel drivers from the deprecated
> devm_kzalloc() + drm_panel_init() pattern to the refcounted
> devm_drm_panel_alloc() API. This follows the work by Anusha Srivatsa
> who introduced the refcounted panel allocation infrastructure [1] and
> converted a first batch of drivers [2] (the last part of a 5 sub-series).
>
> Reasoning:
> ----------
> The old allocation pattern is unsafe: when the panel device is
> unbound, devm frees the context struct immediately, but the DRM
> device may still hold a reference to the embedded drm_panel through
> the panel bridge, leading to a use-after-free. devm_drm_panel_alloc()
> wraps the allocation in a kref scheme, so the memory is only freed
> when the last reference is dropped.
>
> After this series, there are no remaining callers of drm_panel_init()
> under drivers/gpu/drm/panel/, and drm_panel_init() is entirely removed
> from the public API.
>
> [1] https://lore.kernel.org/all/20250331-b4-panel-refcounting-v4-0-dad50c60c6c9@redhat.com/
> [2] https://lore.kernel.org/all/20250710-b4-driver-convert-last-part-july-v1-0-de73ba81b2f5@redhat.com/
>
> Signed-off-by: Albert Esteve <aesteve@redhat.com>
Aside from the minor comment on the doc in patch 10,
Reviewed-by: Maxime Ripard <mripard@kernel.org>
Thanks!
Maxime
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 273 bytes --]
^ permalink raw reply [flat|nested] 25+ messages in thread