summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Clark <robdclark@chromium.org>2022-03-14 16:56:55 -0700
committerMarge Bot <emma+marge@anholt.net>2022-03-25 02:03:30 +0000
commit72a427244f545b9f2713b3f0aed23d04cb953727 (patch)
treebb3bde625d5c1f93bf9b55d8c1ea504c47a86b2b
parent877f9049c3e87e5d64820bcdf62c8fbfe2a33206 (diff)
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>
-rw-r--r--src/freedreno/drm/freedreno_priv.h3
-rw-r--r--src/freedreno/drm/msm/msm_pipe.c4
-rw-r--r--src/freedreno/drm/msm/msm_priv.h6
-rw-r--r--src/freedreno/drm/msm/msm_ringbuffer_sp.c13
4 files changed, 13 insertions, 13 deletions
diff --git a/src/freedreno/drm/freedreno_priv.h b/src/freedreno/drm/freedreno_priv.h
index 155535dc58a..0d8efa6acd4 100644
--- a/src/freedreno/drm/freedreno_priv.h
+++ b/src/freedreno/drm/freedreno_priv.h
@@ -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;
};
diff --git a/src/freedreno/drm/msm/msm_pipe.c b/src/freedreno/drm/msm/msm_pipe.c
index 49587fc8915..babb89b6a43 100644
--- a/src/freedreno/drm/msm/msm_pipe.c
+++ b/src/freedreno/drm/msm/msm_pipe.c
@@ -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:
diff --git a/src/freedreno/drm/msm/msm_priv.h b/src/freedreno/drm/msm/msm_priv.h
index 828ee03ef9a..ca2bca80d4a 100644
--- a/src/freedreno/drm/msm/msm_priv.h
+++ b/src/freedreno/drm/msm/msm_priv.h
@@ -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;
diff --git a/src/freedreno/drm/msm/msm_ringbuffer_sp.c b/src/freedreno/drm/msm/msm_ringbuffer_sp.c
index c87399ccae2..a607f0e96e7 100644
--- a/src/freedreno/drm/msm/msm_ringbuffer_sp.c
+++ b/src/freedreno/drm/msm/msm_ringbuffer_sp.c
@@ -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