| From: |
| Maxime Ripard <mripard-AT-kernel.org> |
| To: |
| Maarten Lankhorst <maarten.lankhorst-AT-linux.intel.com>, Thomas Zimmermann <tzimmermann-AT-suse.de>, David Airlie <airlied-AT-gmail.com>, Simona Vetter <simona-AT-ffwll.ch>, Jonathan Corbet <corbet-AT-lwn.net>, Shuah Khan <skhan-AT-linuxfoundation.org>, Dmitry Baryshkov <dmitry.baryshkov-AT-oss.qualcomm.com>, Jyri Sarha <jyri.sarha-AT-iki.fi>, Tomi Valkeinen <tomi.valkeinen-AT-ideasonboard.com>, Andrzej Hajda <andrzej.hajda-AT-intel.com>, Neil Armstrong <neil.armstrong-AT-linaro.org>, Robert Foss <rfoss-AT-kernel.org>, Laurent Pinchart <Laurent.pinchart-AT-ideasonboard.com>, Jonas Karlman <jonas-AT-kwiboo.se>, Jernej Skrabec <jernej.skrabec-AT-gmail.com>, Simon Ser <contact-AT-emersion.fr>, Harry Wentland <harry.wentland-AT-amd.com>, Melissa Wen <mwen-AT-igalia.com>, Sebastian Wick <sebastian.wick-AT-redhat.com>, Alex Hung <alex.hung-AT-amd.com>, Jani Nikula <jani.nikula-AT-linux.intel.com>, Rodrigo Vivi <rodrigo.vivi-AT-intel.com>, Joonas Lahtinen <joonas.lahtinen-AT-linux.intel.com>, Tvrtko Ursulin <tursulin-AT-ursulin.net>, Chen-Yu Tsai <wens-AT-kernel.org>, Samuel Holland <samuel-AT-sholland.org>, Dave Stevenson <dave.stevenson-AT-raspberrypi.com>, MaĆra Canal <mcanal-AT-igalia.com>, Raspberry Pi Kernel Maintenance <kernel-list-AT-raspberrypi.com> |
| Subject: |
| [PATCH v2 00/20] drm/atomic: Rework initial state allocation |
| Date: |
| Fri, 20 Mar 2026 17:27:07 +0100 |
| Message-ID: |
| <20260320-drm-mode-config-init-v2-0-c63f1134e76c@kernel.org> |
| Cc: |
| dri-devel-AT-lists.freedesktop.org, linux-doc-AT-vger.kernel.org, linux-kernel-AT-vger.kernel.org, Daniel Stone <daniels-AT-collabora.com>, intel-gfx-AT-lists.freedesktop.org, intel-xe-AT-lists.freedesktop.org, linux-arm-kernel-AT-lists.infradead.org, linux-sunxi-AT-lists.linux.dev, Maxime Ripard <mripard-AT-kernel.org>, Laurent Pinchart <laurent.pinchart+renesas-AT-ideasonboard.com>, Laurent Pinchart <laurent.pinchart-AT-ideasonboard.com> |
| Archive-link: |
| Article |
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 are a documentation of the existing behaviour and some
random cleanups.
Then, we add the new atomic_create_state callback to every other DRM
object. Next, we leverage those new callbacks to create a new helper,
drm_mode_config_create_state() to create the initial state for all the
objects of a driver.
Finally, we hook that new helper in drm_dev_register and start
converting a few drivers.
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-read...
2: https://lore.kernel.org/dri-devel/5920ffe5-b6b1-484b-b320...
Signed-off-by: Maxime Ripard <mripard@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-v...
---
Maxime Ripard (20):
drm/colorop: Fix typos in the doc
drm/atomic: Drop drm_private_state.obj assignment from create_state
drm/mode-config: Mention drm_mode_config_reset() culprits
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_state()
drm/drv: Call drm_mode_config_create_state() by default
drm/atomic: Drop private obj state allocation
drm/drv: Drop drm_mode_config_reset() from our skeleton
drm/tidss: Drop call to drm_mode_config_reset at probe time
drm/tidss: Convert to atomic_create_state
drm/bridge_connector: Convert to atomic_create_state
drivers/gpu/drm/display/drm_bridge_connector.c | 17 ++-
drivers/gpu/drm/display/drm_hdmi_state_helper.c | 14 +-
drivers/gpu/drm/drm_atomic.c | 19 +--
drivers/gpu/drm/drm_atomic_state_helper.c | 170 ++++++++++++++++++---
drivers/gpu/drm/drm_colorop.c | 41 +++--
drivers/gpu/drm/drm_drv.c | 6 +-
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 | 2 -
drivers/gpu/drm/tidss/tidss_kms.c | 2 -
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_state_helper.h | 18 ++-
include/drm/drm_colorop.h | 2 +
include/drm/drm_connector.h | 13 ++
include/drm/drm_crtc.h | 13 ++
include/drm/drm_mode_config.h | 1 +
include/drm/drm_plane.h | 13 ++
23 files changed, 441 insertions(+), 77 deletions(-)
---
base-commit: cd5c40f745f10f082f75520ebc9deae3ea37b185
change-id: 20260310-drm-mode-config-init-1e1f52b745d0
prerequisite-change-id: 20251008-drm-private-obj-reset-ae1e2741027a:v5
prerequisite-patch-id: 9684f0ca4b16455c1340409561e8fb32f98b327a
prerequisite-patch-id: e177eb92b269436a94d7ef603d44436799be7469
prerequisite-patch-id: fef6d20ab33358c1db6cd9d21aa8ec0990cae758
prerequisite-patch-id: 2dcc96d43f34d8f6237829ed29d0087c092954d1
Best regards,
--
Maxime Ripard <mripard@kernel.org>