Lines Matching defs:fence

160    bool                         device_event; /* fence is used for device events */
165 struct wsi_display_fence *fence;
1223 static void wsi_display_fence_event_handler(struct wsi_display_fence *fence);
1238 struct wsi_display_fence *fence = data;
1240 wsi_display_fence_event_handler(fence);
1246 struct wsi_display_fence *fence =
1249 wsi_display_fence_event_handler(fence);
1553 wsi_display_fence_wait(struct wsi_display_fence *fence, uint64_t timeout)
1555 wsi_display_debug("%9lu wait fence %lu %ld\n",
1556 pthread_self(), fence->sequence,
1559 pthread_mutex_lock(&fence->wsi->wait_mutex);
1564 if (fence->event_received) {
1565 wsi_display_debug("%9lu fence %lu passed\n",
1566 pthread_self(), fence->sequence);
1572 wsi_display_debug("%9lu fence %lu timeout\n",
1573 pthread_self(), fence->sequence);
1578 if (fence->device_event)
1579 ret = wsi_device_wait_for_event(fence->wsi, timeout);
1581 ret = wsi_display_wait_for_event(fence->wsi, timeout);
1584 wsi_display_debug("%9lu fence %lu error\n",
1585 pthread_self(), fence->sequence);
1590 pthread_mutex_unlock(&fence->wsi->wait_mutex);
1591 wsi_display_debug("%9lu fence wait %f ms\n",
1599 wsi_display_fence_check_free(struct wsi_display_fence *fence)
1601 if (fence->event_received && fence->destroyed)
1602 vk_free(fence->wsi->alloc, fence);
1605 static void wsi_display_fence_event_handler(struct wsi_display_fence *fence)
1607 if (fence->syncobj) {
1608 (void) drmSyncobjSignal(fence->wsi->syncobj_fd, &fence->syncobj, 1);
1609 (void) drmSyncobjDestroy(fence->wsi->syncobj_fd, fence->syncobj);
1612 fence->event_received = true;
1613 wsi_display_fence_check_free(fence);
1617 wsi_display_fence_destroy(struct wsi_display_fence *fence)
1619 /* Destroy hotplug fence list. */
1620 if (fence->device_event) {
1621 mtx_lock(&fence->wsi->wait_mutex);
1622 list_del(&fence->link);
1623 mtx_unlock(&fence->wsi->wait_mutex);
1624 fence->event_received = true;
1627 assert(!fence->destroyed);
1628 fence->destroyed = true;
1629 wsi_display_fence_check_free(fence);
1635 struct wsi_display_fence *fence =
1636 vk_zalloc(wsi->alloc, sizeof (*fence),
1639 if (!fence)
1643 int ret = drmSyncobjFDToHandle(wsi->syncobj_fd, sync_fd, &fence->syncobj);
1646 vk_free(wsi->alloc, fence);
1651 fence->wsi = wsi;
1652 fence->event_received = false;
1653 fence->destroyed = false;
1654 fence->sequence = ++fence_sequence;
1655 return fence;
1673 if (wsi_sync->fence)
1674 wsi_display_fence_destroy(wsi_sync->fence);
1690 return wsi_display_fence_wait(wsi_sync->fence, abs_timeout_ns);
1704 struct wsi_display_fence *fence,
1716 sync->fence = fence;
1722 wsi_register_vblank_event(struct wsi_display_fence *fence,
1753 (uintptr_t) fence);
1764 wsi_display_debug("queue vblank event %lu failed\n", fence->sequence);
2101 /* Note, this supports both drmSyncobjWait for fence->syncobj
2106 list_for_each_entry(struct wsi_display_fence, fence,
2108 if (fence->syncobj)
2109 drmSyncobjSignal(wsi->syncobj_fd, &fence->syncobj, 1);
2110 fence->event_received = true;
2798 struct wsi_display_fence *fence;
2802 fence = wsi_display_fence_alloc(wsi, sync_fd);
2804 if (!fence)
2807 fence->device_event = true;
2810 list_addtail(&fence->link, &wsi_device->hotplug_fences);
2814 ret = wsi_display_sync_create(device, fence, sync_out);
2816 wsi_display_fence_destroy(fence);
2818 wsi_display_fence_destroy(fence);
2829 struct vk_fence *fence;
2836 ret = vk_fence_create(device, &info, allocator, &fence);
2844 &fence->temporary,
2847 *_fence = vk_fence_to_handle(fence);
2849 vk_fence_destroy(device, fence, allocator);
2865 struct wsi_display_fence *fence;
2871 fence = wsi_display_fence_alloc(wsi, sync_fd);
2873 if (!fence)
2876 ret = wsi_register_vblank_event(fence, wsi_device, display,
2881 ret = wsi_display_sync_create(device, fence, sync_out);
2883 wsi_display_fence_destroy(fence);
2885 wsi_display_fence_destroy(fence);
2887 } else if (fence != NULL) {
2888 if (fence->syncobj)
2889 drmSyncobjDestroy(wsi->syncobj_fd, fence->syncobj);
2890 vk_free2(wsi->alloc, allocator, fence);
2908 struct vk_fence *fence;
2915 ret = vk_fence_create(device, &info, allocator, &fence);
2921 display, display_event_info, allocator, &fence->temporary, -1);
2924 *_fence = vk_fence_to_handle(fence);
2926 vk_fence_destroy(device, fence, allocator);