panfrost: Get rid of the now unused SLAB allocator
authorBoris Brezillon <boris.brezillon@collabora.com>
Thu, 5 Sep 2019 19:41:32 +0000 (21:41 +0200)
committerBoris Brezillon <boris.brezillon@collabora.com>
Sun, 8 Sep 2019 14:24:19 +0000 (16:24 +0200)
The last users have been converted to use plain BOs. Let's get rid of
this abstraction. We can always consider adding it back if we need it
at some point.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
src/gallium/drivers/panfrost/pan_allocate.h
src/gallium/drivers/panfrost/pan_drm.c
src/gallium/drivers/panfrost/pan_screen.h

index cf9499154c8bd1ee2b7f567b0acbb49da665b8eb..c0aff62df4a175a42d042439be038d7b9dbc2f21 100644 (file)
@@ -63,23 +63,10 @@ struct panfrost_bo {
         uint32_t flags;
 };
 
-struct panfrost_memory {
-        /* Backing for the slab in memory */
-        struct panfrost_bo *bo;
-        int stack_bottom;
-};
-
 struct panfrost_transfer
 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);
 
-static inline mali_ptr
-panfrost_reserve(struct panfrost_memory *mem, size_t sz)
-{
-        mem->stack_bottom += sz;
-        return mem->bo->gpu + (mem->stack_bottom - sz);
-}
-
 #endif /* __PAN_ALLOCATE_H__ */
index 1edbb5bd1dcc52a5d53c194d9f3e8ce0bc9db1a7..e7dcd2e587519fad51f362ee6fbf0e6bf46bcb08 100644 (file)
@@ -183,29 +183,6 @@ panfrost_drm_release_bo(struct panfrost_screen *screen, struct panfrost_bo *bo,
         ralloc_free(bo);
 }
 
-void
-panfrost_drm_allocate_slab(struct panfrost_screen *screen,
-                           struct panfrost_memory *mem,
-                           size_t pages,
-                           bool same_va,
-                           int extra_flags,
-                           int commit_count,
-                           int extent)
-{
-        // TODO cache allocations
-        // TODO properly handle errors
-        // TODO take into account extra_flags
-        mem->bo = panfrost_drm_create_bo(screen, pages * 4096, extra_flags);
-        mem->stack_bottom = 0;
-}
-
-void
-panfrost_drm_free_slab(struct panfrost_screen *screen, struct panfrost_memory *mem)
-{
-        panfrost_bo_unreference(&screen->base, mem->bo);
-        mem->bo = NULL;
-}
-
 struct panfrost_bo *
 panfrost_drm_import_bo(struct panfrost_screen *screen, int fd)
 {
index 7ed5193277ac8ca366859c9d3e75c79e1b7fff75..96044b8c8b90a90683043476caf27b2f8991fdbf 100644 (file)
@@ -120,17 +120,6 @@ pan_screen(struct pipe_screen *p)
         return (struct panfrost_screen *)p;
 }
 
-void
-panfrost_drm_allocate_slab(struct panfrost_screen *screen,
-                           struct panfrost_memory *mem,
-                           size_t pages,
-                           bool same_va,
-                           int extra_flags,
-                           int commit_count,
-                           int extent);
-void
-panfrost_drm_free_slab(struct panfrost_screen *screen,
-                       struct panfrost_memory *mem);
 struct panfrost_bo *
 panfrost_drm_create_bo(struct panfrost_screen *screen, size_t size,
                        uint32_t flags);