freedreno/drm: Move ring_pool slab parent to base
Prep to move most of sp submit/ringbuffer to something that can be re-used by virtio backend. Signed-off-by: Rob Clark <robdclark@chromium.org> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14900>
This commit is contained in:
@@ -42,6 +42,7 @@
|
||||
#include "util/list.h"
|
||||
#include "util/log.h"
|
||||
#include "util/simple_mtx.h"
|
||||
#include "util/slab.h"
|
||||
#include "util/u_atomic.h"
|
||||
#include "util/u_debug.h"
|
||||
#include "util/u_math.h"
|
||||
@@ -250,6 +251,8 @@ struct fd_pipe {
|
||||
struct fd_bo *control_mem;
|
||||
volatile struct fd_pipe_control *control;
|
||||
|
||||
struct slab_parent_pool ring_pool;
|
||||
|
||||
const struct fd_pipe_funcs *funcs;
|
||||
};
|
||||
|
||||
|
||||
@@ -199,7 +199,7 @@ msm_pipe_destroy(struct fd_pipe *pipe)
|
||||
struct msm_pipe *msm_pipe = to_msm_pipe(pipe);
|
||||
|
||||
close_submitqueue(pipe, msm_pipe->queue_id);
|
||||
msm_pipe_sp_ringpool_init(msm_pipe);
|
||||
msm_pipe_sp_ringpool_fini(pipe);
|
||||
free(msm_pipe);
|
||||
}
|
||||
|
||||
@@ -281,7 +281,7 @@ msm_pipe_new(struct fd_device *dev, enum fd_pipe_id id, uint32_t prio)
|
||||
if (open_submitqueue(pipe, prio))
|
||||
goto fail;
|
||||
|
||||
msm_pipe_sp_ringpool_init(msm_pipe);
|
||||
msm_pipe_sp_ringpool_init(pipe);
|
||||
|
||||
return pipe;
|
||||
fail:
|
||||
|
||||
@@ -29,7 +29,6 @@
|
||||
|
||||
#include "freedreno_priv.h"
|
||||
|
||||
#include "util/slab.h"
|
||||
#include "util/timespec.h"
|
||||
|
||||
#include "pipe/p_defines.h"
|
||||
@@ -55,7 +54,6 @@ struct msm_pipe {
|
||||
uint64_t gmem_base;
|
||||
uint32_t gmem;
|
||||
uint32_t queue_id;
|
||||
struct slab_parent_pool ring_pool;
|
||||
|
||||
/**
|
||||
* If we *ever* see an in-fence-fd, assume that userspace is
|
||||
@@ -77,8 +75,8 @@ 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_flush(struct fd_pipe *pipe, uint32_t fence);
|
||||
|
||||
void msm_pipe_sp_ringpool_init(struct msm_pipe *msm_pipe);
|
||||
void msm_pipe_sp_ringpool_fini(struct msm_pipe *msm_pipe);
|
||||
void msm_pipe_sp_ringpool_init(struct fd_pipe *pipe);
|
||||
void msm_pipe_sp_ringpool_fini(struct fd_pipe *pipe);
|
||||
|
||||
struct msm_bo {
|
||||
struct fd_bo base;
|
||||
|
||||
@@ -617,7 +617,7 @@ msm_submit_sp_new(struct fd_pipe *pipe)
|
||||
msm_submit->bo_table = _mesa_hash_table_create(NULL, _mesa_hash_pointer,
|
||||
_mesa_key_pointer_equal);
|
||||
|
||||
slab_create_child(&msm_submit->ring_pool, &to_msm_pipe(pipe)->ring_pool);
|
||||
slab_create_child(&msm_submit->ring_pool, &pipe->ring_pool);
|
||||
|
||||
submit = &msm_submit->base;
|
||||
submit->funcs = &submit_funcs;
|
||||
@@ -626,18 +626,17 @@ msm_submit_sp_new(struct fd_pipe *pipe)
|
||||
}
|
||||
|
||||
void
|
||||
msm_pipe_sp_ringpool_init(struct msm_pipe *msm_pipe)
|
||||
msm_pipe_sp_ringpool_init(struct fd_pipe *pipe)
|
||||
{
|
||||
// TODO tune size:
|
||||
slab_create_parent(&msm_pipe->ring_pool, sizeof(struct msm_ringbuffer_sp),
|
||||
16);
|
||||
slab_create_parent(&pipe->ring_pool, sizeof(struct msm_ringbuffer_sp), 16);
|
||||
}
|
||||
|
||||
void
|
||||
msm_pipe_sp_ringpool_fini(struct msm_pipe *msm_pipe)
|
||||
msm_pipe_sp_ringpool_fini(struct fd_pipe *pipe)
|
||||
{
|
||||
if (msm_pipe->ring_pool.num_elements)
|
||||
slab_destroy_parent(&msm_pipe->ring_pool);
|
||||
if (pipe->ring_pool.num_elements)
|
||||
slab_destroy_parent(&pipe->ring_pool);
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
Reference in New Issue
Block a user