Re: [PATCH v7 0/9] drm: writeback: clean up writeback connector initialization

From: Liviu Dudau

Date: Fri Oct 23 2026 - 06:22:23 EST


On Mon, Oct 19, 2026 at 04:12:26PM +0300, Dmitry Baryshkov wrote:
> Drivers using drm_writeback_connector_init() / _with_encoder() don't
> perform cleanup in a manner similar to drmm_writeback_connector_init()
> (see drm_writeback_connector_cleanup()). Enough of the drivers don't use
> the encoder embedded into the drm_writeback connector. In preparation
> to further rework of the WB connectors (as planned to enable WB for i915
> / xe drivers, which would move drm_writeback_connector to be a field
> inside drm_connector instead of subclassing it) remove the drm_encoder
> wrapped in struct drm_writeback_connector. Rename the
> drm_writeback_connector_init_with_encoder() to
> drm_writeback_connector_init()
> and copy drmm_writeback_connector_init() interface. Then, with the
> encoder being gone, handle proper cleanup of writeback data in
> drm_connector_cleanup().
>
> ---
> Changes in v7:
> - Significantly reworked series, no longer insisting on using drmm.
> - Link to v6: https://patch.msgid.link/20260612-wb-drop-encoder-v6-0-9f3a54f81310@xxxxxxxxxxxxxxxx
>
> Changes in v6:
> - Dropped applied patch
> - Implemented suggestion by Alex to use drmm allocation for the
> writeback connector.
> - Link to v5: https://patch.msgid.link/20260505-wb-drop-encoder-v5-0-42567b7c7af2@xxxxxxxxxxxxxxxx
>
> Changes in v5:
> - Rebased on top of drm-misc-next
> - Expanded commit message for msm patch, describing devm vs drmm issues (Laurent)
> - Expanded commit messages, describing why the drivers are converted to
> drmm_writeback_connector_init() (Laurent)
> - Link to v4: https://lore.kernel.org/r/20251228-wb-drop-encoder-v4-0-58d28e668901@xxxxxxxxxxxxxxxx
>
> Changes in v4:
> - Rebase on top of drm-misc-next, dropping applied patch.
> - Added a note regarding memory leak in the AMDGPU driver.
> - Fixed a devm vs drmm issue in the msm/dpu driver.
> - Link to v3: https://lore.kernel.org/r/20250819-wb-drop-encoder-v3-0-b48a6af7903b@xxxxxxxxxxxxxxxx
>
> Changes in v3:
> - Fixed subject prefix for the rcar-du patch (Jessica Zhang)
> - Link to v2: https://lore.kernel.org/r/20250816-wb-drop-encoder-v2-0-f951de04f4f9@xxxxxxxxxxxxxxxx
>
> Changes in v2:
> - Switched to drm_crtc_mask() where applicable (Louis Chauvet)
> - Link to v1: https://lore.kernel.org/r/20250801-wb-drop-encoder-v1-0-824646042f7d@xxxxxxxxxxxxxxxx
>
> To: Maarten Lankhorst <maarten.lankhorst@xxxxxxxxxxxxxxx>
> To: Maxime Ripard <mripard@xxxxxxxxxx>
> To: Thomas Zimmermann <tzimmermann@xxxxxxx>
> To: David Airlie <airlied@xxxxxxxxx>
> To: Simona Vetter <simona@xxxxxxxx>
> To: John Harrison <John.Harrison@xxxxxxxxxx>
> To: Harry Wentland <harry.wentland@xxxxxxx>
> To: Leo Li <sunpeng.li@xxxxxxx>
> To: Rodrigo Siqueira <siqueira@xxxxxxxxxx>
> To: Alex Deucher <alexander.deucher@xxxxxxx>
> To: Christian König <christian.koenig@xxxxxxx>
> To: Liviu Dudau <liviu.dudau@xxxxxxx>
> To: Laurent Pinchart <laurent.pinchart+renesas@xxxxxxxxxxxxxxxx>
> To: Tomi Valkeinen <tomi.valkeinen+renesas@xxxxxxxxxxxxxxxx>
> To: Kieran Bingham <kieran.bingham+renesas@xxxxxxxxxxxxxxxx>
> To: Geert Uytterhoeven <geert+renesas@xxxxxxxxx>
> To: Magnus Damm <magnus.damm@xxxxxxxxx>
> To: Dave Stevenson <dave.stevenson@xxxxxxxxxxxxxxx>
> To: Maíra Canal <mcanal@xxxxxxxxxx>
> To: Raspberry Pi Kernel Maintenance <kernel-list@xxxxxxxxxxxxxxx>
> To: Louis Chauvet <louis.chauvet@xxxxxxxxxxx>
> To: Mihail Atanassov <mihail.atanassov@xxxxxxx>
> To: Eric Anholt <eric@xxxxxxxxxx>
> To: Rob Clark <robin.clark@xxxxxxxxxxxxxxxx>
> To: Brian Starkey <brian.starkey@xxxxxxx>
> Cc: dri-devel@xxxxxxxxxxxxxxxxxxxxx
> Cc: linux-kernel@xxxxxxxxxxxxxxx
> Cc: amd-gfx@xxxxxxxxxxxxxxxxxxxxx
> Cc: linux-renesas-soc@xxxxxxxxxxxxxxx
>
> ---
> Dmitry Baryshkov (9):
> drm/amd/display: embed the writeback encoder in amdgpu_dm_wb_connector
> drm/komeda: embed the writeback encoder in komeda_wb_connector
> drm/mali: embed the writeback encoder in malidp_drm
> drm: renesas: rcar-du: embed the writeback encoder in rcar_du_crtc
> drm: writeback: drop excess connector initialization functions
> drm: writeback: rename drm_writeback_connector_init_with_encoder()
> drm: writeback: don't destroy the shared writeback properties
> drm: writeback: clean up writeback connectors in drm_connector_cleanup()
> drm: writeback: drop the drmm writeback cleanup action
>
> drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2 +-
> drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h | 1 +
> .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_wb.c | 27 +++-
> .../amd/display/amdgpu_dm/tests/amdgpu_dm_test.c | 4 +-
> .../display/amdgpu_dm/tests/amdgpu_dm_wb_test.c | 4 +-
> drivers/gpu/drm/arm/display/komeda/komeda_kms.h | 3 +
> .../drm/arm/display/komeda/komeda_wb_connector.c | 24 +++-
> drivers/gpu/drm/arm/malidp_drv.h | 1 +
> drivers/gpu/drm/arm/malidp_mw.c | 25 +++-
> drivers/gpu/drm/drm_connector.c | 3 +
> drivers/gpu/drm/drm_crtc_internal.h | 3 +
> drivers/gpu/drm/drm_writeback.c | 147 +++++----------------
> drivers/gpu/drm/renesas/rcar-du/rcar_du_crtc.h | 2 +
> .../gpu/drm/renesas/rcar-du/rcar_du_writeback.c | 29 +++-
> drivers/gpu/drm/vc4/vc4_txp.c | 8 +-
> include/drm/drm_writeback.h | 22 +--
> 16 files changed, 140 insertions(+), 165 deletions(-)

I still personally dislike the whole idea of removing a framework feature that was beneficial
to a lot of drivers in order to help one driver, but that is just my stance. The stats kind of
show that and if it wasn't for the massive delete in drm_writeback.c (partly of comments) you
would add more code with this change. The cleanup and fixes patches in this series also points
out that there are still issues with the concept and John and sashiko are also raising issues.

Anyway, as far as komeda and malidp drivers changes are concerned, I'm OK with them being applied
as long as the framework or the patch series solves any cleanup issues. So for those two patches
you can have my

Reviewed-by: Liviu Dudau <liviu.dudau@xxxxxxx>

Best regards,
Liviu


> ---
> base-commit: 725953d4da85cfb97a4c309fad6346b72f8529e7
> change-id: 20250801-wb-drop-encoder-97a0c75bd5d7
>
> Best regards,
> --
> With best wishes
> Dmitry
>

--
====================
| I would like to |
| fix the world, |
| but they're not |
| giving me the |
\ source code! /
---------------
¯\_(ツ)_/¯