drm/radeon: allow move_notify to be called without reservation
authorMaarten Lankhorst <m.b.lankhorst@gmail.com>
Wed, 28 Nov 2012 11:25:40 +0000 (11:25 +0000)
committerDave Airlie <airlied@redhat.com>
Mon, 10 Dec 2012 10:13:49 +0000 (20:13 +1000)
The few places that care should have those checks instead.
This allows destruction of bo backed memory without a reservation.
It's required for being able to rework the delayed destroy path,
as it is no longer guaranteed to hold a reservation before unlocking.

However any previous wait is still guaranteed to complete, and it's
one of the last things to be done before the buffer object is freed.

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

index 8690be757d80e532cf20700499efc0cca902f212..6e24f84755b526567e44dc78f8b4abbce28f7670 100644 (file)
@@ -1237,7 +1237,6 @@ void radeon_vm_bo_invalidate(struct radeon_device *rdev,
 {
        struct radeon_bo_va *bo_va;
 
-       BUG_ON(!radeon_bo_is_reserved(bo));
        list_for_each_entry(bo_va, &bo->va, bo_list) {
                bo_va->valid = false;
        }
index fe6fe2527b95fbc7f6a4ff2e09652f1a6b2fe0cb..e6ee65cdfb5c81c6e2e8a0ca2570cfa2aa5b7be2 100644 (file)
@@ -530,7 +530,7 @@ void radeon_bo_get_tiling_flags(struct radeon_bo *bo,
 int radeon_bo_check_tiling(struct radeon_bo *bo, bool has_moved,
                                bool force_drop)
 {
-       BUG_ON(!radeon_bo_is_reserved(bo));
+       BUG_ON(!radeon_bo_is_reserved(bo) && !force_drop);
 
        if (!(bo->tiling_flags & RADEON_TILING_SURFACE))
                return 0;