dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 00/40] drm/plane: Convert all drivers to atomic_create_state and remove reset
@ 2026-08-31 16:17 Maxime Ripard
  2026-08-31 16:17 ` [PATCH v3 01/40] drm/simple-kms: Remove unused reset_plane hook Maxime Ripard
                   ` (39 more replies)
  0 siblings, 40 replies; 51+ messages in thread
From: Maxime Ripard @ 2026-08-31 16:17 UTC (permalink / raw)
  To: Maarten Lankhorst, Thomas Zimmermann, David Airlie, Simona Vetter
  Cc: dri-devel, Maxime Ripard, hamohammed.sa, louis.chauvet,
	melissa.srw, alexander.deucher, amd-gfx, christian.koenig,
	alison.wang, stefan, jstultz, sumit.semwal, xinliang.liu,
	yongqin.liu, Frank.Li, Sascha Hauer, festevam, imx, kernel,
	victor.liu, anitha.chrisanthus, paulk, chenhuacai, jeffbai,
	lvjianmin, wuqianhai, xry111, zhengxingda, marex, airlied, kraxel,
	spice-devel, virtualization, andy.yan, heiko, hjc, linux-rockchip,
	Baolin Wang, orsonzhai, zhang.lyra, alain.volmat, rgallaispou,
	alexandre.torgue, mcoquelin.stm32, philippe.cornu,
	raphael.gallais-pou, yannick.fertre, jyri.sarha, tomi.valkeinen,
	hansg, dmitry.osipenko, gurchetansingh, olvaffe, michal.simek,
	harry.wentland, siqueira, sunpeng.li, linux,
	Dharma Balasubiramani, Ludovic Desroches, Manikandan Muralidharan,
	alexandre.belloni, claudiu.beznea, nicolas.ferre, alim.akhtar,
	inki.dae, krzk, kyungmin.park, linux-samsung-soc, sw0312.kim,
	p.zabel, angelogioacchino.delregno, chunkuang.hu, matthias.bgg,
	Lyude Paul, dakr, nouveau, geert+renesas, kieran.bingham+renesas,
	laurent.pinchart+renesas, linux-renesas-soc, magnus.damm,
	tomi.valkeinen+renesas, Biju Das, linux-sunxi, samuel, wens,
	bcm-kernel-feedback-list, zack.rusin

This is a follow-up to the bridge reset removal series, and part of a
larger effort to remove the reset hook from all KMS objects.

The plane reset hook is overloaded: it is called both at probe time
to create the initial software state and during suspend/resume to
reset hardware and software state. These two roles have different
requirements, and the reset hook is not fallible, making error
handling difficult for the initial state allocation path.

While reset has the semantics to reset both the software and hardware
state, the vast majority of implementations and all the helpers only
reset the software state, making them equivalent to
atomic_create_state in practice. The atomic_create_state hook makes
this explicit: it only allocates and initializes a pristine state
without any side effect, and returns the state pointer or an ERR_PTR
on failure.

This series first adds the necessary infrastructure in the simple-kms
and GEM atomic helpers, then converts all 51 plane drivers tree-wide
from the reset hook to atomic_create_state. The conversions were done
using a combination of Coccinelle semantic patches and manual
adjustments. Once all drivers are converted, the old helpers and the
reset hook itself are removed from struct drm_plane_funcs.

Signed-off-by: Maxime Ripard <mripard@kernel.org>
---
Changes in v3:
- Drop leftover state destruction in sun4i
- Rebase on current drm-misc-next
- Link to v2: https://lore.kernel.org/r/20260814-drm-no-more-plane-reset-v2-0-82d2963dd134@kernel.org

Changes in v2:
- Rebase on latest drm-misc-next tag
- Fix sashiko reviews
- Fix atmel-hlcdc breakage
- Link to v1: https://lore.kernel.org/r/20260709-drm-no-more-plane-reset-v1-0-302d986fe5f0@kernel.org

