mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-02-23 22:40:34 +01:00
turnip: Move QueueWaitIdle entrypoint to kgsl
Handle in the same way as other kgsl specific entrypoints. Signed-off-by: Rob Clark <robdclark@chromium.org> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21394>
This commit is contained in:
parent
1170efcf01
commit
fc06e35a58
2 changed files with 27 additions and 28 deletions
|
|
@ -2504,34 +2504,6 @@ tu_EnumerateInstanceLayerProperties(uint32_t *pPropertyCount,
|
|||
return VK_SUCCESS;
|
||||
}
|
||||
|
||||
/* Only used for kgsl since drm started using common implementation */
|
||||
#ifdef TU_USE_KGSL
|
||||
VKAPI_ATTR VkResult VKAPI_CALL
|
||||
tu_QueueWaitIdle(VkQueue _queue)
|
||||
{
|
||||
TU_FROM_HANDLE(tu_queue, queue, _queue);
|
||||
|
||||
if (vk_device_is_lost(&queue->device->vk))
|
||||
return VK_ERROR_DEVICE_LOST;
|
||||
|
||||
if (queue->fence < 0)
|
||||
return VK_SUCCESS;
|
||||
|
||||
struct pollfd fds = { .fd = queue->fence, .events = POLLIN };
|
||||
int ret;
|
||||
do {
|
||||
ret = poll(&fds, 1, -1);
|
||||
} while (ret == -1 && (errno == EINTR || errno == EAGAIN));
|
||||
|
||||
/* TODO: otherwise set device lost ? */
|
||||
assert(ret == 1 && !(fds.revents & (POLLERR | POLLNVAL)));
|
||||
|
||||
close(queue->fence);
|
||||
queue->fence = -1;
|
||||
return VK_SUCCESS;
|
||||
}
|
||||
#endif
|
||||
|
||||
VKAPI_ATTR VkResult VKAPI_CALL
|
||||
tu_EnumerateInstanceExtensionProperties(const char *pLayerName,
|
||||
uint32_t *pPropertyCount,
|
||||
|
|
|
|||
|
|
@ -293,6 +293,32 @@ sync_merge(const VkSemaphore *syncobjs, uint32_t count, bool wait_all, bool rese
|
|||
return ret;
|
||||
}
|
||||
|
||||
/* Only used for kgsl since drm started using common implementation */
|
||||
static VKAPI_ATTR VkResult VKAPI_CALL
|
||||
kgsl_QueueWaitIdle(VkQueue _queue)
|
||||
{
|
||||
TU_FROM_HANDLE(tu_queue, queue, _queue);
|
||||
|
||||
if (vk_device_is_lost(&queue->device->vk))
|
||||
return VK_ERROR_DEVICE_LOST;
|
||||
|
||||
if (queue->fence < 0)
|
||||
return VK_SUCCESS;
|
||||
|
||||
struct pollfd fds = { .fd = queue->fence, .events = POLLIN };
|
||||
int ret;
|
||||
do {
|
||||
ret = poll(&fds, 1, -1);
|
||||
} while (ret == -1 && (errno == EINTR || errno == EAGAIN));
|
||||
|
||||
/* TODO: otherwise set device lost ? */
|
||||
assert(ret == 1 && !(fds.revents & (POLLERR | POLLNVAL)));
|
||||
|
||||
close(queue->fence);
|
||||
queue->fence = -1;
|
||||
return VK_SUCCESS;
|
||||
}
|
||||
|
||||
static VKAPI_ATTR VkResult VKAPI_CALL
|
||||
kgsl_QueueSubmit2(VkQueue _queue,
|
||||
uint32_t submitCount,
|
||||
|
|
@ -763,6 +789,7 @@ kgsl_QueueSignalReleaseImageANDROID(VkQueue _queue,
|
|||
* instead.
|
||||
*/
|
||||
static const struct vk_device_entrypoint_table kgsl_device_entrypoints = {
|
||||
.QueueWaitIdle = kgsl_QueueWaitIdle,
|
||||
.QueueSubmit2 = kgsl_QueueSubmit2,
|
||||
.ImportSemaphoreFdKHR = kgsl_ImportSemaphoreFdKHR,
|
||||
.GetSemaphoreFdKHR = kgsl_GetSemaphoreFdKHR,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue