rbug: implement missing explicit sync related fence functions

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
This commit is contained in:
Lucas Stach 2019-09-16 15:07:07 +02:00 committed by Lucas Stach
parent 5f76d3cce8
commit 024eaa7fec
2 changed files with 38 additions and 0 deletions

View file

@ -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;

View file

@ -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;