Skip to content

Commit

Permalink
drm/amdgpu: fix BO move offsets
Browse files Browse the repository at this point in the history
It's pretty pointless to get the offset first and then initialize it.

Should fix issues with the new GTT manager.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
  • Loading branch information
Christian König authored and Alex Deucher committed Sep 28, 2016
1 parent 98b480d commit ad78069
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
Original file line number Diff line number Diff line change
Expand Up @@ -272,8 +272,6 @@ static int amdgpu_move_blit(struct ttm_buffer_object *bo,

adev = amdgpu_get_adev(bo->bdev);
ring = adev->mman.buffer_funcs_ring;
old_start = (u64)old_mem->start << PAGE_SHIFT;
new_start = (u64)new_mem->start << PAGE_SHIFT;

switch (old_mem->mem_type) {
case TTM_PL_TT:
Expand All @@ -282,6 +280,7 @@ static int amdgpu_move_blit(struct ttm_buffer_object *bo,
return r;

case TTM_PL_VRAM:
old_start = (u64)old_mem->start << PAGE_SHIFT;
old_start += bo->bdev->man[old_mem->mem_type].gpu_offset;
break;
default:
Expand All @@ -295,6 +294,7 @@ static int amdgpu_move_blit(struct ttm_buffer_object *bo,
return r;

case TTM_PL_VRAM:
new_start = (u64)new_mem->start << PAGE_SHIFT;
new_start += bo->bdev->man[new_mem->mem_type].gpu_offset;
break;
default:
Expand Down

0 comments on commit ad78069

Please sign in to comment.