summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/nouveau/nouveau_bo.c
diff options
context:
space:
mode:
authorFrancisco Jerez <currojerez@riseup.net>2010-10-20 23:35:40 +0200
committerBen Skeggs <bskeggs@redhat.com>2010-12-03 15:11:12 +1000
commit332b242f47786d1a43bd7a19a0513dd5d493db8e (patch)
treef6681c1513c58db54f71c64184ebc033a14c49fe /drivers/gpu/drm/nouveau/nouveau_bo.c
parent042206c0cd4924879c4292c5ffa2bf1e8023ae5a (diff)
drm/nouveau: Implement the pageflip ioctl.
nv0x-nv4x should be mostly fine, nv50 doesn't work yet. Signed-off-by: Francisco Jerez <currojerez@riseup.net> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nouveau_bo.c')
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_bo.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_bo.c b/drivers/gpu/drm/nouveau/nouveau_bo.c
index c09928322eb..cdc8f544d47 100644
--- a/drivers/gpu/drm/nouveau/nouveau_bo.c
+++ b/drivers/gpu/drm/nouveau/nouveau_bo.c
@@ -942,6 +942,18 @@ nouveau_ttm_fault_reserve_notify(struct ttm_buffer_object *bo)
return ttm_bo_validate(bo, &nvbo->placement, false, true, false);
}
+void
+nouveau_bo_fence(struct nouveau_bo *nvbo, struct nouveau_fence *fence)
+{
+ spin_lock(&nvbo->bo.bdev->fence_lock);
+ __nouveau_fence_unref(&nvbo->bo.sync_obj);
+
+ if (likely(fence))
+ nvbo->bo.sync_obj = nouveau_fence_ref(fence);
+
+ spin_unlock(&nvbo->bo.bdev->fence_lock);
+}
+
struct ttm_bo_driver nouveau_bo_driver = {
.create_ttm_backend_entry = nouveau_bo_create_ttm_backend_entry,
.invalidate_caches = nouveau_bo_invalidate_caches,