diff options
author | Christian König <christian.koenig@amd.com> | 2016-02-15 10:59:57 -0500 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2016-02-16 17:46:24 -0500 |
commit | 418aa0c296ddb5df90c4e94f995cfd3f3c9e96dc (patch) | |
tree | ad4be1eb7a8537b33c479418f6f749f7f827f1d2 /drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | |
parent | 7ea235653328644b5ba8707e65484446a118e193 (diff) |
drm/amdgpu: cleanup gem init/finit
Remove the double housekeeping and use something sane to
forcefuly delete BOs on unload.
Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_object.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c index b74084ce734f..9a025a77958d 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | |||
@@ -97,9 +97,6 @@ static void amdgpu_ttm_bo_destroy(struct ttm_buffer_object *tbo) | |||
97 | 97 | ||
98 | amdgpu_update_memory_usage(bo->adev, &bo->tbo.mem, NULL); | 98 | amdgpu_update_memory_usage(bo->adev, &bo->tbo.mem, NULL); |
99 | 99 | ||
100 | mutex_lock(&bo->adev->gem.mutex); | ||
101 | list_del_init(&bo->list); | ||
102 | mutex_unlock(&bo->adev->gem.mutex); | ||
103 | drm_gem_object_release(&bo->gem_base); | 100 | drm_gem_object_release(&bo->gem_base); |
104 | amdgpu_bo_unref(&bo->parent); | 101 | amdgpu_bo_unref(&bo->parent); |
105 | kfree(bo->metadata); | 102 | kfree(bo->metadata); |
@@ -473,26 +470,6 @@ int amdgpu_bo_evict_vram(struct amdgpu_device *adev) | |||
473 | return ttm_bo_evict_mm(&adev->mman.bdev, TTM_PL_VRAM); | 470 | return ttm_bo_evict_mm(&adev->mman.bdev, TTM_PL_VRAM); |
474 | } | 471 | } |
475 | 472 | ||
476 | void amdgpu_bo_force_delete(struct amdgpu_device *adev) | ||
477 | { | ||
478 | struct amdgpu_bo *bo, *n; | ||
479 | |||
480 | if (list_empty(&adev->gem.objects)) { | ||
481 | return; | ||
482 | } | ||
483 | dev_err(adev->dev, "Userspace still has active objects !\n"); | ||
484 | list_for_each_entry_safe(bo, n, &adev->gem.objects, list) { | ||
485 | dev_err(adev->dev, "%p %p %lu %lu force free\n", | ||
486 | &bo->gem_base, bo, (unsigned long)bo->gem_base.size, | ||
487 | *((unsigned long *)&bo->gem_base.refcount)); | ||
488 | mutex_lock(&bo->adev->gem.mutex); | ||
489 | list_del_init(&bo->list); | ||
490 | mutex_unlock(&bo->adev->gem.mutex); | ||
491 | /* this should unref the ttm bo */ | ||
492 | drm_gem_object_unreference_unlocked(&bo->gem_base); | ||
493 | } | ||
494 | } | ||
495 | |||
496 | int amdgpu_bo_init(struct amdgpu_device *adev) | 473 | int amdgpu_bo_init(struct amdgpu_device *adev) |
497 | { | 474 | { |
498 | /* Add an MTRR for the VRAM */ | 475 | /* Add an MTRR for the VRAM */ |