From: Aaron Watry Date: Sat, 26 Aug 2017 19:15:17 +0000 (-0500) Subject: r600/compute: Remove unused compute_memory_pool functions X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d21e64c626b73b3ed19339cdc27c83b42540ed82;p=mesa.git r600/compute: Remove unused compute_memory_pool functions Signed-off-by: Aaron Watry Reviewed-by: Jan Vesely --- diff --git a/src/gallium/drivers/r600/compute_memory_pool.c b/src/gallium/drivers/r600/compute_memory_pool.c index 4b0e0044f51..d1ef25ae1ee 100644 --- a/src/gallium/drivers/r600/compute_memory_pool.c +++ b/src/gallium/drivers/r600/compute_memory_pool.c @@ -101,83 +101,6 @@ void compute_memory_pool_delete(struct compute_memory_pool* pool) free(pool); } -/** - * Searches for an empty space in the pool, return with the pointer to the - * allocatable space in the pool. - * \param size_in_dw The size of the space we are looking for. - * \return -1 on failure - */ -int64_t compute_memory_prealloc_chunk( - struct compute_memory_pool* pool, - int64_t size_in_dw) -{ - struct compute_memory_item *item; - - int last_end = 0; - - assert(size_in_dw <= pool->size_in_dw); - - COMPUTE_DBG(pool->screen, "* compute_memory_prealloc_chunk() size_in_dw = %"PRIi64"\n", - size_in_dw); - - LIST_FOR_EACH_ENTRY(item, pool->item_list, link) { - if (last_end + size_in_dw <= item->start_in_dw) { - return last_end; - } - - last_end = item->start_in_dw + align(item->size_in_dw, ITEM_ALIGNMENT); - } - - if (pool->size_in_dw - last_end < size_in_dw) { - return -1; - } - - return last_end; -} - -/** - * Search for the chunk where we can link our new chunk after it. - * \param start_in_dw The position of the item we want to add to the pool. - * \return The item that is just before the passed position - */ -struct list_head *compute_memory_postalloc_chunk( - struct compute_memory_pool* pool, - int64_t start_in_dw) -{ - struct compute_memory_item *item; - struct compute_memory_item *next; - struct list_head *next_link; - - COMPUTE_DBG(pool->screen, "* compute_memory_postalloc_chunck() start_in_dw = %"PRIi64"\n", - start_in_dw); - - /* Check if we can insert it in the front of the list */ - item = LIST_ENTRY(struct compute_memory_item, pool->item_list->next, link); - if (LIST_IS_EMPTY(pool->item_list) || item->start_in_dw > start_in_dw) { - return pool->item_list; - } - - LIST_FOR_EACH_ENTRY(item, pool->item_list, link) { - next_link = item->link.next; - - if (next_link != pool->item_list) { - next = container_of(next_link, item, link); - if (item->start_in_dw < start_in_dw - && next->start_in_dw > start_in_dw) { - return &item->link; - } - } - else { - /* end of chain */ - assert(item->start_in_dw < start_in_dw); - return &item->link; - } - } - - assert(0 && "unreachable"); - return NULL; -} - /** * Reallocates and defragments the pool, conserves data. * \returns -1 if it fails, 0 otherwise @@ -686,18 +609,3 @@ void compute_memory_transfer( pipe->transfer_unmap(pipe, xfer); } } - -/** - * Transfer data between chunk<->data, it is for VRAM<->GART transfers - */ -void compute_memory_transfer_direct( - struct compute_memory_pool* pool, - int chunk_to_data, - struct compute_memory_item* chunk, - struct r600_resource* data, - int offset_in_chunk, - int offset_in_data, - int size) -{ - ///TODO: DMA -} diff --git a/src/gallium/drivers/r600/compute_memory_pool.h b/src/gallium/drivers/r600/compute_memory_pool.h index 161ddd53eae..3a17c5176b0 100644 --- a/src/gallium/drivers/r600/compute_memory_pool.h +++ b/src/gallium/drivers/r600/compute_memory_pool.h @@ -86,12 +86,6 @@ struct compute_memory_pool* compute_memory_pool_new(struct r600_screen *rscreen) void compute_memory_pool_delete(struct compute_memory_pool* pool); -int64_t compute_memory_prealloc_chunk(struct compute_memory_pool* pool, - int64_t size_in_dw); - -struct list_head *compute_memory_postalloc_chunk(struct compute_memory_pool* pool, - int64_t start_in_dw); - int compute_memory_grow_defrag_pool(struct compute_memory_pool* pool, struct pipe_context *pipe, int new_size_in_dw); @@ -127,9 +121,4 @@ void compute_memory_transfer(struct compute_memory_pool* pool, struct compute_memory_item* chunk, void* data, int offset_in_chunk, int size); -void compute_memory_transfer_direct(struct compute_memory_pool* pool, - int chunk_to_data, struct compute_memory_item* chunk, - struct r600_resource* data, int offset_in_chunk, - int offset_in_data, int size); - #endif