From: Christian König Date: Fri, 20 Oct 2017 11:11:00 +0000 (+0200) Subject: drm/amdgpu: use the actual placement for pin accounting X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=5e91fb57eb6ac027dcdaec6ced32658ca2dcd3f0;p=openwrt%2Fstaging%2Fblogic.git drm/amdgpu: use the actual placement for pin accounting This allows us to specify multiple possible placements again. Signed-off-by: Christian König Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher --- diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c index c48fc450d99b..8a103303da3e 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c @@ -697,6 +697,8 @@ int amdgpu_bo_pin_restricted(struct amdgpu_bo *bo, u32 domain, } *gpu_addr = amdgpu_bo_gpu_offset(bo); } + + domain = amdgpu_mem_type_to_domain(bo->tbo.mem.mem_type); if (domain == AMDGPU_GEM_DOMAIN_VRAM) { adev->vram_pin_size += amdgpu_bo_size(bo); if (bo->flags & AMDGPU_GEM_CREATE_NO_CPU_ACCESS)