Commit e3be4c23 authored by Maarten Lankhorst's avatar Maarten Lankhorst

drm/nouveau: specify if interruptible wait is desired in nouveau_fence_sync

Signed-off-by: default avatarMaarten Lankhorst <maarten.lankhorst@canonical.com>
parent 055dffdf
...@@ -970,7 +970,7 @@ nouveau_bo_move_m2mf(struct ttm_buffer_object *bo, int evict, bool intr, ...@@ -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); mutex_lock_nested(&cli->mutex, SINGLE_DEPTH_NESTING);
ret = nouveau_fence_sync(nouveau_bo(bo), chan, true); ret = nouveau_fence_sync(nouveau_bo(bo), chan, true, intr);
if (ret == 0) { if (ret == 0) {
ret = drm->ttm.move(chan, bo, &bo->mem, new_mem); ret = drm->ttm.move(chan, bo, &bo->mem, new_mem);
if (ret == 0) { if (ret == 0) {
......
...@@ -658,7 +658,7 @@ nouveau_page_flip_emit(struct nouveau_channel *chan, ...@@ -658,7 +658,7 @@ nouveau_page_flip_emit(struct nouveau_channel *chan,
spin_unlock_irqrestore(&dev->event_lock, flags); spin_unlock_irqrestore(&dev->event_lock, flags);
/* Synchronize with the old framebuffer */ /* Synchronize with the old framebuffer */
ret = nouveau_fence_sync(old_bo, chan, false); ret = nouveau_fence_sync(old_bo, chan, false, false);
if (ret) if (ret)
goto fail; goto fail;
...@@ -722,7 +722,7 @@ nouveau_crtc_page_flip(struct drm_crtc *crtc, struct drm_framebuffer *fb, ...@@ -722,7 +722,7 @@ nouveau_crtc_page_flip(struct drm_crtc *crtc, struct drm_framebuffer *fb,
goto fail_unpin; goto fail_unpin;
/* synchronise rendering channel with the kernel's channel */ /* synchronise rendering channel with the kernel's channel */
ret = nouveau_fence_sync(new_bo, chan, false); ret = nouveau_fence_sync(new_bo, chan, false, true);
if (ret) { if (ret) {
ttm_bo_unreserve(&new_bo->bo); ttm_bo_unreserve(&new_bo->bo);
goto fail_unpin; goto fail_unpin;
......
...@@ -226,12 +226,10 @@ nouveau_fence_emit(struct nouveau_fence *fence, struct nouveau_channel *chan) ...@@ -226,12 +226,10 @@ nouveau_fence_emit(struct nouveau_fence *fence, struct nouveau_channel *chan)
if (priv->uevent) if (priv->uevent)
fence_init(&fence->base, &nouveau_fence_ops_uevent, fence_init(&fence->base, &nouveau_fence_ops_uevent,
&fctx->lock, &fctx->lock, fctx->context, ++fctx->sequence);
priv->context_base + chan->chid, ++fctx->sequence);
else else
fence_init(&fence->base, &nouveau_fence_ops_legacy, fence_init(&fence->base, &nouveau_fence_ops_legacy,
&fctx->lock, &fctx->lock, fctx->context, ++fctx->sequence);
priv->context_base + chan->chid, ++fctx->sequence);
trace_fence_emit(&fence->base); trace_fence_emit(&fence->base);
ret = fctx->emit(fence); ret = fctx->emit(fence);
...@@ -342,7 +340,7 @@ nouveau_fence_wait(struct nouveau_fence *fence, bool lazy, bool intr) ...@@ -342,7 +340,7 @@ nouveau_fence_wait(struct nouveau_fence *fence, bool lazy, bool intr)
} }
int int
nouveau_fence_sync(struct nouveau_bo *nvbo, struct nouveau_channel *chan, bool exclusive) nouveau_fence_sync(struct nouveau_bo *nvbo, struct nouveau_channel *chan, bool exclusive, bool intr)
{ {
struct nouveau_fence_chan *fctx = chan->fence; struct nouveau_fence_chan *fctx = chan->fence;
struct fence *fence; struct fence *fence;
...@@ -369,7 +367,7 @@ nouveau_fence_sync(struct nouveau_bo *nvbo, struct nouveau_channel *chan, bool e ...@@ -369,7 +367,7 @@ nouveau_fence_sync(struct nouveau_bo *nvbo, struct nouveau_channel *chan, bool e
prev = f->channel; prev = f->channel;
if (!prev || (prev != chan && (ret = fctx->sync(f, prev, chan)))) if (!prev || (prev != chan && (ret = fctx->sync(f, prev, chan))))
ret = fence_wait(fence, true); ret = fence_wait(fence, intr);
return ret; return ret;
} }
...@@ -387,8 +385,8 @@ nouveau_fence_sync(struct nouveau_bo *nvbo, struct nouveau_channel *chan, bool e ...@@ -387,8 +385,8 @@ nouveau_fence_sync(struct nouveau_bo *nvbo, struct nouveau_channel *chan, bool e
if (f) if (f)
prev = f->channel; prev = f->channel;
if (!prev || (ret = fctx->sync(f, prev, chan))) if (!prev || (prev != chan && (ret = fctx->sync(f, prev, chan))))
ret = fence_wait(fence, true); ret = fence_wait(fence, intr);
if (ret) if (ret)
break; break;
......
...@@ -26,7 +26,7 @@ int nouveau_fence_emit(struct nouveau_fence *, struct nouveau_channel *); ...@@ -26,7 +26,7 @@ int nouveau_fence_emit(struct nouveau_fence *, struct nouveau_channel *);
bool nouveau_fence_done(struct nouveau_fence *); bool nouveau_fence_done(struct nouveau_fence *);
void nouveau_fence_work(struct fence *, void (*)(void *), void *); void nouveau_fence_work(struct fence *, void (*)(void *), void *);
int nouveau_fence_wait(struct nouveau_fence *, bool lazy, bool intr); int nouveau_fence_wait(struct nouveau_fence *, bool lazy, bool intr);
int nouveau_fence_sync(struct nouveau_bo *, struct nouveau_channel *, bool exclusive); int nouveau_fence_sync(struct nouveau_bo *, struct nouveau_channel *, bool exclusive, bool intr);
struct nouveau_fence_chan { struct nouveau_fence_chan {
spinlock_t lock; spinlock_t lock;
......
...@@ -459,7 +459,7 @@ validate_list(struct nouveau_channel *chan, struct nouveau_cli *cli, ...@@ -459,7 +459,7 @@ validate_list(struct nouveau_channel *chan, struct nouveau_cli *cli,
return ret; return ret;
} }
ret = nouveau_fence_sync(nvbo, chan, !!b->write_domains); ret = nouveau_fence_sync(nvbo, chan, !!b->write_domains, true);
if (unlikely(ret)) { if (unlikely(ret)) {
if (ret != -ERESTARTSYS) if (ret != -ERESTARTSYS)
NV_PRINTK(error, cli, "fail post-validate sync\n"); NV_PRINTK(error, cli, "fail post-validate sync\n");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment