Use channel-based APIs to open devices
Implement vk_icdInitializeConnectToServiceCallback and use the callback
to connect to tracing, sysmem, and the driver, and pass those
connections to libmagma. This involves changing a bunch of APIs inside
anvil to take an anv_device_handle_t instead of an fd.
Test: go/magma-tps#L0 and termina_integration_tests on NUC
Bug: 13095
Change-Id: Ia7c470eb1b830bb49550428de10f3325827920a8
diff --git a/src/intel/common/BUILD.gn b/src/intel/common/BUILD.gn
index 61e88b0..d12efa8 100644
--- a/src/intel/common/BUILD.gn
+++ b/src/intel/common/BUILD.gn
@@ -53,6 +53,7 @@
"$mesa_build_root/src/util",
]
+ defines = ["ANV_MAGMA=1"]
if (is_fuchsia) {
deps += [
"$msd_intel_gen_build_root/include",
diff --git a/src/intel/common/gen_gem.h b/src/intel/common/gen_gem.h
index c4eed62..13a8544 100644
--- a/src/intel/common/gen_gem.h
+++ b/src/intel/common/gen_gem.h
@@ -71,6 +71,10 @@
return ret;
}
+#if defined(ANV_MAGMA)
+bool gen_getparam(uintptr_t handle, uint32_t param, int* value);
+#else
bool gen_getparam(int fd, uint32_t param, int *value);
+#endif
#endif /* GEN_GEM_H */
diff --git a/src/intel/common/gen_magma.c b/src/intel/common/gen_magma.c
index f16df68..d9b35e8 100644
--- a/src/intel/common/gen_magma.c
+++ b/src/intel/common/gen_magma.c
@@ -27,22 +27,21 @@
#include <magma.h>
#include <msd_intel_gen_query.h>
-bool
-gen_getparam(int fd, uint32_t param, int* value_out)
+bool gen_getparam(uintptr_t handle, uint32_t param, int* value_out)
{
magma_status_t status = MAGMA_STATUS_OK;
uint64_t value;
switch (param) {
case I915_PARAM_CHIPSET_ID:
- status = magma_query(fd, MAGMA_QUERY_DEVICE_ID, &value);
+ status = magma_query2(handle, MAGMA_QUERY_DEVICE_ID, &value);
break;
case I915_PARAM_SUBSLICE_TOTAL:
- status = magma_query(fd, kMsdIntelGenQuerySubsliceAndEuTotal, &value);
+ status = magma_query2(handle, kMsdIntelGenQuerySubsliceAndEuTotal, &value);
value >>= 32;
break;
case I915_PARAM_EU_TOTAL:
- status = magma_query(fd, kMsdIntelGenQuerySubsliceAndEuTotal, &value);
+ status = magma_query2(handle, kMsdIntelGenQuerySubsliceAndEuTotal, &value);
value = (uint32_t)value;
break;
case I915_PARAM_HAS_WAIT_TIMEOUT:
@@ -54,7 +53,7 @@
break;
case I915_PARAM_HAS_EXEC_SOFTPIN: {
// client driver manages GPU address space
- status = magma_query(fd, kMsdIntelGenQueryExtraPageCount, &value);
+ status = magma_query2(handle, kMsdIntelGenQueryExtraPageCount, &value);
break;
case I915_PARAM_REVISION:
value = 1;
diff --git a/src/intel/dev/BUILD.gn b/src/intel/dev/BUILD.gn
index dd7d2d2..1332e6e 100644
--- a/src/intel/dev/BUILD.gn
+++ b/src/intel/dev/BUILD.gn
@@ -40,4 +40,5 @@
public_deps = [
"$mesa_build_root/src/util",
]
+ defines = ["ANV_MAGMA=1"]
}
diff --git a/src/intel/dev/gen_device_info.c b/src/intel/dev/gen_device_info.c
index 7f7772f..dbef4a5 100644
--- a/src/intel/dev/gen_device_info.c
+++ b/src/intel/dev/gen_device_info.c
@@ -1199,8 +1199,7 @@
return true;
}
-static bool
-getparam(int fd, uint32_t param, int *value)
+static bool getparam(device_info_handle_t fd, uint32_t param, int* value)
{
return gen_getparam(fd, param, value);
}
@@ -1273,8 +1272,7 @@
* for gen8/gen9, SLICE_MASK/SUBSLICE_MASK can be used to compute the topology
* (kernel 4.13+)
*/
-static bool
-getparam_topology(struct gen_device_info *devinfo, int fd)
+static bool getparam_topology(struct gen_device_info* devinfo, device_info_handle_t fd)
{
int slice_mask = 0;
if (!getparam(fd, I915_PARAM_SLICE_MASK, &slice_mask))
@@ -1294,8 +1292,7 @@
/**
* preferred API for updating the topology in devinfo (kernel 4.17+)
*/
-static bool
-query_topology(struct gen_device_info *devinfo, int fd)
+static bool query_topology(struct gen_device_info* devinfo, device_info_handle_t fd)
{
struct drm_i915_query_item item = {
.query_id = DRM_I915_QUERY_TOPOLOGY_INFO,
@@ -1324,8 +1321,7 @@
}
-bool
-gen_get_device_info_from_fd(int fd, struct gen_device_info *devinfo)
+bool gen_get_device_info_from_fd(device_info_handle_t fd, struct gen_device_info* devinfo)
{
int devid = get_pci_device_id_override();
if (devid > 0) {
diff --git a/src/intel/dev/gen_device_info.h b/src/intel/dev/gen_device_info.h
index ea34468..a75456d 100644
--- a/src/intel/dev/gen_device_info.h
+++ b/src/intel/dev/gen_device_info.h
@@ -287,7 +287,13 @@
return (1000000000ull * gpu_timestamp) / devinfo->timestamp_frequency;
}
-bool gen_get_device_info_from_fd(int fh, struct gen_device_info *devinfo);
+#if defined(ANV_MAGMA)
+typedef uintptr_t device_info_handle_t;
+#else
+typedef int device_info_handle_t;
+#endif
+
+bool gen_get_device_info_from_fd(device_info_handle_t fd, struct gen_device_info* devinfo);
bool gen_get_device_info_from_pci_id(int pci_id,
struct gen_device_info *devinfo);
diff --git a/src/intel/vulkan/BUILD.gn b/src/intel/vulkan/BUILD.gn
index c46a6b8..ddde301 100644
--- a/src/intel/vulkan/BUILD.gn
+++ b/src/intel/vulkan/BUILD.gn
@@ -26,7 +26,7 @@
}
config("vulkan_internal_config") {
- defines = [ "ANV_MAGMA" ]
+ defines = [ "ANV_MAGMA=1" ]
include_dirs = [
".",
diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c
index 37b8cb1..2dca6b7 100644
--- a/src/intel/vulkan/anv_device.c
+++ b/src/intel/vulkan/anv_device.c
@@ -101,8 +101,7 @@
va_end(args);
}
-static uint64_t
-anv_compute_heap_size(int fd, uint64_t gtt_size)
+static uint64_t anv_compute_heap_size(anv_device_handle_t fd, uint64_t gtt_size)
{
/* Query the total ram from the system */
#if defined(__Fuchsia__)
@@ -131,8 +130,8 @@
return MIN2(available_ram, available_gtt);
}
-static VkResult
-anv_physical_device_init_heaps(struct anv_physical_device *device, int fd)
+static VkResult anv_physical_device_init_heaps(struct anv_physical_device* device,
+ anv_device_handle_t fd)
{
uint64_t gtt_size;
if (anv_gem_get_context_param(fd, 0, I915_CONTEXT_PARAM_GTT_SIZE,
@@ -407,14 +406,22 @@
const char *path = drm_device->nodes[DRM_NODE_RENDER];
#endif
VkResult result;
- int fd;
int master_fd = -1;
brw_process_intel_debug_variable();
+#if defined(ANV_MAGMA)
+ anv_device_handle_t fd;
+ result = anv_magma_open_device_handle(path, &fd);
+ if (result != VK_SUCCESS) {
+ return vk_error(result);
+ }
+#else
+ int fd;
fd = open(path, O_RDWR | O_CLOEXEC);
if (fd < 0)
return vk_error(VK_ERROR_INCOMPATIBLE_DRIVER);
+#endif
device->_loader_data.loaderMagic = ICD_LOADER_MAGIC;
device->instance = instance;
@@ -422,7 +429,7 @@
assert(strlen(path) < ARRAY_SIZE(device->path));
snprintf(device->path, ARRAY_SIZE(device->path), "%s", path);
- if (!gen_get_device_info_from_fd(fd, &device->info)) {
+ if (!gen_get_device_info_from_fd((device_info_handle_t)fd, &device->info)) {
result = vk_error(VK_ERROR_INCOMPATIBLE_DRIVER);
goto fail;
}
@@ -619,6 +626,11 @@
anv_physical_device_init_disk_cache(device);
if (instance->enabled_extensions.KHR_display) {
+#if defined(ANV_MAGMA)
+ result = vk_errorf(device->instance, device, VK_ERROR_INITIALIZATION_FAILED,
+ "Unsupported extension");
+ goto fail;
+#else
master_fd = open(primary_path, O_RDWR | O_CLOEXEC);
if (master_fd >= 0) {
/* prod the device with a GETPARAM call which will fail if
@@ -629,6 +641,7 @@
master_fd = -1;
}
}
+#endif
}
device->master_fd = master_fd;
@@ -642,13 +655,20 @@
anv_physical_device_get_supported_extensions(device,
&device->supported_extensions);
-
+#if defined(ANV_MAGMA)
+ device->magma_device = fd;
+#else
device->local_fd = fd;
+#endif
return VK_SUCCESS;
fail:
+#if defined(ANV_MAGMA)
+ anv_magma_release_device_handle(fd);
+#else
close(fd);
+#endif
if (master_fd != -1)
close(master_fd);
return result;
@@ -660,7 +680,11 @@
anv_finish_wsi(device);
anv_physical_device_free_disk_cache(device);
ralloc_free(device->compiler);
+#if defined(ANV_MAGMA)
+ anv_magma_release_device_handle(device->magma_device);
+#else
close(device->local_fd);
+#endif
if (device->master_fd >= 0)
close(device->master_fd);
}
@@ -2453,13 +2477,19 @@
device->alloc = *pAllocator;
else
device->alloc = physical_device->instance->alloc;
-
+#if defined(ANV_MAGMA)
+ result = anv_magma_open_device_handle(physical_device->path, &device->handle);
+ if (result != VK_SUCCESS) {
+ goto fail_device;
+ }
+#else
/* XXX(chadv): Can we dup() physicalDevice->fd here? */
device->fd = open(physical_device->path, O_RDWR | O_CLOEXEC);
if (device->fd == -1) {
result = vk_error(VK_ERROR_INITIALIZATION_FAILED);
goto fail_device;
}
+#endif
#if defined(ANV_MAGMA)
if (anv_gem_connect(device) != 0) {
@@ -2499,9 +2529,15 @@
* is returned.
*/
if (physical_device->has_context_priority) {
+#if defined(ANV_MAGMA)
+ int err =
+ anv_gem_set_context_param(device->handle, device->context_id, I915_CONTEXT_PARAM_PRIORITY,
+ vk_priority_to_gen(priority));
+#else
int err = anv_gem_set_context_param(device->fd, device->context_id,
I915_CONTEXT_PARAM_PRIORITY,
vk_priority_to_gen(priority));
+#endif
if (err != 0 && priority > VK_QUEUE_GLOBAL_PRIORITY_MEDIUM_EXT) {
result = vk_error(VK_ERROR_NOT_PERMITTED_EXT);
goto fail_fd;
@@ -2674,7 +2710,11 @@
fail_context_id:
anv_gem_destroy_context(device, device->context_id);
fail_fd:
- close(device->fd);
+#if defined(ANV_MAGMA)
+ anv_magma_release_device_handle(device->handle);
+#else
+ close(device->fd);
+#endif
fail_device:
vk_free(&device->alloc, device);
@@ -2742,7 +2782,11 @@
if (INTEL_DEBUG & DEBUG_BATCH)
gen_batch_decode_ctx_finish(&device->decoder_ctx);
+#if defined(ANV_MAGMA)
+ anv_magma_release_device_handle(device->handle);
+#else
close(device->fd);
+#endif
vk_free(&device->alloc, device);
}
diff --git a/src/intel/vulkan/anv_magma.c b/src/intel/vulkan/anv_magma.c
index fca51c6..c33b2bb 100644
--- a/src/intel/vulkan/anv_magma.c
+++ b/src/intel/vulkan/anv_magma.c
@@ -9,6 +9,16 @@
#include "magma_util/dlog.h"
#include "msd_intel_gen_query.h"
+#if defined(__linux__)
+#include <fcntl.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#endif
+
+#if defined(__Fuchsia__)
+#include <zircon/syscalls.h>
+#endif
+
static magma_connection_t magma_connection(struct anv_device* device)
{
assert(device);
@@ -25,7 +35,7 @@
int anv_gem_connect(struct anv_device* device)
{
magma_connection_t connection;
- magma_status_t status = magma_create_connection(device->fd, &connection);
+ magma_status_t status = magma_create_connection2((magma_device_t)device->handle, &connection);
if (status != MAGMA_STATUS_OK || !connection) {
DLOG("magma_create_connection failed: %d", status);
return -1;
@@ -144,10 +154,11 @@
return AnvMagmaConnectionIsBusy(device->connection, magma_get_buffer_id(magma_buffer(handle)));
}
-bool anv_gem_supports_48b_addresses(int fd)
+bool anv_gem_supports_48b_addresses(anv_device_handle_t handle)
{
uint64_t gtt_size;
- magma_status_t status = magma_query(fd, kMsdIntelGenQueryGttSize, >t_size);
+ magma_status_t status =
+ magma_query2((magma_device_t)handle, kMsdIntelGenQueryGttSize, >t_size);
if (status != MAGMA_STATUS_OK) {
DLOG("magma_query failed: %d", status);
return false;
@@ -155,12 +166,13 @@
return gtt_size >= 1ul << 48;
}
-int anv_gem_get_context_param(int fd, int context, uint32_t param, uint64_t* value)
+int anv_gem_get_context_param(anv_device_handle_t handle, int context, uint32_t param,
+ uint64_t* value)
{
magma_status_t status;
switch (param) {
case I915_CONTEXT_PARAM_GTT_SIZE:
- status = magma_query(fd, kMsdIntelGenQueryGttSize, value);
+ status = magma_query2((magma_device_t)handle, kMsdIntelGenQueryGttSize, value);
if (status != MAGMA_STATUS_OK) {
DLOG("magma_query failed: %d", status);
return -1;
@@ -185,15 +197,97 @@
return 0;
}
-int anv_gem_get_param(int fd, uint32_t param)
+#if VK_USE_PLATFORM_FUCHSIA
+typedef VkResult(VKAPI_PTR* PFN_vkGetServiceAddr)(const char* pName, uint32_t handle);
+
+static PFN_vkGetServiceAddr vulkan_lookup_func;
+static pthread_once_t tracing_initialize = PTHREAD_ONCE_INIT;
+
+static void initialize_tracing()
+{
+ uint32_t client_handle;
+ VkResult result =
+ anv_magma_connect_to_service("/svc/fuchsia.tracing.provider.Registry", &client_handle);
+ if (result != VK_SUCCESS) {
+ DLOG("Connecting to trace provider failed: %d", result);
+ return;
+ }
+ magma_status_t status = magma_initialize_tracing(client_handle);
+ if (status != MAGMA_STATUS_OK) {
+ DLOG("Initializing tracing failed: %d", status);
+ }
+}
+
+PUBLIC VKAPI_ATTR void VKAPI_CALL
+vk_icdInitializeConnectToServiceCallback(PFN_vkGetServiceAddr get_services_addr)
+{
+ vulkan_lookup_func = get_services_addr;
+
+ // Multiple loader instances may call this multiple times, but we only ever
+ // support initializing tracing once.
+ pthread_once(&tracing_initialize, &initialize_tracing);
+}
+
+VkResult anv_magma_connect_to_service(const char* path, uint32_t* client_handle_out)
+{
+ if (!vulkan_lookup_func) {
+ DLOG("No vulkan lookup function");
+ return VK_ERROR_INITIALIZATION_FAILED;
+ }
+ zx_handle_t client_handle, server_handle;
+ zx_status_t status = zx_channel_create(0, &client_handle, &server_handle);
+ if (status != ZX_OK) {
+ DLOG("Channel create failed: %d", status);
+ return VK_ERROR_INITIALIZATION_FAILED;
+ }
+ VkResult result = vulkan_lookup_func(path, server_handle);
+ if (result != VK_SUCCESS) {
+ return result;
+ }
+ *client_handle_out = client_handle;
+ return VK_SUCCESS;
+}
+#endif // VK_USE_PLATFORM_FUCHSIA
+
+VkResult anv_magma_open_device_handle(const char* path, anv_device_handle_t* device_out)
+{
+ magma_device_t device;
+#if defined(__Fuchsia__)
+ zx_handle_t client_handle;
+ VkResult result = anv_magma_connect_to_service(path, &client_handle);
+ if (result != VK_SUCCESS) {
+ return result;
+ }
+ if (magma_device_import(client_handle, &device) != MAGMA_STATUS_OK) {
+ return VK_ERROR_INCOMPATIBLE_DRIVER;
+ }
+#else
+ int fd;
+ fd = open(path, O_RDWR | O_CLOEXEC);
+ if (fd < 0)
+ return VK_ERROR_INCOMPATIBLE_DRIVER;
+ if (magma_device_import(fd, &device) != MAGMA_STATUS_OK) {
+ return VK_ERROR_INCOMPATIBLE_DRIVER;
+ }
+#endif
+ *device_out = (anv_device_handle_t)device;
+ return VK_SUCCESS;
+}
+
+void anv_magma_release_device_handle(anv_device_handle_t device)
+{
+ magma_device_release((magma_device_t)device);
+}
+
+int anv_gem_get_param(anv_device_handle_t fd, uint32_t param)
{
int value;
- if (!gen_getparam(fd, param, &value))
+ if (!gen_getparam((uintptr_t)fd, param, &value))
return 0;
return value;
}
-bool anv_gem_get_bit6_swizzle(int fd, uint32_t tiling)
+bool anv_gem_get_bit6_swizzle(anv_device_handle_t fd, uint32_t tiling)
{
DLOG("anv_gem_get_bit6_swizzle - STUB");
return 0;
@@ -213,7 +307,7 @@
return 0;
}
-int anv_gem_get_aperture(int fd, uint64_t* size)
+int anv_gem_get_aperture(anv_device_handle_t fd, uint64_t* size)
{
DLOG("anv_gem_get_aperture - STUB");
return 0;
@@ -388,7 +482,7 @@
#endif // VK_USE_PLATFORM_FUCHSIA
-bool anv_gem_supports_syncobj_wait(int fd) { return true; }
+bool anv_gem_supports_syncobj_wait(anv_device_handle_t fd) { return true; }
anv_syncobj_handle_t anv_gem_syncobj_create(struct anv_device* device, uint32_t flags)
{
@@ -489,10 +583,11 @@
return -1;
}
-int anv_gem_set_context_param(int fd, int context, uint32_t param, uint64_t value)
+int anv_gem_set_context_param(anv_device_handle_t handle, int context, uint32_t param,
+ uint64_t value)
{
assert(false);
return -1;
}
-bool anv_gem_has_context_priority(int fd) { return false; }
+bool anv_gem_has_context_priority(anv_device_handle_t fd) { return false; }
diff --git a/src/intel/vulkan/anv_magma.h b/src/intel/vulkan/anv_magma.h
index c225391..3e7f8b6 100644
--- a/src/intel/vulkan/anv_magma.h
+++ b/src/intel/vulkan/anv_magma.h
@@ -11,6 +11,7 @@
#include "magma.h"
#include <stdio.h>
+#include <vulkan/vulkan.h>
#if DEBUG
#define ANV_MAGMA_DRET(ret) (ret == 0 ? ret : anv_magma_dret(__FILE__, __LINE__, ret))
@@ -58,6 +59,8 @@
return ret;
}
+VkResult anv_magma_connect_to_service(const char* path, uint32_t* client_handle_out);
+
#ifdef __cplusplus
} // extern "C"
#endif
diff --git a/src/intel/vulkan/anv_magma_connection.cc b/src/intel/vulkan/anv_magma_connection.cc
index eff8782..cdb4597 100644
--- a/src/intel/vulkan/anv_magma_connection.cc
+++ b/src/intel/vulkan/anv_magma_connection.cc
@@ -78,7 +78,12 @@
magma_status_t GetSysmemConnection(magma_sysmem_connection_t* sysmem_connection_out)
{
if (!sysmem_connection_) {
- magma_status_t status = magma_sysmem_connection_create(&sysmem_connection_);
+ uint32_t client_handle;
+ VkResult result =
+ anv_magma_connect_to_service("/svc/fuchsia.sysmem.Allocator", &client_handle);
+ if (result != VK_SUCCESS)
+ return DRET(MAGMA_STATUS_INTERNAL_ERROR);
+ magma_status_t status = magma_sysmem_connection_import(client_handle, &sysmem_connection_);
if (status != MAGMA_STATUS_OK)
return DRET(status);
}
diff --git a/src/intel/vulkan/anv_private.h b/src/intel/vulkan/anv_private.h
index 81bfc84..9b337a0 100644
--- a/src/intel/vulkan/anv_private.h
+++ b/src/intel/vulkan/anv_private.h
@@ -590,8 +590,19 @@
return anv_multialloc_alloc(ma, alloc ? alloc : parent_alloc, scope);
}
+#if defined(ANV_MAGMA)
+// magma_buffer_t
typedef uintptr_t anv_buffer_handle_t;
+// magma_semaphore_t
typedef uintptr_t anv_syncobj_handle_t;
+// magma_device_t
+typedef void* anv_device_handle_t;
+#else
+// fds.
+typedef int anv_buffer_handle_t;
+typedef int anv_syncobj_handle_t;
+typedef int anv_device_handle_t;
+#endif
/* Extra ANV-defined BO flags which won't be passed to the kernel */
#define ANV_BO_UNCACHED (1ull << 30)
@@ -920,6 +931,11 @@
struct anv_bo_cache *cache,
struct anv_bo *bo);
+#if defined(ANV_MAGMA)
+VkResult anv_magma_open_device_handle(const char* path, anv_device_handle_t* device);
+void anv_magma_release_device_handle(anv_device_handle_t device);
+#endif
+
struct anv_memory_type {
/* Standard bits passed on to the client */
VkMemoryPropertyFlags propertyFlags;
@@ -1011,7 +1027,11 @@
struct disk_cache * disk_cache;
struct wsi_device wsi_device;
+#if defined(ANV_MAGMA)
+ anv_device_handle_t magma_device;
+#else
int local_fd;
+#endif
int master_fd;
};
@@ -1142,7 +1162,11 @@
struct gen_device_info info;
struct isl_device isl_dev;
int context_id;
+#if defined(ANV_MAGMA)
+ anv_device_handle_t handle;
+#else
int fd;
+#endif
bool can_chain_batches;
bool robust_buffer_access;
struct anv_device_extension_table enabled_extensions;
@@ -1281,16 +1305,16 @@
int anv_gem_set_tiling(struct anv_device* device, anv_buffer_handle_t gem_handle,
uint32_t stride, uint32_t tiling);
int anv_gem_create_context(struct anv_device *device);
-bool anv_gem_has_context_priority(int fd);
+bool anv_gem_has_context_priority(anv_device_handle_t fd);
int anv_gem_destroy_context(struct anv_device *device, int context);
-int anv_gem_set_context_param(int fd, int context, uint32_t param,
+int anv_gem_set_context_param(anv_device_handle_t handle, int context, uint32_t param,
uint64_t value);
-int anv_gem_get_context_param(int fd, int context, uint32_t param,
- uint64_t *value);
-int anv_gem_get_param(int fd, uint32_t param);
+int anv_gem_get_context_param(anv_device_handle_t handle, int context, uint32_t param,
+ uint64_t* value);
+int anv_gem_get_param(anv_device_handle_t fd, uint32_t param);
int anv_gem_get_tiling(struct anv_device *device, uint32_t gem_handle);
-bool anv_gem_get_bit6_swizzle(int fd, uint32_t tiling);
-int anv_gem_get_aperture(int fd, uint64_t *size);
+bool anv_gem_get_bit6_swizzle(anv_device_handle_t fd, uint32_t tiling);
+int anv_gem_get_aperture(anv_device_handle_t fd, uint64_t *size);
int anv_gem_gpu_get_reset_stats(struct anv_device *device,
uint32_t *active, uint32_t *pending);
int anv_gem_handle_to_fd(struct anv_device *device, anv_buffer_handle_t gem_handle);
@@ -1310,7 +1334,7 @@
int anv_gem_syncobj_import_sync_file(struct anv_device *device,
anv_syncobj_handle_t handle, int fd);
void anv_gem_syncobj_reset(struct anv_device *device, anv_syncobj_handle_t handle);
-bool anv_gem_supports_syncobj_wait(int fd);
+bool anv_gem_supports_syncobj_wait(anv_device_handle_t fd);
int anv_gem_syncobj_wait(struct anv_device *device,
anv_syncobj_handle_t *handles, uint32_t num_handles,
int64_t abs_timeout_ns, bool wait_all);