summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/common
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
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')
-rw-r--r--src/mesa/drivers/dri/common/dri_bufmgr.c12
-rw-r--r--src/mesa/drivers/dri/common/dri_drmpool.c2
2 files changed, 10 insertions, 4 deletions
diff --git a/src/mesa/drivers/dri/common/dri_bufmgr.c b/src/mesa/drivers/dri/common/dri_bufmgr.c
index 65d6545965..eaa4fb09c7 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,
diff --git a/src/mesa/drivers/dri/common/dri_drmpool.c b/src/mesa/drivers/dri/common/dri_drmpool.c
index b5b324be50..878a148b39 100644
--- a/src/mesa/drivers/dri/common/dri_drmpool.c
+++ b/src/mesa/drivers/dri/common/dri_drmpool.c
@@ -185,7 +185,7 @@ pool_setstatic(struct _DriBufferPool *pool, unsigned long offset,
return NULL;
ret = drmBOCreate(pool->fd, offset, size, 0, NULL, drm_bo_type_fake,
- flags, 0, buf);
+ flags, DRM_BO_HINT_DONT_FENCE, buf);
if (ret) {
free(buf);