diff options
author | Roger He <Hongbo.He@amd.com> | 2017-12-08 10:09:50 +0300 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2017-12-27 19:38:54 +0300 |
commit | 279c01f6ef626d59b93383d183fb69173d3f7ac7 (patch) | |
tree | 5874a26a7c74a50a483fbf18df1d9a2aadbc3026 /drivers/gpu/drm/vmwgfx/vmwgfx_buffer.c | |
parent | a6c26af8a4348a0ba2eb146b08f4d4d908cd9222 (diff) | |
download | linux-279c01f6ef626d59b93383d183fb69173d3f7ac7.tar.xz |
drm/ttm: use an operation ctx for ttm_mem_global_alloc
forward the operation context to ttm_mem_global_alloc as well, and the
ultimate goal is swapout enablement for reserved BOs
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
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/vmwgfx/vmwgfx_buffer.c')
-rw-r--r-- | drivers/gpu/drm/vmwgfx/vmwgfx_buffer.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_buffer.c b/drivers/gpu/drm/vmwgfx/vmwgfx_buffer.c index 828dd5994854..cb386eb234ac 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_buffer.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_buffer.c @@ -394,6 +394,10 @@ static int vmw_ttm_map_dma(struct vmw_ttm_tt *vmw_tt) struct vmw_private *dev_priv = vmw_tt->dev_priv; struct ttm_mem_global *glob = vmw_mem_glob(dev_priv); struct vmw_sg_table *vsgt = &vmw_tt->vsgt; + struct ttm_operation_ctx ctx = { + .interruptible = true, + .no_wait_gpu = false + }; struct vmw_piter iter; dma_addr_t old; int ret = 0; @@ -417,8 +421,7 @@ static int vmw_ttm_map_dma(struct vmw_ttm_tt *vmw_tt) sgt_size = ttm_round_pot(sizeof(struct sg_table)); } vmw_tt->sg_alloc_size = sgt_size + sgl_size * vsgt->num_pages; - ret = ttm_mem_global_alloc(glob, vmw_tt->sg_alloc_size, false, - true); + ret = ttm_mem_global_alloc(glob, vmw_tt->sg_alloc_size, &ctx); if (unlikely(ret != 0)) return ret; @@ -638,6 +641,10 @@ static int vmw_ttm_populate(struct ttm_tt *ttm) container_of(ttm, struct vmw_ttm_tt, dma_ttm.ttm); struct vmw_private *dev_priv = vmw_tt->dev_priv; struct ttm_mem_global *glob = vmw_mem_glob(dev_priv); + struct ttm_operation_ctx ctx = { + .interruptible = true, + .no_wait_gpu = false + }; int ret; if (ttm->state != tt_unpopulated) @@ -646,7 +653,7 @@ static int vmw_ttm_populate(struct ttm_tt *ttm) if (dev_priv->map_mode == vmw_dma_alloc_coherent) { size_t size = ttm_round_pot(ttm->num_pages * sizeof(dma_addr_t)); - ret = ttm_mem_global_alloc(glob, size, false, true); + ret = ttm_mem_global_alloc(glob, size, &ctx); if (unlikely(ret != 0)) return ret; |