aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/radeon/radeon_ttm.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/radeon/radeon_ttm.c')
-rw-r--r--drivers/gpu/drm/radeon/radeon_ttm.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_ttm.c b/drivers/gpu/drm/radeon/radeon_ttm.c
index 7bed4122528c..a00450743d60 100644
--- a/drivers/gpu/drm/radeon/radeon_ttm.c
+++ b/drivers/gpu/drm/radeon/radeon_ttm.c
@@ -494,6 +494,7 @@ int radeon_ttm_init(struct radeon_device *rdev)
494 DRM_ERROR("failed initializing buffer object driver(%d).\n", r); 494 DRM_ERROR("failed initializing buffer object driver(%d).\n", r);
495 return r; 495 return r;
496 } 496 }
497 rdev->mman.initialized = true;
497 r = ttm_bo_init_mm(&rdev->mman.bdev, TTM_PL_VRAM, 498 r = ttm_bo_init_mm(&rdev->mman.bdev, TTM_PL_VRAM,
498 rdev->mc.real_vram_size >> PAGE_SHIFT); 499 rdev->mc.real_vram_size >> PAGE_SHIFT);
499 if (r) { 500 if (r) {
@@ -541,6 +542,8 @@ void radeon_ttm_fini(struct radeon_device *rdev)
541{ 542{
542 int r; 543 int r;
543 544
545 if (!rdev->mman.initialized)
546 return;
544 if (rdev->stollen_vga_memory) { 547 if (rdev->stollen_vga_memory) {
545 r = radeon_bo_reserve(rdev->stollen_vga_memory, false); 548 r = radeon_bo_reserve(rdev->stollen_vga_memory, false);
546 if (r == 0) { 549 if (r == 0) {
@@ -554,6 +557,7 @@ void radeon_ttm_fini(struct radeon_device *rdev)
554 ttm_bo_device_release(&rdev->mman.bdev); 557 ttm_bo_device_release(&rdev->mman.bdev);
555 radeon_gart_fini(rdev); 558 radeon_gart_fini(rdev);
556 radeon_ttm_global_fini(rdev); 559 radeon_ttm_global_fini(rdev);
560 rdev->mman.initialized = false;
557 DRM_INFO("radeon: ttm finalized\n"); 561 DRM_INFO("radeon: ttm finalized\n");
558} 562}
559 563