|
@@ -35,9 +35,12 @@
|
|
|
#include "i915_trace.h"
|
|
|
#include "intel_drv.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_crtc_helper.h>
|
|
|
|
|
|
static struct drm_driver driver;
|
|
@@ -969,6 +972,15 @@ static int i915_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
|
|
|
if (PCI_FUNC(pdev->devfn))
|
|
|
return -ENODEV;
|
|
|
|
|
|
+ /*
|
|
|
+ * 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;
|
|
|
+
|
|
|
return drm_get_pci_dev(pdev, ent, &driver);
|
|
|
}
|
|
|
|