panfrost: Add pan_bucket helper
[mesa.git] / src / gallium / drivers / panfrost / pan_allocate.h
index 45c86b7cb7b9a0ea30dafa864c5d63b3f97f96bb..8d925ee38a4c9c2842c1ce02e92631ff2536a7c3 100644 (file)
 #include <unistd.h>
 #include <sys/mman.h>
 #include <stdbool.h>
-#include "pipebuffer/pb_slab.h"
 
 #include <panfrost-misc.h>
 
-struct panfrost_context;
-
-/* Texture memory */
-
-#define HEAP_TEXTURE 0
-
-/* Single-frame (transient) command stream memory, done at the block scale
- * rather than the individual cmdstream alllocation scale. We use pb_alloc for
- * pooling, but we have to implement our own logic atop the API for performance
- * reasons when considering many low-latency tiny heterogenous allocations */
-
-#define HEAP_TRANSIENT 1
+#include "util/list.h"
 
-/* Multi-frame descriptor memory (replaces what used to be
- * cmdstream_persistent), for long-living small allocations */
-
-#define HEAP_DESCRIPTOR 2
+struct panfrost_context;
 
 /* Represents a fat pointer for GPU-mapped memory, returned from the transient
  * allocator and not used for much else */
@@ -59,6 +44,9 @@ struct panfrost_transfer {
 };
 
 struct panfrost_bo {
+        /* Must be first for casting */
+        struct list_head link;
+
         struct pipe_reference reference;
 
         /* Mapping for the entire object (all levels) */
@@ -74,39 +62,13 @@ struct panfrost_bo {
 };
 
 struct panfrost_memory {
-        /* Subclassing slab object */
-        struct pb_slab slab;
-
         /* Backing for the slab in memory */
         struct panfrost_bo *bo;
         int stack_bottom;
 };
 
-/* Slab entry sizes range from 2^min to 2^max. In this case, we range from 1k
- * to 16MB. Numbers are kind of arbitrary but these seem to work alright in
- * practice. */
-
-#define MIN_SLAB_ENTRY_SIZE (10)
-#define MAX_SLAB_ENTRY_SIZE (24)
-
-struct panfrost_memory_entry {
-        /* Subclass */
-        struct pb_slab_entry base;
-
-        /* Have we been freed? */
-        bool freed;
-
-        /* Offset into the slab of the entry */
-        off_t offset;
-};
-
-/* Functions for replay */
-mali_ptr pandev_upload(int cheating_offset, int *stack_bottom, mali_ptr base, void *base_map, const void *data, size_t sz, bool no_pad);
-mali_ptr pandev_upload_sequential(mali_ptr base, void *base_map, const void *data, size_t sz);
-
 /* Functions for the actual Galliumish driver */
-mali_ptr panfrost_upload(struct panfrost_memory *mem, const void *data, size_t sz, bool no_pad);
-mali_ptr panfrost_upload_sequential(struct panfrost_memory *mem, const void *data, size_t sz);
+mali_ptr panfrost_upload(struct panfrost_memory *mem, const void *data, size_t sz);
 
 struct panfrost_transfer
 panfrost_allocate_transient(struct panfrost_context *ctx, size_t sz);
@@ -114,9 +76,6 @@ panfrost_allocate_transient(struct panfrost_context *ctx, size_t sz);
 mali_ptr
 panfrost_upload_transient(struct panfrost_context *ctx, const void *data, size_t sz);
 
-void *
-panfrost_allocate_transfer(struct panfrost_memory *mem, size_t sz, mali_ptr *gpu);
-
 static inline mali_ptr
 panfrost_reserve(struct panfrost_memory *mem, size_t sz)
 {
@@ -124,7 +83,4 @@ panfrost_reserve(struct panfrost_memory *mem, size_t sz)
         return mem->bo->gpu + (mem->stack_bottom - sz);
 }
 
-struct panfrost_transfer
-panfrost_allocate_chunk(struct panfrost_context *ctx, size_t size, unsigned heap_id);
-
 #endif /* __PAN_ALLOCATE_H__ */