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,
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;
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()
{
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;