]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
drm/amdgpu: register a vga_switcheroo client for MacBooks with apple-gmux
authorOrlando Chamberlain <orlandoch.dev@gmail.com>
Fri, 3 Mar 2023 11:34:25 +0000 (22:34 +1100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 11 May 2023 14:10:57 +0000 (23:10 +0900)
commit10d08e5dd284d2462ff8a560a727d2f7a2d52ac6
tree1c8725d6bddee5a83b7ecd2e3bfd49b6ddf04c3c
parentb19b4852e3a48c44d0c1dbbb18b9f52c76e3ebb2
drm/amdgpu: register a vga_switcheroo client for MacBooks with apple-gmux

[ Upstream commit d37a3929ca0363ed1dce02b2772cd5bc547ca66d ]

Commit 3840c5bcc245 ("drm/amdgpu: disentangle runtime pm and
vga_switcheroo") made amdgpu only register a vga_switcheroo client for
GPU's with PX, however AMD GPUs in dual gpu Apple Macbooks do need to
register, but don't have PX. Instead of AMD's PX, they use apple-gmux.

Use apple_gmux_detect() to identify these gpus, and
pci_is_thunderbolt_attached() to ensure eGPUs connected to Dual GPU
Macbooks don't register with vga_switcheroo.

Fixes: 3840c5bcc245 ("drm/amdgpu: disentangle runtime pm and vga_switcheroo")
Link: https://lore.kernel.org/amd-gfx/20230210044826.9834-10-orlandoch.dev@gmail.com/
Signed-off-by: Orlando Chamberlain <orlandoch.dev@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c