From 66800a04e512ab02ddde7bdb564feb0a77b2f575 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 18 Oct 2010 11:32:19 -0700 Subject: [PATCH] i965: Fix assertion failure on gen6 BufferSubData to busy BO. Fixes fbo-blit and probably several other tests. --- .../drivers/dri/intel/intel_buffer_objects.c | 27 ++++++++++++------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/src/mesa/drivers/dri/intel/intel_buffer_objects.c b/src/mesa/drivers/dri/intel/intel_buffer_objects.c index 1e99f9040af..fea99b2ad60 100644 --- a/src/mesa/drivers/dri/intel/intel_buffer_objects.c +++ b/src/mesa/drivers/dri/intel/intel_buffer_objects.c @@ -214,21 +214,28 @@ intel_bufferobj_subdata(struct gl_context * ctx, memcpy((char *)intel_obj->sys_buffer + offset, data, size); else { /* Flush any existing batchbuffer that might reference this data. */ - if (drm_intel_bo_busy(intel_obj->buffer) || - drm_intel_bo_references(intel->batch->buf, intel_obj->buffer)) { - drm_intel_bo *temp_bo; + if (intel->gen < 6) { + if (drm_intel_bo_busy(intel_obj->buffer) || + drm_intel_bo_references(intel->batch->buf, intel_obj->buffer)) { + drm_intel_bo *temp_bo; - temp_bo = drm_intel_bo_alloc(intel->bufmgr, "subdata temp", size, 64); + temp_bo = drm_intel_bo_alloc(intel->bufmgr, "subdata temp", size, 64); - drm_intel_bo_subdata(temp_bo, 0, size, data); + drm_intel_bo_subdata(temp_bo, 0, size, data); - intel_emit_linear_blit(intel, - intel_obj->buffer, offset, - temp_bo, 0, - size); + intel_emit_linear_blit(intel, + intel_obj->buffer, offset, + temp_bo, 0, + size); - drm_intel_bo_unreference(temp_bo); + drm_intel_bo_unreference(temp_bo); + } else { + drm_intel_bo_subdata(intel_obj->buffer, offset, size, data); + } } else { + if (drm_intel_bo_references(intel->batch->buf, intel_obj->buffer)) { + intel_batchbuffer_flush(intel->batch); + } drm_intel_bo_subdata(intel_obj->buffer, offset, size, data); } } -- 2.30.2