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-02 07:21:31 -0400
committerAlex Deucher <alexander.deucher@amd.com>2017-09-12 14:23:10 -0400
commita216ab09955d6b77f3af4f0aba9255c5ddf382f5 (patch)
tree729b38ef0a74fc185972a65116b1b5a8ad900ab5 /drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
parent7a9667ae197460e6c9c3bb432fe68c708fce6259 (diff)
drm/amdgpu: fix userptr put_page handling
Move calling put_page into the unpopulate callback. Otherwise we mess up the pages reference count when it is unbound multiple times. Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com> 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, 2 insertions, 4 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
index 233b6f2f8427..e58db0c69c6a 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
@@ -474,10 +474,8 @@ static int amdgpu_cs_list_validate(struct amdgpu_cs_parser *p,
474 474
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 (lobj->user_pages && bo->tbo.ttm->state != tt_bound) { 476 if (lobj->user_pages && bo->tbo.ttm->state != tt_bound) {
477 size_t size = sizeof(struct page *); 477 amdgpu_ttm_tt_set_user_pages(bo->tbo.ttm,
478 478 lobj->user_pages);
479 size *= bo->tbo.ttm->num_pages;
480 memcpy(bo->tbo.ttm->pages, lobj->user_pages, size);
481 binding_userptr = true; 479 binding_userptr = true;
482 } 480 }
483 481