summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Hellstrom <thomas-at-tungstengraphics-dot-com>2007-10-21 12:26:26 +0200
committerThomas Hellstrom <thomas-at-tungstengraphics-dot-com>2007-10-21 12:26:26 +0200
commit9ddff6d15fdff571193aac10ef81e67798fd712d (patch)
treebc807f42841e8b5788b44c88f667b38453419fb2
parent3b19b50cb5cd31e60eb03e99dd1109b6d0f5b8a3 (diff)
Adapt i915 super-ioctl for lock-free operation.
-rw-r--r--shared-core/i915_dma.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/shared-core/i915_dma.c b/shared-core/i915_dma.c
index 99d98cd3..14a91f36 100644
--- a/shared-core/i915_dma.c
+++ b/shared-core/i915_dma.c
@@ -1010,8 +1010,6 @@ static int i915_execbuffer(struct drm_device *dev, void *data,
}
- LOCK_TEST_WITH_RETURN(dev, file_priv);
-
if (batch->num_cliprects && DRM_VERIFYAREA_READ(batch->cliprects,
batch->num_cliprects *
sizeof(struct drm_clip_rect)))
@@ -1020,11 +1018,18 @@ static int i915_execbuffer(struct drm_device *dev, void *data,
if (exec_buf->num_buffers > dev_priv->max_validate_buffers)
return -EINVAL;
+
+ ret = drm_bo_read_lock(&dev->bm.bm_lock);
+ if (ret)
+ return ret;
+
num_buffers = exec_buf->num_buffers;
buffers = drm_calloc(num_buffers, sizeof(struct drm_buffer_object *), DRM_MEM_DRIVER);
- if (!buffers)
+ if (!buffers) {
+ drm_bo_read_unlock(&dev->bm.bm_lock);
return -ENOMEM;
+ }
/* validate buffer list + fixup relocations */
ret = i915_validate_buffer_list(file_priv, 0, exec_buf->ops_list,
@@ -1068,7 +1073,7 @@ out_err0:
out_free:
drm_free(buffers, (exec_buf->num_buffers * sizeof(struct drm_buffer_object *)), DRM_MEM_DRIVER);
-
+ drm_bo_read_unlock(&dev->bm.bm_lock);
return ret;
}
#endif