summaryrefslogtreecommitdiffstats
path: root/src/intel/vulkan/anv_formats.c
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2017-11-27 18:33:44 -0800
committerJason Ekstrand <[email protected]>2017-12-04 10:04:19 -0800
commitab18e8e59b6212003eb223d633070b3f9efd6e4d (patch)
tree45ce143c959748fea4ba21e21d6d21a6f2a3b83c /src/intel/vulkan/anv_formats.c
parent66dc61821576a16f118162ca979b404b388bce40 (diff)
anv: Implement VK_EXT_external_memory_dma_buf
This is a modified version of the patch originally sent by Chad Versace. The primary difference is that this version claims that OPQAUE_FD and DMA_BUF are compatible handle types. Reviewed-by: Dave Airlie <[email protected]> Reviewed-by: Chad Versace <[email protected]>
Diffstat (limited to 'src/intel/vulkan/anv_formats.c')
-rw-r--r--src/intel/vulkan/anv_formats.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/intel/vulkan/anv_formats.c b/src/intel/vulkan/anv_formats.c
index 810f26cc750..4075ae8e620 100644
--- a/src/intel/vulkan/anv_formats.c
+++ b/src/intel/vulkan/anv_formats.c
@@ -866,9 +866,11 @@ static const VkExternalMemoryPropertiesKHR prime_fd_props = {
VK_EXTERNAL_MEMORY_FEATURE_IMPORTABLE_BIT_KHR,
/* For the moment, let's not support mixing and matching */
.exportFromImportedHandleTypes =
- VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT_KHR,
+ VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT_KHR |
+ VK_EXTERNAL_MEMORY_HANDLE_TYPE_DMA_BUF_BIT_EXT,
.compatibleHandleTypes =
- VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT_KHR,
+ VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT_KHR |
+ VK_EXTERNAL_MEMORY_HANDLE_TYPE_DMA_BUF_BIT_EXT,
};
VkResult anv_GetPhysicalDeviceImageFormatProperties2KHR(
@@ -923,6 +925,7 @@ VkResult anv_GetPhysicalDeviceImageFormatProperties2KHR(
if (external_info && external_info->handleType != 0) {
switch (external_info->handleType) {
case VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT_KHR:
+ case VK_EXTERNAL_MEMORY_HANDLE_TYPE_DMA_BUF_BIT_EXT:
if (external_props)
external_props->externalMemoryProperties = prime_fd_props;
break;
@@ -1005,6 +1008,7 @@ void anv_GetPhysicalDeviceExternalBufferPropertiesKHR(
switch (pExternalBufferInfo->handleType) {
case VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT_KHR:
+ case VK_EXTERNAL_MEMORY_HANDLE_TYPE_DMA_BUF_BIT_EXT:
pExternalBufferProperties->externalMemoryProperties = prime_fd_props;
return;
default: