kernel/apple_gmux: Unbreak loading i915.
authorPeeter Must <karu.pruun@gmail.com>
Tue, 28 Aug 2018 13:26:05 +0000 (16:26 +0300)
committerPeeter Must <karu.pruun@gmail.com>
Tue, 28 Aug 2018 13:26:05 +0000 (16:26 +0300)
commit0e1e180184c0a0a318f2c30138422cbb76f13e32
tree7199a56d2ecd1022c829a58ba9cf734edea1a0ec
parent54b9cd0b8b5b214cd2175a76597a92a009233be3
kernel/apple_gmux: Unbreak loading i915.

* Commit 183e2373896e4ea605435a6bd8f943e8273bf8cd broke loading i915
  on Apple MacBookPro laptops with dual GPUs and the gmux chip. The
  reason is that whereas formely drm_init_pdev() and drm_fill_pdev()
  where mere bookkeeping routines, the above commit relocates
  assignment of irq from drm_drv.c:drm_attach() to drm_fill_pdev().
  Since apple_gmux is loaded before i915, and apple_gmux initializes
  a pdev structure including an irq for the graphics pci device, the
  i915 which is loaded afterwards will get zero for an irq and hence
  fails to attach.

* The temporary fix is to disable apple_gmux initializing a pci_dev
  structure for bookkeeping purposes. This is not needed at the
  moment since the primary purpose of apple_gmux is to switch to iGPU
  so the user is not left with a frozen screen after loading i915. We
  do not support switching between GPUs yet.

* When and if the initialization of graphics pci devices becomes
  independent from the drm subsystem, we can make apple_gmux aware of
  the various GPUs in the system.
sys/gnu/dev/misc/apple_gmux/apple-gmux.c