virgl: add assert and missing function parameter
authorRobert Foss <robert.foss@collabora.com>
Tue, 20 Nov 2018 15:38:27 +0000 (16:38 +0100)
committerRobert Foss <robert.foss@collabora.com>
Wed, 21 Nov 2018 14:59:00 +0000 (15:59 +0100)
Verify the pipe_fd_type to be of PIPE_FD_TYPE_NATIVE_SYNC.

Fixes: d1a1c21e7621b5177feb "virgl: native fence fd support"
Suggested-by: Eric Engestrom <eric.engestrom@intel.com>
Signed-off-by: Robert Foss <robert.foss@collabora.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
src/gallium/drivers/virgl/virgl_context.c

index 9be7775abd3178d4b6250c8141d3bde41a24ef9e..892fef76c7584b58b204789cbb798098af71f4df 100644 (file)
@@ -1030,8 +1030,11 @@ static void virgl_set_shader_buffers(struct pipe_context *ctx,
 }
 
 static void virgl_create_fence_fd(struct pipe_context *ctx,
-                               struct pipe_fence_handle **fence, int fd)
+                                  struct pipe_fence_handle **fence,
+                                  int fd,
+                                  enum pipe_fd_type type)
 {
+   assert(type == PIPE_FD_TYPE_NATIVE_SYNC);
    struct virgl_screen *rs = virgl_screen(ctx->screen);
 
    *fence = rs->vws->cs_create_fence(rs->vws, fd);