public inbox for linux-doc@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 00/20] drm/atomic: Rework initial state allocation
@ 2026-04-24 10:18 Maxime Ripard
  2026-04-24 10:18 ` [PATCH v3 01/20] drm/atomic: Document atomic state lifetime Maxime Ripard
                   ` (19 more replies)
  0 siblings, 20 replies; 21+ messages in thread
From: Maxime Ripard @ 2026-04-24 10:18 UTC (permalink / raw)
  To: Maarten Lankhorst, Thomas Zimmermann, David Airlie, Simona Vetter,
	Jonathan Corbet, Shuah Khan, Dmitry Baryshkov, Jyri Sarha,
	Tomi Valkeinen, Andrzej Hajda, Neil Armstrong, Robert Foss,
	Laurent Pinchart, Jonas Karlman, Jernej Skrabec, Simon Ser,
	Harry Wentland, Melissa Wen, Sebastian Wick, Alex Hung,
	Jani Nikula, Rodrigo Vivi, Joonas Lahtinen, Tvrtko Ursulin,
	Chen-Yu Tsai, Samuel Holland, Dave Stevenson, Maíra Canal,
	Raspberry Pi Kernel Maintenance
  Cc: dri-devel, linux-doc, linux-kernel, Daniel Stone, intel-gfx,
	intel-xe, linux-arm-kernel, linux-sunxi, Maxime Ripard,
	Laurent Pinchart, Laurent Pinchart

Hi,

This series started from my work on the hardware state readout[1], and
more specifically a discussion with Thomas[2].

This series expands the work that has been merged recently to make
drm_private_obj and drm_private_state allocation a bit more consistent
and ended up creating a new atomic_create_state callback to allocate a
new state with no side effect.

The first patches document the existing behaviour and fix a few
cleanups and typos.

Then, __drm_*_state_reset() helpers are renamed to
__drm_*_state_init() to clarify that they initialize rather than
reset state, and we add the new atomic_create_state callback to
every other DRM object (planes, CRTCs, connectors, colorops).

Next, we leverage those new callbacks to create a new helper,
drm_mode_config_create_initial_state(), to create the initial state
for all the objects of a driver, and update the driver skeleton to
recommend it.

Finally, we convert the tidss driver and the bridge_connector to the
new pattern.

This was tested on a TI SK-AM62, with the tidss driver.

Let me know what you think,
Maxime

1: https://lore.kernel.org/dri-devel/20250902-drm-state-readout-v1-0-14ad5315da3f@kernel.org/
2: https://lore.kernel.org/dri-devel/5920ffe5-b6b1-484b-b320-332b9eb9db82@suse.de/

Signed-off-by: Maxime Ripard <mripard@kernel.org>
---
Changes in v3:
- Reintroduce state documentation that was dropped by accident
- Change name to drm_mode_config_create_initial_state()
- Don't call drm_mode_config_create_initial_state() in drm_dev_register
  anymore
- Drop __drm_atomic_helper_*_create_state
- Improve documentation and commit messages where necessary
- Collected tags
- Link to v2: https://lore.kernel.org/r/20260320-drm-mode-config-init-v2-0-c63f1134e76c@kernel.org

Changes in v2:
- Change the _state_reset function names to _state_init
- Change the colorop too
- Various doc improvements
- Link to v1: https://lore.kernel.org/r/20260310-drm-mode-config-init-v1-0-de7397c8e1cf@kernel.org

