Lines Matching refs:device

38 anv_device_execbuf(struct anv_device *device,  in anv_device_execbuf()  argument
42 int ret = anv_gem_execbuffer(device, execbuf); in anv_device_execbuf()
45 device->lost = true; in anv_device_execbuf()
46 return vk_errorf(device->instance, device, VK_ERROR_DEVICE_LOST, in anv_device_execbuf()
59 anv_device_submit_simple_batch(struct anv_device *device, in anv_device_submit_simple_batch() argument
70 result = anv_bo_pool_alloc(&device->batch_bo_pool, &bo, size); in anv_device_submit_simple_batch()
75 if (!device->info.has_llc) in anv_device_submit_simple_batch()
99 execbuf.rsvd1 = device->context_id; in anv_device_submit_simple_batch()
102 result = anv_device_execbuf(device, &execbuf, exec_bos); in anv_device_submit_simple_batch()
106 result = anv_device_wait(device, &bo, INT64_MAX); in anv_device_submit_simple_batch()
109 anv_bo_pool_free(&device->batch_bo_pool, &bo); in anv_device_submit_simple_batch()
121 struct anv_device *device = queue->device; in anv_QueueSubmit() local
130 VkResult result = anv_device_query_status(device); in anv_QueueSubmit()
159 pthread_mutex_lock(&device->mutex); in anv_QueueSubmit()
167 result = anv_cmd_buffer_execbuf(device, NULL, NULL, 0, NULL, 0, fence); in anv_QueueSubmit()
181 result = anv_cmd_buffer_execbuf(device, NULL, in anv_QueueSubmit()
218 result = anv_cmd_buffer_execbuf(device, cmd_buffer, in anv_QueueSubmit()
227 pthread_cond_broadcast(&device->queue_submit); in anv_QueueSubmit()
243 result = vk_errorf(device->instance, device, VK_ERROR_DEVICE_LOST, in anv_QueueSubmit()
245 device->lost = true; in anv_QueueSubmit()
248 pthread_mutex_unlock(&device->mutex); in anv_QueueSubmit()
258 return anv_DeviceWaitIdle(anv_device_to_handle(queue->device)); in anv_QueueWaitIdle()
267 ANV_FROM_HANDLE(anv_device, device, _device); in anv_CreateFence()
272 fence = vk_zalloc2(&device->alloc, pAllocator, sizeof(*fence), 8, in anv_CreateFence()
277 if (device->instance->physicalDevice.has_syncobj_wait) { in anv_CreateFence()
284 fence->permanent.syncobj = anv_gem_syncobj_create(device, create_flags); in anv_CreateFence()
290 VkResult result = anv_bo_pool_alloc(&device->batch_bo_pool, in anv_CreateFence()
308 anv_fence_impl_cleanup(struct anv_device *device, in anv_fence_impl_cleanup() argument
317 anv_bo_pool_free(&device->batch_bo_pool, &impl->bo.bo); in anv_fence_impl_cleanup()
321 anv_gem_syncobj_destroy(device, impl->syncobj); in anv_fence_impl_cleanup()
333 ANV_FROM_HANDLE(anv_device, device, _device); in anv_DestroyFence()
339 anv_fence_impl_cleanup(device, &fence->temporary); in anv_DestroyFence()
340 anv_fence_impl_cleanup(device, &fence->permanent); in anv_DestroyFence()
342 vk_free2(&device->alloc, pAllocator, fence); in anv_DestroyFence()
350 ANV_FROM_HANDLE(anv_device, device, _device); in anv_ResetFences()
363 anv_fence_impl_cleanup(device, &fence->temporary); in anv_ResetFences()
375 anv_gem_syncobj_reset(device, impl->syncobj); in anv_ResetFences()
390 ANV_FROM_HANDLE(anv_device, device, _device); in anv_GetFenceStatus()
393 if (unlikely(device->lost)) in anv_GetFenceStatus()
414 VkResult result = anv_device_bo_busy(device, &impl->bo.bo); in anv_GetFenceStatus()
427 int ret = anv_gem_syncobj_wait(device, &impl->syncobj, 1, 0, true); in anv_GetFenceStatus()
433 device->lost = true; in anv_GetFenceStatus()
434 return vk_errorf(device->instance, device, VK_ERROR_DEVICE_LOST, in anv_GetFenceStatus()
459 anv_wait_for_syncobj_fences(struct anv_device *device, in anv_wait_for_syncobj_fences() argument
465 uint32_t *syncobjs = vk_zalloc(&device->alloc, in anv_wait_for_syncobj_fences()
502 ret = anv_gem_syncobj_wait(device, syncobjs, fenceCount, in anv_wait_for_syncobj_fences()
506 vk_free(&device->alloc, syncobjs); in anv_wait_for_syncobj_fences()
513 device->lost = true; in anv_wait_for_syncobj_fences()
514 return vk_errorf(device->instance, device, VK_ERROR_DEVICE_LOST, in anv_wait_for_syncobj_fences()
523 anv_wait_for_bo_fences(struct anv_device *device, in anv_wait_for_bo_fences() argument
580 result = anv_device_wait(device, &impl->bo.bo, timeout); in anv_wait_for_bo_fences()
604 pthread_mutex_lock(&device->mutex); in anv_wait_for_bo_fences()
634 ret = pthread_cond_timedwait(&device->queue_submit, in anv_wait_for_bo_fences()
635 &device->mutex, &abstime); in anv_wait_for_bo_fences()
645 pthread_mutex_unlock(&device->mutex); in anv_wait_for_bo_fences()
653 pthread_mutex_unlock(&device->mutex); in anv_wait_for_bo_fences()
658 if (unlikely(device->lost)) in anv_wait_for_bo_fences()
671 ANV_FROM_HANDLE(anv_device, device, _device); in anv_WaitForFences()
673 if (unlikely(device->lost)) in anv_WaitForFences()
676 if (device->instance->physicalDevice.has_syncobj_wait) { in anv_WaitForFences()
677 return anv_wait_for_syncobj_fences(device, fenceCount, pFences, in anv_WaitForFences()
680 return anv_wait_for_bo_fences(device, fenceCount, pFences, in anv_WaitForFences()
690 ANV_FROM_HANDLE(anv_physical_device, device, physicalDevice); in anv_GetPhysicalDeviceExternalFencePropertiesKHR()
695 if (device->has_syncobj_wait) { in anv_GetPhysicalDeviceExternalFencePropertiesKHR()
722 ANV_FROM_HANDLE(anv_device, device, _device); in anv_ImportFenceFdKHR()
737 new_impl.syncobj = anv_gem_syncobj_fd_to_handle(device, fd); in anv_ImportFenceFdKHR()
750 new_impl.syncobj = anv_gem_syncobj_create(device, 0); in anv_ImportFenceFdKHR()
754 if (anv_gem_syncobj_import_sync_file(device, new_impl.syncobj, fd)) { in anv_ImportFenceFdKHR()
755 anv_gem_syncobj_destroy(device, new_impl.syncobj); in anv_ImportFenceFdKHR()
756 return vk_errorf(device->instance, NULL, in anv_ImportFenceFdKHR()
778 anv_fence_impl_cleanup(device, &fence->temporary); in anv_ImportFenceFdKHR()
781 anv_fence_impl_cleanup(device, &fence->permanent); in anv_ImportFenceFdKHR()
793 ANV_FROM_HANDLE(anv_device, device, _device); in anv_GetFenceFdKHR()
805 int fd = anv_gem_syncobj_handle_to_fd(device, impl->syncobj); in anv_GetFenceFdKHR()
814 int fd = anv_gem_syncobj_export_sync_file(device, impl->syncobj); in anv_GetFenceFdKHR()
834 anv_fence_impl_cleanup(device, impl); in anv_GetFenceFdKHR()
847 ANV_FROM_HANDLE(anv_device, device, _device); in anv_CreateSemaphore()
852 semaphore = vk_alloc2(&device->alloc, pAllocator, sizeof(*semaphore), 8, in anv_CreateSemaphore()
870 if (device->instance->physicalDevice.has_syncobj) { in anv_CreateSemaphore()
872 semaphore->permanent.syncobj = anv_gem_syncobj_create(device, 0); in anv_CreateSemaphore()
874 vk_free2(&device->alloc, pAllocator, semaphore); in anv_CreateSemaphore()
879 VkResult result = anv_bo_cache_alloc(device, &device->bo_cache, in anv_CreateSemaphore()
882 vk_free2(&device->alloc, pAllocator, semaphore); in anv_CreateSemaphore()
898 vk_free2(&device->alloc, pAllocator, semaphore); in anv_CreateSemaphore()
910 anv_semaphore_impl_cleanup(struct anv_device *device, in anv_semaphore_impl_cleanup() argument
920 anv_bo_cache_release(device, &device->bo_cache, impl->bo); in anv_semaphore_impl_cleanup()
928 anv_gem_syncobj_destroy(device, impl->syncobj); in anv_semaphore_impl_cleanup()
936 anv_semaphore_reset_temporary(struct anv_device *device, in anv_semaphore_reset_temporary() argument
942 anv_semaphore_impl_cleanup(device, &semaphore->temporary); in anv_semaphore_reset_temporary()
951 ANV_FROM_HANDLE(anv_device, device, _device); in anv_DestroySemaphore()
957 anv_semaphore_impl_cleanup(device, &semaphore->temporary); in anv_DestroySemaphore()
958 anv_semaphore_impl_cleanup(device, &semaphore->permanent); in anv_DestroySemaphore()
960 vk_free2(&device->alloc, pAllocator, semaphore); in anv_DestroySemaphore()
968 ANV_FROM_HANDLE(anv_physical_device, device, physicalDevice); in anv_GetPhysicalDeviceExternalSemaphorePropertiesKHR()
982 if (device->has_exec_fence) { in anv_GetPhysicalDeviceExternalSemaphorePropertiesKHR()
1006 ANV_FROM_HANDLE(anv_device, device, _device); in anv_ImportSemaphoreFdKHR()
1016 if (device->instance->physicalDevice.has_syncobj) { in anv_ImportSemaphoreFdKHR()
1019 new_impl.syncobj = anv_gem_syncobj_fd_to_handle(device, fd); in anv_ImportSemaphoreFdKHR()
1025 VkResult result = anv_bo_cache_import(device, &device->bo_cache, in anv_ImportSemaphoreFdKHR()
1031 anv_bo_cache_release(device, &device->bo_cache, new_impl.bo); in anv_ImportSemaphoreFdKHR()
1065 anv_semaphore_impl_cleanup(device, &semaphore->temporary); in anv_ImportSemaphoreFdKHR()
1068 anv_semaphore_impl_cleanup(device, &semaphore->permanent); in anv_ImportSemaphoreFdKHR()
1080 ANV_FROM_HANDLE(anv_device, device, _device); in anv_GetSemaphoreFdKHR()
1093 result = anv_bo_cache_export(device, &device->bo_cache, impl->bo, pFd); in anv_GetSemaphoreFdKHR()
1127 fd = anv_gem_syncobj_handle_to_fd(device, impl->syncobj); in anv_GetSemaphoreFdKHR()
1145 anv_semaphore_impl_cleanup(device, impl); in anv_GetSemaphoreFdKHR()