From 024eaa7fec7300d0736f3782f09a9242a0e2586e Mon Sep 17 00:00:00 2001 From: Lucas Stach Date: Mon, 16 Sep 2019 15:07:07 +0200 Subject: [PATCH] rbug: implement missing explicit sync related fence functions Signed-off-by: Lucas Stach --- .../auxiliary/driver_rbug/rbug_context.c | 27 +++++++++++++++++++ .../auxiliary/driver_rbug/rbug_screen.c | 11 ++++++++ 2 files changed, 38 insertions(+) diff --git a/src/gallium/auxiliary/driver_rbug/rbug_context.c b/src/gallium/auxiliary/driver_rbug/rbug_context.c index f089765858d..20b6f9755b2 100644 --- a/src/gallium/auxiliary/driver_rbug/rbug_context.c +++ b/src/gallium/auxiliary/driver_rbug/rbug_context.c @@ -1004,6 +1004,31 @@ rbug_flush(struct pipe_context *_pipe, mtx_unlock(&rb_pipe->call_mutex); } +static void +rbug_create_fence_fd(struct pipe_context *_pipe, + struct pipe_fence_handle **fence, int fd, + enum pipe_fd_type type) +{ + struct rbug_context *rb_pipe = rbug_context(_pipe); + struct pipe_context *pipe = rb_pipe->pipe; + + mtx_lock(&rb_pipe->call_mutex); + pipe->create_fence_fd(pipe, fence, fd, type); + mtx_unlock(&rb_pipe->call_mutex); +} + +static void +rbug_fence_server_sync(struct pipe_context *_pipe, + struct pipe_fence_handle *fence) +{ + struct rbug_context *rb_pipe = rbug_context(_pipe); + struct pipe_context *pipe = rb_pipe->pipe; + + mtx_lock(&rb_pipe->call_mutex); + pipe->fence_server_sync(pipe, fence); + mtx_unlock(&rb_pipe->call_mutex); +} + static struct pipe_sampler_view * rbug_context_create_sampler_view(struct pipe_context *_pipe, struct pipe_resource *_resource, @@ -1256,6 +1281,8 @@ rbug_context_create(struct pipe_screen *_screen, struct pipe_context *pipe) rb_pipe->base.clear_render_target = rbug_clear_render_target; rb_pipe->base.clear_depth_stencil = rbug_clear_depth_stencil; rb_pipe->base.flush = rbug_flush; + rb_pipe->base.create_fence_fd = rbug_create_fence_fd; + rb_pipe->base.fence_server_sync = rbug_fence_server_sync; rb_pipe->base.create_sampler_view = rbug_context_create_sampler_view; rb_pipe->base.sampler_view_destroy = rbug_context_sampler_view_destroy; rb_pipe->base.create_surface = rbug_context_create_surface; diff --git a/src/gallium/auxiliary/driver_rbug/rbug_screen.c b/src/gallium/auxiliary/driver_rbug/rbug_screen.c index a85d4e60e5b..62ee8001767 100644 --- a/src/gallium/auxiliary/driver_rbug/rbug_screen.c +++ b/src/gallium/auxiliary/driver_rbug/rbug_screen.c @@ -314,6 +314,16 @@ rbug_screen_fence_finish(struct pipe_screen *_screen, return screen->fence_finish(screen, ctx, fence, timeout); } +static int +rbug_screen_fence_get_fd(struct pipe_screen *_screen, + struct pipe_fence_handle *fence) +{ + struct rbug_screen *rb_screen = rbug_screen(_screen); + struct pipe_screen *screen = rb_screen->screen; + + return screen->fence_get_fd(screen, fence); +} + bool rbug_enabled() { @@ -362,6 +372,7 @@ rbug_screen_create(struct pipe_screen *screen) rb_screen->base.flush_frontbuffer = rbug_screen_flush_frontbuffer; rb_screen->base.fence_reference = rbug_screen_fence_reference; rb_screen->base.fence_finish = rbug_screen_fence_finish; + rb_screen->base.fence_get_fd = rbug_screen_fence_get_fd; rb_screen->screen = screen; -- 2.30.2