Skip to content

Commit

Permalink
drm/nouveau: rework to new fence interface
Browse files Browse the repository at this point in the history
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Acked-by: Ben Skeggs <bskeggs@redhat.com>
  • Loading branch information
Maarten Lankhorst authored and Maarten Lankhorst committed Sep 2, 2014
1 parent 2298e80 commit 29ba89b
Show file tree
Hide file tree
Showing 10 changed files with 383 additions and 205 deletions.
6 changes: 4 additions & 2 deletions drivers/gpu/drm/nouveau/nouveau_bo.c
Original file line number Diff line number Diff line change
Expand Up @@ -970,7 +970,7 @@ nouveau_bo_move_m2mf(struct ttm_buffer_object *bo, int evict, bool intr,
}

mutex_lock_nested(&cli->mutex, SINGLE_DEPTH_NESTING);
ret = nouveau_fence_sync(bo->sync_obj, chan);
ret = nouveau_fence_sync(nouveau_bo(bo), chan);
if (ret == 0) {
ret = drm->ttm.move(chan, bo, &bo->mem, new_mem);
if (ret == 0) {
Expand Down Expand Up @@ -1464,10 +1464,12 @@ nouveau_bo_fence_unref(void **sync_obj)
void
nouveau_bo_fence(struct nouveau_bo *nvbo, struct nouveau_fence *fence)
{
lockdep_assert_held(&nvbo->bo.resv->lock.base);
struct reservation_object *resv = nvbo->bo.resv;

nouveau_bo_fence_unref(&nvbo->bo.sync_obj);
nvbo->bo.sync_obj = nouveau_fence_ref(fence);

reservation_object_add_excl_fence(resv, &fence->base);
}

static void *
Expand Down
4 changes: 2 additions & 2 deletions drivers/gpu/drm/nouveau/nouveau_display.c
Original file line number Diff line number Diff line change
Expand Up @@ -658,7 +658,7 @@ nouveau_page_flip_emit(struct nouveau_channel *chan,
spin_unlock_irqrestore(&dev->event_lock, flags);

/* Synchronize with the old framebuffer */
ret = nouveau_fence_sync(old_bo->bo.sync_obj, chan);
ret = nouveau_fence_sync(old_bo, chan);
if (ret)
goto fail;

Expand Down Expand Up @@ -722,7 +722,7 @@ nouveau_crtc_page_flip(struct drm_crtc *crtc, struct drm_framebuffer *fb,
goto fail_unpin;

/* synchronise rendering channel with the kernel's channel */
ret = nouveau_fence_sync(new_bo->bo.sync_obj, chan);
ret = nouveau_fence_sync(new_bo, chan);
if (ret) {
ttm_bo_unreserve(&new_bo->bo);
goto fail_unpin;
Expand Down
Loading

0 comments on commit 29ba89b

Please sign in to comment.