Skip to content

Commit 8f1a2c8

Browse files
committed
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>
1 parent ba8286f commit 8f1a2c8

2 files changed

Lines changed: 17 additions & 17 deletions

File tree

‎include/drm/drmP.h‎

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -221,23 +221,6 @@ int drm_err(const char *func, const char *format, ...);
221221

222222
#define DRM_IF_VERSION(maj, min) (maj << 16 | min)
223223

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-
241224
/**
242225
* Ioctl function type.
243226
*

‎include/drm/drm_legacy.h‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,23 @@ struct drm_local_map *drm_legacy_getsarea(struct drm_device *dev);
161161
int drm_legacy_addbufs_agp(struct drm_device *d, struct drm_buf_desc *req);
162162
int drm_legacy_addbufs_pci(struct drm_device *d, struct drm_buf_desc *req);
163163

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+
164181
void drm_legacy_idlelock_take(struct drm_lock_data *lock);
165182
void drm_legacy_idlelock_release(struct drm_lock_data *lock);
166183

0 commit comments

Comments
 (0)