Mesa (master): panfrost: Move pool routines to common code

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Jul 9 15:06:17 UTC 2020


Module: Mesa
Branch: master
Commit: c8d848b2782b99eb617cb83958a3d977c406e8ff
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=c8d848b2782b99eb617cb83958a3d977c406e8ff

Author: Alyssa Rosenzweig <alyssa.rosenzweig at collabora.com>
Date:   Tue Jul  7 16:24:41 2020 -0400

panfrost: Move pool routines to common code

We finally have it decoupled from Galliumisms (and OpenGLisms, indeed)
so we can share the file.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5794>

---

 src/gallium/drivers/panfrost/Makefile.sources              |  2 --
 src/gallium/drivers/panfrost/meson.build                   |  1 -
 src/gallium/drivers/panfrost/pan_cmdstream.c               |  2 +-
 src/gallium/drivers/panfrost/pan_job.h                     |  2 +-
 src/gallium/drivers/panfrost/pan_resource.h                |  2 +-
 src/gallium/drivers/panfrost/pan_scoreboard.c              |  2 +-
 src/gallium/drivers/panfrost/pan_screen.h                  |  2 +-
 src/panfrost/Makefile.sources                              |  2 ++
 src/panfrost/encoder/meson.build                           |  1 +
 .../pan_allocate.c => panfrost/encoder/pan_pool.c}         |  9 ++-------
 .../pan_allocate.h => panfrost/encoder/pan_pool.h}         | 14 +++-----------
 11 files changed, 13 insertions(+), 26 deletions(-)

diff --git a/src/gallium/drivers/panfrost/Makefile.sources b/src/gallium/drivers/panfrost/Makefile.sources
index 2453edec60c..4688754672c 100644
--- a/src/gallium/drivers/panfrost/Makefile.sources
+++ b/src/gallium/drivers/panfrost/Makefile.sources
@@ -2,8 +2,6 @@ C_SOURCES := \
 	nir/nir_lower_blend.c \
 	nir/nir_lower_blend.h \
     \
-	pan_allocate.c \
-	pan_allocate.h \
 	pan_assemble.c \
 	pan_blend_cso.c \
 	pan_blend.h \
