diff options
author | Christian König <deathsimple@vodafone.de> | 2012-10-09 07:31:18 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2012-10-15 13:21:01 -0400 |
commit | d72d43cfc5847c176edabc72e6431ba691322c98 (patch) | |
tree | 5106b3d8c9fde2f8c5670d2ede983364e77ce722 /drivers/gpu/drm/radeon/radeon_gart.c | |
parent | 90a51a329258e3c868f6f4c1fb264ca01c590c57 (diff) |
drm/radeon: don't add the IB pool to all VMs v2
We want to use VMs without the IB pool in the future.
v2: also remove it from radeon_vm_finish.
Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/radeon/radeon_gart.c')
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_gart.c | 34 |
1 files changed, 3 insertions, 31 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_gart.c b/drivers/gpu/drm/radeon/radeon_gart.c index 98b170a0df90..7e21ea32242a 100644 --- a/drivers/gpu/drm/radeon/radeon_gart.c +++ b/drivers/gpu/drm/radeon/radeon_gart.c | |||
@@ -602,7 +602,6 @@ int radeon_vm_evict(struct radeon_device *rdev, struct radeon_vm *vm) | |||
602 | * @vm: vm to bind | 602 | * @vm: vm to bind |
603 | * | 603 | * |
604 | * Allocate a page table for the requested vm (cayman+). | 604 | * Allocate a page table for the requested vm (cayman+). |
605 | * Also starts to populate the page table. | ||
606 | * Returns 0 for success, error for failure. | 605 | * Returns 0 for success, error for failure. |
607 | * | 606 | * |
608 | * Global and local mutex must be locked! | 607 | * Global and local mutex must be locked! |
@@ -655,8 +654,7 @@ retry: | |||
655 | } | 654 | } |
656 | 655 | ||
657 | list_add_tail(&vm->list, &rdev->vm_manager.lru_vm); | 656 | list_add_tail(&vm->list, &rdev->vm_manager.lru_vm); |
658 | return radeon_vm_bo_update_pte(rdev, vm, rdev->ring_tmp_bo.bo, | 657 | return 0; |
659 | &rdev->ring_tmp_bo.bo->tbo.mem); | ||
660 | } | 658 | } |
661 | 659 | ||
662 | /** | 660 | /** |
@@ -1241,30 +1239,15 @@ void radeon_vm_bo_invalidate(struct radeon_device *rdev, | |||
1241 | * @rdev: radeon_device pointer | 1239 | * @rdev: radeon_device pointer |
1242 | * @vm: requested vm | 1240 | * @vm: requested vm |
1243 | * | 1241 | * |
1244 | * Init @vm (cayman+). | 1242 | * Init @vm fields (cayman+). |
1245 | * Map the IB pool and any other shared objects into the VM | ||
1246 | * by default as it's used by all VMs. | ||
1247 | * Returns 0 for success, error for failure. | ||
1248 | */ | 1243 | */ |
1249 | int radeon_vm_init(struct radeon_device *rdev, struct radeon_vm *vm) | 1244 | void radeon_vm_init(struct radeon_device *rdev, struct radeon_vm *vm) |
1250 | { | 1245 | { |
1251 | struct radeon_bo_va *bo_va; | ||
1252 | int r; | ||
1253 | |||
1254 | vm->id = 0; | 1246 | vm->id = 0; |
1255 | vm->fence = NULL; | 1247 | vm->fence = NULL; |
1256 | mutex_init(&vm->mutex); | 1248 | mutex_init(&vm->mutex); |
1257 | INIT_LIST_HEAD(&vm->list); | 1249 | INIT_LIST_HEAD(&vm->list); |
1258 | INIT_LIST_HEAD(&vm->va); | 1250 | INIT_LIST_HEAD(&vm->va); |
1259 | |||
1260 | /* map the ib pool buffer at 0 in virtual address space, set | ||
1261 | * read only | ||
1262 | */ | ||
1263 | bo_va = radeon_vm_bo_add(rdev, vm, rdev->ring_tmp_bo.bo); | ||
1264 | r = radeon_vm_bo_set_addr(rdev, bo_va, RADEON_VA_IB_OFFSET, | ||
1265 | RADEON_VM_PAGE_READABLE | | ||
1266 | RADEON_VM_PAGE_SNOOPED); | ||
1267 | return r; | ||
1268 | } | 1251 | } |
1269 | 1252 | ||
1270 | /** | 1253 | /** |
@@ -1286,17 +1269,6 @@ void radeon_vm_fini(struct radeon_device *rdev, struct radeon_vm *vm) | |||
1286 | radeon_vm_free_pt(rdev, vm); | 1269 | radeon_vm_free_pt(rdev, vm); |
1287 | mutex_unlock(&rdev->vm_manager.lock); | 1270 | mutex_unlock(&rdev->vm_manager.lock); |
1288 | 1271 | ||
1289 | /* remove all bo at this point non are busy any more because unbind | ||
1290 | * waited for the last vm fence to signal | ||
1291 | */ | ||
1292 | r = radeon_bo_reserve(rdev->ring_tmp_bo.bo, false); | ||
1293 | if (!r) { | ||
1294 | bo_va = radeon_vm_bo_find(vm, rdev->ring_tmp_bo.bo); | ||
1295 | list_del_init(&bo_va->bo_list); | ||
1296 | list_del_init(&bo_va->vm_list); | ||
1297 | radeon_bo_unreserve(rdev->ring_tmp_bo.bo); | ||
1298 | kfree(bo_va); | ||
1299 | } | ||
1300 | if (!list_empty(&vm->va)) { | 1272 | if (!list_empty(&vm->va)) { |
1301 | dev_err(rdev->dev, "still active bo inside vm\n"); | 1273 | dev_err(rdev->dev, "still active bo inside vm\n"); |
1302 | } | 1274 | } |