diff --git a/src/gallium/drivers/iris/iris_resource.c b/src/gallium/drivers/iris/iris_resource.c index 845cd4f9dd8..a544fa7537d 100644 --- a/src/gallium/drivers/iris/iris_resource.c +++ b/src/gallium/drivers/iris/iris_resource.c @@ -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); + } } /** diff --git a/src/gallium/drivers/iris/iris_screen.c b/src/gallium/drivers/iris/iris_screen.c index c7c39bff0da..933cf95c099 100644 --- a/src/gallium/drivers/iris/iris_screen.c +++ b/src/gallium/drivers/iris/iris_screen.c @@ -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;