diff options
author | Eric Anholt <[email protected]> | 2010-10-18 11:32:19 -0700 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2010-10-18 12:56:44 -0700 |
commit | 66800a04e512ab02ddde7bdb564feb0a77b2f575 (patch) | |
tree | 967eb5bb2ec7d977caf584fda13efc40180b6ead /src/mesa | |
parent | 746e68c50b4ae1566b342fbc965557b6dbcfaa2e (diff) |
i965: Fix assertion failure on gen6 BufferSubData to busy BO.
Fixes fbo-blit and probably several other tests.
Diffstat (limited to 'src/mesa')
-rw-r--r-- | src/mesa/drivers/dri/intel/intel_buffer_objects.c | 27 |
1 files 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); } } |