From 52ceb9dcb6f161295c28d37fa17dfe06d838fcaa Mon Sep 17 00:00:00 2001 From: Pierre-Eric Pelloux-Prayer Date: Mon, 21 Feb 2022 20:14:02 +0100 Subject: [PATCH] gallium/tc: warn if an app is incompatible with cpu_storage MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Instead of silently ignoring unmap calls. Reviewed-by: Marek Olšák Part-of: --- src/gallium/auxiliary/util/u_threaded_context.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/gallium/auxiliary/util/u_threaded_context.c b/src/gallium/auxiliary/util/u_threaded_context.c index ee4dba93537..87f75416f05 100644 --- a/src/gallium/auxiliary/util/u_threaded_context.c +++ b/src/gallium/auxiliary/util/u_threaded_context.c @@ -2459,6 +2459,13 @@ tc_buffer_unmap(struct pipe_context *_pipe, struct pipe_transfer *transfer) 0, tres->b.width0, tres->cpu_storage); /* This shouldn't have been freed by buffer_subdata. */ assert(tres->cpu_storage); + } else { + static bool warned_once = false; + if (!warned_once) { + fprintf(stderr, "This application is incompatible with cpu_storage.\n"); + fprintf(stderr, "Use tc_max_cpu_storage_size=0 to disable it and report this issue to Mesa.\n"); + warned_once = true; + } } tc_drop_resource_reference(ttrans->staging);