drm/amdgpu:cleanup stolen vga memory finish
authorMonk Liu <Monk.Liu@amd.com>
Mon, 13 Nov 2017 12:41:56 +0000 (20:41 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 6 Dec 2017 17:47:49 +0000 (12:47 -0500)
Signed-off-by: Monk Liu <Monk.Liu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c

index b12a46fadb16daf58aebacda05c65f047a4d99ac..f34adb0cd1eadc053dec9f169c218225c5f5a18c 100644 (file)
@@ -1401,15 +1401,10 @@ void amdgpu_ttm_fini(struct amdgpu_device *adev)
 
        if (!adev->mman.initialized)
                return;
+
        amdgpu_ttm_debugfs_fini(adev);
-       if (adev->stolen_vga_memory) {
-               r = amdgpu_bo_reserve(adev->stolen_vga_memory, true);
-               if (r == 0) {
-                       amdgpu_bo_unpin(adev->stolen_vga_memory);
-                       amdgpu_bo_unreserve(adev->stolen_vga_memory);
-               }
-               amdgpu_bo_unref(&adev->stolen_vga_memory);
-       }
+       amdgpu_bo_free_kernel(&adev->stolen_vga_memory, NULL, NULL);
+
        ttm_bo_clean_mm(&adev->mman.bdev, TTM_PL_VRAM);
        ttm_bo_clean_mm(&adev->mman.bdev, TTM_PL_TT);
        if (adev->gds.mem.total_size)