From 44e7cd92021150d734a2b91336d22a20ba130af9 Mon Sep 17 00:00:00 2001 From: Daniel Vetter Date: Mon, 27 Jan 2020 18:04:03 +0100 Subject: drm: Complain if drivers still use the ->load callback Kinda time to get this sorted. The locking around this really is not nice. Thomas mentioned in his review that the only drivers left unconverted are radeon and amdgpu. Cc: Harry Wentland Cc: Alex Deucher Reviewed-by: Chris Wilson Reviewed-by: Thomas Zimmermann Signed-off-by: Daniel Vetter --- drivers/gpu/drm/drm_drv.c | 6 ++++++ include/drm/drm_drv.h | 3 +++ 2 files changed, 9 insertions(+) diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c index 243cacb3575c..cd3308cfa918 100644 --- a/drivers/gpu/drm/drm_drv.c +++ b/drivers/gpu/drm/drm_drv.c @@ -914,6 +914,12 @@ int drm_dev_register(struct drm_device *dev, unsigned long flags) else drm_debugfs_dev_register(dev); + if (dev->driver->load) { + if (!drm_core_check_feature(dev, DRIVER_LEGACY)) + DRM_INFO("drm driver %s is using deprecated ->load callback\n", + dev->driver->name); + } + ret = drm_minor_register(dev, DRM_MINOR_RENDER); if (ret) goto err_minors; diff --git a/include/drm/drm_drv.h b/include/drm/drm_drv.h index 8878260d7529..44a99c028c43 100644 --- a/include/drm/drm_drv.h +++ b/include/drm/drm_drv.h @@ -188,6 +188,9 @@ struct drm_driver { * * This is deprecated, do not use! * + * FIXME: A few non-DRIVER_LEGACY drivers still use this, and should be + * converted. + * * Returns: * * Zero on success, non-zero value on failure. -- cgit v1.2.3