summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLucas Stach <[email protected]>2019-09-16 15:07:07 +0200
committerLucas Stach <[email protected]>2019-10-18 10:12:07 +0000
commit024eaa7fec7300d0736f3782f09a9242a0e2586e (patch)
tree0dcfac427d2fc976607ecd225a053a80a3222708 /src
parent5f76d3cce88c907075d4472f2dc3fbacd1c4a83d (diff)
rbug: implement missing explicit sync related fence functions
Signed-off-by: Lucas Stach <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/gallium/auxiliary/driver_rbug/rbug_context.c27
-rw-r--r--src/gallium/auxiliary/driver_rbug/rbug_screen.c11
2 files changed, 38 insertions, 0 deletions
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;