struct validate_op op;
struct nouveau_fence *fence = NULL;
int i, j, ret = 0;
- bool do_reloc = false;
+ bool do_reloc = false, sync = false;
if (unlikely(!abi16))
return -ENOMEM;
if (unlikely(atomic_read(&chan->killed)))
return nouveau_abi16_put(abi16, -ENODEV);
+ sync = req->vram_available & NOUVEAU_GEM_PUSHBUF_SYNC;
+
req->vram_available = drm->gem.vram_available;
req->gart_available = drm->gem.gart_available;
if (unlikely(req->nr_push == 0))
goto out;
}
+ if (sync) {
+ if (!(ret = nouveau_fence_wait(fence, false, false))) {
+ if ((ret = dma_fence_get_status(&fence->base)) == 1)
+ ret = 0;
+ }
+ }
+
out:
validate_fini(&op, chan, fence, bo);
nouveau_fence_unref(&fence);