From nobody Sun Feb 22 04:19:32 2026 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4fJW385x5zz6SvGf for ; Sun, 22 Feb 2026 04:19:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fJW385BBcz3ZqG for ; Sun, 22 Feb 2026 04:19:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1771733972; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GXKdPYWJVVJowK8FFNdy37ay0wepPDqu6aszXc5i8q0=; b=YR6OSyxF7p5yPI9FL0xEaGye/2Py8J1oN3GlPEjEQIXRR5Uk7Z3TzNXEV3P5JMEIOWJHtQ mPvuaOG5r0a1/rg4Hm3QGSLMTg0FPchfXFyv3AP/c2+87Jmkfwel0WUClScXqYuN6xEe2i W6dZwlJ/3UozbQ4ORqXq6jk2HKgqSnjuZ5LbmS68sM7DPIc1poMtK0Q5vFvHwLexC4wQzA CESkK1uv4igf8/65JKSq9nn3GKyilUZt+0TFNLvvlzBM/8lH7GdKwo/Eh6S3si/BhcTKge GX/OqPxqe4n7/cVkQSmVM+X3gzV0sbsMBBF1qCnMygWpKBFjZi/FnCQceFeZdQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1771733972; a=rsa-sha256; cv=none; b=k2QD4BjvUhoQl/P+ignxHUB1LN158LbBxAo7xgD6ns5sjuE3JyY53jSvn97PYWWpQXV1rg EJPIP88CnMt8W8DLvRgIz0t0O0LVAq4+DTp2Xdr0HYj5qGBpfCp+n2niHjzJlKXl1RQi9d XnWm6+rDBAlqKFhXPRhNsHxXTbP7aRsRft/CARhoNOJXeZBDZtqFYf2PC9nMuCInmwdOfq UiCN9ZNPeqKCDDF3gyTGxaDwiszvBS3VEFjYH/JSYcw+AXpdozYHAFfcN1dWCwS7hKWOWY xeR2OGZL0dFlarsyv2aFDjAyncZyT0zhE4huPlcf6DsQA8ROha+81Zw3YfhJIw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1771733972; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GXKdPYWJVVJowK8FFNdy37ay0wepPDqu6aszXc5i8q0=; b=Rck82kobeZ+Bd1zWLprvOF0OTVFpKutHuVCKQwVnU2RFRvHHeXK+xskBeicDinzgvhcz+d Qgaz+UuGSggNpwf4cNd9caRyDq8iXGDVBpYaFqFo6MybY0AeQlRr4w/gQbQIt4Yd2f6M3L zjRebGq1oLMOVW0yQB4OVPEqOZtBDdlK6Fqr56HMYieKArhK+v0wIor01uKAac+UBSHL68 YPsZeEdLPWk7kW5T7e9oHGX/j716jl6pR6iaInt4K78ofN5hjJQckkSP59nLriJKfApCWc 2BYFb2BNF+gAHHo86bWPjgapGRM8f6EvWrXZ6XoXjp94rbKvbxThqoSvjfikXA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fJW384l3GzCpJ for ; Sun, 22 Feb 2026 04:19:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 25b31 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sun, 22 Feb 2026 04:19:32 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Cc: Abdelkader Boudih From: Enji Cooper Subject: git: cd937141ac00 - stable/15 - acpi: add Darwin OSI quirk for Apple Mac hardware List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ngie X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: cd937141ac0041d018e56bfc39843b7a96a5fd41 Auto-Submitted: auto-generated Date: Sun, 22 Feb 2026 04:19:32 +0000 Message-Id: <699a83d4.25b31.29b25edf@gitrepo.freebsd.org> The branch stable/15 has been updated by ngie: URL: https://cgit.FreeBSD.org/src/commit/?id=cd937141ac0041d018e56bfc39843b7a96a5fd41 commit cd937141ac0041d018e56bfc39843b7a96a5fd41 Author: Abdelkader Boudih AuthorDate: 2026-02-03 01:43:00 +0000 Commit: Enji Cooper CommitDate: 2026-02-22 04:17:44 +0000 acpi: add Darwin OSI quirk for Apple Mac hardware Mac firmware hides the Intel integrated GPU (iGPU) on dual GPU x86 systems, i.e., with AMD/NVIDIA dGPUs, when the Darwin OSI is not installed via ACPI. Prior to this change, FreeBSD always used the dGPU. This is fine in practice, but consumed more power than when the iGPU is used, resulting in reduced battery life. Linux handles this in `drivers/acpi/osi.c` by detecting Apple hardware via DMI, disabling all Windows OSI strings, and by explicitly installing the Darwin OSI ACPI handler. This change applies equivalent logic to the acpi(4) driver on FreeBSD. This feature can be enabled/disabled using the `hw.acpi.apple_darwin_osi` tunable. Setting this tunable to `0` restores the previous behavior by explicitly disabling the added support. Reviewed by: obiwac, ngie, adrian Differential Revision: https://reviews.freebsd.org/D54762 (cherry picked from commit 052a791b00555805f19ccc38a04d42d48b54104b) --- sys/dev/acpica/acpi.c | 72 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) diff --git a/sys/dev/acpica/acpi.c b/sys/dev/acpica/acpi.c index 04fc8d708a7d..9a141248524c 100644 --- a/sys/dev/acpica/acpi.c +++ b/sys/dev/acpica/acpi.c @@ -273,6 +273,17 @@ static char acpi_remove_interface[256]; TUNABLE_STR("hw.acpi.remove_interface", acpi_remove_interface, sizeof(acpi_remove_interface)); +/* + * Automatically apply the Darwin OSI on Apple Mac hardware to obtain + * access to full ACPI hardware support on supported platforms. + * + * This flag automatically overrides any values set by + * `hw.acpi.acpi_install_interface` and unset by + * `hw.acpi.acpi_remove_interface`. + */ +static int acpi_apple_darwin_osi = 1; +TUNABLE_INT("hw.acpi.apple_darwin_osi", &acpi_apple_darwin_osi); + /* Allow users to dump Debug objects without ACPI debugger. */ static int acpi_debug_objects; TUNABLE_INT("debug.acpi.enable_debug_objects", &acpi_debug_objects); @@ -4616,6 +4627,67 @@ acpi_reset_interfaces(device_t dev) } acpi_free_interfaces(&list); } + + /* + * Apple Mac hardware quirk: install Darwin OSI. + * + * On Apple hardware, install the Darwin OSI and remove the Windows OSI + * to match Linux behavior. + * + * This is required for dual-GPU MacBook Pro systems + * (Intel iGPU + AMD/NVIDIA dGPU) where the iGPU is hidden when the + * firmware doesn't see Darwin OSI, but it also unlocks additional ACPI + * support on non-MacBook Pro Apple platforms. + * + * Apple's ACPI firmware checks _OSI("Darwin") and sets OSYS=10000 + * for macOS. Many device methods use OSDW() which checks OSYS==10000 + * for macOS-specific behavior including GPU visibility and power + * management. + * + * Linux enables Darwin OSI by default on Apple hardware and disables + * all Windows OSI strings (drivers/acpi/osi.c). Users can override + * this behavior with acpi_osi=!Darwin to get Windows-like behavior, + * in general, but this logic makes that process unnecessary. + * + * Detect Apple via SMBIOS and enable Darwin while disabling Windows + * vendor strings. This makes both GPUs visible on dual-GPU MacBook Pro + * systems (Intel iGPU + AMD dGPU) and unlocks full platform + * ACPI support. + */ + if (acpi_apple_darwin_osi) { + char *vendor = kern_getenv("smbios.system.maker"); + if (vendor != NULL) { + if (strcmp(vendor, "Apple Inc.") == 0 || + strcmp(vendor, "Apple Computer, Inc.") == 0) { + /* Disable all other OSI vendor strings. */ + status = AcpiUpdateInterfaces( + ACPI_DISABLE_ALL_VENDOR_STRINGS); + /* Install Darwin */ + if (ACPI_SUCCESS(status)) { + status = AcpiInstallInterface("Darwin"); + } + if (bootverbose) { + if (ACPI_SUCCESS(status)) { + device_printf(dev, + "Apple hardware: installed Darwin " + "OSI and removed other vendor OSI " + "(Windows, etc)\n"); + } else { + device_printf(dev, + "Apple hardware: failed to install " + "Darwin OSI: %s\n", + AcpiFormatException( + status)); + } + } + } else if (bootverbose) { + device_printf(dev, + "Not installing Darwin OSI on unsupported platform: %s\n", + vendor); + } + freeenv(vendor); + } + } } static int