---
Maxime Ripard (40):
      drm/simple-kms: Remove unused reset_plane hook
      drm/vkms: Convert to atomic_create_state
      drm/gem-atomic-helper: Remove __drm_gem_reset_shadow_plane()
      drm/amdgpu: Convert to atomic_create_state
      drm/fsl-dcu: Convert to atomic_create_state
      drm/hisilicon/kirin: Convert to atomic_create_state
      drm/imx/dc: Convert to atomic_create_state
      drm/kmb: Convert to atomic_create_state
      drm/logicvc: Convert to atomic_create_state
      drm/loongson: Convert to atomic_create_state
      drm/lcdif: Convert to atomic_create_state
      drm/mxsfb: Convert to atomic_create_state
      drm/qxl: Convert to atomic_create_state
      drm/rockchip: Convert to atomic_create_state
      drm/sprd: Convert to atomic_create_state
      drm/sti: Convert to atomic_create_state
      drm/stm: Convert to atomic_create_state
      drm/tests: kunit: Convert to atomic_create_state
      drm/tilcdc: Convert to atomic_create_state
      drm/vboxvideo: Convert to atomic_create_state
      drm/verisilicon: Convert to atomic_create_state
      drm/virtio: Convert to atomic_create_state
      drm/xlnx: Convert to atomic_create_state
      drm/atomic-state-helper: Remove drm_atomic_helper_plane_reset()
      drm/amdgpu_dm: Convert to atomic_create_state
      drm/armada: Convert to atomic_create_state
      drm/atmel-hlcdc: Drop spurious csc_init call from reset
      drm/atmel-hlcdc: Convert to atomic_create_state
      drm/exynos: Convert to atomic_create_state
      drm/imx/ipuv3: Convert to atomic_create_state
      drm/mediatek: Convert to atomic_create_state
      drm/nouveau: Convert to atomic_create_state
      drm/omap: Convert to atomic_create_state
      drm/rcar-du: Convert to atomic_create_state
      drm/rz-du: Convert to atomic_create_state
      drm/shmobile: Convert to atomic_create_state
      drm/sun4i: layer: Convert to atomic_create_state
      drm/vmwgfx: Convert to atomic_create_state
      drm/atomic-state-helper: Remove __drm_atomic_helper_plane_reset()
      drm/plane: Remove reset

 drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c           |  2 +-
 .../drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c    | 28 +++++++++------
 .../drm/amd/display/amdgpu_dm/amdgpu_dm_plane.h    |  2 +-
 .../display/amdgpu_dm/tests/amdgpu_dm_plane_test.c | 30 ++++++----------
 drivers/gpu/drm/armada/armada_overlay.c            | 39 ++++++++++----------
 drivers/gpu/drm/armada/armada_plane.c              | 15 ++++----
 drivers/gpu/drm/armada/armada_plane.h              |  2 +-
 drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c    | 33 ++++++++---------
 drivers/gpu/drm/drm_atomic_state_helper.c          | 41 ----------------------
 drivers/gpu/drm/drm_gem_atomic_helper.c            | 20 -----------
 drivers/gpu/drm/drm_mode_config.c                  |  4 +--
 drivers/gpu/drm/exynos/exynos_drm_plane.c          | 22 +++++-------
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.c        |  2 +-
 drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c    |  2 +-
 drivers/gpu/drm/imx/dc/dc-plane.c                  |  2 +-
 drivers/gpu/drm/imx/ipuv3/ipuv3-plane.c            | 19 +++++-----
 drivers/gpu/drm/kmb/kmb_plane.c                    |  2 +-
 drivers/gpu/drm/logicvc/logicvc_layer.c            |  2 +-
 drivers/gpu/drm/loongson/lsdc_plane.c              |  2 +-
 drivers/gpu/drm/mediatek/mtk_plane.c               | 22 +++++-------
 drivers/gpu/drm/mxsfb/lcdif_kms.c                  |  2 +-
 drivers/gpu/drm/mxsfb/mxsfb_kms.c                  |  2 +-
 drivers/gpu/drm/nouveau/dispnv50/wndw.c            | 15 ++++----
 drivers/gpu/drm/omapdrm/omap_plane.c               | 13 ++++---
 drivers/gpu/drm/qxl/qxl_display.c                  |  4 +--
 drivers/gpu/drm/renesas/rcar-du/rcar_du_plane.c    | 15 ++++----
 drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c      | 15 ++++----
 drivers/gpu/drm/renesas/rz-du/rzg2l_du_vsp.c       | 15 ++++----
 drivers/gpu/drm/renesas/shmobile/shmob_drm_plane.c | 15 ++++----
 drivers/gpu/drm/rockchip/rockchip_drm_vop.c        |  2 +-
 drivers/gpu/drm/rockchip/rockchip_drm_vop2.c       |  2 +-
 drivers/gpu/drm/sprd/sprd_dpu.c                    |  2 +-
 drivers/gpu/drm/sti/sti_cursor.c                   |  2 +-
 drivers/gpu/drm/sti/sti_gdp.c                      |  2 +-
 drivers/gpu/drm/sti/sti_hqvdp.c                    |  2 +-
 drivers/gpu/drm/stm/ltdc.c                         |  2 +-
 drivers/gpu/drm/sun4i/sun4i_layer.c                | 21 +++++------
 drivers/gpu/drm/tests/drm_kunit_helpers.c          |  2 +-
 drivers/gpu/drm/tilcdc/tilcdc_plane.c              |  2 +-
 drivers/gpu/drm/vboxvideo/vbox_mode.c              |  2 +-
 drivers/gpu/drm/verisilicon/vs_cursor_plane.c      |  2 +-
 drivers/gpu/drm/verisilicon/vs_plane.c             | 14 +++-----
 drivers/gpu/drm/verisilicon/vs_plane.h             |  2 +-
 drivers/gpu/drm/verisilicon/vs_primary_plane.c     |  2 +-
 drivers/gpu/drm/virtio/virtgpu_plane.c             |  2 +-
 drivers/gpu/drm/vkms/vkms_plane.c                  | 15 ++++----
 drivers/gpu/drm/vmwgfx/vmwgfx_kms.c                | 17 ++++-----
 drivers/gpu/drm/vmwgfx/vmwgfx_kms.h                |  2 +-
 drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c                |  4 +--
 drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c               |  4 +--
 drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c               |  4 +--
 drivers/gpu/drm/xlnx/zynqmp_kms.c                  |  2 +-
 include/drm/drm_atomic_state_helper.h              |  3 --
 include/drm/drm_gem_atomic_helper.h                |  2 --
 include/drm/drm_plane.h                            | 12 -------
 include/drm/drm_simple_kms_helper.h                |  1 -
 56 files changed, 192 insertions(+), 324 deletions(-)
