}
if ((p->cs_flags & RADEON_CS_USE_VM) &&
- (p->rdev->family < CHIP_CAYMAN)) {
- DRM_ERROR("VM not supported on asic!\n");
+ !p->rdev->vm_manager.enabled) {
+ DRM_ERROR("VM not active on asic!\n");
if (p->chunk_relocs_idx != -1)
kfree(p->chunks[p->chunk_relocs_idx].kdata);
if (p->chunk_flags_idx != -1)
{
int r;
+ rdev->vm_manager.enabled = false;
+
/* mark first vm as always in use, it's the system one */
r = radeon_sa_bo_manager_init(rdev, &rdev->vm_manager.sa_manager,
rdev->vm_manager.max_pfn * 8,
(rdev->vm_manager.max_pfn * 8) >> 10);
return r;
}
- return rdev->vm_manager.funcs->init(rdev);
+
+ r = rdev->vm_manager.funcs->init(rdev);
+ if (r == 0)
+ rdev->vm_manager.enabled = true;
+
+ return r;
}
/* cs mutex must be lock */
radeon_vm_manager_suspend(rdev);
rdev->vm_manager.funcs->fini(rdev);
radeon_sa_bo_manager_fini(rdev, &rdev->vm_manager.sa_manager);
+ rdev->vm_manager.enabled = false;
}
int radeon_vm_manager_start(struct radeon_device *rdev)
u32 invalid_flags;
int r = 0;
+ if (!rdev->vm_manager.enabled) {
+ args->operation = RADEON_VA_RESULT_ERROR;
+ return -ENOTTY;
+ }
+
/* !! DONT REMOVE !!
* We don't support vm_id yet, to be sure we don't have have broken
* userspace, reject anyone trying to use non 0 value thus moving