All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 00/61] drm/plane: Convert all drivers to atomic_create_state and remove reset
@ 2026-08-14 14:56 ` Maxime Ripard
  0 siblings, 0 replies; 77+ messages in thread
From: Maxime Ripard @ 2026-08-14 14:56 UTC (permalink / raw)
  To: Maarten Lankhorst, Thomas Zimmermann, David Airlie, Simona Vetter
  Cc: dri-devel, Maxime Ripard, javierm, Iker Pedrosa, Aditya Garg,
	admin, hamohammed.sa, louis.chauvet, melissa.srw,
	alexander.deucher, amd-gfx, christian.koenig, Liviu Dudau,
	alison.wang, stefan, jstultz, sumit.semwal, xinliang.liu,
	yongqin.liu, Frank.Li, Sascha Hauer, festevam, imx, kernel,
	victor.liu, l.stach, laurentiu.palcu, Paul Cercueil, linux-mips,
	anitha.chrisanthus, paulk, chenhuacai, jeffbai, lvjianmin,
	wuqianhai, xry111, zhengxingda, Martin Blumenstingl, jbrunet,
	khilman, linux-amlogic, Dmitry Baryshkov, abhinav.kumar,
	freedreno, jesszhan0024, linux-arm-msm, lumag, marijn.suijten,
	robin.clark, sean, 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, linux-sunxi, samuel, wens,
	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, dakr, lyude, nouveau, geert+renesas,
	kieran.bingham+renesas, laurent.pinchart+renesas,
	linux-renesas-soc, magnus.damm, tomi.valkeinen+renesas, Biju Das,
	Maíra Canal, dave.stevenson, kernel-list,
	bcm-kernel-feedback-list, zack.rusin, Mikko Perttunen, jonathanh,
	linux-tegra, thierry.reding

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 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 (61):
      drm/simple-kms: Add create_plane_state hook
      drm/gem-atomic-helper: Create drm_gem_create_shadow_plane_state()
      drm/gem-atomic-helper: Convert simple-kms shadow helpers to create_plane_state
      drm/gem-atomic-helper: Switch DRM_GEM_SHADOW_PLANE_FUNCS to atomic_create_state
      drm/gem-atomic-helper: Remove drm_gem_reset_shadow_plane()
      drm/sysfb: Convert to atomic_create_state
      drm/simple-kms: Switch to atomic_create_state
      drm/ssd130x: Convert to atomic_create_state
      drm/st7920: Convert to atomic_create_state
      drm/appletbdrm: Convert to atomic_create_state
      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/hdlcd: 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/imx/dcss: Convert to atomic_create_state
      drm/ingenic: 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/meson: Convert to atomic_create_state
      drm/msm/mdp4: 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/sun4i: sun8i: 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/komeda: Convert to atomic_create_state
      drm/malidp: 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/msm/dpu1: Convert to atomic_create_state
      drm/msm/mdp5: 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/vc4: Convert to atomic_create_state
      drm/vmwgfx: Convert to atomic_create_state
      drm/atomic-state-helper: Remove __drm_atomic_helper_plane_reset()
      drm/tegra: Convert to atomic_create_state
      drm/plane: Remove reset

 drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c           |   2 +-
 .../drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c    |  26 +++---
 drivers/gpu/drm/arm/display/komeda/komeda_plane.c  |  18 ++--
 drivers/gpu/drm/arm/hdlcd_crtc.c                   |   2 +-
 drivers/gpu/drm/arm/malidp_planes.c                |  18 ++--
 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            | 100 +++++++++++----------
 drivers/gpu/drm/drm_mode_config.c                  |   4 +-
 drivers/gpu/drm/drm_simple_kms_helper.c            |  11 +--
 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/dcss/dcss-plane.c              |   2 +-
 drivers/gpu/drm/imx/ipuv3/ipuv3-plane.c            |  19 ++--
 drivers/gpu/drm/ingenic/ingenic-drm-drv.c          |   2 +-
 drivers/gpu/drm/ingenic/ingenic-ipu.c              |   2 +-
 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/meson/meson_overlay.c              |   2 +-
 drivers/gpu/drm/meson/meson_plane.c                |   2 +-
 drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c          |  18 ++--
 drivers/gpu/drm/msm/disp/mdp4/mdp4_plane.c         |   2 +-
 drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c         |  16 ++--
 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/sitronix/st7920.c                  |  12 +--
 drivers/gpu/drm/solomon/ssd130x.c                  |  12 +--
 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                |  12 ++-
 drivers/gpu/drm/sun4i/sun8i_ui_layer.c             |   2 +-
 drivers/gpu/drm/sun4i/sun8i_vi_layer.c             |   2 +-
 drivers/gpu/drm/sysfb/drm_sysfb_helper.h           |   4 +-
 drivers/gpu/drm/sysfb/drm_sysfb_modeset.c          |  30 +++++--
 drivers/gpu/drm/tegra/plane.c                      |  28 +++---
 drivers/gpu/drm/tests/drm_kunit_helpers.c          |   2 +-
 drivers/gpu/drm/tilcdc/tilcdc_plane.c              |   2 +-
 drivers/gpu/drm/tiny/appletbdrm.c                  |  12 +--
 drivers/gpu/drm/vboxvideo/vbox_mode.c              |   2 +-
 drivers/gpu/drm/vc4/vc4_plane.c                    |  15 ++--
 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                |  13 +--
 include/drm/drm_plane.h                            |  12 ---
 include/drm/drm_simple_kms_helper.h                |   1 +
 75 files changed, 343 insertions(+), 433 deletions(-)
---
base-commit: bd4f284df04d76fd65e57141cb1e6e7a49e4c3cb
change-id: 20260629-drm-no-more-plane-reset-04950f42e07f

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


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

end of thread, other threads:[~2026-08-14 19:07 UTC | newest]

Thread overview: 77+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-14 14:56 [PATCH v2 00/61] drm/plane: Convert all drivers to atomic_create_state and remove reset Maxime Ripard
2026-08-14 14:56 ` Maxime Ripard
2026-08-14 14:56 ` [PATCH v2 01/61] drm/simple-kms: Add create_plane_state hook Maxime Ripard
2026-08-14 15:13   ` sashiko-bot
2026-08-14 14:56 ` [PATCH v2 02/61] drm/gem-atomic-helper: Create drm_gem_create_shadow_plane_state() Maxime Ripard
2026-08-14 15:11   ` sashiko-bot
2026-08-14 14:56 ` [PATCH v2 03/61] drm/gem-atomic-helper: Convert simple-kms shadow helpers to create_plane_state Maxime Ripard
2026-08-14 14:56 ` [PATCH v2 04/61] drm/gem-atomic-helper: Switch DRM_GEM_SHADOW_PLANE_FUNCS to atomic_create_state Maxime Ripard
2026-08-14 15:11   ` sashiko-bot
2026-08-14 14:56 ` [PATCH v2 05/61] drm/gem-atomic-helper: Remove drm_gem_reset_shadow_plane() Maxime Ripard
2026-08-14 14:56 ` [PATCH v2 06/61] drm/sysfb: Convert to atomic_create_state Maxime Ripard
2026-08-14 14:56 ` [PATCH v2 07/61] drm/simple-kms: Switch " Maxime Ripard
2026-08-14 15:10   ` sashiko-bot
2026-08-14 14:56 ` [PATCH v2 08/61] drm/ssd130x: Convert " Maxime Ripard
2026-08-14 14:56 ` [PATCH v2 09/61] drm/st7920: " Maxime Ripard
2026-08-14 14:56 ` [PATCH v2 10/61] drm/appletbdrm: " Maxime Ripard
2026-08-14 14:57 ` [PATCH v2 11/61] drm/vkms: " Maxime Ripard
2026-08-14 14:57 ` [PATCH v2 12/61] drm/gem-atomic-helper: Remove __drm_gem_reset_shadow_plane() Maxime Ripard
2026-08-14 14:57 ` [PATCH v2 13/61] drm/amdgpu: Convert to atomic_create_state Maxime Ripard
2026-08-14 15:14   ` sashiko-bot
2026-08-14 14:57 ` [PATCH v2 14/61] drm/hdlcd: " Maxime Ripard
2026-08-14 14:57 ` [PATCH v2 15/61] drm/fsl-dcu: " Maxime Ripard
2026-08-14 15:08   ` sashiko-bot
2026-08-14 14:57 ` [PATCH v2 16/61] drm/hisilicon/kirin: " Maxime Ripard
2026-08-14 14:57 ` [PATCH v2 17/61] drm/imx/dc: " Maxime Ripard
2026-08-14 14:57 ` [PATCH v2 18/61] drm/imx/dcss: " Maxime Ripard
2026-08-14 14:57 ` [PATCH v2 19/61] drm/ingenic: " Maxime Ripard
2026-08-14 14:57 ` [PATCH v2 20/61] drm/kmb: " Maxime Ripard
2026-08-14 15:14   ` sashiko-bot
2026-08-14 14:57 ` [PATCH v2 21/61] drm/logicvc: " Maxime Ripard
2026-08-14 14:57 ` [PATCH v2 22/61] drm/loongson: " Maxime Ripard
2026-08-14 14:57 ` [PATCH v2 23/61] drm/meson: " Maxime Ripard
2026-08-14 14:57   ` Maxime Ripard
2026-08-14 14:57 ` [PATCH v2 24/61] drm/msm/mdp4: " Maxime Ripard
2026-08-14 14:57 ` [PATCH v2 25/61] drm/lcdif: " Maxime Ripard
2026-08-14 14:57 ` [PATCH v2 26/61] drm/mxsfb: " Maxime Ripard
2026-08-14 14:57 ` [PATCH v2 27/61] drm/qxl: " Maxime Ripard
2026-08-14 14:57 ` [PATCH v2 28/61] drm/rockchip: " Maxime Ripard
2026-08-14 14:57   ` Maxime Ripard
2026-08-14 14:57 ` [PATCH v2 29/61] drm/sprd: " Maxime Ripard
2026-08-14 14:57 ` [PATCH v2 30/61] drm/sti: " Maxime Ripard
2026-08-14 14:57 ` [PATCH v2 31/61] drm/stm: " Maxime Ripard
2026-08-14 14:57 ` [PATCH v2 32/61] drm/sun4i: sun8i: " Maxime Ripard
2026-08-14 14:57 ` [PATCH v2 33/61] drm/tests: kunit: " Maxime Ripard
2026-08-14 14:57 ` [PATCH v2 34/61] drm/tilcdc: " Maxime Ripard
2026-08-14 14:57 ` [PATCH v2 35/61] drm/vboxvideo: " Maxime Ripard
2026-08-14 14:57 ` [PATCH v2 36/61] drm/verisilicon: " Maxime Ripard
2026-08-14 14:57 ` [PATCH v2 37/61] drm/virtio: " Maxime Ripard
2026-08-14 14:57 ` [PATCH v2 38/61] drm/xlnx: " Maxime Ripard
2026-08-14 14:57 ` [PATCH v2 39/61] drm/atomic-state-helper: Remove drm_atomic_helper_plane_reset() Maxime Ripard
2026-08-14 14:57 ` [PATCH v2 40/61] drm/amdgpu_dm: Convert to atomic_create_state Maxime Ripard
2026-08-14 15:25   ` sashiko-bot
2026-08-14 14:57 ` [PATCH v2 41/61] drm/komeda: " Maxime Ripard
2026-08-14 14:57 ` [PATCH v2 42/61] drm/malidp: " Maxime Ripard
2026-08-14 14:57 ` [PATCH v2 43/61] drm/armada: " Maxime Ripard
2026-08-14 14:57 ` [PATCH v2 44/61] drm/atmel-hlcdc: Drop spurious csc_init call from reset Maxime Ripard
2026-08-14 14:57 ` [PATCH v2 45/61] drm/atmel-hlcdc: Convert to atomic_create_state Maxime Ripard
2026-08-14 14:57 ` [PATCH v2 46/61] drm/exynos: " Maxime Ripard
2026-08-14 14:57 ` [PATCH v2 47/61] drm/imx/ipuv3: " Maxime Ripard
2026-08-14 14:57 ` [PATCH v2 48/61] drm/mediatek: " Maxime Ripard
2026-08-14 14:57 ` [PATCH v2 49/61] drm/msm/dpu1: " Maxime Ripard
2026-08-14 14:57 ` [PATCH v2 50/61] drm/msm/mdp5: " Maxime Ripard
2026-08-14 14:57 ` [PATCH v2 51/61] drm/nouveau: " Maxime Ripard
2026-08-14 14:57   ` Maxime Ripard
2026-08-14 19:06   ` lyude
2026-08-14 14:57 ` [PATCH v2 52/61] drm/omap: " Maxime Ripard
2026-08-14 14:57 ` [PATCH v2 53/61] drm/rcar-du: " Maxime Ripard
2026-08-14 14:57 ` [PATCH v2 54/61] drm/rz-du: " Maxime Ripard
2026-08-14 14:57 ` [PATCH v2 55/61] drm/shmobile: " Maxime Ripard
2026-08-14 14:57 ` [PATCH v2 56/61] drm/sun4i: layer: " Maxime Ripard
2026-08-14 15:28   ` sashiko-bot
2026-08-14 14:57 ` [PATCH v2 57/61] drm/vc4: " Maxime Ripard
2026-08-14 14:57 ` [PATCH v2 58/61] drm/vmwgfx: " Maxime Ripard
2026-08-14 15:30   ` sashiko-bot
2026-08-14 14:57 ` [PATCH v2 59/61] drm/atomic-state-helper: Remove __drm_atomic_helper_plane_reset() Maxime Ripard
2026-08-14 14:57 ` [PATCH v2 60/61] drm/tegra: Convert to atomic_create_state Maxime Ripard
2026-08-14 14:57 ` [PATCH v2 61/61] drm/plane: Remove reset Maxime Ripard

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.