Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions macos/build-qemu-gpu-runtime.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ pinch_patch="$native_dir/patches/qemu-cocoa-pinch-zoom.patch"
audio_device_patch="$native_dir/patches/qemu-sdl-audio-device-selection.patch"
shared_folder_patch="$native_dir/patches/qemu-9p-guest-owner.patch"
strchrnul_patch="$native_dir/patches/qemu-darwin-strchrnul-compat.patch"
fence_poll_patch="$native_dir/patches/qemu-darwin-gpu-fence-poll.patch"
prepare_runtime="$native_dir/prepare-qemu-gpu-runtime.sh"
pinned_bottles="$native_dir/pinned-runtime-bottles.sh"

Expand All @@ -72,6 +73,7 @@ pause_ownership_patch_sha256=1a5729b36eb3e437395d41883a10c3c652df71d289d5df84d95
pinch_patch_sha256=37acb8895dddd35fc66812d0c49ec5fc697f9127e9e12ed2e60d17999bf32aee
audio_device_patch_sha256=03aca71c26163c337338cc3b2013c35430690fc0e8b66c5ce92a42f59a9b3334
shared_folder_patch_sha256=41247692501655393ae3a40f56915472ab29b6e89c5173e33db1f62cca56632f
fence_poll_patch_sha256=82a836c8f720fff09bea8c990133f88907e7ee2e0fd5b68451771065009d9743
strchrnul_patch_sha256=ec1048dd0e8ebe53bf7e8a3bca9bf2f5f4336cd607d4cd077437470e9a32094a
macos_deployment_target=15.0

Expand Down Expand Up @@ -347,6 +349,8 @@ verify_file_sha "Try Omarchy SDL audio-device patch" \
"$audio_device_patch" "$audio_device_patch_sha256"
verify_file_sha "Try Omarchy 9p shared-folder patch" \
"$shared_folder_patch" "$shared_folder_patch_sha256"
verify_file_sha "Try Omarchy Darwin GPU fence polling patch" \
"$fence_poll_patch" "$fence_poll_patch_sha256"
verify_file_sha "Try Omarchy Darwin strchrnul compatibility patch" \
"$strchrnul_patch" "$strchrnul_patch_sha256"

Expand All @@ -361,6 +365,7 @@ patch -d "$source_dir" -p1 -f -i "$pause_ownership_patch"
patch -d "$source_dir" -p1 -f -i "$audio_device_patch"
patch -d "$source_dir" -p1 -f -i "$shared_folder_patch"
patch -d "$source_dir" -p1 -f -i "$strchrnul_patch"
patch -d "$source_dir" -p1 -f -i "$fence_poll_patch"
patch -d "$source_dir" -p1 -f -i "$pinch_patch"

virgl_root="$dependency_root/virglrenderer/$virgl_version"
Expand Down
16 changes: 16 additions & 0 deletions macos/patches/qemu-darwin-gpu-fence-poll.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
--- a/hw/display/virtio-gpu-virgl.c
+++ b/hw/display/virtio-gpu-virgl.c
@@ -1389,7 +1389,13 @@
virgl_renderer_poll();
virtio_gpu_process_cmdq(g);
if (!QTAILQ_EMPTY(&g->cmdq) || !QTAILQ_EMPTY(&g->fenceq)) {
+#ifdef CONFIG_DARWIN
+ /* ANGLE fences are polled on the render thread. The generic 10 ms
+ * interval exceeds an entire 120 Hz frame and stalls guest uploads. */
+ timer_mod(gl->fence_poll, qemu_clock_get_ms(QEMU_CLOCK_VIRTUAL) + 1);
+#else
timer_mod(gl->fence_poll, qemu_clock_get_ms(QEMU_CLOCK_VIRTUAL) + 10);
+#endif
}
}

Loading