[PATCH v2 16/20] drm/atomic: Drop private obj state allocation

Maxime Ripard
2026-03-20T16:28:15Z

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