anv: Drop support for VK_KHX_external_semaphore_*
These have been formally deprecated by Khronos never to be shipped again. The KHR versions should be implemented/used instead. Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com> Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
This commit is contained in:
parent
4ac94d0dee
commit
dc179aa123
|
@ -437,10 +437,6 @@ static const VkExtensionProperties global_extensions[] = {
|
||||||
.specVersion = 6,
|
.specVersion = 6,
|
||||||
},
|
},
|
||||||
#endif
|
#endif
|
||||||
{
|
|
||||||
.extensionName = VK_KHX_EXTERNAL_SEMAPHORE_CAPABILITIES_EXTENSION_NAME,
|
|
||||||
.specVersion = 1,
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static const VkExtensionProperties device_extensions[] = {
|
static const VkExtensionProperties device_extensions[] = {
|
||||||
|
@ -472,14 +468,6 @@ static const VkExtensionProperties device_extensions[] = {
|
||||||
.extensionName = VK_KHR_SWAPCHAIN_EXTENSION_NAME,
|
.extensionName = VK_KHR_SWAPCHAIN_EXTENSION_NAME,
|
||||||
.specVersion = 68,
|
.specVersion = 68,
|
||||||
},
|
},
|
||||||
{
|
|
||||||
.extensionName = VK_KHX_EXTERNAL_SEMAPHORE_EXTENSION_NAME,
|
|
||||||
.specVersion = 1,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
.extensionName = VK_KHX_EXTERNAL_SEMAPHORE_FD_EXTENSION_NAME,
|
|
||||||
.specVersion = 1,
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
.extensionName = VK_KHX_MULTIVIEW_EXTENSION_NAME,
|
.extensionName = VK_KHX_MULTIVIEW_EXTENSION_NAME,
|
||||||
.specVersion = 1,
|
.specVersion = 1,
|
||||||
|
|
|
@ -46,9 +46,6 @@ SUPPORTED_EXTENSIONS = [
|
||||||
'VK_KHR_wayland_surface',
|
'VK_KHR_wayland_surface',
|
||||||
'VK_KHR_xcb_surface',
|
'VK_KHR_xcb_surface',
|
||||||
'VK_KHR_xlib_surface',
|
'VK_KHR_xlib_surface',
|
||||||
'VK_KHX_external_semaphore',
|
|
||||||
'VK_KHX_external_semaphore_capabilities',
|
|
||||||
'VK_KHX_external_semaphore_fd',
|
|
||||||
'VK_KHX_multiview',
|
'VK_KHX_multiview',
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
|
@ -528,38 +528,11 @@ VkResult anv_CreateSemaphore(
|
||||||
if (semaphore == NULL)
|
if (semaphore == NULL)
|
||||||
return vk_error(VK_ERROR_OUT_OF_HOST_MEMORY);
|
return vk_error(VK_ERROR_OUT_OF_HOST_MEMORY);
|
||||||
|
|
||||||
const VkExportSemaphoreCreateInfoKHX *export =
|
|
||||||
vk_find_struct_const(pCreateInfo->pNext, EXPORT_SEMAPHORE_CREATE_INFO_KHX);
|
|
||||||
VkExternalSemaphoreHandleTypeFlagsKHX handleTypes =
|
|
||||||
export ? export->handleTypes : 0;
|
|
||||||
|
|
||||||
if (handleTypes == 0) {
|
|
||||||
/* The DRM execbuffer ioctl always execute in-oder so long as you stay
|
/* The DRM execbuffer ioctl always execute in-oder so long as you stay
|
||||||
* on the same ring. Since we don't expose the blit engine as a DMA
|
* on the same ring. Since we don't expose the blit engine as a DMA
|
||||||
* queue, a dummy no-op semaphore is a perfectly valid implementation.
|
* queue, a dummy no-op semaphore is a perfectly valid implementation.
|
||||||
*/
|
*/
|
||||||
semaphore->permanent.type = ANV_SEMAPHORE_TYPE_DUMMY;
|
semaphore->permanent.type = ANV_SEMAPHORE_TYPE_DUMMY;
|
||||||
} else if (handleTypes & VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT_KHX) {
|
|
||||||
assert(handleTypes == VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT_KHX);
|
|
||||||
|
|
||||||
semaphore->permanent.type = ANV_SEMAPHORE_TYPE_BO;
|
|
||||||
VkResult result = anv_bo_cache_alloc(device, &device->bo_cache,
|
|
||||||
4096, &semaphore->permanent.bo);
|
|
||||||
if (result != VK_SUCCESS) {
|
|
||||||
vk_free2(&device->alloc, pAllocator, semaphore);
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* If we're going to use this as a fence, we need to *not* have the
|
|
||||||
* EXEC_OBJECT_ASYNC bit set.
|
|
||||||
*/
|
|
||||||
assert(!(semaphore->permanent.bo->flags & EXEC_OBJECT_ASYNC));
|
|
||||||
} else {
|
|
||||||
assert(!"Unknown handle type");
|
|
||||||
vk_free2(&device->alloc, pAllocator, semaphore);
|
|
||||||
return vk_error(VK_ERROR_INVALID_EXTERNAL_HANDLE_KHX);
|
|
||||||
}
|
|
||||||
|
|
||||||
semaphore->temporary.type = ANV_SEMAPHORE_TYPE_NONE;
|
semaphore->temporary.type = ANV_SEMAPHORE_TYPE_NONE;
|
||||||
|
|
||||||
*pSemaphore = anv_semaphore_to_handle(semaphore);
|
*pSemaphore = anv_semaphore_to_handle(semaphore);
|
||||||
|
@ -601,81 +574,3 @@ void anv_DestroySemaphore(
|
||||||
|
|
||||||
vk_free2(&device->alloc, pAllocator, semaphore);
|
vk_free2(&device->alloc, pAllocator, semaphore);
|
||||||
}
|
}
|
||||||
|
|
||||||
void anv_GetPhysicalDeviceExternalSemaphorePropertiesKHX(
|
|
||||||
VkPhysicalDevice physicalDevice,
|
|
||||||
const VkPhysicalDeviceExternalSemaphoreInfoKHX* pExternalSemaphoreInfo,
|
|
||||||
VkExternalSemaphorePropertiesKHX* pExternalSemaphoreProperties)
|
|
||||||
{
|
|
||||||
switch (pExternalSemaphoreInfo->handleType) {
|
|
||||||
case VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT_KHX:
|
|
||||||
pExternalSemaphoreProperties->exportFromImportedHandleTypes =
|
|
||||||
VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT_KHX;
|
|
||||||
pExternalSemaphoreProperties->compatibleHandleTypes =
|
|
||||||
VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT_KHX;
|
|
||||||
pExternalSemaphoreProperties->externalSemaphoreFeatures =
|
|
||||||
VK_EXTERNAL_SEMAPHORE_FEATURE_EXPORTABLE_BIT_KHX |
|
|
||||||
VK_EXTERNAL_SEMAPHORE_FEATURE_IMPORTABLE_BIT_KHX;
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
pExternalSemaphoreProperties->exportFromImportedHandleTypes = 0;
|
|
||||||
pExternalSemaphoreProperties->compatibleHandleTypes = 0;
|
|
||||||
pExternalSemaphoreProperties->externalSemaphoreFeatures = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
VkResult anv_ImportSemaphoreFdKHX(
|
|
||||||
VkDevice _device,
|
|
||||||
const VkImportSemaphoreFdInfoKHX* pImportSemaphoreFdInfo)
|
|
||||||
{
|
|
||||||
ANV_FROM_HANDLE(anv_device, device, _device);
|
|
||||||
ANV_FROM_HANDLE(anv_semaphore, semaphore, pImportSemaphoreFdInfo->semaphore);
|
|
||||||
|
|
||||||
switch (pImportSemaphoreFdInfo->handleType) {
|
|
||||||
case VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT_KHX: {
|
|
||||||
struct anv_bo *bo;
|
|
||||||
VkResult result = anv_bo_cache_import(device, &device->bo_cache,
|
|
||||||
pImportSemaphoreFdInfo->fd, 4096,
|
|
||||||
&bo);
|
|
||||||
if (result != VK_SUCCESS)
|
|
||||||
return result;
|
|
||||||
|
|
||||||
/* If we're going to use this as a fence, we need to *not* have the
|
|
||||||
* EXEC_OBJECT_ASYNC bit set.
|
|
||||||
*/
|
|
||||||
assert(!(bo->flags & EXEC_OBJECT_ASYNC));
|
|
||||||
|
|
||||||
anv_semaphore_impl_cleanup(device, &semaphore->permanent);
|
|
||||||
|
|
||||||
semaphore->permanent.type = ANV_SEMAPHORE_TYPE_BO;
|
|
||||||
semaphore->permanent.bo = bo;
|
|
||||||
|
|
||||||
return VK_SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
default:
|
|
||||||
return vk_error(VK_ERROR_INVALID_EXTERNAL_HANDLE_KHX);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
VkResult anv_GetSemaphoreFdKHX(
|
|
||||||
VkDevice _device,
|
|
||||||
VkSemaphore _semaphore,
|
|
||||||
VkExternalSemaphoreHandleTypeFlagBitsKHX handleType,
|
|
||||||
int* pFd)
|
|
||||||
{
|
|
||||||
ANV_FROM_HANDLE(anv_device, device, _device);
|
|
||||||
ANV_FROM_HANDLE(anv_semaphore, semaphore, _semaphore);
|
|
||||||
|
|
||||||
switch (semaphore->permanent.type) {
|
|
||||||
case ANV_SEMAPHORE_TYPE_BO:
|
|
||||||
return anv_bo_cache_export(device, &device->bo_cache,
|
|
||||||
semaphore->permanent.bo, pFd);
|
|
||||||
|
|
||||||
default:
|
|
||||||
return vk_error(VK_ERROR_INVALID_EXTERNAL_HANDLE_KHX);
|
|
||||||
}
|
|
||||||
|
|
||||||
return VK_SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in New Issue