From 94e5dd8619bf849e01a25a898b6fef741999b906 Mon Sep 17 00:00:00 2001 From: osy <50960678+osy@users.noreply.github.com> Date: Fri, 30 Dec 2022 22:56:24 -0800 Subject: [PATCH 1/2] CocoaSpice: update to latest commit This resolves the issue where GRUB renders really slowly in GL mode and also improves rendering performance of non-GL. --- Platform/iOS/Display/VMDisplayMetalViewController.m | 5 +++-- .../macOS/Display/VMDisplayQemuMetalWindowController.swift | 5 +++-- .../xcshareddata/swiftpm/Package.resolved | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Platform/iOS/Display/VMDisplayMetalViewController.m b/Platform/iOS/Display/VMDisplayMetalViewController.m index 86b41492..891646be 100644 --- a/Platform/iOS/Display/VMDisplayMetalViewController.m +++ b/Platform/iOS/Display/VMDisplayMetalViewController.m @@ -88,8 +88,9 @@ // Initialize our renderer with the view size CGSize drawableSize = self.view.bounds.size; self.mtkView.drawableSize = drawableSize; - self.renderer.preferredFramesPerSecond = [self integerForSetting:@"QEMURendererFPSLimit"]; - [self.renderer mtkView:self.mtkView drawableSizeWillChange:drawableSize]; + if ([self integerForSetting:@"QEMURendererFPSLimit"] > 0) { + self.mtkView.preferredFramesPerSecond = [self integerForSetting:@"QEMURendererFPSLimit"]; + } [self.renderer changeUpscaler:self.delegate.qemuDisplayUpscaler downscaler:self.delegate.qemuDisplayDownscaler]; diff --git a/Platform/macOS/Display/VMDisplayQemuMetalWindowController.swift b/Platform/macOS/Display/VMDisplayQemuMetalWindowController.swift index 632c4a84..5e92a179 100644 --- a/Platform/macOS/Display/VMDisplayQemuMetalWindowController.swift +++ b/Platform/macOS/Display/VMDisplayQemuMetalWindowController.swift @@ -82,8 +82,9 @@ class VMDisplayQemuMetalWindowController: VMDisplayQemuWindowController { logger.critical("Failed to create renderer.") return } - renderer.preferredFramesPerSecond = rendererFpsLimit - renderer.mtkView(metalView, drawableSizeWillChange: metalView.drawableSize) + if rendererFpsLimit > 0 { + metalView.preferredFramesPerSecond = rendererFpsLimit + } renderer.changeUpscaler(displayConfig?.upscalingFilter.metalSamplerMinMagFilter ?? .linear, downscaler: displayConfig?.downscalingFilter.metalSamplerMinMagFilter ?? .linear) renderer.source = vmDisplay // can be nil if primary metalView.delegate = renderer diff --git a/UTM.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/UTM.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index e4abbd2c..72d54bd7 100644 --- a/UTM.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/UTM.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -15,7 +15,7 @@ "location" : "https://github.com/utmapp/CocoaSpice.git", "state" : { "branch" : "main", - "revision" : "89fabc654b65568fae5192c1547023cfe333c2df" + "revision" : "3d34a2ba65c4feb741275ad937fc4efe20ffbaac" } }, { From 115364c0898f934202f1cccf4b08b2be0f3fa4e6 Mon Sep 17 00:00:00 2001 From: osy <50960678+osy@users.noreply.github.com> Date: Fri, 30 Dec 2022 22:58:39 -0800 Subject: [PATCH 2/2] qemu: fix TCTI build Fixes #4848 --- patches/qemu-7.2.0-utm.patch | 41 ++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/patches/qemu-7.2.0-utm.patch b/patches/qemu-7.2.0-utm.patch index 3231e60e..768892ea 100644 --- a/patches/qemu-7.2.0-utm.patch +++ b/patches/qemu-7.2.0-utm.patch @@ -322,3 +322,44 @@ index 7f589b4146..d311c57cca 100644 -- 2.28.0 +From c874e68e5a1635326f8a2f52320b8dbe82f6be51 Mon Sep 17 00:00:00 2001 +From: osy <50960678+osy@users.noreply.github.com> +Date: Fri, 30 Dec 2022 20:24:00 -0800 +Subject: [PATCH] tcti: disable TARGET_TB_PCREL for TCTI + +It is currently not supported. +--- + target/arm/cpu-param.h | 2 ++ + target/i386/cpu-param.h | 2 +- + 2 files changed, 3 insertions(+), 1 deletion(-) + +diff --git a/target/arm/cpu-param.h b/target/arm/cpu-param.h +index 53cac9c89b..6c4af8f0d2 100644 +--- a/target/arm/cpu-param.h ++++ b/target/arm/cpu-param.h +@@ -31,7 +31,9 @@ + # define TARGET_PAGE_BITS_VARY + # define TARGET_PAGE_BITS_MIN 10 + ++#ifndef CONFIG_TCG_THREADED_INTERPRETER + # define TARGET_TB_PCREL 1 ++#endif + + /* + * Cache the attrs and shareability fields from the page table entry. +diff --git a/target/i386/cpu-param.h b/target/i386/cpu-param.h +index f579b16bd2..0975265ff3 100644 +--- a/target/i386/cpu-param.h ++++ b/target/i386/cpu-param.h +@@ -25,7 +25,7 @@ + #define TARGET_PAGE_BITS 12 + #define NB_MMU_MODES 5 + +-#ifndef CONFIG_USER_ONLY ++#if !defined(CONFIG_USER_ONLY) && !defined(CONFIG_TCG_THREADED_INTERPRETER) + # define TARGET_TB_PCREL 1 + #endif + +-- +2.28.0 +