aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
diff options
context:
space:
mode:
authorChristian König <christian.koenig@amd.com>2017-09-05 08:36:44 -0400
committerAlex Deucher <alexander.deucher@amd.com>2017-09-12 14:24:18 -0400
commit1b0c0f9dc5ca6c0c8be21eeac92c7aa77bbf1d33 (patch)
tree6fe97ca83570c4e9107f30e3a3dfaecbadbd2369 /drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
parentca666a3c298f838346ccea46ff542c605e68deb5 (diff)
drm/amdgpu: move userptr BOs to CPU domain during CS v2
Instead of moving them in the MMU notifier move them during CS. v2: still mark pages as accessed/dirty Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com> (v1) Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
index 4d3f8fbfa59d..4877df83b801 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
@@ -475,6 +475,12 @@ static int amdgpu_cs_list_validate(struct amdgpu_cs_parser *p,
475 /* Check if we have user pages and nobody bound the BO already */ 475 /* Check if we have user pages and nobody bound the BO already */
476 if (amdgpu_ttm_tt_userptr_needs_pages(bo->tbo.ttm) && 476 if (amdgpu_ttm_tt_userptr_needs_pages(bo->tbo.ttm) &&
477 lobj->user_pages) { 477 lobj->user_pages) {
478 amdgpu_ttm_placement_from_domain(bo,
479 AMDGPU_GEM_DOMAIN_CPU);
480 r = ttm_bo_validate(&bo->tbo, &bo->placement, true,
481 false);
482 if (r)
483 return r;
478 amdgpu_ttm_tt_set_user_pages(bo->tbo.ttm, 484 amdgpu_ttm_tt_set_user_pages(bo->tbo.ttm,
479 lobj->user_pages); 485 lobj->user_pages);
480 binding_userptr = true; 486 binding_userptr = true;