drm/atomic: Add dev pointer to drm_private_obj

All the objects that need to implement some callbacks in KMS have a
pointer in there structure to the main drm_device.

However, it's not the case for drm_private_objs, which makes it harder
than it needs to be to implement some of its callbacks. Let's add that
pointer.

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Reviewed-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Tested-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Link: https://patch.msgid.link/20251014-drm-private-obj-reset-v2-1-6dd60e985e9d@kernel.org
Signed-off-by: Maxime Ripard <mripard@kernel.org>
This commit is contained in:
Maxime Ripard
2025-10-14 11:31:45 +02:00
parent 70478348fc
commit 4ebaaa3b62
2 changed files with 6 additions and 0 deletions

View File

@@ -906,6 +906,7 @@ drm_atomic_private_obj_init(struct drm_device *dev,
drm_modeset_lock_init(&obj->lock);
obj->dev = dev;
obj->state = state;
obj->funcs = funcs;
list_add_tail(&obj->head, &dev->mode_config.privobj_list);

View File

@@ -339,6 +339,11 @@ struct drm_private_state_funcs {
* drm_atomic_helper_wait_for_dependencies().
*/
struct drm_private_obj {
/**
* @dev: parent DRM device
*/
struct drm_device *dev;
/**
* @head: List entry used to attach a private object to a &drm_device
* (queued to &drm_mode_config.privobj_list).