aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu.h
diff options
context:
space:
mode:
authorChristian König <christian.koenig@amd.com>2016-02-23 06:36:59 -0500
committerAlex Deucher <alexander.deucher@amd.com>2016-03-08 11:01:50 -0500
commit2f568dbd6b944c2e8c0c54b53c2211c23995e6a4 (patch)
tree385cdb8bc9d264b40e9f83e6e89440b867866c07 /drivers/gpu/drm/amd/amdgpu/amdgpu.h
parentd564a06e1c9c285bab1c1579c18c811aa1271884 (diff)
drm/amdgpu: move get_user_pages out of amdgpu_ttm_tt_pin_userptr v6
That avoids lock inversion between the BO reservation lock and the anon_vma lock. v2: * Changed amdgpu_bo_list_entry.user_pages to an array of pointers * Lock mmap_sem only for get_user_pages * Added invalidation of unbound userpointer BOs * Fixed memory leak and page reference leak v3 (chk): * Revert locking mmap_sem only for_get user_pages * Revert adding invalidation of unbound userpointer BOs * Sanitize and fix error handling v4 (chk): * Init userpages pointer everywhere. * Fix error handling when get_user_pages() fails. * Add invalidation of unbound userpointer BOs again. v5 (chk): * Add maximum number of tries. v6 (chk): * Fix error handling when we run out of tries. Signed-off-by: Christian König <christian.koenig@amd.com> Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com> Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com> (v4) Acked-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu.h')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
index e0727de9c2b2..e32ab13227d4 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
@@ -471,6 +471,8 @@ struct amdgpu_bo_list_entry {
471 struct ttm_validate_buffer tv; 471 struct ttm_validate_buffer tv;
472 struct amdgpu_bo_va *bo_va; 472 struct amdgpu_bo_va *bo_va;
473 uint32_t priority; 473 uint32_t priority;
474 struct page **user_pages;
475 int user_invalidated;
474}; 476};
475 477
476struct amdgpu_bo_va_mapping { 478struct amdgpu_bo_va_mapping {
@@ -2365,11 +2367,14 @@ int amdgpu_cs_get_ring(struct amdgpu_device *adev, u32 ip_type,
2365 struct amdgpu_ring **out_ring); 2367 struct amdgpu_ring **out_ring);
2366void amdgpu_ttm_placement_from_domain(struct amdgpu_bo *rbo, u32 domain); 2368void amdgpu_ttm_placement_from_domain(struct amdgpu_bo *rbo, u32 domain);
2367bool amdgpu_ttm_bo_is_amdgpu_bo(struct ttm_buffer_object *bo); 2369bool amdgpu_ttm_bo_is_amdgpu_bo(struct ttm_buffer_object *bo);
2370int amdgpu_ttm_tt_get_user_pages(struct ttm_tt *ttm, struct page **pages);
2368int amdgpu_ttm_tt_set_userptr(struct ttm_tt *ttm, uint64_t addr, 2371int amdgpu_ttm_tt_set_userptr(struct ttm_tt *ttm, uint64_t addr,
2369 uint32_t flags); 2372 uint32_t flags);
2370struct mm_struct *amdgpu_ttm_tt_get_usermm(struct ttm_tt *ttm); 2373struct mm_struct *amdgpu_ttm_tt_get_usermm(struct ttm_tt *ttm);
2371bool amdgpu_ttm_tt_affect_userptr(struct ttm_tt *ttm, unsigned long start, 2374bool amdgpu_ttm_tt_affect_userptr(struct ttm_tt *ttm, unsigned long start,
2372 unsigned long end); 2375 unsigned long end);
2376bool amdgpu_ttm_tt_userptr_invalidated(struct ttm_tt *ttm,
2377 int *last_invalidated);
2373bool amdgpu_ttm_tt_is_readonly(struct ttm_tt *ttm); 2378bool amdgpu_ttm_tt_is_readonly(struct ttm_tt *ttm);
2374uint32_t amdgpu_ttm_tt_pte_flags(struct amdgpu_device *adev, struct ttm_tt *ttm, 2379uint32_t amdgpu_ttm_tt_pte_flags(struct amdgpu_device *adev, struct ttm_tt *ttm,
2375 struct ttm_mem_reg *mem); 2380 struct ttm_mem_reg *mem);