---
base-commit: 07c66ce1e6446f5cc6a4ace99a8d46880f45c527
change-id: 20260629-drm-no-more-plane-reset-04950f42e07f

Best regards,
-- 
Maxime Ripard <mripard@kernel.org>


^ permalink raw reply	[flat|nested] 51+ messages in thread

end of thread, other threads:[~2026-08-31 22:58 UTC | newest]

Thread overview: 51+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-31 16:17 [PATCH v3 00/40] drm/plane: Convert all drivers to atomic_create_state and remove reset Maxime Ripard
2026-08-31 16:17 ` [PATCH v3 01/40] drm/simple-kms: Remove unused reset_plane hook Maxime Ripard
2026-08-31 16:17 ` [PATCH v3 02/40] drm/vkms: Convert to atomic_create_state Maxime Ripard
2026-08-31 16:17 ` [PATCH v3 03/40] drm/gem-atomic-helper: Remove __drm_gem_reset_shadow_plane() Maxime Ripard
2026-08-31 16:17 ` [PATCH v3 04/40] drm/amdgpu: Convert to atomic_create_state Maxime Ripard
2026-08-31 16:17 ` [PATCH v3 05/40] drm/fsl-dcu: " Maxime Ripard
2026-08-31 19:22   ` sashiko-bot
2026-08-31 16:17 ` [PATCH v3 06/40] drm/hisilicon/kirin: " Maxime Ripard
2026-08-31 18:07   ` John Stultz
2026-08-31 19:31   ` sashiko-bot
2026-08-31 16:17 ` [PATCH v3 07/40] drm/imx/dc: " Maxime Ripard
2026-08-31 16:17 ` [PATCH v3 08/40] drm/kmb: " Maxime Ripard
2026-08-31 19:44   ` sashiko-bot
2026-08-31 16:17 ` [PATCH v3 09/40] drm/logicvc: " Maxime Ripard
2026-08-31 16:17 ` [PATCH v3 10/40] drm/loongson: " Maxime Ripard
2026-08-31 16:17 ` [PATCH v3 11/40] drm/lcdif: " Maxime Ripard
2026-08-31 16:17 ` [PATCH v3 12/40] drm/mxsfb: " Maxime Ripard
2026-08-31 16:17 ` [PATCH v3 13/40] drm/qxl: " Maxime Ripard
2026-08-31 16:17 ` [PATCH v3 14/40] drm/rockchip: " Maxime Ripard
2026-08-31 16:17 ` [PATCH v3 15/40] drm/sprd: " Maxime Ripard
2026-08-31 16:17 ` [PATCH v3 16/40] drm/sti: " Maxime Ripard
2026-08-31 16:17 ` [PATCH v3 17/40] drm/stm: " Maxime Ripard
2026-08-31 16:17 ` [PATCH v3 18/40] drm/tests: kunit: " Maxime Ripard
2026-08-31 16:17 ` [PATCH v3 19/40] drm/tilcdc: " Maxime Ripard
2026-08-31 16:17 ` [PATCH v3 20/40] drm/vboxvideo: " Maxime Ripard
2026-08-31 16:17 ` [PATCH v3 21/40] drm/verisilicon: " Maxime Ripard
2026-08-31 16:17 ` [PATCH v3 22/40] drm/virtio: " Maxime Ripard
2026-08-31 21:16   ` sashiko-bot
2026-08-31 16:17 ` [PATCH v3 23/40] drm/xlnx: " Maxime Ripard
2026-08-31 16:17 ` [PATCH v3 24/40] drm/atomic-state-helper: Remove drm_atomic_helper_plane_reset() Maxime Ripard
2026-08-31 16:17 ` [PATCH v3 25/40] drm/amdgpu_dm: Convert to atomic_create_state Maxime Ripard
2026-08-31 21:37   ` sashiko-bot
2026-08-31 16:17 ` [PATCH v3 26/40] drm/armada: " Maxime Ripard
2026-08-31 16:17 ` [PATCH v3 27/40] drm/atmel-hlcdc: Drop spurious csc_init call from reset Maxime Ripard
2026-08-31 16:17 ` [PATCH v3 28/40] drm/atmel-hlcdc: Convert to atomic_create_state Maxime Ripard
2026-08-31 21:56   ` sashiko-bot
2026-08-31 16:17 ` [PATCH v3 29/40] drm/exynos: " Maxime Ripard
2026-08-31 16:17 ` [PATCH v3 30/40] drm/imx/ipuv3: " Maxime Ripard
2026-08-31 16:17 ` [PATCH v3 31/40] drm/mediatek: " Maxime Ripard
2026-08-31 16:17 ` [PATCH v3 32/40] drm/nouveau: " Maxime Ripard
2026-08-31 16:17 ` [PATCH v3 33/40] drm/omap: " Maxime Ripard
2026-08-31 16:17 ` [PATCH v3 34/40] drm/rcar-du: " Maxime Ripard
2026-08-31 16:17 ` [PATCH v3 35/40] drm/rz-du: " Maxime Ripard
2026-08-31 22:39   ` sashiko-bot
2026-08-31 16:17 ` [PATCH v3 36/40] drm/shmobile: " Maxime Ripard
2026-08-31 16:17 ` [PATCH v3 37/40] drm/sun4i: layer: " Maxime Ripard
2026-08-31 16:17 ` [PATCH v3 38/40] drm/vmwgfx: " Maxime Ripard
2026-08-31 17:47   ` Zack Rusin
2026-08-31 22:58   ` sashiko-bot
2026-08-31 16:17 ` [PATCH v3 39/40] drm/atomic-state-helper: Remove __drm_atomic_helper_plane_reset() Maxime Ripard
2026-08-31 16:17 ` [PATCH v3 40/40] drm/plane: Remove reset Maxime Ripard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox