diff options
| author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2014-09-10 06:43:58 -0400 |
|---|---|---|
| committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2014-09-12 09:28:13 -0400 |
| commit | 8f1a2c8dc0dc5c2842e08f304ebdd34b5ddb982c (patch) | |
| tree | f88c8f80b2096a4232a16259f69d67604d86bf03 | |
| parent | ba8286fab52652e431784d066b075c1bb4933ea1 (diff) | |
drm: Move LOCK_TEST_WITH_RETURN to <drm/drm_legacy.h>
Unfortunately we can't move struct drm_lock_data easily since
it's embedded into struct drm_master. And figuring out where exactly
this struct should be allocated isn't that simple ...
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
| -rw-r--r-- | include/drm/drmP.h | 17 | ||||
| -rw-r--r-- | include/drm/drm_legacy.h | 17 |
2 files changed, 17 insertions, 17 deletions
diff --git a/include/drm/drmP.h b/include/drm/drmP.h index 0d68ecdb447a..0308214a6f83 100644 --- a/include/drm/drmP.h +++ b/include/drm/drmP.h | |||
| @@ -222,23 +222,6 @@ int drm_err(const char *func, const char *format, ...); | |||
| 222 | #define DRM_IF_VERSION(maj, min) (maj << 16 | min) | 222 | #define DRM_IF_VERSION(maj, min) (maj << 16 | min) |
| 223 | 223 | ||
| 224 | /** | 224 | /** |
| 225 | * Test that the hardware lock is held by the caller, returning otherwise. | ||
| 226 | * | ||
| 227 | * \param dev DRM device. | ||
| 228 | * \param filp file pointer of the caller. | ||
| 229 | */ | ||
| 230 | #define LOCK_TEST_WITH_RETURN( dev, _file_priv ) \ | ||
| 231 | do { \ | ||
| 232 | if (!_DRM_LOCK_IS_HELD(_file_priv->master->lock.hw_lock->lock) || \ | ||
| 233 | _file_priv->master->lock.file_priv != _file_priv) { \ | ||
| 234 | DRM_ERROR( "%s called without lock held, held %d owner %p %p\n",\ | ||
| 235 | __func__, _DRM_LOCK_IS_HELD(_file_priv->master->lock.hw_lock->lock),\ | ||
| 236 | _file_priv->master->lock.file_priv, _file_priv); \ | ||
| 237 | return -EINVAL; \ | ||
| 238 | } \ | ||
| 239 | } while (0) | ||
| 240 | |||
| 241 | /** | ||
| 242 | * Ioctl function type. | 225 | * Ioctl function type. |
| 243 | * | 226 | * |
| 244 | * \param inode device inode. | 227 | * \param inode device inode. |
diff --git a/include/drm/drm_legacy.h b/include/drm/drm_legacy.h index a0fabf7624ea..6486306beb0d 100644 --- a/include/drm/drm_legacy.h +++ b/include/drm/drm_legacy.h | |||
| @@ -161,6 +161,23 @@ struct drm_local_map *drm_legacy_getsarea(struct drm_device *dev); | |||
| 161 | int drm_legacy_addbufs_agp(struct drm_device *d, struct drm_buf_desc *req); | 161 | int drm_legacy_addbufs_agp(struct drm_device *d, struct drm_buf_desc *req); |
| 162 | int drm_legacy_addbufs_pci(struct drm_device *d, struct drm_buf_desc *req); | 162 | int drm_legacy_addbufs_pci(struct drm_device *d, struct drm_buf_desc *req); |
| 163 | 163 | ||
| 164 | /** | ||
| 165 | * Test that the hardware lock is held by the caller, returning otherwise. | ||
| 166 | * | ||
| 167 | * \param dev DRM device. | ||
| 168 | * \param filp file pointer of the caller. | ||
| 169 | */ | ||
| 170 | #define LOCK_TEST_WITH_RETURN( dev, _file_priv ) \ | ||
| 171 | do { \ | ||
| 172 | if (!_DRM_LOCK_IS_HELD(_file_priv->master->lock.hw_lock->lock) || \ | ||
| 173 | _file_priv->master->lock.file_priv != _file_priv) { \ | ||
| 174 | DRM_ERROR( "%s called without lock held, held %d owner %p %p\n",\ | ||
| 175 | __func__, _DRM_LOCK_IS_HELD(_file_priv->master->lock.hw_lock->lock),\ | ||
| 176 | _file_priv->master->lock.file_priv, _file_priv); \ | ||
| 177 | return -EINVAL; \ | ||
| 178 | } \ | ||
| 179 | } while (0) | ||
| 180 | |||
| 164 | void drm_legacy_idlelock_take(struct drm_lock_data *lock); | 181 | void drm_legacy_idlelock_take(struct drm_lock_data *lock); |
| 165 | void drm_legacy_idlelock_release(struct drm_lock_data *lock); | 182 | void drm_legacy_idlelock_release(struct drm_lock_data *lock); |
| 166 | 183 | ||
