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 at ffwll.ch>
---
 include/drm/drmP.h       | 17 -----------------
 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 d40edf096154..6b5705535fe7 100644
--- a/include/drm/drmP.h
+++ b/include/drm/drmP.h
@@ -222,23 +222,6 @@ int drm_err(const char *func, const char *format, ...);
 #define DRM_IF_VERSION(maj, min) (maj << 16 | min)

 /**
- * Test that the hardware lock is held by the caller, returning otherwise.
- *
- * \param dev DRM device.
- * \param filp file pointer of the caller.
- */
-#define LOCK_TEST_WITH_RETURN( dev, _file_priv )                               
\
-do {                                                                           
\
-       if (!_DRM_LOCK_IS_HELD(_file_priv->master->lock.hw_lock->lock) ||       
\
-           _file_priv->master->lock.file_priv != _file_priv)   {               
\
-               DRM_ERROR( "%s called without lock held, held  %d owner %p 
%p\n",\
-                          __func__, 
_DRM_LOCK_IS_HELD(_file_priv->master->lock.hw_lock->lock),\
-                          _file_priv->master->lock.file_priv, _file_priv);     
\
-               return -EINVAL;                                                 
\
-       }                                                                       
\
-} while (0)
-
-/**
  * Ioctl function type.
  *
  * \param inode device inode.
diff --git a/include/drm/drm_legacy.h b/include/drm/drm_legacy.h
index 815a8266bf1b..7e743ef6aa9f 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);
 int drm_legacy_addbufs_agp(struct drm_device *d, struct drm_buf_desc *req);
 int drm_legacy_addbufs_pci(struct drm_device *d, struct drm_buf_desc *req);

+/**
+ * Test that the hardware lock is held by the caller, returning otherwise.
+ *
+ * \param dev DRM device.
+ * \param filp file pointer of the caller.
+ */
+#define LOCK_TEST_WITH_RETURN( dev, _file_priv )                               
\
+do {                                                                           
\
+       if (!_DRM_LOCK_IS_HELD(_file_priv->master->lock.hw_lock->lock) ||       
\
+           _file_priv->master->lock.file_priv != _file_priv)   {               
\
+               DRM_ERROR( "%s called without lock held, held  %d owner %p 
%p\n",\
+                          __func__, 
_DRM_LOCK_IS_HELD(_file_priv->master->lock.hw_lock->lock),\
+                          _file_priv->master->lock.file_priv, _file_priv);     
\
+               return -EINVAL;                                                 
\
+       }                                                                       
\
+} while (0)
+
 void drm_legacy_idlelock_take(struct drm_lock_data *lock);
 void drm_legacy_idlelock_release(struct drm_lock_data *lock);

-- 
1.9.3

Reply via email to