diff options
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c index 100bfd4a0707..cdb393db11a5 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | |||
@@ -499,9 +499,6 @@ static int amdgpu_ttm_tt_pin_userptr(struct ttm_tt *ttm) | |||
499 | enum dma_data_direction direction = write ? | 499 | enum dma_data_direction direction = write ? |
500 | DMA_BIDIRECTIONAL : DMA_TO_DEVICE; | 500 | DMA_BIDIRECTIONAL : DMA_TO_DEVICE; |
501 | 501 | ||
502 | if (current->mm != gtt->usermm) | ||
503 | return -EPERM; | ||
504 | |||
505 | if (gtt->userflags & AMDGPU_GEM_USERPTR_ANONONLY) { | 502 | if (gtt->userflags & AMDGPU_GEM_USERPTR_ANONONLY) { |
506 | /* check that we only pin down anonymous memory | 503 | /* check that we only pin down anonymous memory |
507 | to prevent problems with writeback */ | 504 | to prevent problems with writeback */ |
@@ -773,14 +770,14 @@ int amdgpu_ttm_tt_set_userptr(struct ttm_tt *ttm, uint64_t addr, | |||
773 | return 0; | 770 | return 0; |
774 | } | 771 | } |
775 | 772 | ||
776 | bool amdgpu_ttm_tt_has_userptr(struct ttm_tt *ttm) | 773 | struct mm_struct *amdgpu_ttm_tt_get_usermm(struct ttm_tt *ttm) |
777 | { | 774 | { |
778 | struct amdgpu_ttm_tt *gtt = (void *)ttm; | 775 | struct amdgpu_ttm_tt *gtt = (void *)ttm; |
779 | 776 | ||
780 | if (gtt == NULL) | 777 | if (gtt == NULL) |
781 | return false; | 778 | return NULL; |
782 | 779 | ||
783 | return !!gtt->userptr; | 780 | return gtt->usermm; |
784 | } | 781 | } |
785 | 782 | ||
786 | bool amdgpu_ttm_tt_affect_userptr(struct ttm_tt *ttm, unsigned long start, | 783 | bool amdgpu_ttm_tt_affect_userptr(struct ttm_tt *ttm, unsigned long start, |