drm/radeon: remove global vm lock
Not needed any more. Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
6d2f2944e9
commit
529364e05b
@ -884,7 +884,6 @@ struct radeon_vm {
|
|||||||
};
|
};
|
||||||
|
|
||||||
struct radeon_vm_manager {
|
struct radeon_vm_manager {
|
||||||
struct mutex lock;
|
|
||||||
struct radeon_fence *active[RADEON_NUM_VM];
|
struct radeon_fence *active[RADEON_NUM_VM];
|
||||||
uint32_t max_pfn;
|
uint32_t max_pfn;
|
||||||
/* number of VMIDs */
|
/* number of VMIDs */
|
||||||
|
@ -502,7 +502,6 @@ static int radeon_cs_ib_vm_chunk(struct radeon_device *rdev,
|
|||||||
if (parser->ring == R600_RING_TYPE_UVD_INDEX)
|
if (parser->ring == R600_RING_TYPE_UVD_INDEX)
|
||||||
radeon_uvd_note_usage(rdev);
|
radeon_uvd_note_usage(rdev);
|
||||||
|
|
||||||
mutex_lock(&rdev->vm_manager.lock);
|
|
||||||
mutex_lock(&vm->mutex);
|
mutex_lock(&vm->mutex);
|
||||||
r = radeon_bo_vm_update_pte(parser, vm);
|
r = radeon_bo_vm_update_pte(parser, vm);
|
||||||
if (r) {
|
if (r) {
|
||||||
@ -510,8 +509,6 @@ static int radeon_cs_ib_vm_chunk(struct radeon_device *rdev,
|
|||||||
}
|
}
|
||||||
radeon_cs_sync_rings(parser);
|
radeon_cs_sync_rings(parser);
|
||||||
radeon_semaphore_sync_to(parser->ib.semaphore, vm->fence);
|
radeon_semaphore_sync_to(parser->ib.semaphore, vm->fence);
|
||||||
radeon_semaphore_sync_to(parser->ib.semaphore,
|
|
||||||
radeon_vm_grab_id(rdev, vm, parser->ring));
|
|
||||||
|
|
||||||
if ((rdev->family >= CHIP_TAHITI) &&
|
if ((rdev->family >= CHIP_TAHITI) &&
|
||||||
(parser->chunk_const_ib_idx != -1)) {
|
(parser->chunk_const_ib_idx != -1)) {
|
||||||
@ -522,7 +519,6 @@ static int radeon_cs_ib_vm_chunk(struct radeon_device *rdev,
|
|||||||
|
|
||||||
out:
|
out:
|
||||||
mutex_unlock(&vm->mutex);
|
mutex_unlock(&vm->mutex);
|
||||||
mutex_unlock(&rdev->vm_manager.lock);
|
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1191,8 +1191,7 @@ int radeon_device_init(struct radeon_device *rdev,
|
|||||||
r = radeon_gem_init(rdev);
|
r = radeon_gem_init(rdev);
|
||||||
if (r)
|
if (r)
|
||||||
return r;
|
return r;
|
||||||
/* initialize vm here */
|
|
||||||
mutex_init(&rdev->vm_manager.lock);
|
|
||||||
/* Adjust VM size here.
|
/* Adjust VM size here.
|
||||||
* Currently set to 4GB ((1 << 20) 4k pages).
|
* Currently set to 4GB ((1 << 20) 4k pages).
|
||||||
* Max GPUVM size for cayman and SI is 40 bits.
|
* Max GPUVM size for cayman and SI is 40 bits.
|
||||||
|
@ -145,6 +145,13 @@ int radeon_ib_schedule(struct radeon_device *rdev, struct radeon_ib *ib,
|
|||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* grab a vm id if necessary */
|
||||||
|
if (ib->vm) {
|
||||||
|
struct radeon_fence *vm_id_fence;
|
||||||
|
vm_id_fence = radeon_vm_grab_id(rdev, ib->vm, ib->ring);
|
||||||
|
radeon_semaphore_sync_to(ib->semaphore, vm_id_fence);
|
||||||
|
}
|
||||||
|
|
||||||
/* sync with other rings */
|
/* sync with other rings */
|
||||||
r = radeon_semaphore_sync_rings(rdev, ib->semaphore, ib->ring);
|
r = radeon_semaphore_sync_rings(rdev, ib->semaphore, ib->ring);
|
||||||
if (r) {
|
if (r) {
|
||||||
|
@ -110,12 +110,10 @@ void radeon_vm_manager_fini(struct radeon_device *rdev)
|
|||||||
if (!rdev->vm_manager.enabled)
|
if (!rdev->vm_manager.enabled)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
mutex_lock(&rdev->vm_manager.lock);
|
|
||||||
for (i = 0; i < RADEON_NUM_VM; ++i)
|
for (i = 0; i < RADEON_NUM_VM; ++i)
|
||||||
radeon_fence_unref(&rdev->vm_manager.active[i]);
|
radeon_fence_unref(&rdev->vm_manager.active[i]);
|
||||||
radeon_asic_vm_fini(rdev);
|
radeon_asic_vm_fini(rdev);
|
||||||
rdev->vm_manager.enabled = false;
|
rdev->vm_manager.enabled = false;
|
||||||
mutex_unlock(&rdev->vm_manager.lock);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -734,7 +732,7 @@ static void radeon_vm_update_ptes(struct radeon_device *rdev,
|
|||||||
* Fill in the page table entries for @bo (cayman+).
|
* Fill in the page table entries for @bo (cayman+).
|
||||||
* Returns 0 for success, -EINVAL for failure.
|
* Returns 0 for success, -EINVAL for failure.
|
||||||
*
|
*
|
||||||
* Object have to be reserved & global and local mutex must be locked!
|
* Object have to be reserved and mutex must be locked!
|
||||||
*/
|
*/
|
||||||
int radeon_vm_bo_update(struct radeon_device *rdev,
|
int radeon_vm_bo_update(struct radeon_device *rdev,
|
||||||
struct radeon_vm *vm,
|
struct radeon_vm *vm,
|
||||||
@ -842,12 +840,10 @@ int radeon_vm_bo_rmv(struct radeon_device *rdev,
|
|||||||
{
|
{
|
||||||
int r = 0;
|
int r = 0;
|
||||||
|
|
||||||
mutex_lock(&rdev->vm_manager.lock);
|
|
||||||
mutex_lock(&bo_va->vm->mutex);
|
mutex_lock(&bo_va->vm->mutex);
|
||||||
if (bo_va->soffset) {
|
if (bo_va->soffset)
|
||||||
r = radeon_vm_bo_update(rdev, bo_va->vm, bo_va->bo, NULL);
|
r = radeon_vm_bo_update(rdev, bo_va->vm, bo_va->bo, NULL);
|
||||||
}
|
|
||||||
mutex_unlock(&rdev->vm_manager.lock);
|
|
||||||
list_del(&bo_va->vm_list);
|
list_del(&bo_va->vm_list);
|
||||||
mutex_unlock(&bo_va->vm->mutex);
|
mutex_unlock(&bo_va->vm->mutex);
|
||||||
list_del(&bo_va->bo_list);
|
list_del(&bo_va->bo_list);
|
||||||
|
Loading…
Reference in New Issue
Block a user