summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/virgl/virgl_screen.c
diff options
context:
space:
mode:
authorRobert Foss <[email protected]>2016-08-29 23:13:45 +0000
committerRobert Foss <[email protected]>2018-11-16 14:41:57 +0100
commitd1a1c21e7621b5177febf191fcd3d3b8ef69dc96 (patch)
treef6d05d201f9f4125a9c5d0bb6039fec8ba495058 /src/gallium/drivers/virgl/virgl_screen.c
parent0db898cef2f5a455138e5845689c075aadba1c1f (diff)
virgl: native fence fd support
Following the support for fences on the virtio driver add support for native fence on virgl. This was somewhat based on the freedeno one. Signed-off-by: Gustavo Padovan <[email protected]> Signed-off-by: Robert Foss <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
Diffstat (limited to 'src/gallium/drivers/virgl/virgl_screen.c')
-rw-r--r--src/gallium/drivers/virgl/virgl_screen.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/gallium/drivers/virgl/virgl_screen.c b/src/gallium/drivers/virgl/virgl_screen.c
index e71883b06f1..8addbea9e4c 100644
--- a/src/gallium/drivers/virgl/virgl_screen.c
+++ b/src/gallium/drivers/virgl/virgl_screen.c
@@ -340,7 +340,7 @@ virgl_get_param(struct pipe_screen *screen, enum pipe_cap param)
case PIPE_CAP_VIDEO_MEMORY:
return 0;
case PIPE_CAP_NATIVE_FENCE_FD:
- return 0;
+ return !!vscreen->vws->supports_fences;
default:
return u_pipe_screen_get_param_defaults(screen, param);
}
@@ -721,6 +721,15 @@ static boolean virgl_fence_finish(struct pipe_screen *screen,
return vws->fence_wait(vws, fence, timeout);
}
+static int virgl_fence_get_fd(struct pipe_screen *screen,
+ struct pipe_fence_handle *fence)
+{
+ struct virgl_screen *vscreen = virgl_screen(screen);
+ struct virgl_winsys *vws = vscreen->vws;
+
+ return vws->fence_get_fd(vws, fence);
+}
+
static uint64_t
virgl_get_timestamp(struct pipe_screen *_screen)
{
@@ -765,6 +774,7 @@ virgl_create_screen(struct virgl_winsys *vws)
screen->base.fence_reference = virgl_fence_reference;
//screen->base.fence_signalled = virgl_fence_signalled;
screen->base.fence_finish = virgl_fence_finish;
+ screen->base.fence_get_fd = virgl_fence_get_fd;
virgl_init_screen_resource_functions(&screen->base);