diff options
author | Roger He <Hongbo.He@amd.com> | 2017-12-08 02:21:18 -0500 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2017-12-27 11:38:55 -0500 |
commit | 9de2fb99ebe059f7777b4c0463eca2946f2bda4d (patch) | |
tree | 9d620a073b86db04996eeabb38095464cccd0242 /drivers/gpu/drm/ttm/ttm_page_alloc.c | |
parent | 279c01f6ef626d59b93383d183fb69173d3f7ac7 (diff) |
drm/ttm: use an operation ctx for ttm_mem_global_alloc_page
forward the operation context to ttm_mem_global_alloc_page as well,
and the ultimate goal is swapout enablement for reserved BOs.
Here reserved BOs refer to all the BOs which share same reservation object
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Roger He <Hongbo.He@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/ttm/ttm_page_alloc.c')
-rw-r--r-- | drivers/gpu/drm/ttm/ttm_page_alloc.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/gpu/drm/ttm/ttm_page_alloc.c b/drivers/gpu/drm/ttm/ttm_page_alloc.c index b5ba6441489f..8f93ff30f78b 100644 --- a/drivers/gpu/drm/ttm/ttm_page_alloc.c +++ b/drivers/gpu/drm/ttm/ttm_page_alloc.c | |||
@@ -1061,6 +1061,10 @@ void ttm_page_alloc_fini(void) | |||
1061 | int ttm_pool_populate(struct ttm_tt *ttm) | 1061 | int ttm_pool_populate(struct ttm_tt *ttm) |
1062 | { | 1062 | { |
1063 | struct ttm_mem_global *mem_glob = ttm->glob->mem_glob; | 1063 | struct ttm_mem_global *mem_glob = ttm->glob->mem_glob; |
1064 | struct ttm_operation_ctx ctx = { | ||
1065 | .interruptible = false, | ||
1066 | .no_wait_gpu = false | ||
1067 | }; | ||
1064 | unsigned i; | 1068 | unsigned i; |
1065 | int ret; | 1069 | int ret; |
1066 | 1070 | ||
@@ -1076,7 +1080,7 @@ int ttm_pool_populate(struct ttm_tt *ttm) | |||
1076 | 1080 | ||
1077 | for (i = 0; i < ttm->num_pages; ++i) { | 1081 | for (i = 0; i < ttm->num_pages; ++i) { |
1078 | ret = ttm_mem_global_alloc_page(mem_glob, ttm->pages[i], | 1082 | ret = ttm_mem_global_alloc_page(mem_glob, ttm->pages[i], |
1079 | PAGE_SIZE); | 1083 | PAGE_SIZE, &ctx); |
1080 | if (unlikely(ret != 0)) { | 1084 | if (unlikely(ret != 0)) { |
1081 | ttm_pool_unpopulate(ttm); | 1085 | ttm_pool_unpopulate(ttm); |
1082 | return -ENOMEM; | 1086 | return -ENOMEM; |