vrend: mask out VIRGL_RENDERER_THREAD_SYNC early

So that it can be honored by all renderers.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
macos/master
Chia-I Wu 4 years ago
parent ccda76bb7d
commit 1d31f70369
  1. 5
      src/virglrenderer.c
  2. 9
      src/vrend_renderer.c

@ -42,6 +42,7 @@
#include "virgl_context.h" #include "virgl_context.h"
#include "virgl_resource.h" #include "virgl_resource.h"
#include "virgl_util.h"
struct global_state { struct global_state {
bool client_initialized; bool client_initialized;
@ -470,6 +471,10 @@ int virgl_renderer_init(void *cookie, int flags, struct virgl_renderer_callbacks
{ {
int ret; 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 || if (state.client_initialized && (state.cookie != cookie ||
state.flags != flags || state.flags != flags ||
state.cbs != cbs)) state.cbs != cbs))

@ -5766,7 +5766,6 @@ static bool do_wait(struct vrend_fence *fence, bool can_block)
return done; return done;
} }
#ifdef HAVE_EVENTFD_H
static void wait_sync(struct vrend_fence *fence) static void wait_sync(struct vrend_fence *fence)
{ {
do_wait(fence, /* can_block */ true); 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; struct virgl_gl_ctx_param ctx_params;
if (getenv("VIRGL_DISABLE_MT"))
return;
ctx_params.shared = true; ctx_params.shared = true;
ctx_params.major_ver = vrend_state.gl_major_ver; ctx_params.major_ver = vrend_state.gl_major_ver;
ctx_params.minor_ver = vrend_state.gl_minor_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); 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, static void vrend_debug_cb(UNUSED GLenum source, GLenum type, UNUSED GLuint id,
UNUSED GLenum severity, UNUSED GLsizei length, UNUSED GLenum severity, UNUSED GLsizei length,

Loading…
Cancel
Save