From 1d31f703691c4f4f28a01464285d69f00ec07931 Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Tue, 6 Oct 2020 11:15:20 -0700 Subject: [PATCH] vrend: mask out VIRGL_RENDERER_THREAD_SYNC early So that it can be honored by all renderers. Signed-off-by: Chia-I Wu Reviewed-by: Gert Wollny --- src/virglrenderer.c | 5 +++++ src/vrend_renderer.c | 9 --------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/src/virglrenderer.c b/src/virglrenderer.c index f6f3578..59d3e7b 100644 --- a/src/virglrenderer.c +++ b/src/virglrenderer.c @@ -42,6 +42,7 @@ #include "virgl_context.h" #include "virgl_resource.h" +#include "virgl_util.h" struct global_state { bool client_initialized; @@ -470,6 +471,10 @@ int virgl_renderer_init(void *cookie, int flags, struct virgl_renderer_callbacks { int ret; + /* VIRGL_RENDERER_THREAD_SYNC is a hint and can be silently ignored */ + if (!has_eventfd() || getenv("VIRGL_DISABLE_MT")) + flags &= ~VIRGL_RENDERER_THREAD_SYNC; + if (state.client_initialized && (state.cookie != cookie || state.flags != flags || state.cbs != cbs)) diff --git a/src/vrend_renderer.c b/src/vrend_renderer.c index f104ba8..6c74d4d 100644 --- a/src/vrend_renderer.c +++ b/src/vrend_renderer.c @@ -5766,7 +5766,6 @@ static bool do_wait(struct vrend_fence *fence, bool can_block) return done; } -#ifdef HAVE_EVENTFD_H static void wait_sync(struct vrend_fence *fence) { do_wait(fence, /* can_block */ true); @@ -5816,9 +5815,6 @@ static void vrend_renderer_use_threaded_sync(void) { struct virgl_gl_ctx_param ctx_params; - if (getenv("VIRGL_DISABLE_MT")) - return; - ctx_params.shared = true; ctx_params.major_ver = vrend_state.gl_major_ver; ctx_params.minor_ver = vrend_state.gl_minor_ver; @@ -5850,11 +5846,6 @@ static void vrend_renderer_use_threaded_sync(void) pipe_mutex_destroy(vrend_state.fence_mutex); } } -#else -static void vrend_renderer_use_threaded_sync(void) -{ -} -#endif static void vrend_debug_cb(UNUSED GLenum source, GLenum type, UNUSED GLuint id, UNUSED GLenum severity, UNUSED GLsizei length,