AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 00/13] drm/crtc: Convert all drivers to atomic_create_state and remove reset
@ 2026-09-04  9:07 Maxime Ripard
  2026-09-04  9:07 ` [PATCH v3 02/13] drm/amdgpu: vkms: Switch to drm_atomic_helper_crtc_create_state Maxime Ripard
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Maxime Ripard @ 2026-09-04  9:07 UTC (permalink / raw)
  To: Maarten Lankhorst, Thomas Zimmermann, David Airlie, Simona Vetter
  Cc: dri-devel, Maxime Ripard, Christian König, Alex Deucher,
	amd-gfx, Paul Kocialkowski, Jyri Sarha, Tomi Valkeinen,
	Harry Wentland, Leo Li, Rodrigo Siqueira, Huacai Chen,
	Icenowy Zheng, Jianmin Lv, Mingcong Bai, Qianhai Wu, Xi Ruoyao,
	AngeloGioacchino Del Regno, Chun-Kuang Hu, Matthias Brugger,
	Philipp Zabel, Iker Pedrosa, Dmitry Baryshkov

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

The CRTC 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 converts all CRTC drivers tree-wide from the reset hook to
atomic_create_state, then removes the reset hook from struct
drm_crtc_funcs entirely. Two drivers (tilcdc and loongson) had actual
hardware reset logic mixed into their reset hook; those are moved to
CRTC creation instead. The conversions were done using a combination of
Coccinelle semantic patches and manual adjustments.

Signed-off-by: Maxime Ripard <mripard@kernel.org>
---
Changes in v3:
- Test if crtc->helper_private is set before accessing it, and call the
  temp variable to store it helper_funcs
- Rework outdated commit logs
- Fix error path for amdgpu_dm_crtc_init
- Fix new amdgpu tests doc
- Rebased on drm-misc-next-2026-09-03
- Link to v2: https://lore.kernel.org/r/20260831-drm-no-more-crtc-reset-v2-0-4500d49a337f@kernel.org

Changes in v2:
- Fix indentation in logicvc
- Fix hardware reset at probe and suspend for loonsoon and tilcldc
- Fix state creation for amdgpu
- Rebase on current drm-misc-next
- Fix commit message for st7920
- Fix merge conflict for mediatek
- Link to v1: https://lore.kernel.org/r/20260821-drm-no-more-crtc-reset-v1-0-fb793475c05a@kernel.org

---
Maxime Ripard (13):
      drm/crtc: Introduce hw_reset helper hook
      drm/amdgpu: vkms: Switch to drm_atomic_helper_crtc_create_state
      drm/logicvc: Switch to drm_atomic_helper_crtc_create_state
      drm/tilcdc: Move hardware reset to hw_reset hook
      drm/tilcdc: Switch to drm_atomic_helper_crtc_create_state
      drm/atomic-helper: Remove drm_atomic_helper_crtc_reset
      drm/amdgpu: dm: Convert to atomic_create_state
      drm/loongson: Move hardware reset to hw_reset hook
      drm/loongson: Convert to atomic_create_state
      drm/mediatek: Convert to atomic_create_state
      drm/sitronix: st7920: Convert to atomic_create_state
      drm/atomic-helper: Remove __drm_atomic_helper_crtc_reset
      drm/crtc: Remove reset

 drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c           |  2 +-
 .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.c | 31 ++++++++++-----
 .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.h |  2 +-
 .../display/amdgpu_dm/tests/amdgpu_dm_crtc_test.c  | 23 ++++++-----
 drivers/gpu/drm/drm_atomic_state_helper.c          | 45 ----------------------
 drivers/gpu/drm/drm_mode_config.c                  | 17 ++++++--
 drivers/gpu/drm/logicvc/logicvc_crtc.c             |  2 +-
 drivers/gpu/drm/loongson/lsdc_crtc.c               | 30 ++++++++-------
 drivers/gpu/drm/mediatek/mtk_crtc.c                | 18 ++++-----
 drivers/gpu/drm/sitronix/st7920.c                  | 12 +++---
 drivers/gpu/drm/tilcdc/tilcdc_crtc.c               |  7 ++--
 include/drm/drm_atomic_state_helper.h              |  3 --
 include/drm/drm_crtc.h                             | 12 ------
 include/drm/drm_modeset_helper_vtables.h           | 14 +++++++
 14 files changed, 96 insertions(+), 122 deletions(-)
---
base-commit: 17c6b88e85ffe5de5720004ae8c2176d52944aca
change-id: 20260709-drm-no-more-crtc-reset-14a4d5bc8d41

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


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

end of thread, other threads:[~2026-09-11 13:14 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-04  9:07 [PATCH v3 00/13] drm/crtc: Convert all drivers to atomic_create_state and remove reset Maxime Ripard
2026-09-04  9:07 ` [PATCH v3 02/13] drm/amdgpu: vkms: Switch to drm_atomic_helper_crtc_create_state Maxime Ripard
2026-09-04  9:07 ` [PATCH v3 07/13] drm/amdgpu: dm: Convert to atomic_create_state Maxime Ripard
2026-09-10 16:41   ` Leo Li
2026-09-10 15:20 ` [PATCH v3 00/13] drm/crtc: Convert all drivers to atomic_create_state and remove reset Javier Martinez Canillas
2026-09-11 13:14 ` Maxime Ripard

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