From c9b73ef6daff75df27d17260a9fc84e68f1b21b4 Mon Sep 17 00:00:00 2001 From: Thomas Hellstrom Date: Sun, 13 Apr 2008 14:49:14 +0200 Subject: Unlock the BO mutex while waiting for idle, unmapped, unfenced. Move unfenced checking into idle checking. Never time out while waiting for software events like unmapped or unfenced. --- linux-core/i915_execbuf.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'linux-core/i915_execbuf.c') diff --git a/linux-core/i915_execbuf.c b/linux-core/i915_execbuf.c index 088a2693..804f3ac1 100644 --- a/linux-core/i915_execbuf.c +++ b/linux-core/i915_execbuf.c @@ -144,7 +144,7 @@ int i915_apply_reloc(struct drm_file *file_priv, int num_buffers, relocatee->offset = new_cmd_offset; if (unlikely(relocatee->idle == I915_RELOC_UNCHECKED)) { - ret = drm_bo_wait(relocatee->buf, 0, 0, 0); + ret = drm_bo_wait(relocatee->buf, 0, 1, 0, 0); if (ret) return ret; relocatee->idle = I915_RELOC_IDLE; @@ -355,11 +355,9 @@ static int i915_update_relocatee(struct i915_relocatee_info *relocatee, if (relocatee->idle == I915_RELOC_UNCHECKED) { preempt_enable(); - ret = mutex_lock_interruptible(&relocatee->buf->mutex); - if (unlikely(ret)) - return -EAGAIN; + mutex_lock(&relocatee->buf->mutex); - ret = drm_bo_wait(relocatee->buf, 0, 0, 1); + ret = drm_bo_wait(relocatee->buf, 0, 1, 1, 0); if (ret == 0) relocatee->idle = I915_RELOC_IDLE; else { @@ -684,7 +682,7 @@ int i915_validate_buffer_list(struct drm_file *file_priv, ret = drm_bo_handle_validate(file_priv, req->bo_req.handle, req->bo_req.flags, req->bo_req.mask, req->bo_req.hint, - req->bo_req.fence_class, 0, + req->bo_req.fence_class, NULL, &item->buffer); if (ret) { DRM_ERROR("error on handle validate %d\n", ret); -- cgit v1.2.3