diff options
author | Dave Airlie <airlied@optimus.(none)> | 2007-10-17 15:36:14 +1000 |
---|---|---|
committer | Dave Airlie <airlied@optimus.(none)> | 2007-10-17 15:36:14 +1000 |
commit | ec1162b212248042bf1317abcb3c47bb10db8aa3 (patch) | |
tree | 965ea8046ae7bf56b5fa62d6d7c5fb3cbe9cc42e | |
parent | db1709f2f3f8cab2477fb149b58420de4db65654 (diff) |
i915: lock struct mutex about buffer object lookups
-rw-r--r-- | shared-core/i915_dma.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/shared-core/i915_dma.c b/shared-core/i915_dma.c index 7209a8de..5a51f6ef 100644 --- a/shared-core/i915_dma.c +++ b/shared-core/i915_dma.c @@ -805,7 +805,9 @@ int i915_process_relocs(struct drm_file *file_priv, memset(&reloc_kmap, 0, sizeof(reloc_kmap)); + mutex_lock(&dev->struct_mutex); reloc_list_object = drm_lookup_buffer_object(file_priv, cur_handle, 1); + mutex_unlock(&dev->struct_mutex); if (!reloc_list_object) return -EINVAL; @@ -905,7 +907,9 @@ int i915_validate_buffer_list(struct drm_file *file_priv, if (arg.handled) { data = arg.next; + mutex_lock(&dev->struct_mutex); buffers[buf_count] = drm_lookup_buffer_object(file_priv, req->arg_handle, 1); + mutex_unlock(&dev->struct_mutex); buf_count++; continue; } @@ -948,7 +952,9 @@ int i915_validate_buffer_list(struct drm_file *file_priv, if (buf_reloc_handle) { memset(&relocatee, 0, sizeof(relocatee)); + mutex_lock(&dev->struct_mutex); relocatee.buf = drm_lookup_buffer_object(file_priv, buf_handle, 1); + mutex_unlock(&dev->struct_mutex); if (!relocatee.buf) { DRM_DEBUG("relocatee buffer invalid %08x\n", buf_handle); ret = -EINVAL; |