diff options
author | Roger He <Hongbo.He@amd.com> | 2017-12-08 15:09:50 +0800 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2017-12-27 11:38:54 -0500 |
commit | 279c01f6ef626d59b93383d183fb69173d3f7ac7 (patch) | |
tree | 5874a26a7c74a50a483fbf18df1d9a2aadbc3026 /drivers/gpu/drm/vmwgfx/vmwgfx_shader.c | |
parent | a6c26af8a4348a0ba2eb146b08f4d4d908cd9222 (diff) |
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_shader.c')
-rw-r--r-- | drivers/gpu/drm/vmwgfx/vmwgfx_shader.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_shader.c b/drivers/gpu/drm/vmwgfx/vmwgfx_shader.c index 004e18b8832c..73b8e9a16368 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_shader.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_shader.c @@ -607,6 +607,10 @@ int vmw_dx_shader_add(struct vmw_cmdbuf_res_manager *man, struct vmw_dx_shader *shader; struct vmw_resource *res; struct vmw_private *dev_priv = ctx->dev_priv; + struct ttm_operation_ctx ttm_opt_ctx = { + .interruptible = true, + .no_wait_gpu = false + }; int ret; if (!vmw_shader_dx_size) @@ -616,7 +620,7 @@ int vmw_dx_shader_add(struct vmw_cmdbuf_res_manager *man, return -EINVAL; ret = ttm_mem_global_alloc(vmw_mem_glob(dev_priv), vmw_shader_dx_size, - false, true); + &ttm_opt_ctx); if (ret) { if (ret != -ERESTARTSYS) DRM_ERROR("Out of graphics memory for shader " @@ -730,6 +734,10 @@ static int vmw_user_shader_alloc(struct vmw_private *dev_priv, { struct vmw_user_shader *ushader; struct vmw_resource *res, *tmp; + struct ttm_operation_ctx ctx = { + .interruptible = true, + .no_wait_gpu = false + }; int ret; /* @@ -742,7 +750,7 @@ static int vmw_user_shader_alloc(struct vmw_private *dev_priv, ret = ttm_mem_global_alloc(vmw_mem_glob(dev_priv), vmw_user_shader_size, - false, true); + &ctx); if (unlikely(ret != 0)) { if (ret != -ERESTARTSYS) DRM_ERROR("Out of graphics memory for shader " @@ -800,6 +808,10 @@ static struct vmw_resource *vmw_shader_alloc(struct vmw_private *dev_priv, { struct vmw_shader *shader; struct vmw_resource *res; + struct ttm_operation_ctx ctx = { + .interruptible = true, + .no_wait_gpu = false + }; int ret; /* @@ -812,7 +824,7 @@ static struct vmw_resource *vmw_shader_alloc(struct vmw_private *dev_priv, ret = ttm_mem_global_alloc(vmw_mem_glob(dev_priv), vmw_shader_size, - false, true); + &ctx); if (unlikely(ret != 0)) { if (ret != -ERESTARTSYS) DRM_ERROR("Out of graphics memory for shader " |