* Claude review: drm/tidss: Drop call to drm_mode_config_reset at probe time
2026-03-10 16:07 ` [PATCH 12/14] drm/tidss: Drop call to drm_mode_config_reset at probe time Maxime Ripard
@ 2026-03-11 3:09 ` Claude Code Review Bot
0 siblings, 0 replies; 43+ messages in thread
From: Claude Code Review Bot @ 2026-03-11 3:09 UTC (permalink / raw)
To: dri-devel-reviews
Patch Review
Correct. The tidss driver's reset callbacks only create states (no HW reset), so they are no longer needed since `drm_dev_register()` will now handle initial state creation.
---
Generated by Claude Code Patch Reviewer
^ permalink raw reply [flat|nested] 43+ messages in thread
* [PATCH v2 00/20] drm/atomic: Rework initial state allocation
@ 2026-03-20 16:27 Maxime Ripard
2026-03-20 16:27 ` [PATCH v2 01/20] drm/colorop: Fix typos in the doc Maxime Ripard
` (20 more replies)
0 siblings, 21 replies; 43+ messages in thread
From: Maxime Ripard @ 2026-03-20 16:27 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 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-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 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/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>
^ permalink raw reply [flat|nested] 43+ messages in thread
* [PATCH v2 01/20] drm/colorop: Fix typos in the doc
2026-03-20 16:27 [PATCH v2 00/20] drm/atomic: Rework initial state allocation Maxime Ripard
@ 2026-03-20 16:27 ` Maxime Ripard
2026-03-21 17:32 ` Claude review: " Claude Code Review Bot
2026-03-20 16:27 ` [PATCH v2 02/20] drm/atomic: Drop drm_private_state.obj assignment from create_state Maxime Ripard
` (19 subsequent siblings)
20 siblings, 1 reply; 43+ messages in thread
From: Maxime Ripard @ 2026-03-20 16:27 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
In the documentation of drm_colorop introduced by commit cfc27680ee20
("drm/colorop: Introduce new drm_colorop mode object"), the
documentation of __drm_colorop_state_reset() and __drm_colorop_reset()
were mentioning CRTC when they really meant colorop, probably due to
copy and paste.
Fixes: cfc27680ee20 ("drm/colorop: Introduce new drm_colorop mode object")
Signed-off-by: Maxime Ripard <mripard@kernel.org>
---
drivers/gpu/drm/drm_colorop.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/gpu/drm/drm_colorop.c b/drivers/gpu/drm/drm_colorop.c
index 566816e3c6f0c7d172534966fcfe56982e6505f3..373cd0ddb8fd4478874509ed12c95451c1f66203 100644
--- a/drivers/gpu/drm/drm_colorop.c
+++ b/drivers/gpu/drm/drm_colorop.c
@@ -503,11 +503,11 @@ void drm_colorop_atomic_destroy_state(struct drm_colorop *colorop,
* __drm_colorop_state_reset - resets colorop state to default values
* @colorop_state: atomic colorop state, must not be NULL
* @colorop: colorop object, must not be NULL
*
* Initializes the newly allocated @colorop_state with default
- * values. This is useful for drivers that subclass the CRTC state.
+ * values. This is useful for drivers that subclass the colorop state.
*/
static void __drm_colorop_state_reset(struct drm_colorop_state *colorop_state,
struct drm_colorop *colorop)
{
u64 val;
@@ -526,14 +526,14 @@ static void __drm_colorop_state_reset(struct drm_colorop_state *colorop_state,
/**
* __drm_colorop_reset - reset state on colorop
* @colorop: drm colorop
* @colorop_state: colorop state to assign
*
- * Initializes the newly allocated @colorop_state and assigns it to
- * the &drm_crtc->state pointer of @colorop, usually required when
- * initializing the drivers or when called from the &drm_colorop_funcs.reset
- * hook.
+ * Initializes the newly allocated @colorop_state and assigns it to the
+ * &drm_colorop->state pointer of @colorop, usually required when
+ * initializing the drivers or when called from the
+ * &drm_colorop_funcs.reset hook.
*
* This is useful for drivers that subclass the colorop state.
*/
static void __drm_colorop_reset(struct drm_colorop *colorop,
struct drm_colorop_state *colorop_state)
--
2.53.0
^ permalink raw reply related [flat|nested] 43+ messages in thread
* [PATCH v2 02/20] drm/atomic: Drop drm_private_state.obj assignment from create_state
2026-03-20 16:27 [PATCH v2 00/20] drm/atomic: Rework initial state allocation Maxime Ripard
2026-03-20 16:27 ` [PATCH v2 01/20] drm/colorop: Fix typos in the doc Maxime Ripard
@ 2026-03-20 16:27 ` Maxime Ripard
2026-03-21 17:32 ` Claude review: " Claude Code Review Bot
2026-03-20 16:27 ` [PATCH v2 03/20] drm/mode-config: Mention drm_mode_config_reset() culprits Maxime Ripard
` (18 subsequent siblings)
20 siblings, 1 reply; 43+ messages in thread
From: Maxime Ripard @ 2026-03-20 16:27 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
The initial intent of the atomic_create_state helper was to simply
allocate a proper drm_private_state and returning it, without any side
effect.
However, the __drm_atomic_helper_private_obj_create_state() introduces a
side effect by setting the drm_private_obj.state to the newly allocated
state.
This assignment defeats the purpose, but is also redundant since
the only caller, drm_atomic_private_obj_init(), will also set this
pointer to the newly allocated state.
Let's drop the assignment in __drm_atomic_helper_private_obj_create_state().
Fixes: e7be39ed1716 ("drm/atomic-helper: Add private_obj atomic_create_state helper")
Signed-off-by: Maxime Ripard <mripard@kernel.org>
---
drivers/gpu/drm/drm_atomic_state_helper.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/gpu/drm/drm_atomic_state_helper.c b/drivers/gpu/drm/drm_atomic_state_helper.c
index 76746ad4a1bbb7142c067c93dd05fbec5d2f98eb..875149494b00e1eb7481e87d7d7038103b72b7e3 100644
--- a/drivers/gpu/drm/drm_atomic_state_helper.c
+++ b/drivers/gpu/drm/drm_atomic_state_helper.c
@@ -729,12 +729,10 @@ EXPORT_SYMBOL(drm_atomic_helper_connector_destroy_state);
void __drm_atomic_helper_private_obj_create_state(struct drm_private_obj *obj,
struct drm_private_state *state)
{
if (state)
state->obj = obj;
-
- obj->state = state;
}
EXPORT_SYMBOL(__drm_atomic_helper_private_obj_create_state);
/**
* __drm_atomic_helper_private_obj_duplicate_state - copy atomic private state
--
2.53.0
^ permalink raw reply related [flat|nested] 43+ messages in thread
* [PATCH v2 03/20] drm/mode-config: Mention drm_mode_config_reset() culprits
2026-03-20 16:27 [PATCH v2 00/20] drm/atomic: Rework initial state allocation Maxime Ripard
2026-03-20 16:27 ` [PATCH v2 01/20] drm/colorop: Fix typos in the doc Maxime Ripard
2026-03-20 16:27 ` [PATCH v2 02/20] drm/atomic: Drop drm_private_state.obj assignment from create_state Maxime Ripard
@ 2026-03-20 16:27 ` Maxime Ripard
2026-03-21 17:32 ` Claude review: " Claude Code Review Bot
2026-03-20 16:27 ` [PATCH v2 04/20] drm/colorop: Rename __drm_colorop_state_reset() Maxime Ripard
` (17 subsequent siblings)
20 siblings, 1 reply; 43+ messages in thread
From: Maxime Ripard @ 2026-03-20 16:27 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
drm_mode_config_reset() does not reset drm_private_states by design.
This is especially significant for the DP MST and tunneling code that
expect to be preserved across a suspend/resume cycle, where
drm_mode_config_reset() is also used.
Let's document this expectation.
Link: https://lore.kernel.org/dri-devel/aOaQLx-7EpsHRwkH@ideak-desk/
Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Maxime Ripard <mripard@kernel.org>
---
drivers/gpu/drm/drm_mode_config.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/gpu/drm/drm_mode_config.c b/drivers/gpu/drm/drm_mode_config.c
index 66f7dc37b5970c0a08f8dde008aef56376c59f37..cba527571ca66d3aa6dc652c87e03a19815d1d41 100644
--- a/drivers/gpu/drm/drm_mode_config.c
+++ b/drivers/gpu/drm/drm_mode_config.c
@@ -187,10 +187,14 @@ int drm_mode_getresources(struct drm_device *dev, void *data,
* @dev: drm device
*
* This functions calls all the crtc's, encoder's and connector's ->reset
* callback. Drivers can use this in e.g. their driver load or resume code to
* reset hardware and software state.
+ *
+ * Note that @drm_private_obj structures are expected to be stable across
+ * suspend/resume cycles, and @drm_mode_config_reset() does not affect these
+ * structures.
*/
void drm_mode_config_reset(struct drm_device *dev)
{
struct drm_crtc *crtc;
struct drm_colorop *colorop;
--
2.53.0
^ permalink raw reply related [flat|nested] 43+ messages in thread
* [PATCH v2 04/20] drm/colorop: Rename __drm_colorop_state_reset()
2026-03-20 16:27 [PATCH v2 00/20] drm/atomic: Rework initial state allocation Maxime Ripard
` (2 preceding siblings ...)
2026-03-20 16:27 ` [PATCH v2 03/20] drm/mode-config: Mention drm_mode_config_reset() culprits Maxime Ripard
@ 2026-03-20 16:27 ` Maxime Ripard
2026-03-21 17:32 ` Claude review: " Claude Code Review Bot
2026-03-20 16:27 ` [PATCH v2 05/20] drm/colorop: Create drm_atomic_helper_colorop_create_state() Maxime Ripard
` (16 subsequent siblings)
20 siblings, 1 reply; 43+ messages in thread
From: Maxime Ripard @ 2026-03-20 16:27 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
__drm_colorop_state_reset() is used to initialize a newly allocated
drm_colorop_state, and is being typically called by drm_colorop_reset().
Since we want to consolidate DRM objects state allocation around the
atomic_create_state callback that will only allocate and initialize a
new drm_colorop_state instance, we will need to call
__drm_colorop_state_reset() from both the reset and atomic_create paths.
To avoid any confusion, we can thus rename __drm_colorop_state_reset()
to __drm_colorop_state_init().
Signed-off-by: Maxime Ripard <mripard@kernel.org>
---
drivers/gpu/drm/drm_colorop.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/drm_colorop.c b/drivers/gpu/drm/drm_colorop.c
index 373cd0ddb8fd4478874509ed12c95451c1f66203..6a26b83b260e8d8e83c703ecde490a7a8740ebfb 100644
--- a/drivers/gpu/drm/drm_colorop.c
+++ b/drivers/gpu/drm/drm_colorop.c
@@ -498,19 +498,19 @@ void drm_colorop_atomic_destroy_state(struct drm_colorop *colorop,
__drm_atomic_helper_colorop_destroy_state(state);
kfree(state);
}
/**
- * __drm_colorop_state_reset - resets colorop state to default values
+ * __drm_colorop_state_init - Initializes colorop state to default values
* @colorop_state: atomic colorop state, must not be NULL
* @colorop: colorop object, must not be NULL
*
* Initializes the newly allocated @colorop_state with default
* values. This is useful for drivers that subclass the colorop state.
*/
-static void __drm_colorop_state_reset(struct drm_colorop_state *colorop_state,
- struct drm_colorop *colorop)
+static void __drm_colorop_state_init(struct drm_colorop_state *colorop_state,
+ struct drm_colorop *colorop)
{
u64 val;
colorop_state->colorop = colorop;
colorop_state->bypass = true;
@@ -537,11 +537,11 @@ static void __drm_colorop_state_reset(struct drm_colorop_state *colorop_state,
*/
static void __drm_colorop_reset(struct drm_colorop *colorop,
struct drm_colorop_state *colorop_state)
{
if (colorop_state)
- __drm_colorop_state_reset(colorop_state, colorop);
+ __drm_colorop_state_init(colorop_state, colorop);
colorop->state = colorop_state;
}
void drm_colorop_reset(struct drm_colorop *colorop)
--
2.53.0
^ permalink raw reply related [flat|nested] 43+ messages in thread
* [PATCH v2 05/20] drm/colorop: Create drm_atomic_helper_colorop_create_state()
2026-03-20 16:27 [PATCH v2 00/20] drm/atomic: Rework initial state allocation Maxime Ripard
` (3 preceding siblings ...)
2026-03-20 16:27 ` [PATCH v2 04/20] drm/colorop: Rename __drm_colorop_state_reset() Maxime Ripard
@ 2026-03-20 16:27 ` Maxime Ripard
2026-03-21 17:32 ` Claude review: " Claude Code Review Bot
2026-03-20 16:27 ` [PATCH v2 06/20] drm/atomic-state-helper: Fix __drm_atomic_helper_plane_reset() doc typo Maxime Ripard
` (15 subsequent siblings)
20 siblings, 1 reply; 43+ messages in thread
From: Maxime Ripard @ 2026-03-20 16:27 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
Commit 47b5ac7daa46 ("drm/atomic: Add new atomic_create_state callback
to drm_private_obj") introduced a new pattern for allocating drm object
states.
Instead of relying on the reset() callback, it created a new
atomic_create_state hook. This is helpful because reset is a bit
overloaded: it's used to create the initial software state, reset it,
but also reset the hardware.
It can also be used either at probe time, to create the initial state
and possibly reset the hardware to an expected default, but also during
suspend/resume.
Both these cases come with different expectations too: during the
initialization, we want to initialize all states, but during
suspend/resume, drm_private_states for example are expected to be kept
around.
And reset() isn't fallible, which makes it harder to handle
initialization errors properly.
It's also only relevant for some drivers, since all the helpers for
reset only create a new state, and don't touch the hardware at all.
It was thus decided to create a new hook that would allocate and
initialize a pristine state without any side effect: atomic_create_state
to untangle a bit some of it, and to separate the
initialization with the actual reset one might need during a
suspend/resume.
Let's continue the transition to the new pattern with drm_colorop.
Signed-off-by: Maxime Ripard <mripard@kernel.org>
---
drivers/gpu/drm/drm_colorop.c | 23 +++++++++++++++++++++++
include/drm/drm_colorop.h | 2 ++
2 files changed, 25 insertions(+)
diff --git a/drivers/gpu/drm/drm_colorop.c b/drivers/gpu/drm/drm_colorop.c
index 6a26b83b260e8d8e83c703ecde490a7a8740ebfb..7bfaf2617ec315f42d80ac72a5eaaef868e65657 100644
--- a/drivers/gpu/drm/drm_colorop.c
+++ b/drivers/gpu/drm/drm_colorop.c
@@ -521,10 +521,33 @@ static void __drm_colorop_state_init(struct drm_colorop_state *colorop_state,
&val);
colorop_state->curve_1d_type = val;
}
}
+/**
+ * drm_atomic_helper_colorop_create_state - Allocates and initializes colorop atomic state
+ * @colorop: drm colorop
+ *
+ * Initializes a pristine @drm_colorop_state.
+ *
+ * RETURNS:
+ * Pointer to new colorop state, or ERR_PTR on failure.
+ */
+struct drm_colorop_state *
+drm_atomic_helper_colorop_create_state(struct drm_colorop *colorop)
+{
+ struct drm_colorop_state *state;
+
+ state = kzalloc_obj(*state);
+ if (!state)
+ return ERR_PTR(-ENOMEM);
+
+ __drm_colorop_state_init(state, colorop);
+
+ return state;
+}
+
/**
* __drm_colorop_reset - reset state on colorop
* @colorop: drm colorop
* @colorop_state: colorop state to assign
*
diff --git a/include/drm/drm_colorop.h b/include/drm/drm_colorop.h
index bd082854ca74cac90b42020b09206a8516687666..874ed693329c0ecf94567c094744fe86fd08e382 100644
--- a/include/drm/drm_colorop.h
+++ b/include/drm/drm_colorop.h
@@ -423,10 +423,12 @@ int drm_plane_colorop_3dlut_init(struct drm_device *dev, struct drm_colorop *col
struct drm_plane *plane, const struct drm_colorop_funcs *funcs,
uint32_t lut_size,
enum drm_colorop_lut3d_interpolation_type interpolation,
uint32_t flags);
+struct drm_colorop_state *
+drm_atomic_helper_colorop_create_state(struct drm_colorop *colorop);
struct drm_colorop_state *
drm_atomic_helper_colorop_duplicate_state(struct drm_colorop *colorop);
void drm_colorop_atomic_destroy_state(struct drm_colorop *colorop,
struct drm_colorop_state *state);
--
2.53.0
^ permalink raw reply related [flat|nested] 43+ messages in thread
* [PATCH v2 06/20] drm/atomic-state-helper: Fix __drm_atomic_helper_plane_reset() doc typo
2026-03-20 16:27 [PATCH v2 00/20] drm/atomic: Rework initial state allocation Maxime Ripard
` (4 preceding siblings ...)
2026-03-20 16:27 ` [PATCH v2 05/20] drm/colorop: Create drm_atomic_helper_colorop_create_state() Maxime Ripard
@ 2026-03-20 16:27 ` Maxime Ripard
2026-03-21 17:32 ` Claude review: " Claude Code Review Bot
2026-03-20 16:27 ` [PATCH v2 07/20] drm/atomic-state-helper: Rename __drm_atomic_helper_plane_state_reset() Maxime Ripard
` (14 subsequent siblings)
20 siblings, 1 reply; 43+ messages in thread
From: Maxime Ripard @ 2026-03-20 16:27 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
A typo has slipped through in the __drm_atomic_helper_plane_reset()
documentation, probably due to copy and paste. It will not assign
drm_crtc state pointer, but rather the drm_plane's.
Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Maxime Ripard <mripard@kernel.org>
---
drivers/gpu/drm/drm_atomic_state_helper.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/drm_atomic_state_helper.c b/drivers/gpu/drm/drm_atomic_state_helper.c
index 875149494b00e1eb7481e87d7d7038103b72b7e3..e1f3d05ad3470154a6be01423979a4deb8617441 100644
--- a/drivers/gpu/drm/drm_atomic_state_helper.c
+++ b/drivers/gpu/drm/drm_atomic_state_helper.c
@@ -303,11 +303,11 @@ EXPORT_SYMBOL(__drm_atomic_helper_plane_state_reset);
* __drm_atomic_helper_plane_reset - reset state on plane
* @plane: drm plane
* @plane_state: plane state to assign
*
* Initializes the newly allocated @plane_state and assigns it to
- * the &drm_crtc->state pointer of @plane, usually required when
+ * the &drm_plane->state pointer of @plane, usually required when
* initializing the drivers or when called from the &drm_plane_funcs.reset
* hook.
*
* This is useful for drivers that subclass the plane state.
*/
--
2.53.0
^ permalink raw reply related [flat|nested] 43+ messages in thread
* [PATCH v2 07/20] drm/atomic-state-helper: Rename __drm_atomic_helper_plane_state_reset()
2026-03-20 16:27 [PATCH v2 00/20] drm/atomic: Rework initial state allocation Maxime Ripard
` (5 preceding siblings ...)
2026-03-20 16:27 ` [PATCH v2 06/20] drm/atomic-state-helper: Fix __drm_atomic_helper_plane_reset() doc typo Maxime Ripard
@ 2026-03-20 16:27 ` Maxime Ripard
2026-03-21 17:32 ` Claude review: " Claude Code Review Bot
2026-03-20 16:27 ` [PATCH v2 08/20] drm/plane: Add new atomic_create_state callback Maxime Ripard
` (13 subsequent siblings)
20 siblings, 1 reply; 43+ messages in thread
From: Maxime Ripard @ 2026-03-20 16:27 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
__drm_atomic_helper_plane_state_reset() is used to initialize a newly
allocated drm_plane_state, and is being typically called by the
drm_plane_funcs.reset implementation.
Since we want to consolidate DRM objects state allocation around the
atomic_create_state callback that will only allocate and initialize a
new drm_plane_state instance, we will need to call
__drm_atomic_helper_plane_state_reset() from both the reset and
atomic_create hooks.
To avoid any confusion, we can thus rename
__drm_atomic_helper_plane_state_reset() to
__drm_atomic_helper_plane_state_init().
Suggested-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Maxime Ripard <mripard@kernel.org>
---
drivers/gpu/drm/drm_atomic_state_helper.c | 10 +++++-----
drivers/gpu/drm/i915/display/intel_plane.c | 2 +-
include/drm/drm_atomic_state_helper.h | 2 +-
3 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/drivers/gpu/drm/drm_atomic_state_helper.c b/drivers/gpu/drm/drm_atomic_state_helper.c
index e1f3d05ad3470154a6be01423979a4deb8617441..2548d6da13675f63304dc92423c5d225de0447a8 100644
--- a/drivers/gpu/drm/drm_atomic_state_helper.c
+++ b/drivers/gpu/drm/drm_atomic_state_helper.c
@@ -235,19 +235,19 @@ void drm_atomic_helper_crtc_destroy_state(struct drm_crtc *crtc,
kfree(state);
}
EXPORT_SYMBOL(drm_atomic_helper_crtc_destroy_state);
/**
- * __drm_atomic_helper_plane_state_reset - resets plane state to default values
+ * __drm_atomic_helper_plane_state_init - Init plane state to default values
* @plane_state: atomic plane state, must not be NULL
* @plane: plane object, must not be NULL
*
* Initializes the newly allocated @plane_state with default
* values. This is useful for drivers that subclass the CRTC state.
*/
-void __drm_atomic_helper_plane_state_reset(struct drm_plane_state *plane_state,
- struct drm_plane *plane)
+void __drm_atomic_helper_plane_state_init(struct drm_plane_state *plane_state,
+ struct drm_plane *plane)
{
u64 val;
plane_state->plane = plane;
plane_state->rotation = DRM_MODE_ROTATE_0;
@@ -295,11 +295,11 @@ void __drm_atomic_helper_plane_state_reset(struct drm_plane_state *plane_state,
plane->hotspot_y_property,
&val))
plane_state->hotspot_y = val;
}
}
-EXPORT_SYMBOL(__drm_atomic_helper_plane_state_reset);
+EXPORT_SYMBOL(__drm_atomic_helper_plane_state_init);
/**
* __drm_atomic_helper_plane_reset - reset state on plane
* @plane: drm plane
* @plane_state: plane state to assign
@@ -313,11 +313,11 @@ EXPORT_SYMBOL(__drm_atomic_helper_plane_state_reset);
*/
void __drm_atomic_helper_plane_reset(struct drm_plane *plane,
struct drm_plane_state *plane_state)
{
if (plane_state)
- __drm_atomic_helper_plane_state_reset(plane_state, plane);
+ __drm_atomic_helper_plane_state_init(plane_state, plane);
plane->state = plane_state;
}
EXPORT_SYMBOL(__drm_atomic_helper_plane_reset);
diff --git a/drivers/gpu/drm/i915/display/intel_plane.c b/drivers/gpu/drm/i915/display/intel_plane.c
index e06a0618b4c6cd3b4d13752f604006b525118193..705367fef836663e50fe9bbfb1fcc83abf1fb249 100644
--- a/drivers/gpu/drm/i915/display/intel_plane.c
+++ b/drivers/gpu/drm/i915/display/intel_plane.c
@@ -65,11 +65,11 @@
static void intel_plane_state_reset(struct intel_plane_state *plane_state,
struct intel_plane *plane)
{
memset(plane_state, 0, sizeof(*plane_state));
- __drm_atomic_helper_plane_state_reset(&plane_state->uapi, &plane->base);
+ __drm_atomic_helper_plane_state_init(&plane_state->uapi, &plane->base);
plane_state->scaler_id = -1;
}
struct intel_plane *intel_plane_alloc(void)
diff --git a/include/drm/drm_atomic_state_helper.h b/include/drm/drm_atomic_state_helper.h
index 900672c6ea90ba9cb87e38a7c84225972aee43c5..44e8850aae7fd6390f4b58188a9c677b8389702f 100644
--- a/include/drm/drm_atomic_state_helper.h
+++ b/include/drm/drm_atomic_state_helper.h
@@ -51,11 +51,11 @@ struct drm_crtc_state *
drm_atomic_helper_crtc_duplicate_state(struct drm_crtc *crtc);
void __drm_atomic_helper_crtc_destroy_state(struct drm_crtc_state *state);
void drm_atomic_helper_crtc_destroy_state(struct drm_crtc *crtc,
struct drm_crtc_state *state);
-void __drm_atomic_helper_plane_state_reset(struct drm_plane_state *state,
+void __drm_atomic_helper_plane_state_init(struct drm_plane_state *state,
struct drm_plane *plane);
void __drm_atomic_helper_plane_reset(struct drm_plane *plane,
struct drm_plane_state *state);
void drm_atomic_helper_plane_reset(struct drm_plane *plane);
void __drm_atomic_helper_plane_duplicate_state(struct drm_plane *plane,
--
2.53.0
^ permalink raw reply related [flat|nested] 43+ messages in thread
* [PATCH v2 08/20] drm/plane: Add new atomic_create_state callback
2026-03-20 16:27 [PATCH v2 00/20] drm/atomic: Rework initial state allocation Maxime Ripard
` (6 preceding siblings ...)
2026-03-20 16:27 ` [PATCH v2 07/20] drm/atomic-state-helper: Rename __drm_atomic_helper_plane_state_reset() Maxime Ripard
@ 2026-03-20 16:27 ` Maxime Ripard
2026-03-21 17:32 ` Claude review: " Claude Code Review Bot
2026-03-20 16:27 ` [PATCH v2 09/20] drm/atomic-state-helper: Rename __drm_atomic_helper_crtc_state_reset() Maxime Ripard
` (12 subsequent siblings)
20 siblings, 1 reply; 43+ messages in thread
From: Maxime Ripard @ 2026-03-20 16:27 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
Commit 47b5ac7daa46 ("drm/atomic: Add new atomic_create_state callback
to drm_private_obj") introduced a new pattern for allocating drm object
states.
Instead of relying on the reset() callback, it created a new
atomic_create_state hook. This is helpful because reset is a bit
overloaded: it's used to create the initial software state, reset it,
but also reset the hardware.
It can also be used either at probe time, to create the initial state
and possibly reset the hardware to an expected default, but also during
suspend/resume.
Both these cases come with different expectations too: during the
initialization, we want to initialize all states, but during
suspend/resume, drm_private_states for example are expected to be kept
around.
And reset() isn't fallible, which makes it harder to handle
initialization errors properly.
And this is only really relevant for some drivers, since all the helpers
for reset only create a new state, and don't touch the hardware at all.
It was thus decided to create a new hook that would allocate and
initialize a pristine state without any side effect:
atomic_create_state to untangle a bit some of it, and to separate the
initialization with the actual reset one might need during a
suspend/resume.
Let's continue the transition to the new pattern with planes.
Signed-off-by: Maxime Ripard <mripard@kernel.org>
---
drivers/gpu/drm/drm_atomic_state_helper.c | 44 +++++++++++++++++++++++++++++++
drivers/gpu/drm/drm_mode_config.c | 21 ++++++++++++++-
include/drm/drm_atomic_state_helper.h | 4 +++
include/drm/drm_plane.h | 13 +++++++++
4 files changed, 81 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/drm_atomic_state_helper.c b/drivers/gpu/drm/drm_atomic_state_helper.c
index 2548d6da13675f63304dc92423c5d225de0447a8..f4ce9d3573cbecf216904db54335e0cf84a01c39 100644
--- a/drivers/gpu/drm/drm_atomic_state_helper.c
+++ b/drivers/gpu/drm/drm_atomic_state_helper.c
@@ -319,10 +319,29 @@ void __drm_atomic_helper_plane_reset(struct drm_plane *plane,
plane->state = plane_state;
}
EXPORT_SYMBOL(__drm_atomic_helper_plane_reset);
+/**
+ * __drm_atomic_helper_plane_create_state - initializes plane state
+ * @plane: plane object
+ * @state: new state to initialize
+ *
+ * Initializes the newly allocated @state, usually required when
+ * initializing the drivers.
+ *
+ * @state is assumed to be zeroed.
+ *
+ * This is useful for drivers that subclass @drm_plane_state.
+ */
+void __drm_atomic_helper_plane_create_state(struct drm_plane *plane,
+ struct drm_plane_state *state)
+{
+ __drm_atomic_helper_plane_state_init(state, plane);
+}
+EXPORT_SYMBOL(__drm_atomic_helper_plane_create_state);
+
/**
* drm_atomic_helper_plane_reset - default &drm_plane_funcs.reset hook for planes
* @plane: drm plane
*
* Resets the atomic state for @plane by freeing the state pointer (which might
@@ -338,10 +357,35 @@ void drm_atomic_helper_plane_reset(struct drm_plane *plane)
if (plane->state)
__drm_atomic_helper_plane_reset(plane, plane->state);
}
EXPORT_SYMBOL(drm_atomic_helper_plane_reset);
+/**
+ * drm_atomic_helper_plane_create_state - default &drm_plane_funcs.atomic_create_state hook for planes
+ * @plane: plane object
+ *
+ * Initializes a pristine @drm_plane_state.
+ *
+ * This is useful for drivers that don't subclass @drm_plane_state.
+ *
+ * RETURNS:
+ * Pointer to new plane state, or ERR_PTR on failure.
+ */
+struct drm_plane_state *drm_atomic_helper_plane_create_state(struct drm_plane *plane)
+{
+ struct drm_plane_state *state;
+
+ state = kzalloc_obj(*state);
+ if (!state)
+ return ERR_PTR(-ENOMEM);
+
+ __drm_atomic_helper_plane_create_state(plane, state);
+
+ return state;
+}
+EXPORT_SYMBOL(drm_atomic_helper_plane_create_state);
+
/**
* __drm_atomic_helper_plane_duplicate_state - copy atomic plane state
* @plane: plane object
* @state: atomic plane state
*
diff --git a/drivers/gpu/drm/drm_mode_config.c b/drivers/gpu/drm/drm_mode_config.c
index cba527571ca66d3aa6dc652c87e03a19815d1d41..09b8292195ba5eb5d96735aee5506407bd32ade3 100644
--- a/drivers/gpu/drm/drm_mode_config.c
+++ b/drivers/gpu/drm/drm_mode_config.c
@@ -180,10 +180,26 @@ int drm_mode_getresources(struct drm_device *dev, void *data,
drm_connector_list_iter_end(&conn_iter);
return ret;
}
+static int drm_mode_config_plane_create_state(struct drm_plane *plane)
+{
+ struct drm_plane_state *plane_state;
+
+ if (!plane->funcs->atomic_create_state)
+ return 0;
+
+ plane_state = plane->funcs->atomic_create_state(plane);
+ if (IS_ERR(plane_state))
+ return PTR_ERR(plane_state);
+
+ plane->state = plane_state;
+
+ return 0;
+}
+
/**
* drm_mode_config_reset - call ->reset callbacks
* @dev: drm device
*
* This functions calls all the crtc's, encoder's and connector's ->reset
@@ -204,13 +220,16 @@ void drm_mode_config_reset(struct drm_device *dev)
struct drm_connector_list_iter conn_iter;
drm_for_each_colorop(colorop, dev)
drm_colorop_reset(colorop);
- drm_for_each_plane(plane, dev)
+ drm_for_each_plane(plane, dev) {
if (plane->funcs->reset)
plane->funcs->reset(plane);
+ else if (plane->funcs->atomic_create_state)
+ drm_mode_config_plane_create_state(plane);
+ }
drm_for_each_crtc(crtc, dev)
if (crtc->funcs->reset)
crtc->funcs->reset(crtc);
diff --git a/include/drm/drm_atomic_state_helper.h b/include/drm/drm_atomic_state_helper.h
index 44e8850aae7fd6390f4b58188a9c677b8389702f..6a3a2feb3dff1f2fbdf2a6e63d8d7317c7d6ead6 100644
--- a/include/drm/drm_atomic_state_helper.h
+++ b/include/drm/drm_atomic_state_helper.h
@@ -53,10 +53,14 @@ void __drm_atomic_helper_crtc_destroy_state(struct drm_crtc_state *state);
void drm_atomic_helper_crtc_destroy_state(struct drm_crtc *crtc,
struct drm_crtc_state *state);
void __drm_atomic_helper_plane_state_init(struct drm_plane_state *state,
struct drm_plane *plane);
+void __drm_atomic_helper_plane_create_state(struct drm_plane *plane,
+ struct drm_plane_state *state);
+struct drm_plane_state *
+drm_atomic_helper_plane_create_state(struct drm_plane *plane);
void __drm_atomic_helper_plane_reset(struct drm_plane *plane,
struct drm_plane_state *state);
void drm_atomic_helper_plane_reset(struct drm_plane *plane);
void __drm_atomic_helper_plane_duplicate_state(struct drm_plane *plane,
struct drm_plane_state *state);
diff --git a/include/drm/drm_plane.h b/include/drm/drm_plane.h
index 703ef4d1bbbcf084c43aa5e127d28691878061c4..4d4d511b681d50c17fbc593cce9f706d63e04a52 100644
--- a/include/drm/drm_plane.h
+++ b/include/drm/drm_plane.h
@@ -386,10 +386,23 @@ struct drm_plane_funcs {
* 0 on success or a negative error code on failure.
*/
int (*set_property)(struct drm_plane *plane,
struct drm_property *property, uint64_t val);
+ /**
+ * @atomic_create_state:
+ *
+ * Allocates a pristine, initialized, state for the plane object
+ * and returns it.
+ *
+ * RETURNS:
+ *
+ * A new, pristine, plane state instance or an error pointer
+ * on failure.
+ */
+ struct drm_plane_state *(*atomic_create_state)(struct drm_plane *plane);
+
/**
* @atomic_duplicate_state:
*
* Duplicate the current atomic state for this plane and return it.
* The core and helpers guarantee that any atomic state duplicated with
--
2.53.0
^ permalink raw reply related [flat|nested] 43+ messages in thread
* [PATCH v2 09/20] drm/atomic-state-helper: Rename __drm_atomic_helper_crtc_state_reset()
2026-03-20 16:27 [PATCH v2 00/20] drm/atomic: Rework initial state allocation Maxime Ripard
` (7 preceding siblings ...)
2026-03-20 16:27 ` [PATCH v2 08/20] drm/plane: Add new atomic_create_state callback Maxime Ripard
@ 2026-03-20 16:27 ` Maxime Ripard
2026-03-21 17:32 ` Claude review: " Claude Code Review Bot
2026-03-20 16:27 ` [PATCH v2 10/20] drm/crtc: Add new atomic_create_state callback Maxime Ripard
` (11 subsequent siblings)
20 siblings, 1 reply; 43+ messages in thread
From: Maxime Ripard @ 2026-03-20 16:27 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
__drm_atomic_helper_crtc_state_reset() is used to initialize a newly
allocated drm_crtc_state, and is being typically called by the
drm_crtc_funcs.reset implementation.
Since we want to consolidate DRM objects state allocation around the
atomic_create_state callback that will only allocate and initialize a
new drm_crtc_state instance, we will need to call
__drm_atomic_helper_crtc_state_reset() from both the reset and
atomic_create hooks.
To avoid any confusion, we can thus rename
__drm_atomic_helper_crtc_state_reset() to
__drm_atomic_helper_crtc_state_init().
Suggested-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Maxime Ripard <mripard@kernel.org>
---
drivers/gpu/drm/drm_atomic_state_helper.c | 10 +++++-----
drivers/gpu/drm/i915/display/intel_crtc.c | 2 +-
include/drm/drm_atomic_state_helper.h | 2 +-
3 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/drivers/gpu/drm/drm_atomic_state_helper.c b/drivers/gpu/drm/drm_atomic_state_helper.c
index f4ce9d3573cbecf216904db54335e0cf84a01c39..b87cc3cd5b0021699ac57a33739d172a5706e2e1 100644
--- a/drivers/gpu/drm/drm_atomic_state_helper.c
+++ b/drivers/gpu/drm/drm_atomic_state_helper.c
@@ -61,25 +61,25 @@
* For other drivers the building blocks are split out, see the documentation
* for these functions.
*/
/**
- * __drm_atomic_helper_crtc_state_reset - reset the CRTC state
+ * __drm_atomic_helper_crtc_state_init - Initializes the CRTC state
* @crtc_state: atomic CRTC state, must not be NULL
* @crtc: CRTC object, must not be NULL
*
* Initializes the newly allocated @crtc_state with default
* values. This is useful for drivers that subclass the CRTC state.
*/
void
-__drm_atomic_helper_crtc_state_reset(struct drm_crtc_state *crtc_state,
- struct drm_crtc *crtc)
+__drm_atomic_helper_crtc_state_init(struct drm_crtc_state *crtc_state,
+ struct drm_crtc *crtc)
{
crtc_state->crtc = crtc;
crtc_state->background_color = DRM_ARGB64_PREP(0xffff, 0, 0, 0);
}
-EXPORT_SYMBOL(__drm_atomic_helper_crtc_state_reset);
+EXPORT_SYMBOL(__drm_atomic_helper_crtc_state_init);
/**
* __drm_atomic_helper_crtc_reset - reset state on CRTC
* @crtc: drm CRTC
* @crtc_state: CRTC state to assign
@@ -94,11 +94,11 @@ EXPORT_SYMBOL(__drm_atomic_helper_crtc_state_reset);
void
__drm_atomic_helper_crtc_reset(struct drm_crtc *crtc,
struct drm_crtc_state *crtc_state)
{
if (crtc_state)
- __drm_atomic_helper_crtc_state_reset(crtc_state, crtc);
+ __drm_atomic_helper_crtc_state_init(crtc_state, crtc);
if (drm_dev_has_vblank(crtc->dev))
drm_crtc_vblank_reset(crtc);
crtc->state = crtc_state;
diff --git a/drivers/gpu/drm/i915/display/intel_crtc.c b/drivers/gpu/drm/i915/display/intel_crtc.c
index 53378d2dcbec867e7973cb3b874802f2ada01d41..b57a59a5f7786f1029d576b0f3d564e77b7060e4 100644
--- a/drivers/gpu/drm/i915/display/intel_crtc.c
+++ b/drivers/gpu/drm/i915/display/intel_crtc.c
@@ -179,11 +179,11 @@ struct intel_crtc_state *intel_crtc_state_alloc(struct intel_crtc *crtc)
void intel_crtc_state_reset(struct intel_crtc_state *crtc_state,
struct intel_crtc *crtc)
{
memset(crtc_state, 0, sizeof(*crtc_state));
- __drm_atomic_helper_crtc_state_reset(&crtc_state->uapi, &crtc->base);
+ __drm_atomic_helper_crtc_state_init(&crtc_state->uapi, &crtc->base);
crtc_state->cpu_transcoder = INVALID_TRANSCODER;
crtc_state->master_transcoder = INVALID_TRANSCODER;
crtc_state->hsw_workaround_pipe = INVALID_PIPE;
crtc_state->scaler_state.scaler_id = -1;
diff --git a/include/drm/drm_atomic_state_helper.h b/include/drm/drm_atomic_state_helper.h
index 6a3a2feb3dff1f2fbdf2a6e63d8d7317c7d6ead6..161cd1f6b8266e882eb1fd128b403cba350be3d2 100644
--- a/include/drm/drm_atomic_state_helper.h
+++ b/include/drm/drm_atomic_state_helper.h
@@ -38,11 +38,11 @@ struct drm_connector_state;
struct drm_private_obj;
struct drm_private_state;
struct drm_modeset_acquire_ctx;
struct drm_device;
-void __drm_atomic_helper_crtc_state_reset(struct drm_crtc_state *state,
+void __drm_atomic_helper_crtc_state_init(struct drm_crtc_state *state,
struct drm_crtc *crtc);
void __drm_atomic_helper_crtc_reset(struct drm_crtc *crtc,
struct drm_crtc_state *state);
void drm_atomic_helper_crtc_reset(struct drm_crtc *crtc);
void __drm_atomic_helper_crtc_duplicate_state(struct drm_crtc *crtc,
--
2.53.0
^ permalink raw reply related [flat|nested] 43+ messages in thread
* [PATCH v2 10/20] drm/crtc: Add new atomic_create_state callback
2026-03-20 16:27 [PATCH v2 00/20] drm/atomic: Rework initial state allocation Maxime Ripard
` (8 preceding siblings ...)
2026-03-20 16:27 ` [PATCH v2 09/20] drm/atomic-state-helper: Rename __drm_atomic_helper_crtc_state_reset() Maxime Ripard
@ 2026-03-20 16:27 ` Maxime Ripard
2026-03-21 17:32 ` Claude review: " Claude Code Review Bot
2026-03-20 16:27 ` [PATCH v2 11/20] drm/atomic-state-helper: Rename __drm_atomic_helper_connector_state_reset() Maxime Ripard
` (10 subsequent siblings)
20 siblings, 1 reply; 43+ messages in thread
From: Maxime Ripard @ 2026-03-20 16:27 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
Commit 47b5ac7daa46 ("drm/atomic: Add new atomic_create_state callback
to drm_private_obj") introduced a new pattern for allocating drm object
states.
Instead of relying on the reset() callback, it created a new
atomic_create_state hook. This is helpful because reset is a bit
overloaded: it's used to create the initial software tate, reset it, but
also reset the hardware.
It can also be used either at probe time, to create the initial state
and possibly reset the hardware to an expected default, but also during
suspend/resume.
Both these cases come with different expectations too: during the
initialization, we want to initialize all states, but during
suspend/resume, drm_private_states for example are expected to be kept
around.
And reset() isn't fallible, which makes it harder to handle
initialization errors properly.
And this is only really relevant for some drivers, since all the helpers
for reset only create a new state, and don't touch the hardware at all.
It was thus decided to create a new hook that would allocate and
initialize a pristine state without any side effect:
atomic_create_state to untangle a bit some of it, and to separate the
initialization with the actual reset one might need during a
suspend/resume.
Let's continue the transition to the new pattern with crtcs.
Signed-off-by: Maxime Ripard <mripard@kernel.org>
---
drivers/gpu/drm/drm_atomic_state_helper.c | 47 +++++++++++++++++++++++++++++++
drivers/gpu/drm/drm_mode_config.c | 21 +++++++++++++-
include/drm/drm_atomic_state_helper.h | 4 +++
include/drm/drm_crtc.h | 13 +++++++++
4 files changed, 84 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/drm_atomic_state_helper.c b/drivers/gpu/drm/drm_atomic_state_helper.c
index b87cc3cd5b0021699ac57a33739d172a5706e2e1..f1fc2edc6e6e35fbac5ef82437f3cb7485afc412 100644
--- a/drivers/gpu/drm/drm_atomic_state_helper.c
+++ b/drivers/gpu/drm/drm_atomic_state_helper.c
@@ -103,10 +103,32 @@ __drm_atomic_helper_crtc_reset(struct drm_crtc *crtc,
crtc->state = crtc_state;
}
EXPORT_SYMBOL(__drm_atomic_helper_crtc_reset);
+/**
+ * __drm_atomic_helper_crtc_create_state - initializes crtc state
+ * @crtc: crtc object
+ * @state: new state to initialize
+ *
+ * Initializes the newly allocated @state, usually required when
+ * initializing the drivers.
+ *
+ * @state is assumed to be zeroed.
+ *
+ * This is useful for drivers that subclass @drm_crtc_state.
+ */
+void __drm_atomic_helper_crtc_create_state(struct drm_crtc *crtc,
+ struct drm_crtc_state *state)
+{
+ __drm_atomic_helper_crtc_state_init(state, crtc);
+
+ if (drm_dev_has_vblank(crtc->dev))
+ drm_crtc_vblank_reset(crtc);
+}
+EXPORT_SYMBOL(__drm_atomic_helper_crtc_create_state);
+
/**
* drm_atomic_helper_crtc_reset - default &drm_crtc_funcs.reset hook for CRTCs
* @crtc: drm CRTC
*
* Resets the atomic state for @crtc by freeing the state pointer (which might
@@ -122,10 +144,35 @@ void drm_atomic_helper_crtc_reset(struct drm_crtc *crtc)
__drm_atomic_helper_crtc_reset(crtc, crtc_state);
}
EXPORT_SYMBOL(drm_atomic_helper_crtc_reset);
+/**
+ * drm_atomic_helper_crtc_create_state - default &drm_crtc_funcs.atomic_create_state hook for crtcs
+ * @crtc: crtc object
+ *
+ * Initializes a pristine @drm_crtc_state.
+ *
+ * This is useful for drivers that don't subclass @drm_crtc_state.
+ *
+ * RETURNS:
+ * Pointer to new crtc state, or ERR_PTR on failure.
+ */
+struct drm_crtc_state *drm_atomic_helper_crtc_create_state(struct drm_crtc *crtc)
+{
+ struct drm_crtc_state *state;
+
+ state = kzalloc_obj(*state);
+ if (!state)
+ return ERR_PTR(-ENOMEM);
+
+ __drm_atomic_helper_crtc_create_state(crtc, state);
+
+ return state;
+}
+EXPORT_SYMBOL(drm_atomic_helper_crtc_create_state);
+
/**
* __drm_atomic_helper_crtc_duplicate_state - copy atomic CRTC state
* @crtc: CRTC object
* @state: atomic CRTC state
*
diff --git a/drivers/gpu/drm/drm_mode_config.c b/drivers/gpu/drm/drm_mode_config.c
index 09b8292195ba5eb5d96735aee5506407bd32ade3..f5092d03b168bb114a199b1dbcaeb770983c9749 100644
--- a/drivers/gpu/drm/drm_mode_config.c
+++ b/drivers/gpu/drm/drm_mode_config.c
@@ -196,10 +196,26 @@ static int drm_mode_config_plane_create_state(struct drm_plane *plane)
plane->state = plane_state;
return 0;
}
+static int drm_mode_config_crtc_create_state(struct drm_crtc *crtc)
+{
+ struct drm_crtc_state *crtc_state;
+
+ if (!crtc->funcs->atomic_create_state)
+ return 0;
+
+ crtc_state = crtc->funcs->atomic_create_state(crtc);
+ if (IS_ERR(crtc_state))
+ return PTR_ERR(crtc_state);
+
+ crtc->state = crtc_state;
+
+ return 0;
+}
+
/**
* drm_mode_config_reset - call ->reset callbacks
* @dev: drm device
*
* This functions calls all the crtc's, encoder's and connector's ->reset
@@ -227,13 +243,16 @@ void drm_mode_config_reset(struct drm_device *dev)
plane->funcs->reset(plane);
else if (plane->funcs->atomic_create_state)
drm_mode_config_plane_create_state(plane);
}
- drm_for_each_crtc(crtc, dev)
+ drm_for_each_crtc(crtc, dev) {
if (crtc->funcs->reset)
crtc->funcs->reset(crtc);
+ else if (crtc->funcs->atomic_create_state)
+ drm_mode_config_crtc_create_state(crtc);
+ }
drm_for_each_encoder(encoder, dev)
if (encoder->funcs && encoder->funcs->reset)
encoder->funcs->reset(encoder);
diff --git a/include/drm/drm_atomic_state_helper.h b/include/drm/drm_atomic_state_helper.h
index 161cd1f6b8266e882eb1fd128b403cba350be3d2..bc83094dfb78f0f3699ca7956a8a666ca09b2d1a 100644
--- a/include/drm/drm_atomic_state_helper.h
+++ b/include/drm/drm_atomic_state_helper.h
@@ -43,10 +43,14 @@ struct drm_device;
void __drm_atomic_helper_crtc_state_init(struct drm_crtc_state *state,
struct drm_crtc *crtc);
void __drm_atomic_helper_crtc_reset(struct drm_crtc *crtc,
struct drm_crtc_state *state);
void drm_atomic_helper_crtc_reset(struct drm_crtc *crtc);
+void __drm_atomic_helper_crtc_create_state(struct drm_crtc *crtc,
+ struct drm_crtc_state *state);
+struct drm_crtc_state *
+drm_atomic_helper_crtc_create_state(struct drm_crtc *crtc);
void __drm_atomic_helper_crtc_duplicate_state(struct drm_crtc *crtc,
struct drm_crtc_state *state);
struct drm_crtc_state *
drm_atomic_helper_crtc_duplicate_state(struct drm_crtc *crtc);
void __drm_atomic_helper_crtc_destroy_state(struct drm_crtc_state *state);
diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h
index 312fc1e745d226adec787cd5f1b7c923fe629670..9e410191683c4cb978d759e3b734afdd3bb8aa76 100644
--- a/include/drm/drm_crtc.h
+++ b/include/drm/drm_crtc.h
@@ -636,10 +636,23 @@ struct drm_crtc_funcs {
* 0 on success or a negative error code on failure.
*/
int (*set_property)(struct drm_crtc *crtc,
struct drm_property *property, uint64_t val);
+ /**
+ * @atomic_create_state:
+ *
+ * Allocates a pristine, initialized, state for the crtc object
+ * and returns it.
+ *
+ * RETURNS:
+ *
+ * A new, pristine, crtc state instance or an error pointer
+ * on failure.
+ */
+ struct drm_crtc_state *(*atomic_create_state)(struct drm_crtc *crtc);
+
/**
* @atomic_duplicate_state:
*
* Duplicate the current atomic state for this CRTC and return it.
* The core and helpers guarantee that any atomic state duplicated with
--
2.53.0
^ permalink raw reply related [flat|nested] 43+ messages in thread
* [PATCH v2 11/20] drm/atomic-state-helper: Rename __drm_atomic_helper_connector_state_reset()
2026-03-20 16:27 [PATCH v2 00/20] drm/atomic: Rework initial state allocation Maxime Ripard
` (9 preceding siblings ...)
2026-03-20 16:27 ` [PATCH v2 10/20] drm/crtc: Add new atomic_create_state callback Maxime Ripard
@ 2026-03-20 16:27 ` Maxime Ripard
2026-03-21 17:32 ` Claude review: " Claude Code Review Bot
2026-03-20 16:27 ` [PATCH v2 12/20] drm/hdmi: Rename __drm_atomic_helper_connector_hdmi_reset() Maxime Ripard
` (9 subsequent siblings)
20 siblings, 1 reply; 43+ messages in thread
From: Maxime Ripard @ 2026-03-20 16:27 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
__drm_atomic_helper_connector_state_reset() is used to initialize a
newly allocated drm_connector_state, and is being typically called by
the drm_connector_funcs.reset implementation.
Since we want to consolidate DRM objects state allocation around the
atomic_create_state callback that will only allocate and initialize a
new drm_connector_state instance, we will need to call
__drm_atomic_helper_connector_state_reset() from both the reset and
atomic_create hooks.
To avoid any confusion, we can thus rename
__drm_atomic_helper_connector_state_reset() to
__drm_atomic_helper_connector_state_init().
Suggested-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Maxime Ripard <mripard@kernel.org>
---
drivers/gpu/drm/drm_atomic_state_helper.c | 10 +++++-----
include/drm/drm_atomic_state_helper.h | 2 +-
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/gpu/drm/drm_atomic_state_helper.c b/drivers/gpu/drm/drm_atomic_state_helper.c
index f1fc2edc6e6e35fbac5ef82437f3cb7485afc412..8ed8cb8a9048e8fd89fa22d20985c84af1672135 100644
--- a/drivers/gpu/drm/drm_atomic_state_helper.c
+++ b/drivers/gpu/drm/drm_atomic_state_helper.c
@@ -515,24 +515,24 @@ void drm_atomic_helper_plane_destroy_state(struct drm_plane *plane,
kfree(state);
}
EXPORT_SYMBOL(drm_atomic_helper_plane_destroy_state);
/**
- * __drm_atomic_helper_connector_state_reset - reset the connector state
+ * __drm_atomic_helper_connector_state_init - Initializes the connector state
* @conn_state: atomic connector state, must not be NULL
* @connector: connectotr object, must not be NULL
*
* Initializes the newly allocated @conn_state with default
* values. This is useful for drivers that subclass the connector state.
*/
void
-__drm_atomic_helper_connector_state_reset(struct drm_connector_state *conn_state,
- struct drm_connector *connector)
+__drm_atomic_helper_connector_state_init(struct drm_connector_state *conn_state,
+ struct drm_connector *connector)
{
conn_state->connector = connector;
}
-EXPORT_SYMBOL(__drm_atomic_helper_connector_state_reset);
+EXPORT_SYMBOL(__drm_atomic_helper_connector_state_init);
/**
* __drm_atomic_helper_connector_reset - reset state on connector
* @connector: drm connector
* @conn_state: connector state to assign
@@ -547,11 +547,11 @@ EXPORT_SYMBOL(__drm_atomic_helper_connector_state_reset);
void
__drm_atomic_helper_connector_reset(struct drm_connector *connector,
struct drm_connector_state *conn_state)
{
if (conn_state)
- __drm_atomic_helper_connector_state_reset(conn_state, connector);
+ __drm_atomic_helper_connector_state_init(conn_state, connector);
connector->state = conn_state;
}
EXPORT_SYMBOL(__drm_atomic_helper_connector_reset);
diff --git a/include/drm/drm_atomic_state_helper.h b/include/drm/drm_atomic_state_helper.h
index bc83094dfb78f0f3699ca7956a8a666ca09b2d1a..259a39a0f41ddb2b7d6c1fe7c1a2b0b51774254c 100644
--- a/include/drm/drm_atomic_state_helper.h
+++ b/include/drm/drm_atomic_state_helper.h
@@ -72,11 +72,11 @@ struct drm_plane_state *
drm_atomic_helper_plane_duplicate_state(struct drm_plane *plane);
void __drm_atomic_helper_plane_destroy_state(struct drm_plane_state *state);
void drm_atomic_helper_plane_destroy_state(struct drm_plane *plane,
struct drm_plane_state *state);
-void __drm_atomic_helper_connector_state_reset(struct drm_connector_state *conn_state,
+void __drm_atomic_helper_connector_state_init(struct drm_connector_state *conn_state,
struct drm_connector *connector);
void __drm_atomic_helper_connector_reset(struct drm_connector *connector,
struct drm_connector_state *conn_state);
void drm_atomic_helper_connector_reset(struct drm_connector *connector);
void drm_atomic_helper_connector_tv_reset(struct drm_connector *connector);
--
2.53.0
^ permalink raw reply related [flat|nested] 43+ messages in thread
* [PATCH v2 12/20] drm/hdmi: Rename __drm_atomic_helper_connector_hdmi_reset()
2026-03-20 16:27 [PATCH v2 00/20] drm/atomic: Rework initial state allocation Maxime Ripard
` (10 preceding siblings ...)
2026-03-20 16:27 ` [PATCH v2 11/20] drm/atomic-state-helper: Rename __drm_atomic_helper_connector_state_reset() Maxime Ripard
@ 2026-03-20 16:27 ` Maxime Ripard
2026-03-21 17:32 ` Claude review: " Claude Code Review Bot
2026-03-20 16:27 ` [PATCH v2 13/20] drm/connector: Add new atomic_create_state callback Maxime Ripard
` (8 subsequent siblings)
20 siblings, 1 reply; 43+ messages in thread
From: Maxime Ripard @ 2026-03-20 16:27 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
__drm_atomic_helper_connector_hdmi_reset() is typically used to
initialize a newly allocated drm_connector_state when the connector is
using the HDMI helpers, and is being called by the
drm_connector_funcs.reset implementation.
Since we want to consolidate DRM objects state allocation around the
atomic_create_state callback that will only allocate and initialize a
new drm_connector_state instance, we will need to call
__drm_atomic_helper_connector_hdmi_reset() from both the reset and
atomic_create hooks.
To avoid any confusion, we can thus rename
__drm_atomic_helper_connector_hdmi_reset() to
__drm_atomic_helper_connector_hdmi_state_init().
Suggested-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Maxime Ripard <mripard@kernel.org>
---
drivers/gpu/drm/display/drm_bridge_connector.c | 4 ++--
drivers/gpu/drm/display/drm_hdmi_state_helper.c | 14 ++++++++------
drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c | 2 +-
drivers/gpu/drm/tests/drm_hdmi_state_helper_test.c | 2 +-
drivers/gpu/drm/vc4/vc4_hdmi.c | 2 +-
include/drm/display/drm_hdmi_state_helper.h | 4 ++--
6 files changed, 15 insertions(+), 13 deletions(-)
diff --git a/drivers/gpu/drm/display/drm_bridge_connector.c b/drivers/gpu/drm/display/drm_bridge_connector.c
index f686aa5c0ed9b84dbe5e0957df22d08aff2f1945..929f06b290626d2091418a6377a5230e3c264b60 100644
--- a/drivers/gpu/drm/display/drm_bridge_connector.c
+++ b/drivers/gpu/drm/display/drm_bridge_connector.c
@@ -270,12 +270,12 @@ static void drm_bridge_connector_reset(struct drm_connector *connector)
struct drm_bridge_connector *bridge_connector =
to_drm_bridge_connector(connector);
drm_atomic_helper_connector_reset(connector);
if (bridge_connector->bridge_hdmi)
- __drm_atomic_helper_connector_hdmi_reset(connector,
- connector->state);
+ __drm_atomic_helper_connector_hdmi_state_init(connector,
+ connector->state);
}
static const struct drm_connector_funcs drm_bridge_connector_funcs = {
.reset = drm_bridge_connector_reset,
.detect = drm_bridge_connector_detect,
diff --git a/drivers/gpu/drm/display/drm_hdmi_state_helper.c b/drivers/gpu/drm/display/drm_hdmi_state_helper.c
index a1d16762ac7a9ebdc48f081c5d2f5e200d406099..cdd6df37c04a4b2073004ea08a3f5283a56692df 100644
--- a/drivers/gpu/drm/display/drm_hdmi_state_helper.c
+++ b/drivers/gpu/drm/display/drm_hdmi_state_helper.c
@@ -304,29 +304,31 @@
* --kunitconfig=drivers/gpu/drm/tests \
* drm_atomic_helper_connector_hdmi_*
*/
/**
- * __drm_atomic_helper_connector_hdmi_reset() - Initializes all HDMI @drm_connector_state resources
+ * __drm_atomic_helper_connector_hdmi_state_init() - Initializes all HDMI @drm_connector_state resources
* @connector: DRM connector
* @new_conn_state: connector state to reset
*
* Initializes all HDMI resources from a @drm_connector_state without
* actually allocating it. This is useful for HDMI drivers, in
- * combination with __drm_atomic_helper_connector_reset() or
- * drm_atomic_helper_connector_reset().
+ * combination with __drm_atomic_helper_connector_reset(),
+ * drm_atomic_helper_connector_reset(),
+ * __drm_atomic_helper_connector_create_state() or
+ * drm_atomic_helper_connector_create_state() .
*/
-void __drm_atomic_helper_connector_hdmi_reset(struct drm_connector *connector,
- struct drm_connector_state *new_conn_state)
+void __drm_atomic_helper_connector_hdmi_state_init(struct drm_connector *connector,
+ struct drm_connector_state *new_conn_state)
{
unsigned int max_bpc = connector->max_bpc;
new_conn_state->max_bpc = max_bpc;
new_conn_state->max_requested_bpc = max_bpc;
new_conn_state->hdmi.broadcast_rgb = DRM_HDMI_BROADCAST_RGB_AUTO;
}
-EXPORT_SYMBOL(__drm_atomic_helper_connector_hdmi_reset);
+EXPORT_SYMBOL(__drm_atomic_helper_connector_hdmi_state_init);
static const struct drm_display_mode *
connector_state_get_mode(const struct drm_connector_state *conn_state)
{
struct drm_atomic_state *state;
diff --git a/drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c b/drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c
index a50f260c73e41493528e545591aaad0e3f138be2..0ebebb04e68fab5b7938a604f85ad9b756fe33f6 100644
--- a/drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c
+++ b/drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c
@@ -283,11 +283,11 @@ sun4i_hdmi_connector_detect(struct drm_connector *connector, bool force)
}
static void sun4i_hdmi_connector_reset(struct drm_connector *connector)
{
drm_atomic_helper_connector_reset(connector);
- __drm_atomic_helper_connector_hdmi_reset(connector, connector->state);
+ __drm_atomic_helper_connector_hdmi_state_init(connector, connector->state);
}
static const struct drm_connector_funcs sun4i_hdmi_connector_funcs = {
.detect = sun4i_hdmi_connector_detect,
.fill_modes = drm_helper_probe_single_connector_modes,
diff --git a/drivers/gpu/drm/tests/drm_hdmi_state_helper_test.c b/drivers/gpu/drm/tests/drm_hdmi_state_helper_test.c
index 4bdcea3c7435146aebb1716f38d7302ddb7c6296..aaa73b75f3ce5010147f48afc365d074bb2ec7a7 100644
--- a/drivers/gpu/drm/tests/drm_hdmi_state_helper_test.c
+++ b/drivers/gpu/drm/tests/drm_hdmi_state_helper_test.c
@@ -166,11 +166,11 @@ static const struct drm_connector_helper_funcs dummy_connector_helper_funcs = {
};
static void dummy_hdmi_connector_reset(struct drm_connector *connector)
{
drm_atomic_helper_connector_reset(connector);
- __drm_atomic_helper_connector_hdmi_reset(connector, connector->state);
+ __drm_atomic_helper_connector_hdmi_state_init(connector, connector->state);
}
static const struct drm_connector_funcs dummy_connector_funcs = {
.atomic_destroy_state = drm_atomic_helper_connector_destroy_state,
.atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state,
diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c
index 9898e5451a07a1dca809fb6db3fec59d07485b95..f59d0877a5f48bed6b421775da7ddd008d68f9d9 100644
--- a/drivers/gpu/drm/vc4/vc4_hdmi.c
+++ b/drivers/gpu/drm/vc4/vc4_hdmi.c
@@ -506,11 +506,11 @@ static int vc4_hdmi_connector_atomic_check(struct drm_connector *connector,
}
static void vc4_hdmi_connector_reset(struct drm_connector *connector)
{
drm_atomic_helper_connector_reset(connector);
- __drm_atomic_helper_connector_hdmi_reset(connector, connector->state);
+ __drm_atomic_helper_connector_hdmi_state_init(connector, connector->state);
drm_atomic_helper_connector_tv_margins_reset(connector);
}
static const struct drm_connector_funcs vc4_hdmi_connector_funcs = {
.force = drm_atomic_helper_connector_hdmi_force,
diff --git a/include/drm/display/drm_hdmi_state_helper.h b/include/drm/display/drm_hdmi_state_helper.h
index 2349c0d0f00fb468167023d4db2055c70e603bcd..f7600aabdd5f066772a9a82a1fa8a00be7a48396 100644
--- a/include/drm/display/drm_hdmi_state_helper.h
+++ b/include/drm/display/drm_hdmi_state_helper.h
@@ -9,12 +9,12 @@ struct drm_connector_state;
struct drm_display_mode;
struct hdmi_audio_infoframe;
enum drm_connector_status;
-void __drm_atomic_helper_connector_hdmi_reset(struct drm_connector *connector,
- struct drm_connector_state *new_conn_state);
+void __drm_atomic_helper_connector_hdmi_state_init(struct drm_connector *connector,
+ struct drm_connector_state *new_conn_state);
int drm_atomic_helper_connector_hdmi_check(struct drm_connector *connector,
struct drm_atomic_state *state);
int drm_atomic_helper_connector_hdmi_update_audio_infoframe(struct drm_connector *connector,
--
2.53.0
^ permalink raw reply related [flat|nested] 43+ messages in thread
* [PATCH v2 13/20] drm/connector: Add new atomic_create_state callback
2026-03-20 16:27 [PATCH v2 00/20] drm/atomic: Rework initial state allocation Maxime Ripard
` (11 preceding siblings ...)
2026-03-20 16:27 ` [PATCH v2 12/20] drm/hdmi: Rename __drm_atomic_helper_connector_hdmi_reset() Maxime Ripard
@ 2026-03-20 16:27 ` Maxime Ripard
2026-03-21 17:32 ` Claude review: " Claude Code Review Bot
2026-03-20 16:27 ` [PATCH v2 14/20] drm/mode-config: Create drm_mode_config_create_state() Maxime Ripard
` (7 subsequent siblings)
20 siblings, 1 reply; 43+ messages in thread
From: Maxime Ripard @ 2026-03-20 16:27 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
Commit 47b5ac7daa46 ("drm/atomic: Add new atomic_create_state callback
to drm_private_obj") introduced a new pattern for allocating drm object
states.
Instead of relying on the reset() callback, it created a new
atomic_create_state hook. This is helpful because reset is a bit
overloaded: it's used to create the initial software tate, reset it, but
also reset the hardware.
It can also be used either at probe time, to create the initial state
and possibly reset the hardware to an expected default, but also during
suspend/resume.
Both these cases come with different expectations too: during the
initialization, we want to initialize all states, but during
suspend/resume, drm_private_states for example are expected to be kept
around.
And reset() isn't fallible, which makes it harder to handle
initialization errors properly.
And this is only really relevant for some drivers, since all the helpers
for reset only create a new state, and don't touch the hardware at all.
It was thus decided to create a new hook that would allocate and
initialize a pristine state without any side effect:
atomic_create_state to untangle a bit some of it, and to separate the
initialization with the actual reset one might need during a
suspend/resume.
Let's continue the transition to the new pattern with connectors.
Signed-off-by: Maxime Ripard <mripard@kernel.org>
---
drivers/gpu/drm/drm_atomic_state_helper.c | 45 +++++++++++++++++++++++++++++++
drivers/gpu/drm/drm_mode_config.c | 21 ++++++++++++++-
include/drm/drm_atomic_state_helper.h | 4 +++
include/drm/drm_connector.h | 13 +++++++++
4 files changed, 82 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/drm_atomic_state_helper.c b/drivers/gpu/drm/drm_atomic_state_helper.c
index 8ed8cb8a9048e8fd89fa22d20985c84af1672135..c7eb3ce8c282a0d1099bdb840653baa9f2005db5 100644
--- a/drivers/gpu/drm/drm_atomic_state_helper.c
+++ b/drivers/gpu/drm/drm_atomic_state_helper.c
@@ -553,10 +553,29 @@ __drm_atomic_helper_connector_reset(struct drm_connector *connector,
connector->state = conn_state;
}
EXPORT_SYMBOL(__drm_atomic_helper_connector_reset);
+/**
+ * __drm_atomic_helper_connector_create_state - initializes connector state
+ * @connector: connector object
+ * @state: new state to initialize
+ *
+ * Initializes the newly allocated @state, usually required when
+ * initializing the drivers.
+ *
+ * @state is assumed to be zeroed.
+ *
+ * This is useful for drivers that subclass @drm_connector_state.
+ */
+void __drm_atomic_helper_connector_create_state(struct drm_connector *connector,
+ struct drm_connector_state *state)
+{
+ __drm_atomic_helper_connector_state_init(state, connector);
+}
+EXPORT_SYMBOL(__drm_atomic_helper_connector_create_state);
+
/**
* drm_atomic_helper_connector_reset - default &drm_connector_funcs.reset hook for connectors
* @connector: drm connector
*
* Resets the atomic state for @connector by freeing the state pointer (which
@@ -573,10 +592,36 @@ void drm_atomic_helper_connector_reset(struct drm_connector *connector)
kfree(connector->state);
__drm_atomic_helper_connector_reset(connector, conn_state);
}
EXPORT_SYMBOL(drm_atomic_helper_connector_reset);
+/**
+ * drm_atomic_helper_connector_create_state - default &drm_connector_funcs.atomic_create_state hook for connectors
+ * @connector: connector object
+ *
+ * Initializes a pristine @drm_connector_state.
+ *
+ * This is useful for drivers that don't subclass @drm_connector_state.
+ *
+ * RETURNS:
+ * Pointer to new connector state, or ERR_PTR on failure.
+ */
+struct drm_connector_state *
+drm_atomic_helper_connector_create_state(struct drm_connector *connector)
+{
+ struct drm_connector_state *state;
+
+ state = kzalloc_obj(*state);
+ if (!state)
+ return ERR_PTR(-ENOMEM);
+
+ __drm_atomic_helper_connector_create_state(connector, state);
+
+ return state;
+}
+EXPORT_SYMBOL(drm_atomic_helper_connector_create_state);
+
/**
* drm_atomic_helper_connector_tv_margins_reset - Resets TV connector properties
* @connector: DRM connector
*
* Resets the TV-related properties attached to a connector.
diff --git a/drivers/gpu/drm/drm_mode_config.c b/drivers/gpu/drm/drm_mode_config.c
index f5092d03b168bb114a199b1dbcaeb770983c9749..124cef8f0c6eb15c9fde4cf7cee2936cbf2b902f 100644
--- a/drivers/gpu/drm/drm_mode_config.c
+++ b/drivers/gpu/drm/drm_mode_config.c
@@ -212,10 +212,26 @@ static int drm_mode_config_crtc_create_state(struct drm_crtc *crtc)
crtc->state = crtc_state;
return 0;
}
+static int drm_mode_config_connector_create_state(struct drm_connector *connector)
+{
+ struct drm_connector_state *conn_state;
+
+ if (!connector->funcs->atomic_create_state)
+ return 0;
+
+ conn_state = connector->funcs->atomic_create_state(connector);
+ if (IS_ERR(conn_state))
+ return PTR_ERR(conn_state);
+
+ connector->state = conn_state;
+
+ return 0;
+}
+
/**
* drm_mode_config_reset - call ->reset callbacks
* @dev: drm device
*
* This functions calls all the crtc's, encoder's and connector's ->reset
@@ -255,13 +271,16 @@ void drm_mode_config_reset(struct drm_device *dev)
drm_for_each_encoder(encoder, dev)
if (encoder->funcs && encoder->funcs->reset)
encoder->funcs->reset(encoder);
drm_connector_list_iter_begin(dev, &conn_iter);
- drm_for_each_connector_iter(connector, &conn_iter)
+ drm_for_each_connector_iter(connector, &conn_iter) {
if (connector->funcs->reset)
connector->funcs->reset(connector);
+ else if (connector->funcs->atomic_create_state)
+ drm_mode_config_connector_create_state(connector);
+ }
drm_connector_list_iter_end(&conn_iter);
}
EXPORT_SYMBOL(drm_mode_config_reset);
/*
diff --git a/include/drm/drm_atomic_state_helper.h b/include/drm/drm_atomic_state_helper.h
index 259a39a0f41ddb2b7d6c1fe7c1a2b0b51774254c..96a058ba698203c023e54c2b3d908c13cfa2d23b 100644
--- a/include/drm/drm_atomic_state_helper.h
+++ b/include/drm/drm_atomic_state_helper.h
@@ -76,11 +76,15 @@ void drm_atomic_helper_plane_destroy_state(struct drm_plane *plane,
void __drm_atomic_helper_connector_state_init(struct drm_connector_state *conn_state,
struct drm_connector *connector);
void __drm_atomic_helper_connector_reset(struct drm_connector *connector,
struct drm_connector_state *conn_state);
+void __drm_atomic_helper_connector_create_state(struct drm_connector *connector,
+ struct drm_connector_state *state);
void drm_atomic_helper_connector_reset(struct drm_connector *connector);
+struct drm_connector_state *
+drm_atomic_helper_connector_create_state(struct drm_connector *connector);
void drm_atomic_helper_connector_tv_reset(struct drm_connector *connector);
int drm_atomic_helper_connector_tv_check(struct drm_connector *connector,
struct drm_atomic_state *state);
void drm_atomic_helper_connector_tv_margins_reset(struct drm_connector *connector);
void
diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h
index c18be8c19de0ab1e02e7d7b1fcd9f2ab5ef1dd15..6d73068de157144770931c64ce3f91e6f15ef0e4 100644
--- a/include/drm/drm_connector.h
+++ b/include/drm/drm_connector.h
@@ -1509,10 +1509,23 @@ struct drm_connector_funcs {
* when a connector is being hot-unplugged for drivers that support
* connector hotplugging (e.g. DisplayPort MST).
*/
void (*destroy)(struct drm_connector *connector);
+ /**
+ * @atomic_create_state:
+ *
+ * Allocates a pristine, initialized, state for the connector object
+ * and returns it.
+ *
+ * RETURNS:
+ *
+ * A new, pristine, connector state instance or an error pointer
+ * on failure.
+ */
+ struct drm_connector_state *(*atomic_create_state)(struct drm_connector *connector);
+
/**
* @atomic_duplicate_state:
*
* Duplicate the current atomic state for this connector and return it.
* The core and helpers guarantee that any atomic state duplicated with
--
2.53.0
^ permalink raw reply related [flat|nested] 43+ messages in thread
* [PATCH v2 14/20] drm/mode-config: Create drm_mode_config_create_state()
2026-03-20 16:27 [PATCH v2 00/20] drm/atomic: Rework initial state allocation Maxime Ripard
` (12 preceding siblings ...)
2026-03-20 16:27 ` [PATCH v2 13/20] drm/connector: Add new atomic_create_state callback Maxime Ripard
@ 2026-03-20 16:27 ` Maxime Ripard
2026-03-21 17:32 ` Claude review: " Claude Code Review Bot
2026-03-20 16:27 ` [PATCH v2 15/20] drm/drv: Call drm_mode_config_create_state() by default Maxime Ripard
` (6 subsequent siblings)
20 siblings, 1 reply; 43+ messages in thread
From: Maxime Ripard @ 2026-03-20 16:27 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
drm_mode_config_reset() can be used to create the initial state, but
also to return to the initial state, when doing a suspend/resume cycle
for example.
It also affects both the software and the hardware, and drivers can
choose to reset the hardware as well. Most will just create an empty
state and the synchronisation between hardware and software states will
effectively be done when the first commit is done.
That dual role can be harmful, since some objects do need to be
initialized but also need to be preserved across a suspend/resume cycle.
drm_private_obj are such objects for example.
Thus, let's create another helper for drivers to call to initialize
their state when the driver is loaded, so we can make
drm_mode_config_reset() only about handling suspend/resume and similar.
Signed-off-by: Maxime Ripard <mripard@kernel.org>
---
drivers/gpu/drm/drm_atomic.c | 12 +++++-
drivers/gpu/drm/drm_mode_config.c | 87 +++++++++++++++++++++++++++++++++++++++
include/drm/drm_mode_config.h | 1 +
3 files changed, 98 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c
index 253a00f450b0fb1b7eb6ea42b3235fbf9ee78376..5aa3f9f0620bd155dd53023e6c76e3883ffaadef 100644
--- a/drivers/gpu/drm/drm_atomic.c
+++ b/drivers/gpu/drm/drm_atomic.c
@@ -59,12 +59,20 @@
* when preparing the update and kept alive as long as they are active
* in the device.
*
* Their respective lifetimes are:
*
- * - at reset time, the object reset implementation will allocate a new
- * default state and will store it in the object state pointer.
+ * - at driver initialization time, the driver will allocate an initial,
+ * pristine, state and will store it using
+ * drm_mode_config_create_state(). Historically, this was one of
+ * drm_mode_config_reset() job, so one might still encounter it in a
+ * driver.
+ *
+ * - at reset time, for example during suspend/resume,
+ * drm_mode_config_reset() will reset the software and hardware state
+ * to a known default and will store it in the object's state pointer.
+ * Not all objects are affected by drm_mode_config_reset() though.
*
* - whenever a new update is needed:
*
* + A new &struct drm_atomic_state is allocated using
* drm_atomic_state_alloc().
diff --git a/drivers/gpu/drm/drm_mode_config.c b/drivers/gpu/drm/drm_mode_config.c
index 124cef8f0c6eb15c9fde4cf7cee2936cbf2b902f..61c3ba5d3901ea2bb05bbd1db0644187820a44dd 100644
--- a/drivers/gpu/drm/drm_mode_config.c
+++ b/drivers/gpu/drm/drm_mode_config.c
@@ -21,10 +21,11 @@
*/
#include <linux/export.h>
#include <linux/uaccess.h>
+#include <drm/drm_atomic.h>
#include <drm/drm_drv.h>
#include <drm/drm_encoder.h>
#include <drm/drm_file.h>
#include <drm/drm_framebuffer.h>
#include <drm/drm_managed.h>
@@ -281,10 +282,96 @@ void drm_mode_config_reset(struct drm_device *dev)
}
drm_connector_list_iter_end(&conn_iter);
}
EXPORT_SYMBOL(drm_mode_config_reset);
+/**
+ * drm_mode_config_create_state - Allocates the initial state
+ * @dev: drm device
+ *
+ * This functions creates the initial state for all the objects. Drivers
+ * can use this in e.g. probe to initialize their software state.
+ *
+ * It has two main differences with drm_mode_config_reset(): the reset()
+ * hooks aren't called and thus the hardware will be left untouched, but
+ * also the @drm_private_obj structures will be initialized as opposed
+ * to drm_mode_config_reset() that skips them.
+ *
+ * Returns: 0 on success, negative error value on failure.
+ */
+int drm_mode_config_create_state(struct drm_device *dev)
+{
+ struct drm_crtc *crtc;
+ struct drm_colorop *colorop;
+ struct drm_plane *plane;
+ struct drm_connector *connector;
+ struct drm_connector_list_iter conn_iter;
+ struct drm_private_obj *privobj;
+ int ret;
+
+ drm_for_each_privobj(privobj, dev) {
+ struct drm_private_state *privobj_state;
+
+ if (privobj->state)
+ continue;
+
+ if (!privobj->funcs->atomic_create_state)
+ continue;
+
+ privobj_state = privobj->funcs->atomic_create_state(privobj);
+ if (IS_ERR(privobj_state))
+ return PTR_ERR(privobj_state);
+
+ privobj->state = privobj_state;
+ }
+
+ drm_for_each_colorop(colorop, dev) {
+ struct drm_colorop_state *colorop_state;
+
+ if (colorop->state)
+ continue;
+
+ colorop_state = drm_atomic_helper_colorop_create_state(colorop);
+ if (IS_ERR(colorop_state))
+ return PTR_ERR(colorop_state);
+
+ colorop->state = colorop_state;
+ }
+
+ drm_for_each_plane(plane, dev) {
+ if (plane->state)
+ continue;
+
+ ret = drm_mode_config_plane_create_state(plane);
+ if (ret)
+ return ret;
+ }
+
+ drm_for_each_crtc(crtc, dev) {
+ if (crtc->state)
+ continue;
+
+ ret = drm_mode_config_crtc_create_state(crtc);
+ if (ret)
+ return ret;
+ }
+
+ drm_connector_list_iter_begin(dev, &conn_iter);
+ drm_for_each_connector_iter(connector, &conn_iter) {
+ if (connector->state)
+ continue;
+
+ ret = drm_mode_config_connector_create_state(connector);
+ if (ret)
+ return ret;
+ }
+ drm_connector_list_iter_end(&conn_iter);
+
+ return 0;
+}
+EXPORT_SYMBOL(drm_mode_config_create_state);
+
/*
* Global properties
*/
static const struct drm_prop_enum_list drm_plane_type_enum_list[] = {
{ DRM_PLANE_TYPE_OVERLAY, "Overlay" },
diff --git a/include/drm/drm_mode_config.h b/include/drm/drm_mode_config.h
index 687c0ee163d25dfa7cf563e77209dd33e349800b..22c7e767a2e98f99fff9311eb590f62bd4c9c8a9 100644
--- a/include/drm/drm_mode_config.h
+++ b/include/drm/drm_mode_config.h
@@ -1005,9 +1005,10 @@ int __must_check drmm_mode_config_init(struct drm_device *dev);
static inline int drm_mode_config_init(struct drm_device *dev)
{
return drmm_mode_config_init(dev);
}
+int drm_mode_config_create_state(struct drm_device *dev);
void drm_mode_config_reset(struct drm_device *dev);
void drm_mode_config_cleanup(struct drm_device *dev);
#endif
--
2.53.0
^ permalink raw reply related [flat|nested] 43+ messages in thread
* [PATCH v2 15/20] drm/drv: Call drm_mode_config_create_state() by default
2026-03-20 16:27 [PATCH v2 00/20] drm/atomic: Rework initial state allocation Maxime Ripard
` (13 preceding siblings ...)
2026-03-20 16:27 ` [PATCH v2 14/20] drm/mode-config: Create drm_mode_config_create_state() Maxime Ripard
@ 2026-03-20 16:27 ` Maxime Ripard
2026-03-21 17:32 ` Claude review: " Claude Code Review Bot
2026-03-20 16:27 ` [PATCH v2 16/20] drm/atomic: Drop private obj state allocation Maxime Ripard
` (5 subsequent siblings)
20 siblings, 1 reply; 43+ messages in thread
From: Maxime Ripard @ 2026-03-20 16:27 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
Almost all drivers, and our documented skeleton, call
drm_mode_config_reset() prior to calling drm_dev_register() to
initialize its DRM object states.
Now that we have drm_mode_config_create_state() to create that initial
state if it doesn't exist, we can call it directly in
drm_dev_register(). That way, we know that the initial atomic state will
always be allocated without any boilerplate.
Signed-off-by: Maxime Ripard <mripard@kernel.org>
---
drivers/gpu/drm/drm_drv.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c
index 2915118436ce8a6640cfb0c59936031990727ed1..820106d56ab399a39cac56d98662b5ddbcae8ded 100644
--- a/drivers/gpu/drm/drm_drv.c
+++ b/drivers/gpu/drm/drm_drv.c
@@ -1097,10 +1097,14 @@ int drm_dev_register(struct drm_device *dev, unsigned long flags)
if (drm_core_check_feature(dev, DRIVER_MODESET)) {
ret = drm_modeset_register_all(dev);
if (ret)
goto err_unload;
+
+ ret = drm_mode_config_create_state(dev);
+ if (ret)
+ goto err_unload;
}
drm_panic_register(dev);
drm_client_sysrq_register(dev);
DRM_INFO("Initialized %s %d.%d.%d for %s on minor %d\n",
--
2.53.0
^ permalink raw reply related [flat|nested] 43+ messages in thread
* [PATCH v2 16/20] drm/atomic: Drop private obj state allocation
2026-03-20 16:27 [PATCH v2 00/20] drm/atomic: Rework initial state allocation Maxime Ripard
` (14 preceding siblings ...)
2026-03-20 16:27 ` [PATCH v2 15/20] drm/drv: Call drm_mode_config_create_state() by default Maxime Ripard
@ 2026-03-20 16:27 ` Maxime Ripard
2026-03-21 17:32 ` Claude review: " Claude Code Review Bot
2026-03-20 16:27 ` [PATCH v2 17/20] drm/drv: Drop drm_mode_config_reset() from our skeleton Maxime Ripard
` (4 subsequent siblings)
20 siblings, 1 reply; 43+ messages in thread
From: Maxime Ripard @ 2026-03-20 16:27 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
Now that drm_dev_register() calls drm_mode_config_create_state() for
every modeset driver, the private obj states will be initialized at
driver registration automatically if they haven't already.
Thus, the explicit initial allocation we have in
drm_atomic_private_obj_init() is now redundant, and we can remove it.
Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Maxime Ripard <mripard@kernel.org>
---
drivers/gpu/drm/drm_atomic.c | 7 -------
1 file changed, 7 deletions(-)
diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c
index 5aa3f9f0620bd155dd53023e6c76e3883ffaadef..3bd52602fe307a1b82a3b68d82b458e1da8a4f6d 100644
--- a/drivers/gpu/drm/drm_atomic.c
+++ b/drivers/gpu/drm/drm_atomic.c
@@ -995,25 +995,18 @@ static void drm_atomic_plane_print_state(struct drm_printer *p,
*/
int drm_atomic_private_obj_init(struct drm_device *dev,
struct drm_private_obj *obj,
const struct drm_private_state_funcs *funcs)
{
- struct drm_private_state *state;
memset(obj, 0, sizeof(*obj));
drm_modeset_lock_init(&obj->lock);
obj->dev = dev;
obj->funcs = funcs;
list_add_tail(&obj->head, &dev->mode_config.privobj_list);
- state = obj->funcs->atomic_create_state(obj);
- if (IS_ERR(state))
- return PTR_ERR(state);
-
- obj->state = state;
-
return 0;
}
EXPORT_SYMBOL(drm_atomic_private_obj_init);
/**
--
2.53.0
^ permalink raw reply related [flat|nested] 43+ messages in thread
* [PATCH v2 17/20] drm/drv: Drop drm_mode_config_reset() from our skeleton
2026-03-20 16:27 [PATCH v2 00/20] drm/atomic: Rework initial state allocation Maxime Ripard
` (15 preceding siblings ...)
2026-03-20 16:27 ` [PATCH v2 16/20] drm/atomic: Drop private obj state allocation Maxime Ripard
@ 2026-03-20 16:27 ` Maxime Ripard
2026-03-21 17:32 ` Claude review: " Claude Code Review Bot
2026-03-20 16:27 ` [PATCH v2 18/20] drm/tidss: Drop call to drm_mode_config_reset at probe time Maxime Ripard
` (3 subsequent siblings)
20 siblings, 1 reply; 43+ messages in thread
From: Maxime Ripard @ 2026-03-20 16:27 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
Now that we have drm_mode_config_create_state() to create the initial
state called as part of drm_dev_register(), we can stop recommending
calling drm_mode_config_reset() to perform that initialization in our
skeleton.
Signed-off-by: Maxime Ripard <mripard@kernel.org>
---
drivers/gpu/drm/drm_drv.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c
index 820106d56ab399a39cac56d98662b5ddbcae8ded..83752725f7c63364880225ec1083f19bd00ddcef 100644
--- a/drivers/gpu/drm/drm_drv.c
+++ b/drivers/gpu/drm/drm_drv.c
@@ -339,12 +339,10 @@ void drm_minor_release(struct drm_minor *minor)
*
* // Further setup, display pipeline etc
*
* platform_set_drvdata(pdev, drm);
*
- * drm_mode_config_reset(drm);
- *
* ret = drm_dev_register(drm);
* if (ret)
* return ret;
*
* drm_fbdev_{...}_setup(drm, 32);
--
2.53.0
^ permalink raw reply related [flat|nested] 43+ messages in thread
* [PATCH v2 18/20] drm/tidss: Drop call to drm_mode_config_reset at probe time
2026-03-20 16:27 [PATCH v2 00/20] drm/atomic: Rework initial state allocation Maxime Ripard
` (16 preceding siblings ...)
2026-03-20 16:27 ` [PATCH v2 17/20] drm/drv: Drop drm_mode_config_reset() from our skeleton Maxime Ripard
@ 2026-03-20 16:27 ` Maxime Ripard
2026-03-21 17:32 ` Claude review: " Claude Code Review Bot
2026-03-20 16:27 ` [PATCH v2 19/20] drm/tidss: Convert to atomic_create_state Maxime Ripard
` (2 subsequent siblings)
20 siblings, 1 reply; 43+ messages in thread
From: Maxime Ripard @ 2026-03-20 16:27 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
Now that we have drm_mode_config_create_state() to create the initial
state called as part of drm_dev_register(), we don't need to call
drm_mode_config_reset() during the driver probe.
Signed-off-by: Maxime Ripard <mripard@kernel.org>
---
drivers/gpu/drm/tidss/tidss_drv.c | 2 --
drivers/gpu/drm/tidss/tidss_kms.c | 2 --
2 files changed, 4 deletions(-)
diff --git a/drivers/gpu/drm/tidss/tidss_drv.c b/drivers/gpu/drm/tidss/tidss_drv.c
index 1c8cc18bc53c3ea3c50368b9f55ab02a0a02fc77..ddd9f428c2a96557ee02040320cbe5f6f0fd6052 100644
--- a/drivers/gpu/drm/tidss/tidss_drv.c
+++ b/drivers/gpu/drm/tidss/tidss_drv.c
@@ -169,12 +169,10 @@ static int tidss_probe(struct platform_device *pdev)
goto err_runtime_suspend;
}
drm_kms_helper_poll_init(ddev);
- drm_mode_config_reset(ddev);
-
ret = drm_dev_register(ddev, 0);
if (ret) {
dev_err(dev, "failed to register DRM device\n");
goto err_irq_uninstall;
}
diff --git a/drivers/gpu/drm/tidss/tidss_kms.c b/drivers/gpu/drm/tidss/tidss_kms.c
index 8bb93194e5ac686050c47f986b8cb6063eae22d3..b4779c09a1bfa5be7010bcd7d4f1379362996d2e 100644
--- a/drivers/gpu/drm/tidss/tidss_kms.c
+++ b/drivers/gpu/drm/tidss/tidss_kms.c
@@ -285,11 +285,9 @@ int tidss_modeset_init(struct tidss_device *tidss)
ret = drm_vblank_init(ddev, tidss->num_crtcs);
if (ret)
return ret;
- drm_mode_config_reset(ddev);
-
dev_dbg(tidss->dev, "%s done\n", __func__);
return 0;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 43+ messages in thread
* [PATCH v2 19/20] drm/tidss: Convert to atomic_create_state
2026-03-20 16:27 [PATCH v2 00/20] drm/atomic: Rework initial state allocation Maxime Ripard
` (17 preceding siblings ...)
2026-03-20 16:27 ` [PATCH v2 18/20] drm/tidss: Drop call to drm_mode_config_reset at probe time Maxime Ripard
@ 2026-03-20 16:27 ` Maxime Ripard
2026-03-21 17:32 ` Claude review: " Claude Code Review Bot
2026-03-20 16:27 ` [PATCH v2 20/20] drm/bridge_connector: " Maxime Ripard
2026-03-21 17:32 ` Claude review: drm/atomic: Rework initial state allocation Claude Code Review Bot
20 siblings, 1 reply; 43+ messages in thread
From: Maxime Ripard @ 2026-03-20 16:27 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
Our driver uses reset to create the various object states, but only
calls the helper that allocate a new state. They are thus strictly
equivalent to the new atomic_create_state helpers, so let's switch to
these.
Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Maxime Ripard <mripard@kernel.org>
---
drivers/gpu/drm/tidss/tidss_crtc.c | 17 +++++++----------
drivers/gpu/drm/tidss/tidss_plane.c | 2 +-
2 files changed, 8 insertions(+), 11 deletions(-)
diff --git a/drivers/gpu/drm/tidss/tidss_crtc.c b/drivers/gpu/drm/tidss/tidss_crtc.c
index a31c21c5f855ac8a94089dd3908e2510193b7d67..66e3d161c60bc14b2982cff4cdd43030d4086798 100644
--- a/drivers/gpu/drm/tidss/tidss_crtc.c
+++ b/drivers/gpu/drm/tidss/tidss_crtc.c
@@ -355,24 +355,21 @@ static void tidss_crtc_destroy_state(struct drm_crtc *crtc,
__drm_atomic_helper_crtc_destroy_state(&tstate->base);
kfree(tstate);
}
-static void tidss_crtc_reset(struct drm_crtc *crtc)
+static struct drm_crtc_state *tidss_crtc_create_state(struct drm_crtc *crtc)
{
struct tidss_crtc_state *tstate;
- if (crtc->state)
- tidss_crtc_destroy_state(crtc, crtc->state);
-
tstate = kzalloc_obj(*tstate);
- if (!tstate) {
- crtc->state = NULL;
- return;
- }
+ if (!tstate)
+ return ERR_PTR(-ENOMEM);
- __drm_atomic_helper_crtc_reset(crtc, &tstate->base);
+ __drm_atomic_helper_crtc_create_state(crtc, &tstate->base);
+
+ return &tstate->base;
}
static struct drm_crtc_state *tidss_crtc_duplicate_state(struct drm_crtc *crtc)
{
struct tidss_crtc_state *state, *current_state;
@@ -403,14 +400,14 @@ static void tidss_crtc_destroy(struct drm_crtc *crtc)
drm_crtc_cleanup(crtc);
kfree(tcrtc);
}
static const struct drm_crtc_funcs tidss_crtc_funcs = {
- .reset = tidss_crtc_reset,
.destroy = tidss_crtc_destroy,
.set_config = drm_atomic_helper_set_config,
.page_flip = drm_atomic_helper_page_flip,
+ .atomic_create_state = tidss_crtc_create_state,
.atomic_duplicate_state = tidss_crtc_duplicate_state,
.atomic_destroy_state = tidss_crtc_destroy_state,
.enable_vblank = tidss_crtc_enable_vblank,
.disable_vblank = tidss_crtc_disable_vblank,
};
diff --git a/drivers/gpu/drm/tidss/tidss_plane.c b/drivers/gpu/drm/tidss/tidss_plane.c
index aaa02c851c595aa3781ec2e6741af1999092aa40..518498d4576528a0ec59fd03cf27a87b1b3f1e6e 100644
--- a/drivers/gpu/drm/tidss/tidss_plane.c
+++ b/drivers/gpu/drm/tidss/tidss_plane.c
@@ -176,12 +176,12 @@ static const struct drm_plane_helper_funcs tidss_primary_plane_helper_funcs = {
};
static const struct drm_plane_funcs tidss_plane_funcs = {
.update_plane = drm_atomic_helper_update_plane,
.disable_plane = drm_atomic_helper_disable_plane,
- .reset = drm_atomic_helper_plane_reset,
.destroy = drm_plane_destroy,
+ .atomic_create_state = drm_atomic_helper_plane_create_state,
.atomic_duplicate_state = drm_atomic_helper_plane_duplicate_state,
.atomic_destroy_state = drm_atomic_helper_plane_destroy_state,
};
struct tidss_plane *tidss_plane_create(struct tidss_device *tidss,
--
2.53.0
^ permalink raw reply related [flat|nested] 43+ messages in thread
* [PATCH v2 20/20] drm/bridge_connector: Convert to atomic_create_state
2026-03-20 16:27 [PATCH v2 00/20] drm/atomic: Rework initial state allocation Maxime Ripard
` (18 preceding siblings ...)
2026-03-20 16:27 ` [PATCH v2 19/20] drm/tidss: Convert to atomic_create_state Maxime Ripard
@ 2026-03-20 16:27 ` Maxime Ripard
2026-03-21 17:32 ` Claude review: " Claude Code Review Bot
2026-03-21 17:32 ` Claude review: drm/atomic: Rework initial state allocation Claude Code Review Bot
20 siblings, 1 reply; 43+ messages in thread
From: Maxime Ripard @ 2026-03-20 16:27 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
The connector created by drm_bridge_connector only initializes a
pristine state in reset, which is equivalent to that atomic_create_state
would expect. Let's convert to it.
Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Maxime Ripard <mripard@kernel.org>
---
drivers/gpu/drm/display/drm_bridge_connector.c | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/display/drm_bridge_connector.c b/drivers/gpu/drm/display/drm_bridge_connector.c
index 929f06b290626d2091418a6377a5230e3c264b60..b640e7d5a065d165a901bd73fc836afaab967dac 100644
--- a/drivers/gpu/drm/display/drm_bridge_connector.c
+++ b/drivers/gpu/drm/display/drm_bridge_connector.c
@@ -263,26 +263,33 @@ static void drm_bridge_connector_debugfs_init(struct drm_connector *connector,
if (bridge->funcs->debugfs_init)
bridge->funcs->debugfs_init(bridge, root);
}
}
-static void drm_bridge_connector_reset(struct drm_connector *connector)
+static struct drm_connector_state *
+drm_bridge_connector_create_state(struct drm_connector *connector)
{
struct drm_bridge_connector *bridge_connector =
to_drm_bridge_connector(connector);
+ struct drm_connector_state *conn_state;
+
+ conn_state = drm_atomic_helper_connector_create_state(connector);
+ if (IS_ERR(conn_state))
+ return conn_state;
- drm_atomic_helper_connector_reset(connector);
if (bridge_connector->bridge_hdmi)
__drm_atomic_helper_connector_hdmi_state_init(connector,
- connector->state);
+ conn_state);
+
+ return conn_state;
}
static const struct drm_connector_funcs drm_bridge_connector_funcs = {
- .reset = drm_bridge_connector_reset,
.detect = drm_bridge_connector_detect,
.force = drm_bridge_connector_force,
.fill_modes = drm_helper_probe_single_connector_modes,
+ .atomic_create_state = drm_bridge_connector_create_state,
.atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state,
.atomic_destroy_state = drm_atomic_helper_connector_destroy_state,
.debugfs_init = drm_bridge_connector_debugfs_init,
.oob_hotplug_event = drm_bridge_connector_oob_hotplug_event,
};
--
2.53.0
^ permalink raw reply related [flat|nested] 43+ messages in thread
* Claude review: drm/atomic: Rework initial state allocation
2026-03-20 16:27 [PATCH v2 00/20] drm/atomic: Rework initial state allocation Maxime Ripard
` (19 preceding siblings ...)
2026-03-20 16:27 ` [PATCH v2 20/20] drm/bridge_connector: " Maxime Ripard
@ 2026-03-21 17:32 ` Claude Code Review Bot
20 siblings, 0 replies; 43+ messages in thread
From: Claude Code Review Bot @ 2026-03-21 17:32 UTC (permalink / raw)
To: dri-devel-reviews
Overall Series Review
Subject: drm/atomic: Rework initial state allocation
Author: Maxime Ripard <mripard@kernel.org>
Patches: 21
Reviewed: 2026-03-22T03:32:25.244110
---
This is a well-structured series by Maxime Ripard that introduces a new `atomic_create_state` callback pattern for DRM objects (plane, crtc, connector), following the precedent already established for `drm_private_obj`. The goal is to separate the concerns of "allocate initial pristine state" from "reset hardware/software state" which are currently conflated in the `reset()` callback.
The series is logically ordered: doc fixes and cleanups first, then renaming `_state_reset` to `_state_init`, then adding the new callbacks per object type, creating `drm_mode_config_create_state()`, hooking it into `drm_dev_register()`, and finally converting two example drivers (tidss, bridge_connector).
There are a few issues worth flagging, most notably around error handling cleanup in `drm_mode_config_create_state()` and the redundancy of some wrapper functions.
---
Generated by Claude Code Patch Reviewer
^ permalink raw reply [flat|nested] 43+ messages in thread
* Claude review: drm/colorop: Fix typos in the doc
2026-03-20 16:27 ` [PATCH v2 01/20] drm/colorop: Fix typos in the doc Maxime Ripard
@ 2026-03-21 17:32 ` Claude Code Review Bot
0 siblings, 0 replies; 43+ messages in thread
From: Claude Code Review Bot @ 2026-03-21 17:32 UTC (permalink / raw)
To: dri-devel-reviews
Patch Review
Straightforward doc fix. Changing "CRTC" references to "colorop" in `__drm_colorop_state_reset()` and `__drm_colorop_reset()` docs, and fixing `&drm_crtc->state` to `&drm_colorop->state`. Has a Fixes tag. No issues.
---
Generated by Claude Code Patch Reviewer
^ permalink raw reply [flat|nested] 43+ messages in thread
* Claude review: drm/atomic: Drop drm_private_state.obj assignment from create_state
2026-03-20 16:27 ` [PATCH v2 02/20] drm/atomic: Drop drm_private_state.obj assignment from create_state Maxime Ripard
@ 2026-03-21 17:32 ` Claude Code Review Bot
0 siblings, 0 replies; 43+ messages in thread
From: Claude Code Review Bot @ 2026-03-21 17:32 UTC (permalink / raw)
To: dri-devel-reviews
Patch Review
Removes `obj->state = state` from `__drm_atomic_helper_private_obj_create_state()`. The commit message claims this is redundant because the only caller `drm_atomic_private_obj_init()` also sets it. However, looking at the current tree, `drm_atomic_private_obj_init()` has already been reworked (it now takes a `state` parameter and has conditional logic). The patch appears to be based on a prerequisite series (`20251008-drm-private-obj-reset-ae1e2741027a:v5`) that may have changed the function signature. This should be fine as long as the prerequisites are merged first, but worth verifying.
The Fixes tag seems appropriate since the assignment was indeed a side effect that the `create_state` contract shouldn't have.
---
Generated by Claude Code Patch Reviewer
^ permalink raw reply [flat|nested] 43+ messages in thread
* Claude review: drm/mode-config: Mention drm_mode_config_reset() culprits
2026-03-20 16:27 ` [PATCH v2 03/20] drm/mode-config: Mention drm_mode_config_reset() culprits Maxime Ripard
@ 2026-03-21 17:32 ` Claude Code Review Bot
0 siblings, 0 replies; 43+ messages in thread
From: Claude Code Review Bot @ 2026-03-21 17:32 UTC (permalink / raw)
To: dri-devel-reviews
Patch Review
Good documentation addition. Notes that `drm_private_obj` structures are expected to be stable across suspend/resume and that `drm_mode_config_reset()` doesn't affect them.
Minor nit: the doc uses `@drm_private_obj` and `@drm_mode_config_reset()` with `@` prefix, but these aren't function parameters -- kernel-doc convention uses `&` for cross-references to structs/functions. Should be `&drm_private_obj` and `&drm_mode_config_reset()`:
```
+ * Note that @drm_private_obj structures are expected to be stable across
+ * suspend/resume cycles, and @drm_mode_config_reset() does not affect these
```
Already has Laurent's R-b.
---
Generated by Claude Code Patch Reviewer
^ permalink raw reply [flat|nested] 43+ messages in thread
* Claude review: drm/colorop: Rename __drm_colorop_state_reset()
2026-03-20 16:27 ` [PATCH v2 04/20] drm/colorop: Rename __drm_colorop_state_reset() Maxime Ripard
@ 2026-03-21 17:32 ` Claude Code Review Bot
0 siblings, 0 replies; 43+ messages in thread
From: Claude Code Review Bot @ 2026-03-21 17:32 UTC (permalink / raw)
To: dri-devel-reviews
Patch Review
Pure rename from `__drm_colorop_state_reset()` to `__drm_colorop_state_init()`. Mechanical, correct. The function is `static` so no external callers to worry about.
---
Generated by Claude Code Patch Reviewer
^ permalink raw reply [flat|nested] 43+ messages in thread
* Claude review: drm/colorop: Create drm_atomic_helper_colorop_create_state()
2026-03-20 16:27 ` [PATCH v2 05/20] drm/colorop: Create drm_atomic_helper_colorop_create_state() Maxime Ripard
@ 2026-03-21 17:32 ` Claude Code Review Bot
0 siblings, 0 replies; 43+ messages in thread
From: Claude Code Review Bot @ 2026-03-21 17:32 UTC (permalink / raw)
To: dri-devel-reviews
Patch Review
Creates the new `drm_atomic_helper_colorop_create_state()` helper. Uses `kzalloc_obj(*state)` for allocation, calls `__drm_colorop_state_init()`, returns `ERR_PTR(-ENOMEM)` on failure. Pattern is consistent with the later patches and the existing `drm_private_obj` pattern.
Note: colorop doesn't get an `atomic_create_state` callback in the `drm_colorop_funcs` -- the function is called directly. This makes sense since colorops have no driver-specific subclassing currently.
---
Generated by Claude Code Patch Reviewer
^ permalink raw reply [flat|nested] 43+ messages in thread
* Claude review: drm/atomic-state-helper: Fix __drm_atomic_helper_plane_reset() doc typo
2026-03-20 16:27 ` [PATCH v2 06/20] drm/atomic-state-helper: Fix __drm_atomic_helper_plane_reset() doc typo Maxime Ripard
@ 2026-03-21 17:32 ` Claude Code Review Bot
0 siblings, 0 replies; 43+ messages in thread
From: Claude Code Review Bot @ 2026-03-21 17:32 UTC (permalink / raw)
To: dri-devel-reviews
Patch Review
Trivial doc fix: `&drm_crtc->state` -> `&drm_plane->state`. Has R-b from Tomi and Laurent.
---
Generated by Claude Code Patch Reviewer
^ permalink raw reply [flat|nested] 43+ messages in thread
* Claude review: drm/atomic-state-helper: Rename __drm_atomic_helper_plane_state_reset()
2026-03-20 16:27 ` [PATCH v2 07/20] drm/atomic-state-helper: Rename __drm_atomic_helper_plane_state_reset() Maxime Ripard
@ 2026-03-21 17:32 ` Claude Code Review Bot
0 siblings, 0 replies; 43+ messages in thread
From: Claude Code Review Bot @ 2026-03-21 17:32 UTC (permalink / raw)
To: dri-devel-reviews
Patch Review
Renames to `__drm_atomic_helper_plane_state_init()`. Updates the one external caller in i915 `intel_plane.c` and the EXPORT_SYMBOL + header declaration. Clean mechanical change.
Minor nit: the doc still says "This is useful for drivers that subclass the CRTC state" (line 1221) when it should say "plane state". This is a pre-existing typo not introduced by this patch, but since the doc block is being touched anyway, it might be worth fixing.
---
Generated by Claude Code Patch Reviewer
^ permalink raw reply [flat|nested] 43+ messages in thread
* Claude review: drm/plane: Add new atomic_create_state callback
2026-03-20 16:27 ` [PATCH v2 08/20] drm/plane: Add new atomic_create_state callback Maxime Ripard
@ 2026-03-21 17:32 ` Claude Code Review Bot
0 siblings, 0 replies; 43+ messages in thread
From: Claude Code Review Bot @ 2026-03-21 17:32 UTC (permalink / raw)
To: dri-devel-reviews
Patch Review
Adds the `atomic_create_state` callback to `drm_plane_funcs`, creates `__drm_atomic_helper_plane_create_state()` and `drm_atomic_helper_plane_create_state()` helpers. Also adds fallback logic in `drm_mode_config_reset()` to call `atomic_create_state` if `reset` isn't set.
**Issue**: `__drm_atomic_helper_plane_create_state()` is a trivial one-line wrapper around `__drm_atomic_helper_plane_state_init()`:
```c
void __drm_atomic_helper_plane_create_state(struct drm_plane *plane,
struct drm_plane_state *state)
{
__drm_atomic_helper_plane_state_init(state, plane);
}
```
This is unlike the crtc version (patch 10) which adds `drm_crtc_vblank_reset()`. For planes there's no extra init needed, so this wrapper adds indirection with no value. Consider whether `__drm_atomic_helper_plane_state_init` could just be called directly, or document why the wrapper exists (future-proofing for additional init steps?).
**Issue in drm_mode_config_reset()**: The return value of `drm_mode_config_plane_create_state()` is silently ignored:
```c
else if (plane->funcs->atomic_create_state)
drm_mode_config_plane_create_state(plane);
```
Since `drm_mode_config_reset()` returns void, there's nothing to do with the error, but a `WARN_ON` or `drm_err` on failure would help debugging. This same issue applies to the crtc and connector versions added in patches 10 and 13.
---
Generated by Claude Code Patch Reviewer
^ permalink raw reply [flat|nested] 43+ messages in thread
* Claude review: drm/atomic-state-helper: Rename __drm_atomic_helper_crtc_state_reset()
2026-03-20 16:27 ` [PATCH v2 09/20] drm/atomic-state-helper: Rename __drm_atomic_helper_crtc_state_reset() Maxime Ripard
@ 2026-03-21 17:32 ` Claude Code Review Bot
0 siblings, 0 replies; 43+ messages in thread
From: Claude Code Review Bot @ 2026-03-21 17:32 UTC (permalink / raw)
To: dri-devel-reviews
Patch Review
Renames to `__drm_atomic_helper_crtc_state_init()`. Updates i915 caller. Clean.
---
Generated by Claude Code Patch Reviewer
^ permalink raw reply [flat|nested] 43+ messages in thread
* Claude review: drm/crtc: Add new atomic_create_state callback
2026-03-20 16:27 ` [PATCH v2 10/20] drm/crtc: Add new atomic_create_state callback Maxime Ripard
@ 2026-03-21 17:32 ` Claude Code Review Bot
0 siblings, 0 replies; 43+ messages in thread
From: Claude Code Review Bot @ 2026-03-21 17:32 UTC (permalink / raw)
To: dri-devel-reviews
Patch Review
Same pattern as patch 8 but for CRTCs. The `__drm_atomic_helper_crtc_create_state()` wrapper here does have added value: it calls `drm_crtc_vblank_reset()` in addition to `__drm_atomic_helper_crtc_state_init()`, mirroring what `__drm_atomic_helper_crtc_reset()` does.
Minor typo in the commit message: "software tate" should be "software state".
Same silent error discard issue in `drm_mode_config_reset()` as noted for patch 8.
---
Generated by Claude Code Patch Reviewer
^ permalink raw reply [flat|nested] 43+ messages in thread
* Claude review: drm/atomic-state-helper: Rename __drm_atomic_helper_connector_state_reset()
2026-03-20 16:27 ` [PATCH v2 11/20] drm/atomic-state-helper: Rename __drm_atomic_helper_connector_state_reset() Maxime Ripard
@ 2026-03-21 17:32 ` Claude Code Review Bot
0 siblings, 0 replies; 43+ messages in thread
From: Claude Code Review Bot @ 2026-03-21 17:32 UTC (permalink / raw)
To: dri-devel-reviews
Patch Review
Renames to `__drm_atomic_helper_connector_state_init()`. Clean mechanical rename.
Pre-existing doc typo at line 2240: "connectotr object" should be "connector object". Since the doc block is being touched, this is worth fixing.
---
Generated by Claude Code Patch Reviewer
^ permalink raw reply [flat|nested] 43+ messages in thread
* Claude review: drm/hdmi: Rename __drm_atomic_helper_connector_hdmi_reset()
2026-03-20 16:27 ` [PATCH v2 12/20] drm/hdmi: Rename __drm_atomic_helper_connector_hdmi_reset() Maxime Ripard
@ 2026-03-21 17:32 ` Claude Code Review Bot
0 siblings, 0 replies; 43+ messages in thread
From: Claude Code Review Bot @ 2026-03-21 17:32 UTC (permalink / raw)
To: dri-devel-reviews
Patch Review
Renames to `__drm_atomic_helper_connector_hdmi_state_init()`. Updates all callers (bridge_connector, sun4i, vc4, test). Also updates the doc to mention the new `create_state` variants.
Minor: Extra space before period in doc at line 2457:
```
+ * drm_atomic_helper_connector_create_state() .
```
---
Generated by Claude Code Patch Reviewer
^ permalink raw reply [flat|nested] 43+ messages in thread
* Claude review: drm/connector: Add new atomic_create_state callback
2026-03-20 16:27 ` [PATCH v2 13/20] drm/connector: Add new atomic_create_state callback Maxime Ripard
@ 2026-03-21 17:32 ` Claude Code Review Bot
0 siblings, 0 replies; 43+ messages in thread
From: Claude Code Review Bot @ 2026-03-21 17:32 UTC (permalink / raw)
To: dri-devel-reviews
Patch Review
Same pattern as patches 8 and 10 for connectors. `__drm_atomic_helper_connector_create_state()` is again a trivial one-line wrapper (same concern as patch 8).
Same silent error discard in `drm_mode_config_reset()`.
---
Generated by Claude Code Patch Reviewer
^ permalink raw reply [flat|nested] 43+ messages in thread
* Claude review: drm/mode-config: Create drm_mode_config_create_state()
2026-03-20 16:27 ` [PATCH v2 14/20] drm/mode-config: Create drm_mode_config_create_state() Maxime Ripard
@ 2026-03-21 17:32 ` Claude Code Review Bot
0 siblings, 0 replies; 43+ messages in thread
From: Claude Code Review Bot @ 2026-03-21 17:32 UTC (permalink / raw)
To: dri-devel-reviews
Patch Review
**This is the key patch of the series.** Creates `drm_mode_config_create_state()` which iterates all DRM objects and creates initial state via the `atomic_create_state` callbacks, skipping objects that already have state.
**Critical issue - missing error cleanup**: When `drm_mode_config_create_state()` fails partway through (e.g., an allocation failure for a connector after planes and CRTCs already got their states allocated), the already-allocated states are not cleaned up:
```c
drm_for_each_connector_iter(connector, &conn_iter) {
...
ret = drm_mode_config_connector_create_state(connector);
if (ret)
return ret; // leaks previously allocated states
}
drm_connector_list_iter_end(&conn_iter);
```
Additionally, returning early from the `drm_for_each_connector_iter` loop without calling `drm_connector_list_iter_end()` will leak the iterator's reference. This needs to be fixed -- either `goto` to cleanup code that calls `drm_connector_list_iter_end()`, or restructure the error path.
The doc update to `drm_atomic.c` (lifetime description) is a nice clarification.
---
Generated by Claude Code Patch Reviewer
^ permalink raw reply [flat|nested] 43+ messages in thread
* Claude review: drm/drv: Call drm_mode_config_create_state() by default
2026-03-20 16:27 ` [PATCH v2 15/20] drm/drv: Call drm_mode_config_create_state() by default Maxime Ripard
@ 2026-03-21 17:32 ` Claude Code Review Bot
0 siblings, 0 replies; 43+ messages in thread
From: Claude Code Review Bot @ 2026-03-21 17:32 UTC (permalink / raw)
To: dri-devel-reviews
Patch Review
Hooks `drm_mode_config_create_state()` into `drm_dev_register()`. This is the right place since it runs after all objects are created.
**Concern**: The `err_unload` label runs `driver->unload()` but doesn't undo the state allocations done by `drm_mode_config_create_state()`. That said, the states are attached to the objects which will be cleaned up by `drm_mode_config_cleanup()` eventually, so this should be fine as long as the normal teardown path handles it. Worth confirming that `drm_mode_config_cleanup()` frees these states.
---
Generated by Claude Code Patch Reviewer
^ permalink raw reply [flat|nested] 43+ messages in thread
* Claude review: drm/atomic: Drop private obj state allocation
2026-03-20 16:27 ` [PATCH v2 16/20] drm/atomic: Drop private obj state allocation Maxime Ripard
@ 2026-03-21 17:32 ` Claude Code Review Bot
0 siblings, 0 replies; 43+ messages in thread
From: Claude Code Review Bot @ 2026-03-21 17:32 UTC (permalink / raw)
To: dri-devel-reviews
Patch Review
Removes the `atomic_create_state` call from `drm_atomic_private_obj_init()` since `drm_mode_config_create_state()` (called from `drm_dev_register()`) now handles it.
**Potential ordering concern**: `drm_atomic_private_obj_init()` may be called before `drm_dev_register()`. Between these calls, `obj->state` will be NULL. If any code accesses `obj->state` during driver setup (between init and register), this would crash. The patch relies on `drm_mode_config_create_state()` checking `if (privobj->state) continue;` which is fine for the new flow, but could break drivers that currently depend on the state being available immediately after `drm_atomic_private_obj_init()`.
The current tree already has the `atomic_create_state` call inside `drm_atomic_private_obj_init` -- removing it changes the contract for all callers. This is a semantic change that should be called out more explicitly and might need a wider audit of callers.
Also note: `drm_atomic_private_obj_fini()` unconditionally calls `obj->funcs->atomic_destroy_state(obj, obj->state)` -- if `obj->state` is NULL at teardown time (e.g., if `drm_dev_register` is never called after init), this will crash.
---
Generated by Claude Code Patch Reviewer
^ permalink raw reply [flat|nested] 43+ messages in thread
* Claude review: drm/drv: Drop drm_mode_config_reset() from our skeleton
2026-03-20 16:27 ` [PATCH v2 17/20] drm/drv: Drop drm_mode_config_reset() from our skeleton Maxime Ripard
@ 2026-03-21 17:32 ` Claude Code Review Bot
0 siblings, 0 replies; 43+ messages in thread
From: Claude Code Review Bot @ 2026-03-21 17:32 UTC (permalink / raw)
To: dri-devel-reviews
Patch Review
Removes `drm_mode_config_reset(drm)` from the example skeleton in `drm_drv.c` documentation. Logical follow-up.
---
Generated by Claude Code Patch Reviewer
^ permalink raw reply [flat|nested] 43+ messages in thread
* Claude review: drm/tidss: Drop call to drm_mode_config_reset at probe time
2026-03-20 16:27 ` [PATCH v2 18/20] drm/tidss: Drop call to drm_mode_config_reset at probe time Maxime Ripard
@ 2026-03-21 17:32 ` Claude Code Review Bot
0 siblings, 0 replies; 43+ messages in thread
From: Claude Code Review Bot @ 2026-03-21 17:32 UTC (permalink / raw)
To: dri-devel-reviews
Patch Review
Removes two `drm_mode_config_reset()` calls from tidss -- one in `tidss_drv.c` (probe) and one in `tidss_kms.c` (modeset_init). Safe because `drm_dev_register()` now calls `drm_mode_config_create_state()`.
---
Generated by Claude Code Patch Reviewer
^ permalink raw reply [flat|nested] 43+ messages in thread
* Claude review: drm/tidss: Convert to atomic_create_state
2026-03-20 16:27 ` [PATCH v2 19/20] drm/tidss: Convert to atomic_create_state Maxime Ripard
@ 2026-03-21 17:32 ` Claude Code Review Bot
0 siblings, 0 replies; 43+ messages in thread
From: Claude Code Review Bot @ 2026-03-21 17:32 UTC (permalink / raw)
To: dri-devel-reviews
Patch Review
Converts tidss_crtc to use `atomic_create_state` instead of `reset`, and tidss_plane to use `drm_atomic_helper_plane_create_state`. The CRTC conversion nicely shows the benefit: the new callback is cleaner without the destroy-old-state / set-NULL-on-failure boilerplate.
Has R-b from Tomi and Laurent. Clean conversion.
---
Generated by Claude Code Patch Reviewer
^ permalink raw reply [flat|nested] 43+ messages in thread
* Claude review: drm/bridge_connector: Convert to atomic_create_state
2026-03-20 16:27 ` [PATCH v2 20/20] drm/bridge_connector: " Maxime Ripard
@ 2026-03-21 17:32 ` Claude Code Review Bot
0 siblings, 0 replies; 43+ messages in thread
From: Claude Code Review Bot @ 2026-03-21 17:32 UTC (permalink / raw)
To: dri-devel-reviews
Patch Review
Converts `drm_bridge_connector` to use `atomic_create_state` instead of `reset`. The old `drm_bridge_connector_reset()` called `drm_atomic_helper_connector_reset()` then `__drm_atomic_helper_connector_hdmi_state_init()`. The new version calls `drm_atomic_helper_connector_create_state()` then adds HDMI init.
**Note**: The `.reset` callback is removed entirely from `drm_bridge_connector_funcs`. This means `drm_mode_config_reset()` will no longer create state for bridge connectors (it falls through to the `else if (atomic_create_state)` path instead). This is fine for the initial state, but if anyone calls `drm_mode_config_reset()` during suspend/resume to re-create connector states, the bridge connector won't get a new state since there's no `reset` anymore. The `drm_mode_config_reset` fallback to `atomic_create_state` added in patch 13 should handle this, but it doesn't free the old state first -- unlike `drm_atomic_helper_connector_reset()` which does `kfree(connector->state)` before creating a new one. This means calling `drm_mode_config_reset()` on a bridge connector after this conversion would leak the old state and overwrite the pointer. However, the `drm_mode_config_reset` fallback code checks nothing (`if (connector->funcs->atomic_create_state)`) and will always create a new state, so this is indeed a leak if `reset()` is called with existing state. Since `drm_mode_config_reset()` is documented for suspend/resume use, this is a concern.
Has Laurent's R-b. The concern above may be acceptable if bridge connectors are never expected to go through `drm_mode_config_reset()` during suspend/resume, but it should be documented or the fallback path in `drm_mode_config_reset()` should handle existing state (free old before creating new).
---
Generated by Claude Code Patch Reviewer
^ permalink raw reply [flat|nested] 43+ messages in thread
end of thread, other threads:[~2026-03-21 17:32 UTC | newest]
Thread overview: 43+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-20 16:27 [PATCH v2 00/20] drm/atomic: Rework initial state allocation Maxime Ripard
2026-03-20 16:27 ` [PATCH v2 01/20] drm/colorop: Fix typos in the doc Maxime Ripard
2026-03-21 17:32 ` Claude review: " Claude Code Review Bot
2026-03-20 16:27 ` [PATCH v2 02/20] drm/atomic: Drop drm_private_state.obj assignment from create_state Maxime Ripard
2026-03-21 17:32 ` Claude review: " Claude Code Review Bot
2026-03-20 16:27 ` [PATCH v2 03/20] drm/mode-config: Mention drm_mode_config_reset() culprits Maxime Ripard
2026-03-21 17:32 ` Claude review: " Claude Code Review Bot
2026-03-20 16:27 ` [PATCH v2 04/20] drm/colorop: Rename __drm_colorop_state_reset() Maxime Ripard
2026-03-21 17:32 ` Claude review: " Claude Code Review Bot
2026-03-20 16:27 ` [PATCH v2 05/20] drm/colorop: Create drm_atomic_helper_colorop_create_state() Maxime Ripard
2026-03-21 17:32 ` Claude review: " Claude Code Review Bot
2026-03-20 16:27 ` [PATCH v2 06/20] drm/atomic-state-helper: Fix __drm_atomic_helper_plane_reset() doc typo Maxime Ripard
2026-03-21 17:32 ` Claude review: " Claude Code Review Bot
2026-03-20 16:27 ` [PATCH v2 07/20] drm/atomic-state-helper: Rename __drm_atomic_helper_plane_state_reset() Maxime Ripard
2026-03-21 17:32 ` Claude review: " Claude Code Review Bot
2026-03-20 16:27 ` [PATCH v2 08/20] drm/plane: Add new atomic_create_state callback Maxime Ripard
2026-03-21 17:32 ` Claude review: " Claude Code Review Bot
2026-03-20 16:27 ` [PATCH v2 09/20] drm/atomic-state-helper: Rename __drm_atomic_helper_crtc_state_reset() Maxime Ripard
2026-03-21 17:32 ` Claude review: " Claude Code Review Bot
2026-03-20 16:27 ` [PATCH v2 10/20] drm/crtc: Add new atomic_create_state callback Maxime Ripard
2026-03-21 17:32 ` Claude review: " Claude Code Review Bot
2026-03-20 16:27 ` [PATCH v2 11/20] drm/atomic-state-helper: Rename __drm_atomic_helper_connector_state_reset() Maxime Ripard
2026-03-21 17:32 ` Claude review: " Claude Code Review Bot
2026-03-20 16:27 ` [PATCH v2 12/20] drm/hdmi: Rename __drm_atomic_helper_connector_hdmi_reset() Maxime Ripard
2026-03-21 17:32 ` Claude review: " Claude Code Review Bot
2026-03-20 16:27 ` [PATCH v2 13/20] drm/connector: Add new atomic_create_state callback Maxime Ripard
2026-03-21 17:32 ` Claude review: " Claude Code Review Bot
2026-03-20 16:27 ` [PATCH v2 14/20] drm/mode-config: Create drm_mode_config_create_state() Maxime Ripard
2026-03-21 17:32 ` Claude review: " Claude Code Review Bot
2026-03-20 16:27 ` [PATCH v2 15/20] drm/drv: Call drm_mode_config_create_state() by default Maxime Ripard
2026-03-21 17:32 ` Claude review: " Claude Code Review Bot
2026-03-20 16:27 ` [PATCH v2 16/20] drm/atomic: Drop private obj state allocation Maxime Ripard
2026-03-21 17:32 ` Claude review: " Claude Code Review Bot
2026-03-20 16:27 ` [PATCH v2 17/20] drm/drv: Drop drm_mode_config_reset() from our skeleton Maxime Ripard
2026-03-21 17:32 ` Claude review: " Claude Code Review Bot
2026-03-20 16:27 ` [PATCH v2 18/20] drm/tidss: Drop call to drm_mode_config_reset at probe time Maxime Ripard
2026-03-21 17:32 ` Claude review: " Claude Code Review Bot
2026-03-20 16:27 ` [PATCH v2 19/20] drm/tidss: Convert to atomic_create_state Maxime Ripard
2026-03-21 17:32 ` Claude review: " Claude Code Review Bot
2026-03-20 16:27 ` [PATCH v2 20/20] drm/bridge_connector: " Maxime Ripard
2026-03-21 17:32 ` Claude review: " Claude Code Review Bot
2026-03-21 17:32 ` Claude review: drm/atomic: Rework initial state allocation Claude Code Review Bot
-- strict thread matches above, loose matches on Subject: below --
2026-03-10 16:06 [PATCH 00/14] " Maxime Ripard
2026-03-10 16:07 ` [PATCH 12/14] drm/tidss: Drop call to drm_mode_config_reset at probe time Maxime Ripard
2026-03-11 3:09 ` Claude review: " Claude Code Review Bot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox