panfrost: Remove panfrost_upload
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Sat, 31 Aug 2019 00:38:27 +0000 (17:38 -0700)
committerTomeu Vizoso <tomeu.vizoso@collabora.com>
Tue, 3 Sep 2019 11:55:29 +0000 (13:55 +0200)
This routine was made obsolete over a series of reworks of memory
allocation; Tomeu's changes to shader memory allocation finally made
this unused as cppcheck noted.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
src/gallium/drivers/panfrost/pan_allocate.c
src/gallium/drivers/panfrost/pan_allocate.h

index 57af5adede5664d32bf4559da04d6b733661c0a1..2efb01c755890012b792d6c561b15a935b4156ba 100644 (file)
@@ -147,26 +147,3 @@ panfrost_upload_transient(struct panfrost_context *ctx, const void *data, size_t
         memcpy(transfer.cpu, data, sz);
         return transfer.gpu;
 }
-
-/* The code below is exclusively for the use of shader memory and is subject to
- * be rewritten soon enough since it never frees the memory it allocates. Here
- * be dragons, etc. */
-
-mali_ptr
-panfrost_upload(struct panfrost_memory *mem, const void *data, size_t sz)
-{
-        size_t aligned_sz = ALIGN_POT(sz, ALIGNMENT);
-
-        /* Bounds check */
-        if ((mem->stack_bottom + aligned_sz) >= mem->bo->size) {
-                printf("Out of memory, tried to upload %zu but only %zu available\n",
-                       sz, mem->bo->size - mem->stack_bottom);
-                assert(0);
-        }
-
-        memcpy((uint8_t *) mem->bo->cpu + mem->stack_bottom, data, sz);
-        mali_ptr gpu = mem->bo->gpu + mem->stack_bottom;
-
-        mem->stack_bottom += aligned_sz;
-        return gpu;
-}
index 0e06567d206983520f5f2578a777f9f30c5bf525..cf9499154c8bd1ee2b7f567b0acbb49da665b8eb 100644 (file)
@@ -69,9 +69,6 @@ struct panfrost_memory {
         int stack_bottom;
 };
 
-/* Functions for the actual Galliumish driver */
-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);