From nobody Sun Feb 22 04:20:34 2026 X-Original-To: dev-commits-src-all@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 4fJW4L27Ffz6SvTQ for ; Sun, 22 Feb 2026 04:20:34 +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 4fJW4L19KRz3bWc for ; Sun, 22 Feb 2026 04:20:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1771734034; 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=61hQNVffy6YJLke8PDyNjgscnZxjC44V1l5KslYhRZg=; b=OtsSCqGMyetpX3iZ49S3XH3eseuTRqPB5hULN2SzBvJUIeL0dgPKkzjdMJIq/DKz4ybHyd MRMawzHbWcRGuD52ZucD8T+q9WM8A+disl9Hflg7wmzvJ54uTDOtdrlQpGRlp32KalBL8E 2iv2FoEjstuayW5DlGO7VBJINiDEPifrWWWyCKCCZ4PEcucIDdzDFTxuViRuXNRudcrUsg WtSJj1hCBF4/8RY23eErsV0Ol5bSUrGIuqZdsqJPjfmAdfr112f+8nejgAVP9CRDv67FDW 5sukhpd779Sho9FaHUm6Y0fLKnk8B+HBprFsfKak6OVaj4jDcT+pcQ1iG+pW7w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1771734034; a=rsa-sha256; cv=none; b=TySvKYOXt/NvizlHGbbYqDv0Lp1yycaJJXFMZ8B/wwa8lDOIe6Mcsk/kvgetHcKuW9PKJt RcinfPG9+nK8/SgxdoJy8VKhyLVnv98pl5HmRIAM1sAYe8Kb0s+zTYSNeI6+U4Hoa6XwPX UZs5IbO7KdI3oUZFhh/sfItnMnMLXGvhPk42KTIU7UQMegUZdipOqXcXe2p3L5igqJj00n K3iWTv4G3XwwH+fQvuUgKibbZPnereDJEZFCF7caX+yXAREhRB2ukZy4PDoWRI4PIZXwF1 pPJcYKQ5EWhVlueXaUi/bnC+vw4xKZb115ZdbkTTuNf+mwUCYCGUVkpHSiiVhQ== 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=1771734034; 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=61hQNVffy6YJLke8PDyNjgscnZxjC44V1l5KslYhRZg=; b=tkrCuIvZlOdW3n5LPcq4Mk7c53o95QMvCRleNsfEMSPcNu2tso+0IuyB14bpnKNTOk4wAl /pKFjQo/o5wOJagCPNFWLsoH/KiJCLc67/YFumlDxO3z3TGkSx9yd2lk43iryBD9ny1liT 9sVOyc4+0cp80XldF11mz35hcOu/4o1lVLo9z69J59NF76qTtfbpg2wPmG3JIWoBMRYFN3 PvcdjGl/kkrKyBTlDUwrXnHgzEEPSBIQSbNbeCtJAKctCf8lVVzNWo4sNyzTCvQqtf5G15 MtE1E3JvYPQAnDcZp4kYQ19emOAg4gg4nMqRcycR2iiXmX23PobAeXV7e2WC9w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fJW4L0PXRzCmb for ; Sun, 22 Feb 2026 04:20:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 25655 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sun, 22 Feb 2026 04:20:34 +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: 964c97aa80ec - stable/14 - acpi: add Darwin OSI quirk for Apple Mac hardware List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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/14 X-Git-Reftype: branch X-Git-Commit: 964c97aa80ec301478dead9b67f0a1fe18d5479b Auto-Submitted: auto-generated Date: Sun, 22 Feb 2026 04:20:34 +0000 Message-Id: <699a8412.25655.6977cbf3@gitrepo.freebsd.org> The branch stable/14 has been updated by ngie: URL: https://cgit.FreeBSD.org/src/commit/?id=964c97aa80ec301478dead9b67f0a1fe18d5479b commit 964c97aa80ec301478dead9b67f0a1fe18d5479b Author: Abdelkader Boudih AuthorDate: 2026-02-03 01:43:00 +0000 Commit: Enji Cooper CommitDate: 2026-02-22 04:19:49 +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 2ba2b2c8c642..00086083f154 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); @@ -4623,6 +4634,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