mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-24 19:40:10 +01:00
iris: implement PIPE_CAP_MAP_UNSYNCHRONIZED_THREAD_SAFE
required by glthread Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20379>
This commit is contained in:
parent
b9caddb4a7
commit
fc0e23b6dd
2 changed files with 13 additions and 6 deletions
|
|
@ -2513,7 +2513,9 @@ iris_transfer_map(struct pipe_context *ctx,
|
|||
|
||||
struct iris_transfer *map;
|
||||
|
||||
if (usage & TC_TRANSFER_MAP_THREADED_UNSYNC)
|
||||
if (usage & PIPE_MAP_THREAD_SAFE)
|
||||
map = CALLOC_STRUCT(iris_transfer);
|
||||
else if (usage & TC_TRANSFER_MAP_THREADED_UNSYNC)
|
||||
map = slab_zalloc(&ice->transfer_pool_unsync);
|
||||
else
|
||||
map = slab_zalloc(&ice->transfer_pool);
|
||||
|
|
@ -2623,11 +2625,15 @@ iris_transfer_unmap(struct pipe_context *ctx, struct pipe_transfer *xfer)
|
|||
|
||||
pipe_resource_reference(&xfer->resource, NULL);
|
||||
|
||||
/* transfer_unmap is always called from the driver thread, so we have to
|
||||
* use transfer_pool, not transfer_pool_unsync. Freeing an object into a
|
||||
* different pool is allowed, however.
|
||||
*/
|
||||
slab_free(&ice->transfer_pool, map);
|
||||
if (xfer->usage & PIPE_MAP_THREAD_SAFE) {
|
||||
free(map);
|
||||
} else {
|
||||
/* transfer_unmap is called from the driver thread, so we have to use
|
||||
* transfer_pool, not transfer_pool_unsync. Freeing an object into a
|
||||
* different pool is allowed, however.
|
||||
*/
|
||||
slab_free(&ice->transfer_pool, map);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -299,6 +299,7 @@ iris_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
|
|||
case PIPE_CAP_IMAGE_STORE_FORMATTED:
|
||||
case PIPE_CAP_LEGACY_MATH_RULES:
|
||||
case PIPE_CAP_ALPHA_TO_COVERAGE_DITHER_CONTROL:
|
||||
case PIPE_CAP_MAP_UNSYNCHRONIZED_THREAD_SAFE:
|
||||
return true;
|
||||
case PIPE_CAP_UMA:
|
||||
return iris_bufmgr_vram_size(screen->bufmgr) == 0;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue