From 758bf5f7648320eb58e80854074f29088c788e73 Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Wed, 5 Apr 2023 15:41:05 -0700 Subject: [PATCH] iris: Allocate coherent buffers for resources flagged as persistent/coherent MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If the application requests a coherent resource, we should honor that. We technically don't need to ensure coherency for persistent mappings, but we would have to handle PIPE_BARRIER_MAPPED_BUFFER to ensure that data became visible at the right times. Instead, we just opt for the easy plan and mark them coherent too. Reviewed-by: José Roberto de Souza Part-of: --- src/gallium/drivers/iris/iris_resource.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gallium/drivers/iris/iris_resource.c b/src/gallium/drivers/iris/iris_resource.c index a77cadcccd2..17003c5707c 100644 --- a/src/gallium/drivers/iris/iris_resource.c +++ b/src/gallium/drivers/iris/iris_resource.c @@ -498,7 +498,7 @@ iris_resource_alloc_flags(const struct iris_screen *screen, if (templ->flags & (PIPE_RESOURCE_FLAG_MAP_COHERENT | PIPE_RESOURCE_FLAG_MAP_PERSISTENT)) - flags |= BO_ALLOC_SMEM; + flags |= BO_ALLOC_SMEM | BO_ALLOC_COHERENT; if (screen->devinfo->verx10 >= 125 && screen->devinfo->has_local_mem && isl_aux_usage_has_ccs(aux_usage)) {