diff options
author | Lukas Wunner <lukas@wunner.de> | 2017-03-10 15:23:45 -0500 |
---|---|---|
committer | Lukas Wunner <lukas@wunner.de> | 2017-03-30 16:42:30 -0400 |
commit | 1d3c11030103680a30bbe78b599f7e009bba3bc6 (patch) | |
tree | ed44125c33a5041055018d7f9744adc7f44e51d9 | |
parent | 84c8b22e9fe8d9a7f2ab3d561a6b4576540f5a31 (diff) |
drm/nouveau: Don't register Thunderbolt eGPU with vga_switcheroo
An external Thunderbolt GPU can neither drive the laptop's panel nor be
powered off by the platform, so there's no point in registering it with
vga_switcheroo. In fact, when the external GPU is runtime suspended,
vga_switcheroo will cut power to the internal discrete GPU, resulting in
a lockup.
Cc: Ben Skeggs <bskeggs@redhat.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Lukas Wunner <lukas@wunner.de>
Link: http://patchwork.freedesktop.org/patch/msgid/8e733152b13e7c14501ad5af45c1c5c736584111.1489145162.git.lukas@wunner.de
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_vga.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_vga.c b/drivers/gpu/drm/nouveau/nouveau_vga.c index ccb597eac538..a4aacbc0cec8 100644 --- a/drivers/gpu/drm/nouveau/nouveau_vga.c +++ b/drivers/gpu/drm/nouveau/nouveau_vga.c | |||
@@ -95,6 +95,10 @@ nouveau_vga_init(struct nouveau_drm *drm) | |||
95 | 95 | ||
96 | vga_client_register(dev->pdev, dev, NULL, nouveau_vga_set_decode); | 96 | vga_client_register(dev->pdev, dev, NULL, nouveau_vga_set_decode); |
97 | 97 | ||
98 | /* don't register Thunderbolt eGPU with vga_switcheroo */ | ||
99 | if (pci_is_thunderbolt_attached(dev->pdev)) | ||
100 | return; | ||
101 | |||
98 | if (nouveau_runtime_pm == 1) | 102 | if (nouveau_runtime_pm == 1) |
99 | runtime = true; | 103 | runtime = true; |
100 | if ((nouveau_runtime_pm == -1) && (nouveau_is_optimus() || nouveau_is_v1_dsm())) | 104 | if ((nouveau_runtime_pm == -1) && (nouveau_is_optimus() || nouveau_is_v1_dsm())) |
@@ -111,6 +115,11 @@ nouveau_vga_fini(struct nouveau_drm *drm) | |||
111 | struct drm_device *dev = drm->dev; | 115 | struct drm_device *dev = drm->dev; |
112 | bool runtime = false; | 116 | bool runtime = false; |
113 | 117 | ||
118 | vga_client_register(dev->pdev, NULL, NULL, NULL); | ||
119 | |||
120 | if (pci_is_thunderbolt_attached(dev->pdev)) | ||
121 | return; | ||
122 | |||
114 | if (nouveau_runtime_pm == 1) | 123 | if (nouveau_runtime_pm == 1) |
115 | runtime = true; | 124 | runtime = true; |
116 | if ((nouveau_runtime_pm == -1) && (nouveau_is_optimus() || nouveau_is_v1_dsm())) | 125 | if ((nouveau_runtime_pm == -1) && (nouveau_is_optimus() || nouveau_is_v1_dsm())) |
@@ -119,7 +128,6 @@ nouveau_vga_fini(struct nouveau_drm *drm) | |||
119 | vga_switcheroo_unregister_client(dev->pdev); | 128 | vga_switcheroo_unregister_client(dev->pdev); |
120 | if (runtime && nouveau_is_v1_dsm() && !nouveau_is_optimus()) | 129 | if (runtime && nouveau_is_v1_dsm() && !nouveau_is_optimus()) |
121 | vga_switcheroo_fini_domain_pm_ops(drm->dev->dev); | 130 | vga_switcheroo_fini_domain_pm_ops(drm->dev->dev); |
122 | vga_client_register(dev->pdev, NULL, NULL, NULL); | ||
123 | } | 131 | } |
124 | 132 | ||
125 | 133 | ||