drm/vmwgfx: Don't commit staged bindings if execbuf fails
authorThomas Hellstrom <thellstrom@vmware.com>
Thu, 30 Jan 2014 09:46:12 +0000 (10:46 +0100)
committerThomas Hellstrom <thellstrom@vmware.com>
Wed, 5 Feb 2014 07:35:09 +0000 (08:35 +0100)
If execbuf fails and binding commands are never sent to the device,
don't commit the staged context bindings to the tracker.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c

index 7a5f1eb55c5a0ad09adf8aa02c92367908c49c24..3f0b4d1450ff44be27102c77628c04081a33d6d7 100644 (file)
@@ -114,8 +114,10 @@ static void vmw_resource_list_unreserve(struct list_head *list,
                 * persistent context binding tracker.
                 */
                if (unlikely(val->staged_bindings)) {
-                       vmw_context_binding_state_transfer
-                               (val->res, val->staged_bindings);
+                       if (!backoff) {
+                               vmw_context_binding_state_transfer
+                                       (val->res, val->staged_bindings);
+                       }
                        kfree(val->staged_bindings);
                        val->staged_bindings = NULL;
                }