drm/radeon: stop re-reserving the BO in radeon_vm_bo_set_addr
authorChristian König <christian.koenig@amd.com>
Wed, 19 Nov 2014 13:01:20 +0000 (14:01 +0100)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 20 Nov 2014 18:00:15 +0000 (13:00 -0500)
That's useless when all callers drop the reservation
immediately after calling the function.

Signed-off-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/radeon/radeon_gem.c
drivers/gpu/drm/radeon/radeon_kms.c
drivers/gpu/drm/radeon/radeon_vm.c

index c194497aa586e16c5c17776d5baa5959f3eac7c5..f752c7f56015f99c84e71a1018cfacf860ac0282 100644 (file)
@@ -601,6 +601,7 @@ int radeon_gem_va_ioctl(struct drm_device *dev, void *data,
                if (bo_va->it.start) {
                        args->operation = RADEON_VA_RESULT_VA_EXIST;
                        args->offset = bo_va->it.start * RADEON_GPU_PAGE_SIZE;
+                       radeon_bo_unreserve(rbo);
                        goto out;
                }
                r = radeon_vm_bo_set_addr(rdev, bo_va, args->offset, args->flags);
@@ -616,7 +617,6 @@ int radeon_gem_va_ioctl(struct drm_device *dev, void *data,
                args->operation = RADEON_VA_RESULT_ERROR;
        }
 out:
-       radeon_bo_unreserve(rbo);
        drm_gem_object_unreference_unlocked(gobj);
        return r;
 }
index 6eb561d33eba5e1d572aba7ba92a3421003d0267..f4dd26ae33e569073bfaaeb86be8495f20aa4a7c 100644 (file)
@@ -628,8 +628,6 @@ int radeon_driver_open_kms(struct drm_device *dev, struct drm_file *file_priv)
                                                  RADEON_VA_IB_OFFSET,
                                                  RADEON_VM_PAGE_READABLE |
                                                  RADEON_VM_PAGE_SNOOPED);
-
-                       radeon_bo_unreserve(rdev->ring_tmp_bo.bo);
                        if (r) {
                                radeon_vm_fini(rdev, vm);
                                kfree(fpriv);
index 9d0f87be6fa063e350a64192a68f27a9d9a7d9a1..db0ed3af8e82f3d7aae9a84499b593ca23142476 100644 (file)
@@ -450,7 +450,7 @@ error:
  * Validate and set the offset requested within the vm address space.
  * Returns 0 for success, error for failure.
  *
- * Object has to be reserved!
+ * Object has to be reserved and gets unreserved by this function!
  */
 int radeon_vm_bo_set_addr(struct radeon_device *rdev,
                          struct radeon_bo_va *bo_va,
@@ -576,7 +576,7 @@ int radeon_vm_bo_set_addr(struct radeon_device *rdev,
        }
 
        mutex_unlock(&vm->mutex);
-       return radeon_bo_reserve(bo_va->bo, false);
+       return 0;
 }
 
 /**