diff --git a/src/venus/venus-protocol/vn_protocol_renderer.h b/src/venus/venus-protocol/vn_protocol_renderer.h index 7e14637..5cba4b5 100644 --- a/src/venus/venus-protocol/vn_protocol_renderer.h +++ b/src/venus/venus-protocol/vn_protocol_renderer.h @@ -1,4 +1,4 @@ -/* This file is generated by venus-protocol git-41236da2. */ +/* This file is generated by venus-protocol git-80f3b6be. */ /* * Copyright 2020 Google LLC diff --git a/src/venus/venus-protocol/vn_protocol_renderer_defines.h b/src/venus/venus-protocol/vn_protocol_renderer_defines.h index 6315480..b6ba1bb 100644 --- a/src/venus/venus-protocol/vn_protocol_renderer_defines.h +++ b/src/venus/venus-protocol/vn_protocol_renderer_defines.h @@ -326,6 +326,8 @@ typedef enum VkCommandTypeEXT { VK_COMMAND_TYPE_vkCmdDrawIndirectByteCountEXT_EXT = 186, VK_COMMAND_TYPE_vkGetMemoryFdKHR_EXT = 193, VK_COMMAND_TYPE_vkGetMemoryFdPropertiesKHR_EXT = 194, + VK_COMMAND_TYPE_vkImportFenceFdKHR_EXT = 238, + VK_COMMAND_TYPE_vkGetFenceFdKHR_EXT = 239, VK_COMMAND_TYPE_vkGetImageDrmFormatModifierPropertiesEXT_EXT = 187, VK_COMMAND_TYPE_vkCmdSetPatchControlPointsEXT_EXT = 233, VK_COMMAND_TYPE_vkCmdSetLogicOpEXT_EXT = 234, @@ -1549,6 +1551,21 @@ struct vn_command_vkGetPhysicalDeviceExternalFenceProperties { VkExternalFenceProperties* pExternalFenceProperties; }; +struct vn_command_vkGetFenceFdKHR { + VkDevice device; + const VkFenceGetFdInfoKHR* pGetFdInfo; + int* pFd; + + VkResult ret; +}; + +struct vn_command_vkImportFenceFdKHR { + VkDevice device; + const VkImportFenceFdInfoKHR* pImportFenceFdInfo; + + VkResult ret; +}; + struct vn_command_vkEnumeratePhysicalDeviceGroups { VkInstance instance; uint32_t* pPhysicalDeviceGroupCount; @@ -2281,6 +2298,8 @@ struct vn_dispatch_context { void (*dispatch_vkGetMemoryFdPropertiesKHR)(struct vn_dispatch_context *ctx, struct vn_command_vkGetMemoryFdPropertiesKHR *args); void (*dispatch_vkGetPhysicalDeviceExternalSemaphoreProperties)(struct vn_dispatch_context *ctx, struct vn_command_vkGetPhysicalDeviceExternalSemaphoreProperties *args); void (*dispatch_vkGetPhysicalDeviceExternalFenceProperties)(struct vn_dispatch_context *ctx, struct vn_command_vkGetPhysicalDeviceExternalFenceProperties *args); + void (*dispatch_vkGetFenceFdKHR)(struct vn_dispatch_context *ctx, struct vn_command_vkGetFenceFdKHR *args); + void (*dispatch_vkImportFenceFdKHR)(struct vn_dispatch_context *ctx, struct vn_command_vkImportFenceFdKHR *args); void (*dispatch_vkEnumeratePhysicalDeviceGroups)(struct vn_dispatch_context *ctx, struct vn_command_vkEnumeratePhysicalDeviceGroups *args); void (*dispatch_vkGetDeviceGroupPeerMemoryFeatures)(struct vn_dispatch_context *ctx, struct vn_command_vkGetDeviceGroupPeerMemoryFeatures *args); void (*dispatch_vkBindBufferMemory2)(struct vn_dispatch_context *ctx, struct vn_command_vkBindBufferMemory2 *args); diff --git a/src/venus/venus-protocol/vn_protocol_renderer_dispatches.h b/src/venus/venus-protocol/vn_protocol_renderer_dispatches.h index 9ecd781..aff50e2 100644 --- a/src/venus/venus-protocol/vn_protocol_renderer_dispatches.h +++ b/src/venus/venus-protocol/vn_protocol_renderer_dispatches.h @@ -280,12 +280,14 @@ static inline const char *vn_dispatch_command_name(VkCommandTypeEXT type) case VK_COMMAND_TYPE_vkMapMemory_EXT: return "vkMapMemory"; case VK_COMMAND_TYPE_vkGetMemoryFdKHR_EXT: return "vkGetMemoryFdKHR"; case VK_COMMAND_TYPE_vkGetMemoryFdPropertiesKHR_EXT: return "vkGetMemoryFdPropertiesKHR"; + case VK_COMMAND_TYPE_vkGetFenceFdKHR_EXT: return "vkGetFenceFdKHR"; + case VK_COMMAND_TYPE_vkImportFenceFdKHR_EXT: return "vkImportFenceFdKHR"; case VK_COMMAND_TYPE_vkUpdateDescriptorSetWithTemplate_EXT: return "vkUpdateDescriptorSetWithTemplate"; default: return "unknown"; } } -static void (*const vn_dispatch_table[238])(struct vn_dispatch_context *ctx, VkCommandFlagsEXT flags) = { +static void (*const vn_dispatch_table[240])(struct vn_dispatch_context *ctx, VkCommandFlagsEXT flags) = { [VK_COMMAND_TYPE_vkCreateInstance_EXT] = vn_dispatch_vkCreateInstance, [VK_COMMAND_TYPE_vkDestroyInstance_EXT] = vn_dispatch_vkDestroyInstance, [VK_COMMAND_TYPE_vkEnumeratePhysicalDevices_EXT] = vn_dispatch_vkEnumeratePhysicalDevices, @@ -532,7 +534,7 @@ static inline void vn_dispatch_command(struct vn_dispatch_context *ctx) #ifdef DEBUG TRACE_SCOPE_SLOW(vn_dispatch_command_name(cmd_type)); #endif - if (cmd_type < 238 && vn_dispatch_table[cmd_type]) + if (cmd_type < 240 && vn_dispatch_table[cmd_type]) vn_dispatch_table[cmd_type](ctx, cmd_flags); else vn_cs_decoder_set_fatal(ctx->decoder); diff --git a/src/venus/venus-protocol/vn_protocol_renderer_fence.h b/src/venus/venus-protocol/vn_protocol_renderer_fence.h index fb94b0c..e4cfac5 100644 --- a/src/venus/venus-protocol/vn_protocol_renderer_fence.h +++ b/src/venus/venus-protocol/vn_protocol_renderer_fence.h @@ -14,6 +14,12 @@ #pragma GCC diagnostic ignored "-Wpointer-arith" #pragma GCC diagnostic ignored "-Wunused-parameter" +/* + * These structs/unions/commands are not included + * + * vkGetFenceFdKHR + */ + /* struct VkExportFenceCreateInfo chain */ static inline void * diff --git a/src/venus/venus-protocol/vn_protocol_renderer_info.h b/src/venus/venus-protocol/vn_protocol_renderer_info.h index ab8ca2a..990cd90 100644 --- a/src/venus/venus-protocol/vn_protocol_renderer_info.h +++ b/src/venus/venus-protocol/vn_protocol_renderer_info.h @@ -12,7 +12,7 @@ struct vn_info_extension_table { union { - bool enabled[86]; + bool enabled[87]; struct { bool EXT_4444_formats; bool EXT_calibrated_timestamps; @@ -64,6 +64,7 @@ struct vn_info_extension_table { bool KHR_dynamic_rendering; bool KHR_external_fence; bool KHR_external_fence_capabilities; + bool KHR_external_fence_fd; bool KHR_external_memory; bool KHR_external_memory_capabilities; bool KHR_external_memory_fd; @@ -132,7 +133,7 @@ vn_info_extension_compare(const void *name, const void *ext) static inline const struct vn_info_extension * vn_info_extension_get(const char *name) { - static const struct vn_info_extension vn_info_extensions[86] = { + static const struct vn_info_extension vn_info_extensions[87] = { { 0, "VK_EXT_4444_formats", 1 }, { 1, "VK_EXT_calibrated_timestamps", 2 }, { 2, "VK_EXT_command_serialization", 0 }, @@ -183,45 +184,46 @@ vn_info_extension_get(const char *name) { 47, "VK_KHR_dynamic_rendering", 1 }, { 48, "VK_KHR_external_fence", 1 }, { 49, "VK_KHR_external_fence_capabilities", 1 }, - { 50, "VK_KHR_external_memory", 1 }, - { 51, "VK_KHR_external_memory_capabilities", 1 }, - { 52, "VK_KHR_external_memory_fd", 1 }, - { 53, "VK_KHR_external_semaphore", 1 }, - { 54, "VK_KHR_external_semaphore_capabilities", 1 }, - { 55, "VK_KHR_format_feature_flags2", 1 }, - { 56, "VK_KHR_get_memory_requirements2", 1 }, - { 57, "VK_KHR_get_physical_device_properties2", 2 }, - { 58, "VK_KHR_image_format_list", 1 }, - { 59, "VK_KHR_imageless_framebuffer", 1 }, - { 60, "VK_KHR_maintenance1", 2 }, - { 61, "VK_KHR_maintenance2", 1 }, - { 62, "VK_KHR_maintenance3", 1 }, - { 63, "VK_KHR_maintenance4", 2 }, - { 64, "VK_KHR_multiview", 1 }, - { 65, "VK_KHR_relaxed_block_layout", 1 }, - { 66, "VK_KHR_sampler_mirror_clamp_to_edge", 3 }, - { 67, "VK_KHR_sampler_ycbcr_conversion", 14 }, - { 68, "VK_KHR_separate_depth_stencil_layouts", 1 }, - { 69, "VK_KHR_shader_atomic_int64", 1 }, - { 70, "VK_KHR_shader_draw_parameters", 1 }, - { 71, "VK_KHR_shader_float16_int8", 1 }, - { 72, "VK_KHR_shader_float_controls", 4 }, - { 73, "VK_KHR_shader_integer_dot_product", 1 }, - { 74, "VK_KHR_shader_non_semantic_info", 1 }, - { 75, "VK_KHR_shader_subgroup_extended_types", 1 }, - { 76, "VK_KHR_shader_terminate_invocation", 1 }, - { 77, "VK_KHR_spirv_1_4", 1 }, - { 78, "VK_KHR_storage_buffer_storage_class", 1 }, - { 79, "VK_KHR_synchronization2", 1 }, - { 80, "VK_KHR_timeline_semaphore", 2 }, - { 81, "VK_KHR_uniform_buffer_standard_layout", 1 }, - { 82, "VK_KHR_variable_pointers", 1 }, - { 83, "VK_KHR_vulkan_memory_model", 3 }, - { 84, "VK_KHR_zero_initialize_workgroup_memory", 1 }, - { 85, "VK_MESA_venus_protocol", 100000 }, + { 50, "VK_KHR_external_fence_fd", 1 }, + { 51, "VK_KHR_external_memory", 1 }, + { 52, "VK_KHR_external_memory_capabilities", 1 }, + { 53, "VK_KHR_external_memory_fd", 1 }, + { 54, "VK_KHR_external_semaphore", 1 }, + { 55, "VK_KHR_external_semaphore_capabilities", 1 }, + { 56, "VK_KHR_format_feature_flags2", 1 }, + { 57, "VK_KHR_get_memory_requirements2", 1 }, + { 58, "VK_KHR_get_physical_device_properties2", 2 }, + { 59, "VK_KHR_image_format_list", 1 }, + { 60, "VK_KHR_imageless_framebuffer", 1 }, + { 61, "VK_KHR_maintenance1", 2 }, + { 62, "VK_KHR_maintenance2", 1 }, + { 63, "VK_KHR_maintenance3", 1 }, + { 64, "VK_KHR_maintenance4", 2 }, + { 65, "VK_KHR_multiview", 1 }, + { 66, "VK_KHR_relaxed_block_layout", 1 }, + { 67, "VK_KHR_sampler_mirror_clamp_to_edge", 3 }, + { 68, "VK_KHR_sampler_ycbcr_conversion", 14 }, + { 69, "VK_KHR_separate_depth_stencil_layouts", 1 }, + { 70, "VK_KHR_shader_atomic_int64", 1 }, + { 71, "VK_KHR_shader_draw_parameters", 1 }, + { 72, "VK_KHR_shader_float16_int8", 1 }, + { 73, "VK_KHR_shader_float_controls", 4 }, + { 74, "VK_KHR_shader_integer_dot_product", 1 }, + { 75, "VK_KHR_shader_non_semantic_info", 1 }, + { 76, "VK_KHR_shader_subgroup_extended_types", 1 }, + { 77, "VK_KHR_shader_terminate_invocation", 1 }, + { 78, "VK_KHR_spirv_1_4", 1 }, + { 79, "VK_KHR_storage_buffer_storage_class", 1 }, + { 80, "VK_KHR_synchronization2", 1 }, + { 81, "VK_KHR_timeline_semaphore", 2 }, + { 82, "VK_KHR_uniform_buffer_standard_layout", 1 }, + { 83, "VK_KHR_variable_pointers", 1 }, + { 84, "VK_KHR_vulkan_memory_model", 3 }, + { 85, "VK_KHR_zero_initialize_workgroup_memory", 1 }, + { 86, "VK_MESA_venus_protocol", 100000 }, }; - return bsearch(name, vn_info_extensions, 86, + return bsearch(name, vn_info_extensions, 87, sizeof(*vn_info_extensions), vn_info_extension_compare); } diff --git a/src/venus/venus-protocol/vn_protocol_renderer_transport.h b/src/venus/venus-protocol/vn_protocol_renderer_transport.h index 641f2ab..0b1b2c2 100644 --- a/src/venus/venus-protocol/vn_protocol_renderer_transport.h +++ b/src/venus/venus-protocol/vn_protocol_renderer_transport.h @@ -19,6 +19,7 @@ * * vkGetMemoryFdKHR * vkGetMemoryFdPropertiesKHR + * vkImportFenceFdKHR */ /* struct VkCalibratedTimestampInfoEXT chain */ diff --git a/src/venus/venus-protocol/vn_protocol_renderer_util.h b/src/venus/venus-protocol/vn_protocol_renderer_util.h index 76e0e08..d49fd8e 100644 --- a/src/venus/venus-protocol/vn_protocol_renderer_util.h +++ b/src/venus/venus-protocol/vn_protocol_renderer_util.h @@ -180,6 +180,7 @@ struct vn_device_proc_table { PFN_vkGetDeviceQueue GetDeviceQueue; PFN_vkGetDeviceQueue2 GetDeviceQueue2; PFN_vkGetEventStatus GetEventStatus; + PFN_vkGetFenceFdKHR GetFenceFdKHR; PFN_vkGetFenceStatus GetFenceStatus; PFN_vkGetImageDrmFormatModifierPropertiesEXT GetImageDrmFormatModifierPropertiesEXT; PFN_vkGetImageMemoryRequirements GetImageMemoryRequirements; @@ -194,6 +195,7 @@ struct vn_device_proc_table { PFN_vkGetQueryPoolResults GetQueryPoolResults; PFN_vkGetRenderAreaGranularity GetRenderAreaGranularity; PFN_vkGetSemaphoreCounterValue GetSemaphoreCounterValue; + PFN_vkImportFenceFdKHR ImportFenceFdKHR; PFN_vkInvalidateMappedMemoryRanges InvalidateMappedMemoryRanges; PFN_vkMapMemory MapMemory; PFN_vkMergePipelineCaches MergePipelineCaches; @@ -582,6 +584,9 @@ vn_util_init_device_proc_table(VkDevice dev, api_version >= VK_API_VERSION_1_1 ? VN_GDPA(dev, vkGetDeviceQueue2) : NULL; proc_table->GetEventStatus = VN_GDPA(dev, vkGetEventStatus); + proc_table->GetFenceFdKHR = + ext_table->KHR_external_fence_fd ? VN_GDPA(dev, vkGetFenceFdKHR) : + NULL; proc_table->GetFenceStatus = VN_GDPA(dev, vkGetFenceStatus); proc_table->GetImageDrmFormatModifierPropertiesEXT = ext_table->EXT_image_drm_format_modifier ? VN_GDPA(dev, vkGetImageDrmFormatModifierPropertiesEXT) : @@ -614,6 +619,9 @@ vn_util_init_device_proc_table(VkDevice dev, api_version >= VK_API_VERSION_1_2 ? VN_GDPA(dev, vkGetSemaphoreCounterValue) : ext_table->KHR_timeline_semaphore ? VN_GDPA(dev, vkGetSemaphoreCounterValueKHR) : NULL; + proc_table->ImportFenceFdKHR = + ext_table->KHR_external_fence_fd ? VN_GDPA(dev, vkImportFenceFdKHR) : + NULL; proc_table->InvalidateMappedMemoryRanges = VN_GDPA(dev, vkInvalidateMappedMemoryRanges); proc_table->MapMemory = VN_GDPA(dev, vkMapMemory); proc_table->MergePipelineCaches = VN_GDPA(dev, vkMergePipelineCaches);