Commit 27798e07 authored by Flora Cui's avatar Flora Cui Committed by Alex Deucher

drm/amdgpu: use domain's gpu_offset for start addr

Signed-off-by: default avatarFlora Cui <Flora.Cui@amd.com>
Reviewed-by: default avatarKen Wang <Qingqing.Wang@amd.com>
Reviewed-by: default avatarMichel Dänzer <michel.daenzer@amd.com>
Reviewed-by: default avatarChristian König <christian.koenig@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 32ab75f0
...@@ -530,11 +530,7 @@ int amdgpu_bo_pin_restricted(struct amdgpu_bo *bo, u32 domain, ...@@ -530,11 +530,7 @@ int amdgpu_bo_pin_restricted(struct amdgpu_bo *bo, u32 domain,
*gpu_addr = amdgpu_bo_gpu_offset(bo); *gpu_addr = amdgpu_bo_gpu_offset(bo);
if (max_offset != 0) { if (max_offset != 0) {
u64 domain_start; u64 domain_start = bo->tbo.bdev->man[mem_type].gpu_offset;
if (domain == AMDGPU_GEM_DOMAIN_VRAM)
domain_start = bo->adev->mc.vram_start;
else
domain_start = bo->adev->mc.gtt_start;
WARN_ON_ONCE(max_offset < WARN_ON_ONCE(max_offset <
(amdgpu_bo_gpu_offset(bo) - domain_start)); (amdgpu_bo_gpu_offset(bo) - domain_start));
} }
......
...@@ -257,10 +257,8 @@ static int amdgpu_move_blit(struct ttm_buffer_object *bo, ...@@ -257,10 +257,8 @@ static int amdgpu_move_blit(struct ttm_buffer_object *bo,
switch (old_mem->mem_type) { switch (old_mem->mem_type) {
case TTM_PL_VRAM: case TTM_PL_VRAM:
old_start += adev->mc.vram_start;
break;
case TTM_PL_TT: case TTM_PL_TT:
old_start += adev->mc.gtt_start; old_start += bo->bdev->man[old_mem->mem_type].gpu_offset;
break; break;
default: default:
DRM_ERROR("Unknown placement %d\n", old_mem->mem_type); DRM_ERROR("Unknown placement %d\n", old_mem->mem_type);
...@@ -268,10 +266,8 @@ static int amdgpu_move_blit(struct ttm_buffer_object *bo, ...@@ -268,10 +266,8 @@ static int amdgpu_move_blit(struct ttm_buffer_object *bo,
} }
switch (new_mem->mem_type) { switch (new_mem->mem_type) {
case TTM_PL_VRAM: case TTM_PL_VRAM:
new_start += adev->mc.vram_start;
break;
case TTM_PL_TT: case TTM_PL_TT:
new_start += adev->mc.gtt_start; new_start += bo->bdev->man[new_mem->mem_type].gpu_offset;
break; break;
default: default:
DRM_ERROR("Unknown placement %d\n", old_mem->mem_type); DRM_ERROR("Unknown placement %d\n", old_mem->mem_type);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment