Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/omapdrm: Switch private_obj initialization to atomic_create_state

The omapdrm driver relies on a drm_private_obj, that is initialized by
allocating and initializing a state, and then passing it to
drm_private_obj_init.

Since we're gradually moving away from that pattern to the more
established one relying on a atomic_create_state implementation, let's
migrate this instance to the new pattern.

Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Link: https://patch.msgid.link/20260224-drm-private-obj-reset-v5-2-5a72f8ec9934@kernel.org
Signed-off-by: Maxime Ripard <mripard@kernel.org>

+16 -6
+16 -6
drivers/gpu/drm/omapdrm/omap_drv.c
··· 275 275 kfree(omap_state); 276 276 } 277 277 278 + static struct drm_private_state * 279 + omap_global_atomic_create_state(struct drm_private_obj *obj) 280 + { 281 + struct omap_global_state *state; 282 + 283 + state = kzalloc_obj(*state); 284 + if (!state) 285 + return ERR_PTR(-ENOMEM); 286 + 287 + __drm_atomic_helper_private_obj_create_state(obj, &state->base); 288 + 289 + return &state->base; 290 + } 291 + 278 292 static const struct drm_private_state_funcs omap_global_state_funcs = { 293 + .atomic_create_state = omap_global_atomic_create_state, 279 294 .atomic_duplicate_state = omap_global_duplicate_state, 280 295 .atomic_destroy_state = omap_global_destroy_state, 281 296 }; ··· 298 283 static int omap_global_obj_init(struct drm_device *dev) 299 284 { 300 285 struct omap_drm_private *priv = dev->dev_private; 301 - struct omap_global_state *state; 302 286 303 - state = kzalloc_obj(*state); 304 - if (!state) 305 - return -ENOMEM; 306 - 307 - drm_atomic_private_obj_init(dev, &priv->glob_obj, &state->base, 287 + drm_atomic_private_obj_init(dev, &priv->glob_obj, NULL, 308 288 &omap_global_state_funcs); 309 289 return 0; 310 290 }