Skip to content

Commit

Permalink
drm/amdgpu: use new cursor in amdgpu_ttm_io_mem_pfn
Browse files Browse the repository at this point in the history
Separate the drm_mm_node walking from the actual handling.

Signed-off-by: Christian König <christian.koenig@amd.com>
Acked-by: Oak Zeng <Oak.Zeng@amd.com>
Tested-by: Nirmoy Das <nirmoy.das@amd.com>
Reviewed-by: Arunpravin <Arunpravin.PaneerSelvam@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
  • Loading branch information
Christian König authored and Alex Deucher committed Mar 24, 2021
1 parent 596ee29 commit 10ebcd9
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
Original file line number Diff line number Diff line change
Expand Up @@ -631,12 +631,10 @@ static unsigned long amdgpu_ttm_io_mem_pfn(struct ttm_buffer_object *bo,
unsigned long page_offset)
{
struct amdgpu_device *adev = amdgpu_ttm_adev(bo->bdev);
uint64_t offset = (page_offset << PAGE_SHIFT);
struct drm_mm_node *mm;
struct amdgpu_res_cursor cursor;

mm = amdgpu_find_mm_node(&bo->mem, &offset);
offset += adev->gmc.aper_base;
return mm->start + (offset >> PAGE_SHIFT);
amdgpu_res_first(&bo->mem, (u64)page_offset << PAGE_SHIFT, 0, &cursor);
return (adev->gmc.aper_base + cursor.start) >> PAGE_SHIFT;
}

/**
Expand Down

0 comments on commit 10ebcd9

Please sign in to comment.