drm/amdgpu: update gart_pin_size if bo is in GTT
authorFlora Cui <Flora.Cui@amd.com>
Fri, 9 Sep 2016 06:15:30 +0000 (14:15 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 14 Sep 2016 19:10:31 +0000 (15:10 -0400)
Signed-off-by: Flora Cui <Flora.Cui@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_object.c

index 5a6216c9c0073972ea99546e96177e479d5dc1bc..e503ca13cccbbd7910f52471a215a4ca82808ec4 100644 (file)
@@ -726,7 +726,7 @@ int amdgpu_bo_unpin(struct amdgpu_bo *bo)
                bo->adev->vram_pin_size -= amdgpu_bo_size(bo);
                if (bo->flags & AMDGPU_GEM_CREATE_NO_CPU_ACCESS)
                        bo->adev->invisible_pin_size -= amdgpu_bo_size(bo);
-       } else {
+       } else if (bo->tbo.mem.mem_type == TTM_PL_TT) {
                bo->adev->gart_pin_size -= amdgpu_bo_size(bo);
        }