提交 d9a13766 编写于 作者: C Christian König 提交者: Alex Deucher

drm/amdgpu: drop gtt->adev

We can use ttm->bdev instead.
Signed-off-by: NChristian König <christian.koenig@amd.com>
Reviewed-by: NAlex Deucher <alexdeucher@amd.com>
Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
上级 87e90c76
...@@ -679,7 +679,6 @@ struct amdgpu_ttm_gup_task_list { ...@@ -679,7 +679,6 @@ struct amdgpu_ttm_gup_task_list {
struct amdgpu_ttm_tt { struct amdgpu_ttm_tt {
struct ttm_dma_tt ttm; struct ttm_dma_tt ttm;
struct amdgpu_device *adev;
u64 offset; u64 offset;
uint64_t userptr; uint64_t userptr;
struct mm_struct *usermm; struct mm_struct *usermm;
...@@ -837,6 +836,7 @@ static void amdgpu_ttm_tt_unpin_userptr(struct ttm_tt *ttm) ...@@ -837,6 +836,7 @@ static void amdgpu_ttm_tt_unpin_userptr(struct ttm_tt *ttm)
static int amdgpu_ttm_backend_bind(struct ttm_tt *ttm, static int amdgpu_ttm_backend_bind(struct ttm_tt *ttm,
struct ttm_mem_reg *bo_mem) struct ttm_mem_reg *bo_mem)
{ {
struct amdgpu_device *adev = amdgpu_ttm_adev(ttm->bdev);
struct amdgpu_ttm_tt *gtt = (void*)ttm; struct amdgpu_ttm_tt *gtt = (void*)ttm;
uint64_t flags; uint64_t flags;
int r = 0; int r = 0;
...@@ -863,9 +863,9 @@ static int amdgpu_ttm_backend_bind(struct ttm_tt *ttm, ...@@ -863,9 +863,9 @@ static int amdgpu_ttm_backend_bind(struct ttm_tt *ttm,
return 0; return 0;
} }
flags = amdgpu_ttm_tt_pte_flags(gtt->adev, ttm, bo_mem); flags = amdgpu_ttm_tt_pte_flags(adev, ttm, bo_mem);
gtt->offset = (u64)bo_mem->start << PAGE_SHIFT; gtt->offset = (u64)bo_mem->start << PAGE_SHIFT;
r = amdgpu_gart_bind(gtt->adev, gtt->offset, ttm->num_pages, r = amdgpu_gart_bind(adev, gtt->offset, ttm->num_pages,
ttm->pages, gtt->ttm.dma_address, flags); ttm->pages, gtt->ttm.dma_address, flags);
if (r) if (r)
...@@ -942,6 +942,7 @@ int amdgpu_ttm_recover_gart(struct ttm_buffer_object *tbo) ...@@ -942,6 +942,7 @@ int amdgpu_ttm_recover_gart(struct ttm_buffer_object *tbo)
static int amdgpu_ttm_backend_unbind(struct ttm_tt *ttm) static int amdgpu_ttm_backend_unbind(struct ttm_tt *ttm)
{ {
struct amdgpu_device *adev = amdgpu_ttm_adev(ttm->bdev);
struct amdgpu_ttm_tt *gtt = (void *)ttm; struct amdgpu_ttm_tt *gtt = (void *)ttm;
int r; int r;
...@@ -952,7 +953,7 @@ static int amdgpu_ttm_backend_unbind(struct ttm_tt *ttm) ...@@ -952,7 +953,7 @@ static int amdgpu_ttm_backend_unbind(struct ttm_tt *ttm)
return 0; return 0;
/* unbind shouldn't be done for GDS/GWS/OA in ttm_bo_clean_mm */ /* unbind shouldn't be done for GDS/GWS/OA in ttm_bo_clean_mm */
r = amdgpu_gart_unbind(gtt->adev, gtt->offset, ttm->num_pages); r = amdgpu_gart_unbind(adev, gtt->offset, ttm->num_pages);
if (r) if (r)
DRM_ERROR("failed to unbind %lu pages at 0x%08llX\n", DRM_ERROR("failed to unbind %lu pages at 0x%08llX\n",
gtt->ttm.ttm.num_pages, gtt->offset); gtt->ttm.ttm.num_pages, gtt->offset);
...@@ -986,7 +987,6 @@ static struct ttm_tt *amdgpu_ttm_tt_create(struct ttm_bo_device *bdev, ...@@ -986,7 +987,6 @@ static struct ttm_tt *amdgpu_ttm_tt_create(struct ttm_bo_device *bdev,
return NULL; return NULL;
} }
gtt->ttm.ttm.func = &amdgpu_backend_func; gtt->ttm.ttm.func = &amdgpu_backend_func;
gtt->adev = adev;
if (ttm_dma_tt_init(&gtt->ttm, bdev, size, page_flags)) { if (ttm_dma_tt_init(&gtt->ttm, bdev, size, page_flags)) {
kfree(gtt); kfree(gtt);
return NULL; return NULL;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册