commit 076c90d28ae6e23545fd3520f7bc1e412b718636
parent 73e5637f996a553258ee097bad97a2cc3498cc4b
Author: Steven Michaud <smichaud@pobox.com>
Date: Fri, 17 Oct 2025 21:44:39 +0000
Bug 1993726 - Accommodate VMware's paravirtualized driver. r=mstange
Differential Revision: https://phabricator.services.mozilla.com/D268394
Diffstat:
1 file changed, 22 insertions(+), 3 deletions(-)
diff --git a/widget/cocoa/GfxInfo.mm b/widget/cocoa/GfxInfo.mm
@@ -176,9 +176,28 @@ void GfxInfo::GetDeviceInfo() {
}
#endif
- CFMutableDictionaryRef apv_dev_dict = IOServiceMatching("AppleParavirtGPU");
- if (IOServiceGetMatchingServices(kIOMasterPortDefault, apv_dev_dict,
- &io_iter) == kIOReturnSuccess) {
+ // "AppleParavirtGPU" is the class name in VMs that use the Apple
+ // Virtualization framework. But it's "AppleParavirtGPUControl" in VMware
+ // VMs (on Intel) that use VMware's "paravirtualized driver". Parallels
+ // Intel VMs have a "AppleParavirtGPUControl" service. But, like VMware
+ // VMs that don't use the "paravirtualized driver", they also have
+ // kClassCodeDisplayVGA devices. So these cases will have been dealt with
+ // above. On Apple Silicon, Parallels uses Apple's Virtualization
+ // framework. VMware doesn't support macOS guest VMs on Apple Silicon.
+ for (const char* className :
+ {"AppleParavirtGPU", "AppleParavirtGPUControl"}) {
+ CFMutableDictionaryRef apv_dev_dict = IOServiceMatching(className);
+ if (IOServiceGetMatchingServices(kIOMasterPortDefault, apv_dev_dict,
+ &io_iter) == kIOReturnSuccess) {
+ if (IOIteratorNext(io_iter) != IO_OBJECT_NULL) {
+ IOIteratorReset(io_iter);
+ break;
+ }
+ IOObjectRelease(io_iter);
+ }
+ io_iter = IO_OBJECT_NULL;
+ }
+ if (io_iter) {
io_registry_entry_t entry = IO_OBJECT_NULL;
while ((entry = IOIteratorNext(io_iter)) != IO_OBJECT_NULL) {
CFTypeRef vendor_id_ref =