drm/amdgpu: update gart_pin_size only if the bo is pined to GTT
authorFlora Cui <Flora.Cui@amd.com>
Thu, 18 Aug 2016 05:17:07 +0000 (13:17 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 19 Aug 2016 16:31:36 +0000 (12:31 -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 0a0f3cb89f92089ee02afa4e1ca8b0cc0e44231e..dbab3c0d096dc3bb96ae9ade0fc9eb2dd3536f0e 100644 (file)
@@ -578,7 +578,7 @@ int amdgpu_bo_pin_restricted(struct amdgpu_bo *bo, u32 domain,
                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 (domain == AMDGPU_GEM_DOMAIN_GTT) {
                bo->adev->gart_pin_size += amdgpu_bo_size(bo);
        }