diff --git a/src/gallium/drivers/panfrost/meson.build b/src/gallium/drivers/panfrost/meson.build
index b3ebb16fe2d..154d05a7344 100644
--- a/src/gallium/drivers/panfrost/meson.build
+++ b/src/gallium/drivers/panfrost/meson.build
@@ -31,7 +31,6 @@ files_panfrost = files(
   'pan_context.c',
   'pan_blit.c',
   'pan_job.c',
-  'pan_allocate.c',
   'pan_assemble.c',
   'pan_blending.c',
   'pan_blend_shaders.c',
diff --git a/src/gallium/drivers/panfrost/pan_cmdstream.c b/src/gallium/drivers/panfrost/pan_cmdstream.c
index fd2e72b2b1f..e761c63c38b 100644
--- a/src/gallium/drivers/panfrost/pan_cmdstream.c
+++ b/src/gallium/drivers/panfrost/pan_cmdstream.c
@@ -28,7 +28,7 @@
 
 #include "panfrost-quirks.h"
 
-#include "pan_allocate.h"
+#include "pan_pool.h"
 #include "pan_bo.h"
 #include "pan_cmdstream.h"
 #include "pan_context.h"
diff --git a/src/gallium/drivers/panfrost/pan_job.h b/src/gallium/drivers/panfrost/pan_job.h
index c0a569bbf64..43ae7795d69 100644
--- a/src/gallium/drivers/panfrost/pan_job.h
+++ b/src/gallium/drivers/panfrost/pan_job.h
@@ -28,7 +28,7 @@
 
 #include "util/u_dynarray.h"
 #include "pipe/p_state.h"
-#include "pan_allocate.h"
+#include "pan_pool.h"
 #include "pan_resource.h"
 
 /* panfrost_batch_fence is the out fence of a batch that users or other batches
diff --git a/src/gallium/drivers/panfrost/pan_resource.h b/src/gallium/drivers/panfrost/pan_resource.h
index 209a6c185cc..bc4e0dbb6c4 100644
--- a/src/gallium/drivers/panfrost/pan_resource.h
+++ b/src/gallium/drivers/panfrost/pan_resource.h
@@ -28,7 +28,7 @@
 
 #include <panfrost-job.h>
 #include "pan_screen.h"
-#include "pan_allocate.h"
+#include "pan_pool.h"
 #include "pan_minmax_cache.h"
 #include "pan_texture.h"
 #include "drm-uapi/drm.h"
diff --git a/src/gallium/drivers/panfrost/pan_scoreboard.c b/src/gallium/drivers/panfrost/pan_scoreboard.c
index 7023ebc4385..63a0f86e737 100644
--- a/src/gallium/drivers/panfrost/pan_scoreboard.c
+++ b/src/gallium/drivers/panfrost/pan_scoreboard.c
@@ -24,7 +24,7 @@
 
 #include "pan_context.h"
 #include "pan_job.h"
-#include "pan_allocate.h"
+#include "pan_pool.h"
 #include "panfrost-quirks.h"
 #include "util/bitset.h"
 
diff --git a/src/gallium/drivers/panfrost/pan_screen.h b/src/gallium/drivers/panfrost/pan_screen.h
index f67856949e2..6fe6381e20f 100644
--- a/src/gallium/drivers/panfrost/pan_screen.h
+++ b/src/gallium/drivers/panfrost/pan_screen.h
@@ -39,7 +39,7 @@
 
 #include <panfrost-misc.h>
 #include "pan_device.h"
-#include "pan_allocate.h"
+#include "pan_pool.h"
 
 struct panfrost_batch;
 struct panfrost_context;
diff --git a/src/panfrost/Makefile.sources b/src/panfrost/Makefile.sources
index 568729887de..d085b763e3e 100644
--- a/src/panfrost/Makefile.sources
+++ b/src/panfrost/Makefile.sources
@@ -29,6 +29,8 @@ encoder_FILES := \
         encoder/pan_encoder.h \
         encoder/pan_format.c \
         encoder/pan_invocation.c \
+        encoder/pan_pool.c \
+        encoder/pan_pool.h \
         encoder/pan_props.c \
         encoder/pan_sampler.c \
         encoder/pan_tiler.c \
diff --git a/src/panfrost/encoder/meson.build b/src/panfrost/encoder/meson.build
index 0086834977b..2e5baea4fc5 100644
--- a/src/panfrost/encoder/meson.build
+++ b/src/panfrost/encoder/meson.build
@@ -31,6 +31,7 @@ libpanfrost_encoder_files = files(
   'pan_tiler.c',
   'pan_texture.c',
   'pan_scratch.c',
+  'pan_pool.c',
   'pan_props.c',
 )
 
diff --git a/src/gallium/drivers/panfrost/pan_allocate.c b/src/panfrost/encoder/pan_pool.c
similarity index 96%
rename from src/gallium/drivers/panfrost/pan_allocate.c
rename to src/panfrost/encoder/pan_pool.c
index ed8d26f127e..1a08be2aacf 100644
--- a/src/gallium/drivers/panfrost/pan_allocate.c
+++ b/src/panfrost/encoder/pan_pool.c
@@ -23,14 +23,9 @@
  *
  */
 
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <assert.h>
-#include <panfrost-misc.h>
-#include <panfrost-job.h>
+#include "util/hash_table.h"
 #include "pan_bo.h"
-#include "pan_context.h"
+#include "pan_pool.h"
 
 /* TODO: What does this actually have to be? */
 #define ALIGNMENT 128
diff --git a/src/gallium/drivers/panfrost/pan_allocate.h b/src/panfrost/encoder/pan_pool.h
similarity index 91%
rename from src/gallium/drivers/panfrost/pan_allocate.h
rename to src/panfrost/encoder/pan_pool.h
index fa41d4c87c4..6d7899800ce 100644
--- a/src/gallium/drivers/panfrost/pan_allocate.h
+++ b/src/panfrost/encoder/pan_pool.h
@@ -22,19 +22,11 @@
  *
  */
 
-#ifndef __PAN_ALLOCATE_H__
-#define __PAN_ALLOCATE_H__
-
-#include <unistd.h>
-#include <sys/mman.h>
-#include <stdbool.h>
+#ifndef __PAN_POOL_H__
+#define __PAN_POOL_H__
 
 #include <panfrost-misc.h>
 
-#include "util/list.h"
-
-struct panfrost_batch;
-
 /* Represents a pool of memory that can only grow, used to allocate objects
  * with the same lifetime as the pool itself. In OpenGL, a pool is owned by the
  * batch for transient structures. In Vulkan, it may be owned by e.g. the
@@ -71,4 +63,4 @@ panfrost_pool_alloc(struct pan_pool *pool, size_t sz);
 mali_ptr
 panfrost_pool_upload(struct pan_pool *pool, const void *data, size_t sz);
 
-#endif /* __PAN_ALLOCATE_H__ */
+#endif



More information about the mesa-commit mailing list