drm/vmwgfx: rework to new fence interface, v2

Use the new fence interface on vmwgfx too.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>

---
Changes since v1:
Fix a sleeping function called from invalid context in enable_signaling.
This commit is contained in:
Maarten Lankhorst
2014-03-26 14:07:44 +01:00
parent c060a4e135
commit 2298e804e9
6 changed files with 228 additions and 146 deletions

View File

@@ -1420,21 +1420,20 @@ void vmw_fence_single_bo(struct ttm_buffer_object *bo,
struct vmw_fence_obj *fence)
{
struct ttm_bo_device *bdev = bo->bdev;
struct ttm_bo_driver *driver = bdev->driver;
struct vmw_fence_obj *old_fence_obj;
struct vmw_private *dev_priv =
container_of(bdev, struct vmw_private, bdev);
if (fence == NULL)
if (fence == NULL) {
vmw_execbuf_fence_commands(NULL, dev_priv, &fence, NULL);
else
driver->sync_obj_ref(fence);
} else
vmw_fence_obj_reference(fence);
reservation_object_add_excl_fence(bo->resv, &fence->base);
old_fence_obj = bo->sync_obj;
bo->sync_obj = fence;
if (old_fence_obj)
vmw_fence_obj_unreference(&old_fence_obj);
}