summaryrefslogtreecommitdiff
path: root/lib/mesa/src/gallium/auxiliary/pipebuffer/pb_bufmgr_slab.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/mesa/src/gallium/auxiliary/pipebuffer/pb_bufmgr_slab.c')
-rw-r--r--lib/mesa/src/gallium/auxiliary/pipebuffer/pb_bufmgr_slab.c30
1 files changed, 16 insertions, 14 deletions
diff --git a/lib/mesa/src/gallium/auxiliary/pipebuffer/pb_bufmgr_slab.c b/lib/mesa/src/gallium/auxiliary/pipebuffer/pb_bufmgr_slab.c
index 8a3b28761..c93609621 100644
--- a/lib/mesa/src/gallium/auxiliary/pipebuffer/pb_bufmgr_slab.c
+++ b/lib/mesa/src/gallium/auxiliary/pipebuffer/pb_bufmgr_slab.c
@@ -204,17 +204,18 @@ pb_slab_buffer_destroy(struct pb_buffer *_buf)
buf->mapCount = 0;
- LIST_DEL(list);
- LIST_ADDTAIL(list, &slab->freeBuffers);
+ list_del(list);
+ list_addtail(list, &slab->freeBuffers);
slab->numFree++;
if (slab->head.next == &slab->head)
- LIST_ADDTAIL(&slab->head, &mgr->slabs);
+ list_addtail(&slab->head, &mgr->slabs);
/* If the slab becomes totally empty, free it */
if (slab->numFree == slab->numBuffers) {
list = &slab->head;
- LIST_DELINIT(list);
+ list_delinit(list);
+ pb_unmap(slab->bo);
pb_reference(&slab->bo, NULL);
FREE(slab->buffers);
FREE(slab);
@@ -315,15 +316,16 @@ pb_slab_create(struct pb_slab_manager *mgr)
}
/* Note down the slab virtual address. All mappings are accessed directly
- * through this address so it is required that the buffer is pinned. */
+ * through this address so it is required that the buffer is mapped
+ * persistent */
slab->virtual = pb_map(slab->bo,
PB_USAGE_CPU_READ |
- PB_USAGE_CPU_WRITE, NULL);
+ PB_USAGE_CPU_WRITE |
+ PB_USAGE_PERSISTENT, NULL);
if(!slab->virtual) {
ret = PIPE_ERROR_OUT_OF_MEMORY;
goto out_err1;
}
- pb_unmap(slab->bo);
numBuffers = slab->bo->size / mgr->bufSize;
@@ -333,8 +335,8 @@ pb_slab_create(struct pb_slab_manager *mgr)
goto out_err1;
}
- LIST_INITHEAD(&slab->head);
- LIST_INITHEAD(&slab->freeBuffers);
+ list_inithead(&slab->head);
+ list_inithead(&slab->freeBuffers);
slab->numBuffers = numBuffers;
slab->numFree = 0;
slab->mgr = mgr;
@@ -350,13 +352,13 @@ pb_slab_create(struct pb_slab_manager *mgr)
buf->start = i* mgr->bufSize;
buf->mapCount = 0;
cnd_init(&buf->event);
- LIST_ADDTAIL(&buf->head, &slab->freeBuffers);
+ list_addtail(&buf->head, &slab->freeBuffers);
slab->numFree++;
buf++;
}
/* Add this slab to the list of partial slabs */
- LIST_ADDTAIL(&slab->head, &mgr->slabs);
+ list_addtail(&slab->head, &mgr->slabs);
return PIPE_OK;
@@ -412,10 +414,10 @@ pb_slab_manager_create_buffer(struct pb_manager *_mgr,
/* If totally full remove from the partial slab list */
if (--slab->numFree == 0)
- LIST_DELINIT(list);
+ list_delinit(list);
list = slab->freeBuffers.next;
- LIST_DELINIT(list);
+ list_delinit(list);
mtx_unlock(&mgr->mutex);
buf = LIST_ENTRY(struct pb_slab_buffer, list, head);
@@ -470,7 +472,7 @@ pb_slab_manager_create(struct pb_manager *provider,
mgr->slabSize = slabSize;
mgr->desc = *desc;
- LIST_INITHEAD(&mgr->slabs);
+ list_inithead(&mgr->slabs);
(void) mtx_init(&mgr->mutex, mtx_plain);