#include "freedreno_priv.h"
+#include "util/slab.h"
+
#ifndef __user
# define __user
#endif
uint32_t gmem;
uint32_t chip_id;
uint32_t queue_id;
+ struct slab_parent_pool ring_pool;
};
FD_DEFINE_CAST(fd_pipe, msm_pipe);
struct fd_submit * msm_submit_new(struct fd_pipe *pipe);
struct fd_submit * msm_submit_sp_new(struct fd_pipe *pipe);
+void msm_pipe_sp_ringpool_init(struct msm_pipe *msm_pipe);
+void msm_pipe_sp_ringpool_fini(struct msm_pipe *msm_pipe);
+
+
struct msm_bo {
struct fd_bo base;
uint64_t offset;
/* maps fd_bo to idx in bos table: */
struct hash_table *bo_table;
- struct slab_mempool ring_pool;
+ struct slab_child_pool ring_pool;
struct fd_ringbuffer *primary;
struct msm_submit_sp *msm_submit = to_msm_submit_sp(submit);
struct msm_ringbuffer_sp *msm_ring;
- msm_ring = slab_alloc_st(&msm_submit->ring_pool);
+ msm_ring = slab_alloc(&msm_submit->ring_pool);
msm_ring->u.submit = submit;
// TODO it would be nice to have a way to debug_assert() if all
// rb's haven't been free'd back to the slab, because that is
// an indication that we are leaking bo's
- slab_destroy(&msm_submit->ring_pool);
+ slab_destroy_child(&msm_submit->ring_pool);
for (unsigned i = 0; i < msm_submit->nr_bos; i++)
fd_bo_del(msm_submit->bos[i]);
msm_submit->bo_table = _mesa_hash_table_create(NULL,
_mesa_hash_pointer, _mesa_key_pointer_equal);
- // TODO tune size:
- slab_create(&msm_submit->ring_pool, sizeof(struct msm_ringbuffer_sp), 16);
+
+ slab_create_child(&msm_submit->ring_pool, &to_msm_pipe(pipe)->ring_pool);
submit = &msm_submit->base;
submit->pipe = pipe;
return submit;
}
+void
+msm_pipe_sp_ringpool_init(struct msm_pipe *msm_pipe)
+{
+ // TODO tune size:
+ slab_create_parent(&msm_pipe->ring_pool, sizeof(struct msm_ringbuffer_sp), 16);
+}
+
+void
+msm_pipe_sp_ringpool_fini(struct msm_pipe *msm_pipe)
+{
+ if (msm_pipe->ring_pool.num_elements)
+ slab_destroy_parent(&msm_pipe->ring_pool);
+}
static void
finalize_current_cmd(struct fd_ringbuffer *ring)
fd_bo_del(msm_ring->u.cmds[i].ring_bo);
}
- slab_free_st(&to_msm_submit_sp(submit)->ring_pool, msm_ring);
+ slab_free(&to_msm_submit_sp(submit)->ring_pool, msm_ring);
}
}