diff options
author | Sinclair Yeh <[email protected]> | 2017-05-15 17:10:38 -0700 |
---|---|---|
committer | Brian Paul <[email protected]> | 2017-07-17 10:09:25 -0600 |
commit | d554f72c41e367d8f9b5f441c45853efd35a162b (patch) | |
tree | 8ed010b10998e26d39f5f462353546d1f20aef81 /src/gallium/winsys/svga/drm/vmw_screen_svga.c | |
parent | 56a6e890f32a51c91fa4feb78dc5a1a22e8008d9 (diff) |
winsys/svga/drm: Connect winsys-side fence_* functions
Connect fence_get_fd, fence_create_fd, and fence_server_sync.
Implement the required functions in vmw_fence module.
Reviewed-by: Brian Paul <[email protected]>
Reviewed-by: Charmaine Lee <[email protected]>
Diffstat (limited to 'src/gallium/winsys/svga/drm/vmw_screen_svga.c')
-rw-r--r-- | src/gallium/winsys/svga/drm/vmw_screen_svga.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/gallium/winsys/svga/drm/vmw_screen_svga.c b/src/gallium/winsys/svga/drm/vmw_screen_svga.c index 46335378e0a..7c80642b377 100644 --- a/src/gallium/winsys/svga/drm/vmw_screen_svga.c +++ b/src/gallium/winsys/svga/drm/vmw_screen_svga.c @@ -32,6 +32,7 @@ * @author Jose Fonseca */ +#include <libsync.h> #include "svga_cmd.h" #include "svga3d_caps.h" @@ -132,6 +133,35 @@ vmw_svga_winsys_fence_finish(struct svga_winsys_screen *sws, } +static int +vmw_svga_winsys_fence_get_fd(struct svga_winsys_screen *sws, + struct pipe_fence_handle *fence, + boolean duplicate) +{ + if (duplicate) + return dup(vmw_fence_get_fd(fence)); + else + return vmw_fence_get_fd(fence); +} + + +static void +vmw_svga_winsys_fence_create_fd(struct svga_winsys_screen *sws, + struct pipe_fence_handle **fence, + int32_t fd) +{ + *fence = vmw_fence_create(NULL, 0, 0, 0, dup(fd)); +} + +static int +vmw_svga_winsys_fence_server_sync(struct svga_winsys_screen *sws, + int32_t *context_fd, + struct pipe_fence_handle *fence) +{ + return sync_accumulate("vmwgfx", context_fd, + sws->fence_get_fd(sws, fence, FALSE)); +} + static struct svga_winsys_surface * vmw_svga_winsys_surface_create(struct svga_winsys_screen *sws, @@ -435,6 +465,9 @@ vmw_winsys_screen_init_svga(struct vmw_winsys_screen *vws) vws->base.shader_create = vmw_svga_winsys_shader_create; vws->base.shader_destroy = vmw_svga_winsys_shader_destroy; vws->base.fence_finish = vmw_svga_winsys_fence_finish; + vws->base.fence_get_fd = vmw_svga_winsys_fence_get_fd; + vws->base.fence_create_fd = vmw_svga_winsys_fence_create_fd; + vws->base.fence_server_sync = vmw_svga_winsys_fence_server_sync; vws->base.query_create = vmw_svga_winsys_query_create; vws->base.query_init = vmw_svga_winsys_query_init; |