diff options
author | Zack Rusin <zackr@vmware.com> | 2021-05-04 23:57:38 -0400 |
---|---|---|
committer | Zack Rusin <zackr@vmware.com> | 2021-05-11 13:37:15 -0400 |
commit | 8211783f16ead18702978dbafc8487a35387a0be (patch) | |
tree | 4e503471859c97ea03e30263199827184e28107a /drivers/gpu/drm/vmwgfx/vmwgfx_context.c | |
parent | 88509f698c4e38e287e016e86a0445547824135c (diff) |
drm/vmwgfx: Remove the reservation semaphore
Now since Christian reworked TTM to always keep objects on the LRU
list unless they are pinned we shouldn't need the reservation
semaphore. It makes the driver code a lot cleaner, especially
because it was a little hard to reason when and where the
reservation semaphore needed to be held.
Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210505035740.286923-5-zackr@vmware.com
Diffstat (limited to 'drivers/gpu/drm/vmwgfx/vmwgfx_context.c')
-rw-r--r-- | drivers/gpu/drm/vmwgfx/vmwgfx_context.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_context.c b/drivers/gpu/drm/vmwgfx/vmwgfx_context.c index 4a5a3e246216..3ed9914cb994 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_context.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_context.c @@ -748,10 +748,6 @@ static int vmw_context_define(struct drm_device *dev, void *data, ((dev_priv->has_mob) ? vmw_cmdbuf_res_man_size() : 0) + + VMW_IDA_ACC_SIZE + TTM_OBJ_EXTRA_SIZE; - ret = ttm_read_lock(&dev_priv->reservation_sem, true); - if (unlikely(ret != 0)) - return ret; - ret = ttm_mem_global_alloc(vmw_mem_glob(dev_priv), vmw_user_context_size, &ttm_opt_ctx); @@ -759,7 +755,7 @@ static int vmw_context_define(struct drm_device *dev, void *data, if (ret != -ERESTARTSYS) DRM_ERROR("Out of graphics memory for context" " creation.\n"); - goto out_unlock; + goto out_ret; } ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); @@ -767,7 +763,7 @@ static int vmw_context_define(struct drm_device *dev, void *data, ttm_mem_global_free(vmw_mem_glob(dev_priv), vmw_user_context_size); ret = -ENOMEM; - goto out_unlock; + goto out_ret; } res = &ctx->res; @@ -780,7 +776,7 @@ static int vmw_context_define(struct drm_device *dev, void *data, ret = vmw_context_init(dev_priv, res, vmw_user_context_free, dx); if (unlikely(ret != 0)) - goto out_unlock; + goto out_ret; tmp = vmw_resource_reference(&ctx->res); ret = ttm_base_object_init(tfile, &ctx->base, false, VMW_RES_CONTEXT, @@ -794,8 +790,7 @@ static int vmw_context_define(struct drm_device *dev, void *data, arg->cid = ctx->base.handle; out_err: vmw_resource_unreference(&res); -out_unlock: - ttm_read_unlock(&dev_priv->reservation_sem); +out_ret: return ret; } |