From 7c71ef3a3d0cf2620525f468960cdc76a0fb0d33 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 12 Dec 2007 10:25:19 -0800 Subject: [intel] Move bufmgr back to context instead of screen, fixing glthreads. Putting the bufmgr in the screen is not thread-safe since the emit_reloc changes. It also led to a significant performance hit from pthread usage for the attempted thread-safety (up to 12% of a cpu spent on refcounting protection in single-threaded 965). The motivation had been to allow multi-context bufmgr sharing in classic mode, but it wasn't worth the cost. --- src/mesa/drivers/dri/intel/intel_batchbuffer.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/mesa/drivers/dri/intel/intel_batchbuffer.c') diff --git a/src/mesa/drivers/dri/intel/intel_batchbuffer.c b/src/mesa/drivers/dri/intel/intel_batchbuffer.c index 1deca8ca1d..cbd6d729d6 100644 --- a/src/mesa/drivers/dri/intel/intel_batchbuffer.c +++ b/src/mesa/drivers/dri/intel/intel_batchbuffer.c @@ -78,15 +78,15 @@ intel_batchbuffer_reset(struct intel_batchbuffer *batch) batch->buf = NULL; } - batch->buf = dri_bo_alloc(intel->intelScreen->bufmgr, "batchbuffer", - intel->intelScreen->maxBatchSize, 4096, + batch->buf = dri_bo_alloc(intel->bufmgr, "batchbuffer", + intel->maxBatchSize, 4096, DRM_BO_FLAG_MEM_LOCAL | DRM_BO_FLAG_CACHED | DRM_BO_FLAG_CACHED_MAPPED); dri_bo_map(batch->buf, GL_TRUE); batch->map = batch->buf->virtual; - batch->size = intel->intelScreen->maxBatchSize; + batch->size = intel->maxBatchSize; batch->ptr = batch->map; batch->dirty_state = ~0; - batch->id = batch->intel->intelScreen->batch_id++; + batch->id = batch->intel->batch_id++; } struct intel_batchbuffer * @@ -144,7 +144,7 @@ do_flush_locked(struct intel_batchbuffer *batch, */ if (!(intel->numClipRects == 0 && !ignore_cliprects)) { - if (intel->intelScreen->ttm == GL_TRUE) { + if (intel->ttm == GL_TRUE) { intel_exec_ioctl(batch->intel, used, ignore_cliprects, allow_unlock, start, count, &batch->last_fence); -- cgit v1.2.3