AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4 00/41] drm/plane: Convert all drivers to atomic_create_state and remove reset
@ 2026-09-08 14:46 Maxime Ripard
  2026-09-08 14:46 ` [PATCH v4 05/41] drm/amdgpu: Convert to atomic_create_state Maxime Ripard
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Maxime Ripard @ 2026-09-08 14:46 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, John Stultz, 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,
	Zack Rusin, bcm-kernel-feedback-list

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 v4:
- Fix a NULL pointer dereference with vkms
- Rebase on drm-misc-next-2026-09-03
- Link to v3: https://lore.kernel.org/r/20260831-drm-no-more-plane-reset-v3-0-1877c7aa57b3@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 (41):
      drm/simple-kms: Remove unused reset_plane hook
      drm/vkms: Move frame_info into vkms_plane_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/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_composer.c               | 30 +++++++-------
 drivers/gpu/drm/vkms/vkms_drv.h                    |  2 +-
 drivers/gpu/drm/vkms/vkms_formats.c                | 48 +++++++++++-----------
 drivers/gpu/drm/vkms/vkms_plane.c                  | 36 +++++-----------
 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 -
 59 files changed, 236 insertions(+), 381 deletions(-)
---
base-commit: 17c6b88e85ffe5de5720004ae8c2176d52944aca
change-id: 20260629-drm-no-more-plane-reset-04950f42e07f

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


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

end of thread, other threads:[~2026-09-10 16:32 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-08 14:46 [PATCH v4 00/41] drm/plane: Convert all drivers to atomic_create_state and remove reset Maxime Ripard
2026-09-08 14:46 ` [PATCH v4 05/41] drm/amdgpu: Convert to atomic_create_state Maxime Ripard
2026-09-08 14:46 ` [PATCH v4 26/41] drm/amdgpu_dm: " Maxime Ripard
2026-09-10 16:31   ` Leo Li
2026-09-10  7:03 ` [PATCH v4 00/41] drm/plane: Convert all drivers to atomic_create_state and remove reset Thomas Zimmermann

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