diff options
author | Maarten Lankhorst <maarten.lankhorst@canonical.com> | 2014-09-16 05:15:07 -0400 |
---|---|---|
committer | Maarten Lankhorst <maarten.lankhorst@canonical.com> | 2014-09-30 08:04:00 -0400 |
commit | e3be4c230dfadf79567a245505a47a90db97f968 (patch) | |
tree | 295bc183975875ae06e0bb6fb9920708a21f84cd | |
parent | 055dffdfb65eb8dcc8e7dabc84fd53059a92a23a (diff) |
drm/nouveau: specify if interruptible wait is desired in nouveau_fence_sync
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_bo.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_display.c | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_fence.c | 14 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_fence.h | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_gem.c | 2 |
5 files changed, 11 insertions, 13 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_bo.c b/drivers/gpu/drm/nouveau/nouveau_bo.c index eea74b127b03..049f5de90928 100644 --- a/drivers/gpu/drm/nouveau/nouveau_bo.c +++ b/drivers/gpu/drm/nouveau/nouveau_bo.c | |||
@@ -970,7 +970,7 @@ nouveau_bo_move_m2mf(struct ttm_buffer_object *bo, int evict, bool intr, | |||
970 | } | 970 | } |
971 | 971 | ||
972 | mutex_lock_nested(&cli->mutex, SINGLE_DEPTH_NESTING); | 972 | mutex_lock_nested(&cli->mutex, SINGLE_DEPTH_NESTING); |
973 | ret = nouveau_fence_sync(nouveau_bo(bo), chan, true); | 973 | ret = nouveau_fence_sync(nouveau_bo(bo), chan, true, intr); |
974 | if (ret == 0) { | 974 | if (ret == 0) { |
975 | ret = drm->ttm.move(chan, bo, &bo->mem, new_mem); | 975 | ret = drm->ttm.move(chan, bo, &bo->mem, new_mem); |
976 | if (ret == 0) { | 976 | if (ret == 0) { |
diff --git a/drivers/gpu/drm/nouveau/nouveau_display.c b/drivers/gpu/drm/nouveau/nouveau_display.c index 6d0a3cdc752b..334db3c6e40c 100644 --- a/drivers/gpu/drm/nouveau/nouveau_display.c +++ b/drivers/gpu/drm/nouveau/nouveau_display.c | |||
@@ -658,7 +658,7 @@ nouveau_page_flip_emit(struct nouveau_channel *chan, | |||
658 | spin_unlock_irqrestore(&dev->event_lock, flags); | 658 | spin_unlock_irqrestore(&dev->event_lock, flags); |
659 | 659 | ||
660 | /* Synchronize with the old framebuffer */ | 660 | /* Synchronize with the old framebuffer */ |
661 | ret = nouveau_fence_sync(old_bo, chan, false); | 661 | ret = nouveau_fence_sync(old_bo, chan, false, false); |
662 | if (ret) | 662 | if (ret) |
663 | goto fail; | 663 | goto fail; |
664 | 664 | ||
@@ -722,7 +722,7 @@ nouveau_crtc_page_flip(struct drm_crtc *crtc, struct drm_framebuffer *fb, | |||
722 | goto fail_unpin; | 722 | goto fail_unpin; |
723 | 723 | ||
724 | /* synchronise rendering channel with the kernel's channel */ | 724 | /* synchronise rendering channel with the kernel's channel */ |
725 | ret = nouveau_fence_sync(new_bo, chan, false); | 725 | ret = nouveau_fence_sync(new_bo, chan, false, true); |
726 | if (ret) { | 726 | if (ret) { |
727 | ttm_bo_unreserve(&new_bo->bo); | 727 | ttm_bo_unreserve(&new_bo->bo); |
728 | goto fail_unpin; | 728 | goto fail_unpin; |
diff --git a/drivers/gpu/drm/nouveau/nouveau_fence.c b/drivers/gpu/drm/nouveau/nouveau_fence.c index decfe6c4ac07..dfd0b9ed4195 100644 --- a/drivers/gpu/drm/nouveau/nouveau_fence.c +++ b/drivers/gpu/drm/nouveau/nouveau_fence.c | |||
@@ -226,12 +226,10 @@ nouveau_fence_emit(struct nouveau_fence *fence, struct nouveau_channel *chan) | |||
226 | 226 | ||
227 | if (priv->uevent) | 227 | if (priv->uevent) |
228 | fence_init(&fence->base, &nouveau_fence_ops_uevent, | 228 | fence_init(&fence->base, &nouveau_fence_ops_uevent, |
229 | &fctx->lock, | 229 | &fctx->lock, fctx->context, ++fctx->sequence); |
230 | priv->context_base + chan->chid, ++fctx->sequence); | ||
231 | else | 230 | else |
232 | fence_init(&fence->base, &nouveau_fence_ops_legacy, | 231 | fence_init(&fence->base, &nouveau_fence_ops_legacy, |
233 | &fctx->lock, | 232 | &fctx->lock, fctx->context, ++fctx->sequence); |
234 | priv->context_base + chan->chid, ++fctx->sequence); | ||
235 | 233 | ||
236 | trace_fence_emit(&fence->base); | 234 | trace_fence_emit(&fence->base); |
237 | ret = fctx->emit(fence); | 235 | ret = fctx->emit(fence); |
@@ -342,7 +340,7 @@ nouveau_fence_wait(struct nouveau_fence *fence, bool lazy, bool intr) | |||
342 | } | 340 | } |
343 | 341 | ||
344 | int | 342 | int |
345 | nouveau_fence_sync(struct nouveau_bo *nvbo, struct nouveau_channel *chan, bool exclusive) | 343 | nouveau_fence_sync(struct nouveau_bo *nvbo, struct nouveau_channel *chan, bool exclusive, bool intr) |
346 | { | 344 | { |
347 | struct nouveau_fence_chan *fctx = chan->fence; | 345 | struct nouveau_fence_chan *fctx = chan->fence; |
348 | struct fence *fence; | 346 | struct fence *fence; |
@@ -369,7 +367,7 @@ nouveau_fence_sync(struct nouveau_bo *nvbo, struct nouveau_channel *chan, bool e | |||
369 | prev = f->channel; | 367 | prev = f->channel; |
370 | 368 | ||
371 | if (!prev || (prev != chan && (ret = fctx->sync(f, prev, chan)))) | 369 | if (!prev || (prev != chan && (ret = fctx->sync(f, prev, chan)))) |
372 | ret = fence_wait(fence, true); | 370 | ret = fence_wait(fence, intr); |
373 | 371 | ||
374 | return ret; | 372 | return ret; |
375 | } | 373 | } |
@@ -387,8 +385,8 @@ nouveau_fence_sync(struct nouveau_bo *nvbo, struct nouveau_channel *chan, bool e | |||
387 | if (f) | 385 | if (f) |
388 | prev = f->channel; | 386 | prev = f->channel; |
389 | 387 | ||
390 | if (!prev || (ret = fctx->sync(f, prev, chan))) | 388 | if (!prev || (prev != chan && (ret = fctx->sync(f, prev, chan)))) |
391 | ret = fence_wait(fence, true); | 389 | ret = fence_wait(fence, intr); |
392 | 390 | ||
393 | if (ret) | 391 | if (ret) |
394 | break; | 392 | break; |
diff --git a/drivers/gpu/drm/nouveau/nouveau_fence.h b/drivers/gpu/drm/nouveau/nouveau_fence.h index 986c8135e564..a7dc5375c320 100644 --- a/drivers/gpu/drm/nouveau/nouveau_fence.h +++ b/drivers/gpu/drm/nouveau/nouveau_fence.h | |||
@@ -26,7 +26,7 @@ int nouveau_fence_emit(struct nouveau_fence *, struct nouveau_channel *); | |||
26 | bool nouveau_fence_done(struct nouveau_fence *); | 26 | bool nouveau_fence_done(struct nouveau_fence *); |
27 | void nouveau_fence_work(struct fence *, void (*)(void *), void *); | 27 | void nouveau_fence_work(struct fence *, void (*)(void *), void *); |
28 | int nouveau_fence_wait(struct nouveau_fence *, bool lazy, bool intr); | 28 | int nouveau_fence_wait(struct nouveau_fence *, bool lazy, bool intr); |
29 | int nouveau_fence_sync(struct nouveau_bo *, struct nouveau_channel *, bool exclusive); | 29 | int nouveau_fence_sync(struct nouveau_bo *, struct nouveau_channel *, bool exclusive, bool intr); |
30 | 30 | ||
31 | struct nouveau_fence_chan { | 31 | struct nouveau_fence_chan { |
32 | spinlock_t lock; | 32 | spinlock_t lock; |
diff --git a/drivers/gpu/drm/nouveau/nouveau_gem.c b/drivers/gpu/drm/nouveau/nouveau_gem.c index b7dbd16904e0..3f693c1f5b36 100644 --- a/drivers/gpu/drm/nouveau/nouveau_gem.c +++ b/drivers/gpu/drm/nouveau/nouveau_gem.c | |||
@@ -459,7 +459,7 @@ validate_list(struct nouveau_channel *chan, struct nouveau_cli *cli, | |||
459 | return ret; | 459 | return ret; |
460 | } | 460 | } |
461 | 461 | ||
462 | ret = nouveau_fence_sync(nvbo, chan, !!b->write_domains); | 462 | ret = nouveau_fence_sync(nvbo, chan, !!b->write_domains, true); |
463 | if (unlikely(ret)) { | 463 | if (unlikely(ret)) { |
464 | if (ret != -ERESTARTSYS) | 464 | if (ret != -ERESTARTSYS) |
465 | NV_PRINTK(error, cli, "fail post-validate sync\n"); | 465 | NV_PRINTK(error, cli, "fail post-validate sync\n"); |