diff options
author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2017-08-02 13:56:02 +0200 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2017-08-11 10:48:03 +0200 |
commit | c07dcd61a0e57c6840c23d90cb1beddad7d682a1 (patch) | |
tree | 8b30f2db8c5346962c418a4cd817442d8386c066 /include/drm | |
parent | e4672e55d6f3428ae9f27542e05c891f2af71051 (diff) |
drm: Document device unplug infrastructure
While at it, also ocd and give them a consistent drm_dev_ prefix, like
the other device instance functionality. Plus move the functions into
the right places.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20170802115604.12734-3-daniel.vetter@ffwll.ch
Diffstat (limited to 'include/drm')
-rw-r--r-- | include/drm/drmP.h | 13 | ||||
-rw-r--r-- | include/drm/drm_drv.h | 22 |
2 files changed, 20 insertions, 15 deletions
diff --git a/include/drm/drmP.h b/include/drm/drmP.h index 3031c256105e..7277783a4ff0 100644 --- a/include/drm/drmP.h +++ b/include/drm/drmP.h @@ -320,19 +320,6 @@ static __inline__ int drm_core_check_feature(struct drm_device *dev, return ((dev->driver->driver_features & feature) ? 1 : 0); } -static inline void drm_device_set_unplugged(struct drm_device *dev) -{ - smp_wmb(); - atomic_set(&dev->unplugged, 1); -} - -static inline int drm_device_is_unplugged(struct drm_device *dev) -{ - int ret = atomic_read(&dev->unplugged); - smp_rmb(); - return ret; -} - /******************************************************************/ /** \name Internal function definitions */ /*@{*/ diff --git a/include/drm/drm_drv.h b/include/drm/drm_drv.h index 505c91354802..71bbaaec836d 100644 --- a/include/drm/drm_drv.h +++ b/include/drm/drm_drv.h @@ -30,7 +30,8 @@ #include <linux/list.h> #include <linux/irqreturn.h> -struct drm_device; +#include <drm/drm_device.h> + struct drm_file; struct drm_gem_object; struct drm_master; @@ -613,7 +614,24 @@ void drm_dev_unregister(struct drm_device *dev); void drm_dev_ref(struct drm_device *dev); void drm_dev_unref(struct drm_device *dev); void drm_put_dev(struct drm_device *dev); -void drm_unplug_dev(struct drm_device *dev); +void drm_dev_unplug(struct drm_device *dev); + +/** + * drm_dev_is_unplugged - is a DRM device unplugged + * @dev: DRM device + * + * This function can be called to check whether a hotpluggable is unplugged. + * Unplugging itself is singalled through drm_dev_unplug(). If a device is + * unplugged, these two functions guarantee that any store before calling + * drm_dev_unplug() is visible to callers of this function after it completes + */ +static inline int drm_dev_is_unplugged(struct drm_device *dev) +{ + int ret = atomic_read(&dev->unplugged); + smp_rmb(); + return ret; +} + int drm_dev_set_unique(struct drm_device *dev, const char *name); |