drm/vmwgfx: get rid of ttm_bo_is_reserved usage
authorMaarten Lankhorst <m.b.lankhorst@gmail.com>
Thu, 27 Jun 2013 11:48:27 +0000 (13:48 +0200)
committerDave Airlie <airlied@redhat.com>
Fri, 28 Jun 2013 02:04:14 +0000 (12:04 +1000)
Use lockdep_assert_held instead.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
drivers/gpu/drm/vmwgfx/vmwgfx_dmabuf.c
drivers/gpu/drm/vmwgfx/vmwgfx_resource.c

index 5fae06ad7e251e609b22af372354f0385f123165..d4e54fcc0acd3e778bd74d1488f898798c740c73 100644 (file)
@@ -302,7 +302,7 @@ void vmw_bo_pin(struct ttm_buffer_object *bo, bool pin)
        uint32_t old_mem_type = bo->mem.mem_type;
        int ret;
 
-       BUG_ON(!ttm_bo_is_reserved(bo));
+       lockdep_assert_held(&bo->resv->lock.base);
        BUG_ON(old_mem_type != TTM_PL_VRAM &&
               old_mem_type != VMW_PL_GMR);
 
index ced79465a095ec9c2af64ba6ac8c4199a6e47266..7953d1f90b63d4eeefb0a44c8a43d2eee3345991 100644 (file)
@@ -958,13 +958,13 @@ void vmw_resource_unreserve(struct vmw_resource *res,
        if (new_backup && new_backup != res->backup) {
 
                if (res->backup) {
-                       BUG_ON(!ttm_bo_is_reserved(&res->backup->base));
+                       lockdep_assert_held(&res->backup->base.resv->lock.base);
                        list_del_init(&res->mob_head);
                        vmw_dmabuf_unreference(&res->backup);
                }
 
                res->backup = vmw_dmabuf_reference(new_backup);
-               BUG_ON(!ttm_bo_is_reserved(&new_backup->base));
+               lockdep_assert_held(&new_backup->base.resv->lock.base);
                list_add_tail(&res->mob_head, &new_backup->res_list);
        }
        if (new_backup)