diff --git a/src/mesa/drivers/dri/i965/intel_buffer_objects.c b/src/mesa/drivers/dri/i965/intel_buffer_objects.c index 96dacde..81baf4c 100644 --- a/src/mesa/drivers/dri/i965/intel_buffer_objects.c +++ b/src/mesa/drivers/dri/i965/intel_buffer_objects.c @@ -252,7 +252,9 @@ intel_bufferobj_subdata(struct gl_context * ctx, if (brw->has_llc) { if (offset + size <= intel_obj->gpu_active_start || intel_obj->gpu_active_end <= offset) { - drm_intel_gem_bo_map_unsynchronized(intel_obj->buffer); + if (drm_intel_gem_bo_map_unsynchronized(intel_obj->buffer) != 0) + goto unsynchronized_map_failed; + memcpy(intel_obj->buffer->virtual + offset, data, size); drm_intel_bo_unmap(intel_obj->buffer); @@ -262,6 +264,7 @@ intel_bufferobj_subdata(struct gl_context * ctx, } } +unsynchronized_map_failed: busy = drm_intel_bo_busy(intel_obj->buffer) || drm_intel_bo_references(brw->batch.bo, intel_obj->buffer);