+ ANV_FROM_HANDLE(anv_device, device, _device);
+ ANV_FROM_HANDLE(anv_semaphore, semaphore, _semaphore);
+ ANV_FROM_HANDLE(anv_device_memory, memory, _memory);
+
+ /* Put a BO semaphore with the image BO in the temporary. For BO binary
+ * semaphores, we always set EXEC_OBJECT_WRITE so this creates a WaR
+ * hazard with the display engine's read to ensure that no one writes to
+ * the image before the read is complete.
+ */
+ anv_semaphore_reset_temporary(device, semaphore);
+
+ struct anv_semaphore_impl *impl = &semaphore->temporary;
+ impl->type = ANV_SEMAPHORE_TYPE_WSI_BO;
+ impl->bo = anv_bo_ref(memory->bo);
+}
+
+static void
+anv_wsi_signal_fence_for_memory(VkDevice _device,
+ VkFence _fence,
+ VkDeviceMemory _memory)
+{
+ ANV_FROM_HANDLE(anv_device, device, _device);
+ ANV_FROM_HANDLE(anv_fence, fence, _fence);
+ ANV_FROM_HANDLE(anv_device_memory, memory, _memory);
+
+ /* Put a BO fence with the image BO in the temporary. For BO fences, we
+ * always just wait until the BO isn't busy and reads from the BO should
+ * count as busy.
+ */
+ anv_fence_reset_temporary(device, fence);
+
+ struct anv_fence_impl *impl = &fence->temporary;
+ impl->type = ANV_FENCE_TYPE_WSI_BO;
+ impl->bo.bo = anv_bo_ref(memory->bo);
+ impl->bo.state = ANV_BO_FENCE_STATE_SUBMITTED;