crocus: add unsync transfer pool

Reviewed-by: Zoltán Böszörményi <zboszor@pr.hu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11710>
This commit is contained in:
Dave Airlie
2021-07-05 15:59:42 +10:00
parent 902eaa9382
commit 86368a5fa2
3 changed files with 12 additions and 1 deletions

View File

@@ -200,6 +200,7 @@ crocus_destroy_context(struct pipe_context *ctx)
crocus_bo_unreference(ice->workaround_bo);
slab_destroy_child(&ice->transfer_pool);
slab_destroy_child(&ice->transfer_pool_unsync);
crocus_batch_free(&ice->batches[CROCUS_BATCH_RENDER]);
if (ice->batches[CROCUS_BATCH_COMPUTE].ice)
@@ -280,6 +281,7 @@ crocus_create_context(struct pipe_screen *pscreen, void *priv, unsigned flags)
crocus_init_program_cache(ice);
slab_create_child(&ice->transfer_pool, &screen->transfer_pool);
slab_create_child(&ice->transfer_pool_unsync, &screen->transfer_pool);
ice->query_buffer_uploader =
u_upload_create(ctx, 4096, PIPE_BIND_CUSTOM, PIPE_USAGE_STAGING,

View File

@@ -26,6 +26,7 @@
#include "pipe/p_context.h"
#include "pipe/p_state.h"
#include "util/u_debug.h"
#include "util/u_threaded_context.h"
#include "intel/blorp/blorp.h"
#include "intel/dev/intel_debug.h"
#include "intel/compiler/brw_compiler.h"
@@ -451,6 +452,9 @@ struct crocus_context {
/** Slab allocator for crocus_transfer_map objects. */
struct slab_child_pool transfer_pool;
/** Slab allocator for threaded_context's crocus_transfer_map objects */
struct slab_child_pool transfer_pool_unsync;
struct blorp_context blorp;
int batch_count;

View File

@@ -1580,7 +1580,12 @@ crocus_transfer_map(struct pipe_context *ctx,
(usage & PIPE_MAP_DIRECTLY))
return NULL;
struct crocus_transfer *map = slab_alloc(&ice->transfer_pool);
struct crocus_transfer *map;
if (usage & TC_TRANSFER_MAP_THREADED_UNSYNC)
map = slab_alloc(&ice->transfer_pool_unsync);
else
map = slab_alloc(&ice->transfer_pool);
struct pipe_transfer *xfer = &map->base.b;
if (!map)