radeon_ttm_placement_from_domain(bo, domain);
/* Kernel allocation are uninterruptible */
+ mutex_lock(&rdev->vram_mutex);
r = ttm_bo_init(&rdev->mman.bdev, &bo->tbo, size, type,
&bo->placement, 0, 0, !kernel, NULL, size,
&radeon_ttm_bo_destroy);
+ mutex_unlock(&rdev->vram_mutex);
if (unlikely(r != 0)) {
if (r != -ERESTARTSYS)
dev_err(rdev->dev,
if ((*bo) == NULL)
return;
tbo = &((*bo)->tbo);
+ mutex_lock(&(*bo)->rdev->vram_mutex);
ttm_bo_unref(&tbo);
+ mutex_unlock(&(*bo)->rdev->vram_mutex);
if (tbo == NULL)
*bo = NULL;
}