From 5cce02325cae6a927af57d1a425badc8e8985c51 Mon Sep 17 00:00:00 2001 From: Christian Gmeiner Date: Sun, 19 Jun 2022 14:44:37 +0200 Subject: [PATCH] ir3: Create at least one thread for async shader compile On a single core CPU system we end with num_threads being 0 and we do _NOT_ create any async compile threads in util_queue_init(..). Signed-off-by: Christian Gmeiner Reviewed-by: Rob Clark Part-of: --- src/gallium/drivers/freedreno/ir3/ir3_gallium.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/gallium/drivers/freedreno/ir3/ir3_gallium.c b/src/gallium/drivers/freedreno/ir3/ir3_gallium.c index 2f40df2..4e089b0 100644 --- a/src/gallium/drivers/freedreno/ir3/ir3_gallium.c +++ b/src/gallium/drivers/freedreno/ir3/ir3_gallium.c @@ -558,6 +558,9 @@ ir3_screen_init(struct pipe_screen *pscreen) */ unsigned num_threads = sysconf(_SC_NPROCESSORS_ONLN) - 1; + /* Create at least one thread - even on single core CPU systems. */ + num_threads = MAX2(1, num_threads); + util_queue_init(&screen->compile_queue, "ir3q", 64, num_threads, UTIL_QUEUE_INIT_RESIZE_IF_FULL | UTIL_QUEUE_INIT_SET_FULL_THREAD_AFFINITY, NULL); -- 2.7.4