---
Maxime Ripard (20):
      drm/atomic: Document atomic state lifetime
      drm/colorop: Fix typos in the doc
      drm/atomic: Drop drm_private_obj.state assignment from create_state
      drm/atomic: Expand atomic_create_state expectations for drm_private_obj
      drm/mode-config: Document drm_private_obj exclusion from drm_mode_config_reset()
      drm/colorop: Rename __drm_colorop_state_reset()
      drm/colorop: Create drm_atomic_helper_colorop_create_state()
      drm/atomic-state-helper: Fix __drm_atomic_helper_plane_reset() doc typo
      drm/atomic-state-helper: Rename __drm_atomic_helper_plane_state_reset()
      drm/plane: Add new atomic_create_state callback
      drm/atomic-state-helper: Rename __drm_atomic_helper_crtc_state_reset()
      drm/crtc: Add new atomic_create_state callback
      drm/atomic-state-helper: Rename __drm_atomic_helper_connector_state_reset()
      drm/hdmi: Rename __drm_atomic_helper_connector_hdmi_reset()
      drm/connector: Add new atomic_create_state callback
      drm/mode-config: Create drm_mode_config_create_initial_state()
      drm/drv: Switch skeleton to drm_mode_config_create_initial_state()
      drm/tidss: Switch to drm_mode_config_create_initial_state()
      drm/tidss: Convert to atomic_create_state
      drm/bridge_connector: Convert to atomic_create_state

 Documentation/gpu/drm-kms.rst                      |   6 +
 drivers/gpu/drm/display/drm_bridge_connector.c     |  17 ++-
 drivers/gpu/drm/display/drm_hdmi_state_helper.c    |  13 +-
 drivers/gpu/drm/drm_atomic.c                       |  63 +++++++++
 drivers/gpu/drm/drm_atomic_state_helper.c          | 136 +++++++++++++++---
 drivers/gpu/drm/drm_colorop.c                      |  41 ++++--
 drivers/gpu/drm/drm_drv.c                          |   4 +-
 drivers/gpu/drm/drm_mode_config.c                  | 154 ++++++++++++++++++++-
 drivers/gpu/drm/i915/display/intel_crtc.c          |   2 +-
 drivers/gpu/drm/i915/display/intel_plane.c         |   2 +-
 drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c             |   2 +-
 drivers/gpu/drm/tests/drm_hdmi_state_helper_test.c |   2 +-
 drivers/gpu/drm/tidss/tidss_crtc.c                 |  17 +--
 drivers/gpu/drm/tidss/tidss_drv.c                  |   6 +-
 drivers/gpu/drm/tidss/tidss_plane.c                |   2 +-
 drivers/gpu/drm/vc4/vc4_hdmi.c                     |   2 +-
 include/drm/display/drm_hdmi_state_helper.h        |   4 +-
 include/drm/drm_atomic.h                           |   5 +-
 include/drm/drm_atomic_state_helper.h              |  14 +-
 include/drm/drm_colorop.h                          |   2 +
 include/drm/drm_connector.h                        |  16 +++
 include/drm/drm_crtc.h                             |  16 +++
 include/drm/drm_mode_config.h                      |   1 +
 include/drm/drm_plane.h                            |  16 +++
 24 files changed, 476 insertions(+), 67 deletions(-)
---
base-commit: ea61048876a7137897da26dac49ee234fb38a35a
change-id: 20260310-drm-mode-config-init-1e1f52b745d0

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


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

end of thread, other threads:[~2026-04-24 10:19 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-24 10:18 [PATCH v3 00/20] drm/atomic: Rework initial state allocation Maxime Ripard
2026-04-24 10:18 ` [PATCH v3 01/20] drm/atomic: Document atomic state lifetime Maxime Ripard
2026-04-24 10:18 ` [PATCH v3 02/20] drm/colorop: Fix typos in the doc Maxime Ripard
2026-04-24 10:18 ` [PATCH v3 03/20] drm/atomic: Drop drm_private_obj.state assignment from create_state Maxime Ripard
2026-04-24 10:18 ` [PATCH v3 04/20] drm/atomic: Expand atomic_create_state expectations for drm_private_obj Maxime Ripard
2026-04-24 10:18 ` [PATCH v3 05/20] drm/mode-config: Document drm_private_obj exclusion from drm_mode_config_reset() Maxime Ripard
2026-04-24 10:18 ` [PATCH v3 06/20] drm/colorop: Rename __drm_colorop_state_reset() Maxime Ripard
2026-04-24 10:18 ` [PATCH v3 07/20] drm/colorop: Create drm_atomic_helper_colorop_create_state() Maxime Ripard
2026-04-24 10:18 ` [PATCH v3 08/20] drm/atomic-state-helper: Fix __drm_atomic_helper_plane_reset() doc typo Maxime Ripard
2026-04-24 10:18 ` [PATCH v3 09/20] drm/atomic-state-helper: Rename __drm_atomic_helper_plane_state_reset() Maxime Ripard
2026-04-24 10:18 ` [PATCH v3 10/20] drm/plane: Add new atomic_create_state callback Maxime Ripard
2026-04-24 10:18 ` [PATCH v3 11/20] drm/atomic-state-helper: Rename __drm_atomic_helper_crtc_state_reset() Maxime Ripard
2026-04-24 10:18 ` [PATCH v3 12/20] drm/crtc: Add new atomic_create_state callback Maxime Ripard
2026-04-24 10:18 ` [PATCH v3 13/20] drm/atomic-state-helper: Rename __drm_atomic_helper_connector_state_reset() Maxime Ripard
2026-04-24 10:18 ` [PATCH v3 14/20] drm/hdmi: Rename __drm_atomic_helper_connector_hdmi_reset() Maxime Ripard
2026-04-24 10:18 ` [PATCH v3 15/20] drm/connector: Add new atomic_create_state callback Maxime Ripard
2026-04-24 10:18 ` [PATCH v3 16/20] drm/mode-config: Create drm_mode_config_create_initial_state() Maxime Ripard
2026-04-24 10:18 ` [PATCH v3 17/20] drm/drv: Switch skeleton to drm_mode_config_create_initial_state() Maxime Ripard
2026-04-24 10:18 ` [PATCH v3 18/20] drm/tidss: Switch " Maxime Ripard
2026-04-24 10:18 ` [PATCH v3 19/20] drm/tidss: Convert to atomic_create_state Maxime Ripard
2026-04-24 10:19 ` [PATCH v3 20/20] drm/bridge_connector: " Maxime Ripard

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