drm/vmwgfx: Persistent tracking of context bindings
Only scrub context bindings when a bound resource is destroyed, or when the MOB backing the context is unbound. Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com> Reviewed-by: Zack Rusin <zackr@vmware.com>
This commit is contained in:
@@ -257,6 +257,9 @@ static int vmw_gb_shader_destroy(struct vmw_resource *res)
|
||||
if (likely(res->id == -1))
|
||||
return 0;
|
||||
|
||||
mutex_lock(&dev_priv->binding_mutex);
|
||||
vmw_context_binding_res_list_kill(&res->binding_head);
|
||||
|
||||
cmd = vmw_fifo_reserve(dev_priv, sizeof(*cmd));
|
||||
if (unlikely(cmd == NULL)) {
|
||||
DRM_ERROR("Failed reserving FIFO space for shader "
|
||||
@@ -268,6 +271,7 @@ static int vmw_gb_shader_destroy(struct vmw_resource *res)
|
||||
cmd->header.size = sizeof(cmd->body);
|
||||
cmd->body.shid = res->id;
|
||||
vmw_fifo_commit(dev_priv, sizeof(*cmd));
|
||||
mutex_unlock(&dev_priv->binding_mutex);
|
||||
vmw_resource_release_id(res);
|
||||
vmw_3d_resource_dec(dev_priv, false);
|
||||
|
||||
|
Reference in New Issue
Block a user