Change-Id: Ia2cb8a8f62d0933b7937991bec4eace560745f97
Signed-off-by: Flora Cui <flora....@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
index 5a6216c..296eb6a 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
@@ -376,6 +376,7 @@ int amdgpu_bo_create_restricted(struct amdgpu_device *adev,
                bo->flags &= ~AMDGPU_GEM_CREATE_CPU_GTT_USWC;
 
        amdgpu_fill_placement_to_bo(bo, placement);
+
        /* Kernel allocation are uninterruptible */
        r = ttm_bo_init(&adev->mman.bdev, &bo->tbo, size, type,
                        &bo->placement, page_align, !kernel, NULL,
@@ -726,7 +727,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);
        }
 
-- 
2.7.4

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

Reply via email to