int shmid;
uint8_t * shmaddr;
uint64_t present_id;
+ uint64_t signal_present_id;
};
struct x11_swapchain {
{
if (image->present_id) {
pthread_mutex_lock(&swapchain->present_progress_mutex);
- if (image->present_id > swapchain->present_id) {
- swapchain->present_id = image->present_id;
+ if (image->signal_present_id > swapchain->present_id) {
+ swapchain->present_id = image->signal_present_id;
pthread_cond_broadcast(&swapchain->present_progress_cond);
}
pthread_mutex_unlock(&swapchain->present_progress_mutex);
pthread_cond_broadcast(&swapchain->present_progress_cond);
pthread_mutex_unlock(&swapchain->present_progress_mutex);
}
+
+ /* It is possible that an IDLE is observed before PRESENT_COMPLETE when
+ * not flipping. In this case, reading image->present_id might be a race
+ * in the FIFO management thread. */
+ image->signal_present_id = image->present_id;
}
static void x11_swapchain_notify_error(struct x11_swapchain *swapchain, VkResult result)