summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichel Dänzer <michel@tungstengraphics.com>2007-05-13 12:04:01 +0200
committerMichel Dänzer <michel@tungstengraphics.com>2007-05-13 12:04:01 +0200
commitbd8dfabbcfe7a8d9b7295630e54af0b11221046a (patch)
tree07fbd0e74192ff01e6bde4ae5b663c4e58f108b5
parent86a95b64eab98e771f02c3130d3792c28adf9957 (diff)
i915tex: Protect intel_bufferobj_data against nested locking.
-rw-r--r--src/mesa/drivers/dri/i915tex/intel_buffer_objects.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/mesa/drivers/dri/i915tex/intel_buffer_objects.c b/src/mesa/drivers/dri/i915tex/intel_buffer_objects.c
index cb76247522..ac2fbd1266 100644
--- a/src/mesa/drivers/dri/i915tex/intel_buffer_objects.c
+++ b/src/mesa/drivers/dri/i915tex/intel_buffer_objects.c
@@ -133,6 +133,7 @@ intel_bufferobj_data(GLcontext * ctx,
{
struct intel_context *intel = intel_context(ctx);
struct intel_buffer_object *intel_obj = intel_buffer_object(obj);
+ GLboolean was_locked = intel->locked;
intel_obj->Base.Size = size;
intel_obj->Base.Usage = usage;
@@ -140,9 +141,11 @@ intel_bufferobj_data(GLcontext * ctx,
if (intel_obj->region)
intel_bufferobj_release_region(intel, intel_obj);
- LOCK_HARDWARE(intel);
+ if (!was_locked)
+ LOCK_HARDWARE(intel);
driBOData(intel_obj->buffer, size, data, 0);
- UNLOCK_HARDWARE(intel);
+ if (!was_locked)
+ UNLOCK_HARDWARE(intel);
}