Commit a6ae74c9 authored by Rob Clark's avatar Rob Clark

drm/msm/gem: Add obj->lock wrappers

This will make it easier to transition over to obj->resv locking for
everything that is per-bo locking.
Signed-off-by: default avatarRob Clark <robdclark@chromium.org>
Reviewed-by: default avatarKristian H. Kristensen <hoegsberg@google.com>
Signed-off-by: default avatarRob Clark <robdclark@chromium.org>
parent 96c876f1
This diff is collapsed.
...@@ -93,6 +93,34 @@ struct msm_gem_object { ...@@ -93,6 +93,34 @@ struct msm_gem_object {
}; };
#define to_msm_bo(x) container_of(x, struct msm_gem_object, base) #define to_msm_bo(x) container_of(x, struct msm_gem_object, base)
static inline void
msm_gem_lock(struct drm_gem_object *obj)
{
struct msm_gem_object *msm_obj = to_msm_bo(obj);
mutex_lock(&msm_obj->lock);
}
static inline int
msm_gem_lock_interruptible(struct drm_gem_object *obj)
{
struct msm_gem_object *msm_obj = to_msm_bo(obj);
return mutex_lock_interruptible(&msm_obj->lock);
}
static inline void
msm_gem_unlock(struct drm_gem_object *obj)
{
struct msm_gem_object *msm_obj = to_msm_bo(obj);
mutex_unlock(&msm_obj->lock);
}
static inline bool
msm_gem_is_locked(struct drm_gem_object *obj)
{
struct msm_gem_object *msm_obj = to_msm_bo(obj);
return mutex_is_locked(&msm_obj->lock);
}
static inline bool is_active(struct msm_gem_object *msm_obj) static inline bool is_active(struct msm_gem_object *msm_obj)
{ {
return atomic_read(&msm_obj->active_count); return atomic_read(&msm_obj->active_count);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment