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:
Thomas Hellstrom
2013-10-08 02:32:36 -07:00
parent b5c3b1a6bf
commit 173fb7d4e2
7 changed files with 143 additions and 10 deletions

View File

@@ -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);