diff options
author | Lukas Wunner <lukas@wunner.de> | 2016-01-11 14:09:20 -0500 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2016-02-09 05:21:13 -0500 |
commit | 14d2000182ed1cb6baf0fe8dc60a3664a832fc01 (patch) | |
tree | 85c76872f03787dae8994dfe6874c4edf0cfbf6a | |
parent | 98b3a3402eb6e38c3bf5dd4281e60e1f186f0041 (diff) |
drm/radeon: Defer probe if gmux is present but its driver isn't
gmux is a microcontroller built into dual GPU MacBook Pros.
On pre-retina MBPs, if we're the inactive GPU, we need apple-gmux
to temporarily switch DDC so that we can probe the panel's EDID.
The checks for CONFIG_VGA_ARB and CONFIG_VGA_SWITCHEROO are necessary
because if either of them is disabled but gmux is present, the driver
would never load, even if we're the active GPU. (vga_default_device()
would evaluate to NULL and vga_switcheroo_handler_flags() would
evaluate to 0.)
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=61115
Signed-off-by: Lukas Wunner <lukas@wunner.de>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/552da6d85a82092146af7b0693595fa2a9ea376b.1452525860.git.lukas@wunner.de
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_drv.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_drv.c b/drivers/gpu/drm/radeon/radeon_drv.c index e266ffc520d2..cad25557650f 100644 --- a/drivers/gpu/drm/radeon/radeon_drv.c +++ b/drivers/gpu/drm/radeon/radeon_drv.c | |||
@@ -34,9 +34,11 @@ | |||
34 | #include "radeon_drv.h" | 34 | #include "radeon_drv.h" |
35 | 35 | ||
36 | #include <drm/drm_pciids.h> | 36 | #include <drm/drm_pciids.h> |
37 | #include <linux/apple-gmux.h> | ||
37 | #include <linux/console.h> | 38 | #include <linux/console.h> |
38 | #include <linux/module.h> | 39 | #include <linux/module.h> |
39 | #include <linux/pm_runtime.h> | 40 | #include <linux/pm_runtime.h> |
41 | #include <linux/vgaarb.h> | ||
40 | #include <linux/vga_switcheroo.h> | 42 | #include <linux/vga_switcheroo.h> |
41 | #include <drm/drm_gem.h> | 43 | #include <drm/drm_gem.h> |
42 | 44 | ||
@@ -319,6 +321,15 @@ static int radeon_pci_probe(struct pci_dev *pdev, | |||
319 | { | 321 | { |
320 | int ret; | 322 | int ret; |
321 | 323 | ||
324 | /* | ||
325 | * apple-gmux is needed on dual GPU MacBook Pro | ||
326 | * to probe the panel if we're the inactive GPU. | ||
327 | */ | ||
328 | if (IS_ENABLED(CONFIG_VGA_ARB) && IS_ENABLED(CONFIG_VGA_SWITCHEROO) && | ||
329 | apple_gmux_present() && pdev != vga_default_device() && | ||
330 | !vga_switcheroo_handler_flags()) | ||
331 | return -EPROBE_DEFER; | ||
332 | |||
322 | /* Get rid of things like offb */ | 333 | /* Get rid of things like offb */ |
323 | ret = radeon_kick_out_firmware_fb(pdev); | 334 | ret = radeon_kick_out_firmware_fb(pdev); |
324 | if (ret) | 335 | if (ret) |