]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/gpu/drm/radeon/radeon_drv.c
Merge remote-tracking branch 'rcu/rcu/next'
[karo-tx-linux.git] / drivers / gpu / drm / radeon / radeon_drv.c
index e266ffc520d264178cd9bb7569c35b3626235396..cad25557650f054746b957bc04ea8a69f3a83e01 100644 (file)
 #include "radeon_drv.h"
 
 #include <drm/drm_pciids.h>
+#include <linux/apple-gmux.h>
 #include <linux/console.h>
 #include <linux/module.h>
 #include <linux/pm_runtime.h>
+#include <linux/vgaarb.h>
 #include <linux/vga_switcheroo.h>
 #include <drm/drm_gem.h>
 
@@ -319,6 +321,15 @@ static int radeon_pci_probe(struct pci_dev *pdev,
 {
        int ret;
 
+       /*
+        * apple-gmux is needed on dual GPU MacBook Pro
+        * to probe the panel if we're the inactive GPU.
+        */
+       if (IS_ENABLED(CONFIG_VGA_ARB) && IS_ENABLED(CONFIG_VGA_SWITCHEROO) &&
+           apple_gmux_present() && pdev != vga_default_device() &&
+           !vga_switcheroo_handler_flags())
+               return -EPROBE_DEFER;
+
        /* Get rid of things like offb */
        ret = radeon_kick_out_firmware_fb(pdev);
        if (ret)