Now that we have all the drm_private_obj users relying on the reset implementation, we can move that call from drm_private_obj_init, where it was initially supposed to happen, to drm_mode_config_reset, which is the location reset is called for every other object in KMS.
Signed-off-by: Maxime Ripard <[email protected]> --- drivers/gpu/drm/drm_atomic.c | 3 --- drivers/gpu/drm/drm_mode_config.c | 6 ++++++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c index e409919b0ccb632e869b4a6f8462731484755b73..5e76ae017117ca25a2620b8b3cad4f0d622448fe 100644 --- a/drivers/gpu/drm/drm_atomic.c +++ b/drivers/gpu/drm/drm_atomic.c @@ -791,13 +791,10 @@ drm_atomic_private_obj_init(struct drm_device *dev, drm_modeset_lock_init(&obj->lock); obj->dev = dev; obj->funcs = funcs; list_add_tail(&obj->head, &dev->mode_config.privobj_list); - - if (obj->funcs->reset) - obj->funcs->reset(obj); } EXPORT_SYMBOL(drm_atomic_private_obj_init); /** * drm_atomic_private_obj_fini - finalize private object diff --git a/drivers/gpu/drm/drm_mode_config.c b/drivers/gpu/drm/drm_mode_config.c index 25f376869b3a41d47bbe72b0df3e35cad142f3e6..76fcf80fdcec4337992b35ac741189bb32ee670d 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> @@ -193,12 +194,17 @@ void drm_mode_config_reset(struct drm_device *dev) { struct drm_crtc *crtc; struct drm_plane *plane; struct drm_encoder *encoder; struct drm_connector *connector; + struct drm_private_obj *obj; struct drm_connector_list_iter conn_iter; + drm_for_each_privobj(obj, dev) + if (obj->funcs->reset) + obj->funcs->reset(obj); + drm_for_each_plane(plane, dev) if (plane->funcs->reset) plane->funcs->reset(plane); drm_for_each_crtc(crtc, dev) -- 2.51.0
