summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/common/dri_bufmgr.c
diff options
context:
space:
mode:
authorThomas Hellstrom <thomas-at-tungstengraphics-dot-com>2007-04-16 16:04:12 +0200
committerThomas Hellstrom <thomas-at-tungstengraphics-dot-com>2007-04-16 16:04:12 +0200
commitda56df9d722a2eb8223434d130436bcb6ea47188 (patch)
tree46bae3654d37cf286ab03df10de2a9e3ff776a25 /src/mesa/drivers/dri/common/dri_bufmgr.c
parent9519785e298c665f8aafe57a6a1b2d5c5d484a6d (diff)
Make sure we are locked when creating drm buffer objects.
Don't place buffer objects on unfenced list when newly created. Fix a buffer object wait-for-idle deadlock.
Diffstat (limited to 'src/mesa/drivers/dri/common/dri_bufmgr.c')
-rw-r--r--src/mesa/drivers/dri/common/dri_bufmgr.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/mesa/drivers/dri/common/dri_bufmgr.c b/src/mesa/drivers/dri/common/dri_bufmgr.c
index 65d65459657..eaa4fb09c70 100644
--- a/src/mesa/drivers/dri/common/dri_bufmgr.c
+++ b/src/mesa/drivers/dri/common/dri_bufmgr.c
@@ -190,11 +190,16 @@ driBOKernel(struct _DriBufferObject *buf)
void
driBOWaitIdle(struct _DriBufferObject *buf, int lazy)
{
- assert(buf->private != NULL);
+ struct _DriBufferPool *pool;
+ void *priv;
_glthread_LOCK_MUTEX(buf->mutex);
- BM_CKFATAL(buf->pool->waitIdle(buf->pool, buf->private, lazy));
+ pool = buf->pool;
+ priv = buf->private;
_glthread_UNLOCK_MUTEX(buf->mutex);
+
+ assert(priv != NULL);
+ BM_CKFATAL(buf->pool->waitIdle(pool, priv, lazy));
}
void *
@@ -296,7 +301,8 @@ driBOData(struct _DriBufferObject *buf,
pool->destroy(pool, buf->private);
if (!flags)
flags = buf->flags;
- buf->private = pool->create(pool, size, flags, 0, buf->alignment);
+ buf->private = pool->create(pool, size, flags, DRM_BO_HINT_DONT_FENCE,
+ buf->alignment);
if (!buf->private)
BM_CKFATAL(-ENOMEM);
BM_CKFATAL(pool->map(pool, buf->private,