aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/ttm/ttm_page_alloc_dma.c
diff options
context:
space:
mode:
authorRoger He <Hongbo.He@amd.com>2017-12-08 15:21:18 +0800
committerAlex Deucher <alexander.deucher@amd.com>2017-12-27 11:38:55 -0500
commit9de2fb99ebe059f7777b4c0463eca2946f2bda4d (patch)
tree9d620a073b86db04996eeabb38095464cccd0242 /drivers/gpu/drm/ttm/ttm_page_alloc_dma.c
parentdrm/ttm: use an operation ctx for ttm_mem_global_alloc (diff)
downloadlinux-dev-9de2fb99ebe059f7777b4c0463eca2946f2bda4d.tar.xz
linux-dev-9de2fb99ebe059f7777b4c0463eca2946f2bda4d.zip
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_dma.c')
-rw-r--r--drivers/gpu/drm/ttm/ttm_page_alloc_dma.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/gpu/drm/ttm/ttm_page_alloc_dma.c b/drivers/gpu/drm/ttm/ttm_page_alloc_dma.c
index bda00b2ab51c..8aac86a16e22 100644
--- a/drivers/gpu/drm/ttm/ttm_page_alloc_dma.c
+++ b/drivers/gpu/drm/ttm/ttm_page_alloc_dma.c
@@ -927,6 +927,10 @@ int ttm_dma_populate(struct ttm_dma_tt *ttm_dma, struct device *dev)
{
struct ttm_tt *ttm = &ttm_dma->ttm;
struct ttm_mem_global *mem_glob = ttm->glob->mem_glob;
+ struct ttm_operation_ctx ctx = {
+ .interruptible = false,
+ .no_wait_gpu = false
+ };
unsigned long num_pages = ttm->num_pages;
struct dma_pool *pool;
enum pool_type type;
@@ -962,7 +966,7 @@ int ttm_dma_populate(struct ttm_dma_tt *ttm_dma, struct device *dev)
break;
ret = ttm_mem_global_alloc_page(mem_glob, ttm->pages[i],
- pool->size);
+ pool->size, &ctx);
if (unlikely(ret != 0)) {
ttm_dma_unpopulate(ttm_dma, dev);
return -ENOMEM;
@@ -998,7 +1002,7 @@ skip_huge:
}
ret = ttm_mem_global_alloc_page(mem_glob, ttm->pages[i],
- pool->size);
+ pool->size, &ctx);
if (unlikely(ret != 0)) {
ttm_dma_unpopulate(ttm_dma, dev);
return -ENOMEM;