vkr: let vkr_device to track device entry point get_memory_fd

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
macos/master
Yiwei Zhang 3 years ago
parent 7fc9dbf3bb
commit 356042291c
  1. 16
      src/venus/vkr_context.c
  2. 2
      src/venus/vkr_device.c
  3. 1
      src/venus/vkr_device.h
  4. 2
      src/venus/vkr_instance.c
  5. 1
      src/venus/vkr_instance.h

@ -322,14 +322,14 @@ vkr_context_get_blob_locked(struct virgl_context *base,
return -EINVAL;
}
VkResult result = ctx->instance->get_memory_fd(
mem->device->base.handle.device,
&(VkMemoryGetFdInfoKHR){
.sType = VK_STRUCTURE_TYPE_MEMORY_GET_FD_INFO_KHR,
.memory = mem->base.handle.device_memory,
.handleType = handle_type,
},
&fd);
VkResult result =
mem->device->get_memory_fd(mem->device->base.handle.device,
&(VkMemoryGetFdInfoKHR){
.sType = VK_STRUCTURE_TYPE_MEMORY_GET_FD_INFO_KHR,
.memory = mem->base.handle.device_memory,
.handleType = handle_type,
},
&fd);
if (result != VK_SUCCESS)
return -EINVAL;
}

@ -139,6 +139,8 @@ vkr_device_init_entry_points(struct vkr_device *dev, uint32_t api_version)
(PFN_vkGetImageDrmFormatModifierPropertiesEXT)vkGetDeviceProcAddr(
handle, "vkGetImageDrmFormatModifierPropertiesEXT");
dev->get_memory_fd =
(PFN_vkGetMemoryFdKHR)vkGetDeviceProcAddr(handle, "vkGetMemoryFdKHR");
dev->get_memory_fd_properties = (PFN_vkGetMemoryFdPropertiesKHR)vkGetDeviceProcAddr(
handle, "vkGetMemoryFdPropertiesKHR");
}

@ -39,6 +39,7 @@ struct vkr_device {
PFN_vkGetImageDrmFormatModifierPropertiesEXT get_image_drm_format_modifier_properties;
PFN_vkGetMemoryFdKHR get_memory_fd;
PFN_vkGetMemoryFdPropertiesKHR get_memory_fd_properties;
struct list_head queues;

@ -196,8 +196,6 @@ vkr_dispatch_vkCreateInstance(struct vn_dispatch_context *dispatch,
return;
}
instance->get_memory_fd = (PFN_vkGetMemoryFdKHR)vkGetInstanceProcAddr(
instance->base.handle.instance, "vkGetMemoryFdKHR");
instance->get_fence_fd = (PFN_vkGetFenceFdKHR)vkGetInstanceProcAddr(
instance->base.handle.instance, "vkGetFenceFdKHR");

@ -14,7 +14,6 @@ struct vkr_instance {
uint32_t api_version;
PFN_vkCreateDebugUtilsMessengerEXT create_debug_utils_messenger;
PFN_vkDestroyDebugUtilsMessengerEXT destroy_debug_utils_messenger;
PFN_vkGetMemoryFdKHR get_memory_fd;
PFN_vkGetFenceFdKHR get_fence_fd;
VkDebugUtilsMessengerEXT validation_messenger;

Loading…
Cancel
Save