From 8559fa505d5972bbbcca4b90c31da4788162b845 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Fri, 24 Mar 2017 01:57:40 +0100 Subject: [PATCH] gallium: add flag PIPE_CONTEXT_PREFER_THREADED MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit State trackers can set this to tell the driver when u_threaded_context is desirable. Reviewed-by: Nicolai Hähnle Tested-by: Dieter Nützel --- src/gallium/include/pipe/p_defines.h | 8 ++++++++ src/mesa/state_tracker/st_manager.c | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/gallium/include/pipe/p_defines.h b/src/gallium/include/pipe/p_defines.h index 82b9d9c08a4..aafa4f82f5a 100644 --- a/src/gallium/include/pipe/p_defines.h +++ b/src/gallium/include/pipe/p_defines.h @@ -383,6 +383,14 @@ enum pipe_flush_flags */ #define PIPE_CONTEXT_ROBUST_BUFFER_ACCESS (1 << 2) +/** + * Prefer threaded pipe_context. It also implies that video codec functions + * will not be used. (they will be either no-ops or NULL when threading is + * enabled) + */ +#define PIPE_CONTEXT_PREFER_THREADED (1 << 3) + + /** * Flags for pipe_context::memory_barrier. */ diff --git a/src/mesa/state_tracker/st_manager.c b/src/mesa/state_tracker/st_manager.c index 41de5967eaa..3178e25a763 100644 --- a/src/mesa/state_tracker/st_manager.c +++ b/src/mesa/state_tracker/st_manager.c @@ -647,7 +647,7 @@ st_api_create_context(struct st_api *stapi, struct st_manager *smapi, struct pipe_context *pipe; struct gl_config mode; gl_api api; - unsigned ctx_flags = 0; + unsigned ctx_flags = PIPE_CONTEXT_PREFER_THREADED; if (!(stapi->profile_mask & (1 << attribs->profile))) return NULL; -- 2.30.2