[PATCH v3 0/3] Apple GMUX hybrid graphics support for MacBookPro15,1

Andre Eikmeyer <[email protected]>
Newsgroups org.freedesktop.lists.amd-gfx,org.freedesktop.lists.dri-devel,org.kernel.vger.linux-kernel,org.kernel.vger.linux-sound,org.kernel.vger.platform-driver-x86
Message-ID <[email protected]>
Hello everyone,

This series enables hybrid graphics on the MacBookPro15,1.

The MacBookPro15,1 normally starts Linux with the discrete GPU as primary.
On the machines tested here that results in roughly 24 W idle power draw,
about 12 W of which is attributable to the otherwise unused discrete GPU.
Selecting the integrated GPU at boot avoids that cost, but the discrete GPU
cannot currently return after GMUX powers it down, so usable hybrid graphics
and suspend are not available.

This series provides the missing power lifecycle across apple-gmux, amdgpu
and the HDA controller. With the integrated GPU as primary, the discrete GPU
transitions between DynOff and DynPwr. Offloading through DRI_PRIME and
external monitor support both work across these transitions.

The result has been tested for three weeks on both the 2018 and 2019
MacBookPro15,1 revisions. Runtime suspend and resume, system suspend and
resume, repeated GPU wakeups, and a variety of external Thunderbolt and
USB-C monitors were tested successfully.

One question remains regarding Apple's gpu-power-prefs EFI variable. The
firmware defaults to the discrete GPU, while selecting the integrated GPU
is required before this hybrid configuration can take effect. Would setting
that preference from the kernel be appropriate on a known-good model, or
should it remain a userspace policy decision? Some discoverable way to
select the power-efficient configuration would seem preferable to requiring
users to know about a vendor-specific NVRAM variable.

Changes in v3:
- Restore integer result validation for PWG1 and PWG3. The MacBookPro15,1
  AML returns Zero on success and One on failure from both methods. The v2
  conversion to acpi_evaluate_object() incorrectly discarded that status.

Changes in v2:
- Refresh the individual patch descriptions.
- Refresh the cached discrete PCI device when a client is re-registered.
- Keep the HDA switcheroo implementation in the existing switcheroo section.
- Document the positive azx_prepare() return and add Takashi's Reviewed-by.

v2: https://lore.kernel.org/all/[email protected]/
v1: https://lore.kernel.org/all/[email protected]/

Thank you for your time and consideration.

Andre Eikmeyer (2):
  drm/amdgpu: add Apple GMUX runtime PM support
  ALSA: hda: allow direct complete with a powered-off GPU

Atharva Tiwari (1):
  platform/x86: apple-gmux: add MacBookPro15,1 dGPU power sequence

 drivers/gpu/drm/amd/amdgpu/amdgpu.h        |  1 +
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 34 +++++++--
 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c    | 30 +++++---
 drivers/gpu/drm/amd/pm/inc/amdgpu_dpm.h    |  1 +
 drivers/platform/x86/apple-gmux.c          | 86 ++++++++++++++++++++--
 sound/hda/controllers/intel.c              | 24 ++++++
 6 files changed, 153 insertions(+), 23 deletions(-)

-- 
2.55.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.