2 * Copyright © 2016 Intel Corporation
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
11 * The above copyright notice and this permission notice (including the next
12 * paragraph) shall be included in all copies or substantial portions of the
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
25 #include <linux/console.h>
26 #include <linux/vgaarb.h>
27 #include <linux/vga_switcheroo.h>
29 #include <drm/drm_drv.h>
32 #include "i915_selftest.h"
34 #define PLATFORM(x) .platform = (x), .platform_mask = BIT(x)
35 #define GEN(x) .gen = (x), .gen_mask = BIT((x) - 1)
37 #define GEN_DEFAULT_PIPEOFFSETS \
39 [TRANSCODER_A] = PIPE_A_OFFSET, \
40 [TRANSCODER_B] = PIPE_B_OFFSET, \
41 [TRANSCODER_C] = PIPE_C_OFFSET, \
42 [TRANSCODER_EDP] = PIPE_EDP_OFFSET, \
45 [TRANSCODER_A] = TRANSCODER_A_OFFSET, \
46 [TRANSCODER_B] = TRANSCODER_B_OFFSET, \
47 [TRANSCODER_C] = TRANSCODER_C_OFFSET, \
48 [TRANSCODER_EDP] = TRANSCODER_EDP_OFFSET, \
51 #define GEN_CHV_PIPEOFFSETS \
53 [TRANSCODER_A] = PIPE_A_OFFSET, \
54 [TRANSCODER_B] = PIPE_B_OFFSET, \
55 [TRANSCODER_C] = CHV_PIPE_C_OFFSET, \
58 [TRANSCODER_A] = TRANSCODER_A_OFFSET, \
59 [TRANSCODER_B] = TRANSCODER_B_OFFSET, \
60 [TRANSCODER_C] = CHV_TRANSCODER_C_OFFSET, \
63 #define CURSOR_OFFSETS \
64 .cursor_offsets = { CURSOR_A_OFFSET, CURSOR_B_OFFSET, CHV_CURSOR_C_OFFSET }
66 #define IVB_CURSOR_OFFSETS \
67 .cursor_offsets = { CURSOR_A_OFFSET, IVB_CURSOR_B_OFFSET, IVB_CURSOR_C_OFFSET }
70 .color = { .degamma_lut_size = 512, .gamma_lut_size = 512 }
72 .color = { .degamma_lut_size = 65, .gamma_lut_size = 257, \
73 .degamma_lut_tests = DRM_COLOR_LUT_NON_DECREASING, \
74 .gamma_lut_tests = DRM_COLOR_LUT_NON_DECREASING, \
77 .color = { .degamma_lut_size = 0, .gamma_lut_size = 1024, \
78 .degamma_lut_tests = DRM_COLOR_LUT_NON_DECREASING | \
79 DRM_COLOR_LUT_EQUAL_CHANNELS, \
82 /* Keep in gen based order, and chronological order within a gen */
84 #define GEN_DEFAULT_PAGE_SIZES \
85 .page_sizes = I915_GTT_PAGE_SIZE_4K
87 #define GEN2_FEATURES \
90 .display.has_overlay = 1, \
91 .display.overlay_needs_physical = 1, \
92 .display.has_gmch_display = 1, \
93 .gpu_reset_clobbers_display = true, \
94 .hws_needs_physical = 1, \
95 .unfenced_needs_alignment = 1, \
96 .ring_mask = RENDER_RING, \
98 .has_coherent_ggtt = false, \
99 GEN_DEFAULT_PIPEOFFSETS, \
100 GEN_DEFAULT_PAGE_SIZES, \
103 static const struct intel_device_info intel_i830_info = {
105 PLATFORM(INTEL_I830),
107 .display.cursor_needs_physical = 1,
108 .num_pipes = 2, /* legal, last one wins */
111 static const struct intel_device_info intel_i845g_info = {
113 PLATFORM(INTEL_I845G),
116 static const struct intel_device_info intel_i85x_info = {
118 PLATFORM(INTEL_I85X),
120 .num_pipes = 2, /* legal, last one wins */
121 .display.cursor_needs_physical = 1,
122 .display.has_fbc = 1,
125 static const struct intel_device_info intel_i865g_info = {
127 PLATFORM(INTEL_I865G),
130 #define GEN3_FEATURES \
133 .display.has_gmch_display = 1, \
134 .gpu_reset_clobbers_display = true, \
135 .ring_mask = RENDER_RING, \
137 .has_coherent_ggtt = true, \
138 GEN_DEFAULT_PIPEOFFSETS, \
139 GEN_DEFAULT_PAGE_SIZES, \
142 static const struct intel_device_info intel_i915g_info = {
144 PLATFORM(INTEL_I915G),
145 .has_coherent_ggtt = false,
146 .display.cursor_needs_physical = 1,
147 .display.has_overlay = 1,
148 .display.overlay_needs_physical = 1,
149 .hws_needs_physical = 1,
150 .unfenced_needs_alignment = 1,
153 static const struct intel_device_info intel_i915gm_info = {
155 PLATFORM(INTEL_I915GM),
157 .display.cursor_needs_physical = 1,
158 .display.has_overlay = 1,
159 .display.overlay_needs_physical = 1,
160 .display.supports_tv = 1,
161 .display.has_fbc = 1,
162 .hws_needs_physical = 1,
163 .unfenced_needs_alignment = 1,
166 static const struct intel_device_info intel_i945g_info = {
168 PLATFORM(INTEL_I945G),
169 .display.has_hotplug = 1,
170 .display.cursor_needs_physical = 1,
171 .display.has_overlay = 1,
172 .display.overlay_needs_physical = 1,
173 .hws_needs_physical = 1,
174 .unfenced_needs_alignment = 1,
177 static const struct intel_device_info intel_i945gm_info = {
179 PLATFORM(INTEL_I945GM),
181 .display.has_hotplug = 1,
182 .display.cursor_needs_physical = 1,
183 .display.has_overlay = 1,
184 .display.overlay_needs_physical = 1,
185 .display.supports_tv = 1,
186 .display.has_fbc = 1,
187 .hws_needs_physical = 1,
188 .unfenced_needs_alignment = 1,
191 static const struct intel_device_info intel_g33_info = {
194 .display.has_hotplug = 1,
195 .display.has_overlay = 1,
198 static const struct intel_device_info intel_pineview_info = {
200 PLATFORM(INTEL_PINEVIEW),
202 .display.has_hotplug = 1,
203 .display.has_overlay = 1,
206 #define GEN4_FEATURES \
209 .display.has_hotplug = 1, \
210 .display.has_gmch_display = 1, \
211 .gpu_reset_clobbers_display = true, \
212 .ring_mask = RENDER_RING, \
214 .has_coherent_ggtt = true, \
215 GEN_DEFAULT_PIPEOFFSETS, \
216 GEN_DEFAULT_PAGE_SIZES, \
219 static const struct intel_device_info intel_i965g_info = {
221 PLATFORM(INTEL_I965G),
222 .display.has_overlay = 1,
223 .hws_needs_physical = 1,
227 static const struct intel_device_info intel_i965gm_info = {
229 PLATFORM(INTEL_I965GM),
231 .display.has_fbc = 1,
232 .display.has_overlay = 1,
233 .display.supports_tv = 1,
234 .hws_needs_physical = 1,
238 static const struct intel_device_info intel_g45_info = {
241 .ring_mask = RENDER_RING | BSD_RING,
242 .gpu_reset_clobbers_display = false,
245 static const struct intel_device_info intel_gm45_info = {
247 PLATFORM(INTEL_GM45),
249 .display.has_fbc = 1,
250 .display.supports_tv = 1,
251 .ring_mask = RENDER_RING | BSD_RING,
252 .gpu_reset_clobbers_display = false,
255 #define GEN5_FEATURES \
258 .display.has_hotplug = 1, \
259 .ring_mask = RENDER_RING | BSD_RING, \
261 .has_coherent_ggtt = true, \
262 /* ilk does support rc6, but we do not implement [power] contexts */ \
264 GEN_DEFAULT_PIPEOFFSETS, \
265 GEN_DEFAULT_PAGE_SIZES, \
268 static const struct intel_device_info intel_ironlake_d_info = {
270 PLATFORM(INTEL_IRONLAKE),
273 static const struct intel_device_info intel_ironlake_m_info = {
275 PLATFORM(INTEL_IRONLAKE),
277 .display.has_fbc = 1,
280 #define GEN6_FEATURES \
283 .display.has_hotplug = 1, \
284 .display.has_fbc = 1, \
285 .ring_mask = RENDER_RING | BSD_RING | BLT_RING, \
286 .has_coherent_ggtt = true, \
290 .ppgtt = INTEL_PPGTT_ALIASING, \
291 GEN_DEFAULT_PIPEOFFSETS, \
292 GEN_DEFAULT_PAGE_SIZES, \
295 #define SNB_D_PLATFORM \
297 PLATFORM(INTEL_SANDYBRIDGE)
299 static const struct intel_device_info intel_sandybridge_d_gt1_info = {
304 static const struct intel_device_info intel_sandybridge_d_gt2_info = {
309 #define SNB_M_PLATFORM \
311 PLATFORM(INTEL_SANDYBRIDGE), \
315 static const struct intel_device_info intel_sandybridge_m_gt1_info = {
320 static const struct intel_device_info intel_sandybridge_m_gt2_info = {
325 #define GEN7_FEATURES \
328 .display.has_hotplug = 1, \
329 .display.has_fbc = 1, \
330 .ring_mask = RENDER_RING | BSD_RING | BLT_RING, \
331 .has_coherent_ggtt = true, \
335 .ppgtt = INTEL_PPGTT_FULL, \
336 GEN_DEFAULT_PIPEOFFSETS, \
337 GEN_DEFAULT_PAGE_SIZES, \
340 #define IVB_D_PLATFORM \
342 PLATFORM(INTEL_IVYBRIDGE), \
345 static const struct intel_device_info intel_ivybridge_d_gt1_info = {
350 static const struct intel_device_info intel_ivybridge_d_gt2_info = {
355 #define IVB_M_PLATFORM \
357 PLATFORM(INTEL_IVYBRIDGE), \
361 static const struct intel_device_info intel_ivybridge_m_gt1_info = {
366 static const struct intel_device_info intel_ivybridge_m_gt2_info = {
371 static const struct intel_device_info intel_ivybridge_q_info = {
373 PLATFORM(INTEL_IVYBRIDGE),
375 .num_pipes = 0, /* legal, last one wins */
379 static const struct intel_device_info intel_valleyview_info = {
380 PLATFORM(INTEL_VALLEYVIEW),
386 .display.has_gmch_display = 1,
387 .display.has_hotplug = 1,
388 .ppgtt = INTEL_PPGTT_FULL,
390 .has_coherent_ggtt = false,
391 .ring_mask = RENDER_RING | BSD_RING | BLT_RING,
392 .display_mmio_offset = VLV_DISPLAY_BASE,
393 GEN_DEFAULT_PAGE_SIZES,
394 GEN_DEFAULT_PIPEOFFSETS,
398 #define G75_FEATURES \
400 .ring_mask = RENDER_RING | BSD_RING | BLT_RING | VEBOX_RING, \
401 .display.has_ddi = 1, \
403 .display.has_psr = 1, \
404 .display.has_dp_mst = 1, \
405 .has_rc6p = 0 /* RC6p removed-by HSW */, \
408 #define HSW_PLATFORM \
410 PLATFORM(INTEL_HASWELL), \
413 static const struct intel_device_info intel_haswell_gt1_info = {
418 static const struct intel_device_info intel_haswell_gt2_info = {
423 static const struct intel_device_info intel_haswell_gt3_info = {
428 #define GEN8_FEATURES \
432 .page_sizes = I915_GTT_PAGE_SIZE_4K | \
433 I915_GTT_PAGE_SIZE_2M, \
434 .has_logical_ring_contexts = 1, \
435 .ppgtt = INTEL_PPGTT_FULL_4LVL, \
436 .has_64bit_reloc = 1, \
437 .has_reset_engine = 1
439 #define BDW_PLATFORM \
441 PLATFORM(INTEL_BROADWELL)
443 static const struct intel_device_info intel_broadwell_gt1_info = {
448 static const struct intel_device_info intel_broadwell_gt2_info = {
453 static const struct intel_device_info intel_broadwell_rsvd_info = {
456 /* According to the device ID those devices are GT3, they were
457 * previously treated as not GT3, keep it like that.
461 static const struct intel_device_info intel_broadwell_gt3_info = {
464 .ring_mask = RENDER_RING | BSD_RING | BLT_RING | VEBOX_RING | BSD2_RING,
467 static const struct intel_device_info intel_cherryview_info = {
468 PLATFORM(INTEL_CHERRYVIEW),
471 .display.has_hotplug = 1,
473 .ring_mask = RENDER_RING | BSD_RING | BLT_RING | VEBOX_RING,
474 .has_64bit_reloc = 1,
477 .has_logical_ring_contexts = 1,
478 .display.has_gmch_display = 1,
479 .ppgtt = INTEL_PPGTT_FULL,
480 .has_reset_engine = 1,
482 .has_coherent_ggtt = false,
483 .display_mmio_offset = VLV_DISPLAY_BASE,
484 GEN_DEFAULT_PAGE_SIZES,
490 #define GEN9_DEFAULT_PAGE_SIZES \
491 .page_sizes = I915_GTT_PAGE_SIZE_4K | \
492 I915_GTT_PAGE_SIZE_64K | \
493 I915_GTT_PAGE_SIZE_2M
495 #define GEN9_FEATURES \
498 GEN9_DEFAULT_PAGE_SIZES, \
499 .has_logical_ring_preemption = 1, \
500 .display.has_csr = 1, \
502 .display.has_ipc = 1, \
505 #define SKL_PLATFORM \
507 /* Display WA #0477 WaDisableIPC: skl */ \
508 .display.has_ipc = 0, \
509 PLATFORM(INTEL_SKYLAKE)
511 static const struct intel_device_info intel_skylake_gt1_info = {
516 static const struct intel_device_info intel_skylake_gt2_info = {
521 #define SKL_GT3_PLUS_PLATFORM \
523 .ring_mask = RENDER_RING | BSD_RING | BLT_RING | VEBOX_RING | BSD2_RING
526 static const struct intel_device_info intel_skylake_gt3_info = {
527 SKL_GT3_PLUS_PLATFORM,
531 static const struct intel_device_info intel_skylake_gt4_info = {
532 SKL_GT3_PLUS_PLATFORM,
536 #define GEN9_LP_FEATURES \
539 .display.has_hotplug = 1, \
540 .ring_mask = RENDER_RING | BSD_RING | BLT_RING | VEBOX_RING, \
542 .has_64bit_reloc = 1, \
543 .display.has_ddi = 1, \
545 .display.has_fbc = 1, \
546 .display.has_psr = 1, \
547 .has_runtime_pm = 1, \
548 .display.has_csr = 1, \
550 .display.has_dp_mst = 1, \
551 .has_logical_ring_contexts = 1, \
552 .has_logical_ring_preemption = 1, \
554 .ppgtt = INTEL_PPGTT_FULL_4LVL, \
555 .has_reset_engine = 1, \
557 .has_coherent_ggtt = false, \
558 .display.has_ipc = 1, \
559 GEN9_DEFAULT_PAGE_SIZES, \
560 GEN_DEFAULT_PIPEOFFSETS, \
561 IVB_CURSOR_OFFSETS, \
564 static const struct intel_device_info intel_broxton_info = {
566 PLATFORM(INTEL_BROXTON),
570 static const struct intel_device_info intel_geminilake_info = {
572 PLATFORM(INTEL_GEMINILAKE),
577 #define KBL_PLATFORM \
579 PLATFORM(INTEL_KABYLAKE)
581 static const struct intel_device_info intel_kabylake_gt1_info = {
586 static const struct intel_device_info intel_kabylake_gt2_info = {
591 static const struct intel_device_info intel_kabylake_gt3_info = {
594 .ring_mask = RENDER_RING | BSD_RING | BLT_RING | VEBOX_RING | BSD2_RING,
597 #define CFL_PLATFORM \
599 PLATFORM(INTEL_COFFEELAKE)
601 static const struct intel_device_info intel_coffeelake_gt1_info = {
606 static const struct intel_device_info intel_coffeelake_gt2_info = {
611 static const struct intel_device_info intel_coffeelake_gt3_info = {
614 .ring_mask = RENDER_RING | BSD_RING | BLT_RING | VEBOX_RING | BSD2_RING,
617 #define GEN10_FEATURES \
621 .has_coherent_ggtt = false, \
624 static const struct intel_device_info intel_cannonlake_info = {
626 PLATFORM(INTEL_CANNONLAKE),
630 #define GEN11_FEATURES \
633 [TRANSCODER_A] = PIPE_A_OFFSET, \
634 [TRANSCODER_B] = PIPE_B_OFFSET, \
635 [TRANSCODER_C] = PIPE_C_OFFSET, \
636 [TRANSCODER_EDP] = PIPE_EDP_OFFSET, \
637 [TRANSCODER_DSI_0] = PIPE_DSI0_OFFSET, \
638 [TRANSCODER_DSI_1] = PIPE_DSI1_OFFSET, \
641 [TRANSCODER_A] = TRANSCODER_A_OFFSET, \
642 [TRANSCODER_B] = TRANSCODER_B_OFFSET, \
643 [TRANSCODER_C] = TRANSCODER_C_OFFSET, \
644 [TRANSCODER_EDP] = TRANSCODER_EDP_OFFSET, \
645 [TRANSCODER_DSI_0] = TRANSCODER_DSI0_OFFSET, \
646 [TRANSCODER_DSI_1] = TRANSCODER_DSI1_OFFSET, \
650 .has_logical_ring_elsq = 1
652 static const struct intel_device_info intel_icelake_11_info = {
654 PLATFORM(INTEL_ICELAKE),
655 .is_alpha_support = 1,
656 .ring_mask = RENDER_RING | BLT_RING | VEBOX_RING | BSD_RING | BSD3_RING,
663 * Make sure any device matches here are from most specific to most
664 * general. For example, since the Quanta match is based on the subsystem
665 * and subvendor IDs, we need it to come before the more general IVB
666 * PCI ID matches, otherwise we'll use the wrong info struct above.
668 static const struct pci_device_id pciidlist[] = {
669 INTEL_I830_IDS(&intel_i830_info),
670 INTEL_I845G_IDS(&intel_i845g_info),
671 INTEL_I85X_IDS(&intel_i85x_info),
672 INTEL_I865G_IDS(&intel_i865g_info),
673 INTEL_I915G_IDS(&intel_i915g_info),
674 INTEL_I915GM_IDS(&intel_i915gm_info),
675 INTEL_I945G_IDS(&intel_i945g_info),
676 INTEL_I945GM_IDS(&intel_i945gm_info),
677 INTEL_I965G_IDS(&intel_i965g_info),
678 INTEL_G33_IDS(&intel_g33_info),
679 INTEL_I965GM_IDS(&intel_i965gm_info),
680 INTEL_GM45_IDS(&intel_gm45_info),
681 INTEL_G45_IDS(&intel_g45_info),
682 INTEL_PINEVIEW_IDS(&intel_pineview_info),
683 INTEL_IRONLAKE_D_IDS(&intel_ironlake_d_info),
684 INTEL_IRONLAKE_M_IDS(&intel_ironlake_m_info),
685 INTEL_SNB_D_GT1_IDS(&intel_sandybridge_d_gt1_info),
686 INTEL_SNB_D_GT2_IDS(&intel_sandybridge_d_gt2_info),
687 INTEL_SNB_M_GT1_IDS(&intel_sandybridge_m_gt1_info),
688 INTEL_SNB_M_GT2_IDS(&intel_sandybridge_m_gt2_info),
689 INTEL_IVB_Q_IDS(&intel_ivybridge_q_info), /* must be first IVB */
690 INTEL_IVB_M_GT1_IDS(&intel_ivybridge_m_gt1_info),
691 INTEL_IVB_M_GT2_IDS(&intel_ivybridge_m_gt2_info),
692 INTEL_IVB_D_GT1_IDS(&intel_ivybridge_d_gt1_info),
693 INTEL_IVB_D_GT2_IDS(&intel_ivybridge_d_gt2_info),
694 INTEL_HSW_GT1_IDS(&intel_haswell_gt1_info),
695 INTEL_HSW_GT2_IDS(&intel_haswell_gt2_info),
696 INTEL_HSW_GT3_IDS(&intel_haswell_gt3_info),
697 INTEL_VLV_IDS(&intel_valleyview_info),
698 INTEL_BDW_GT1_IDS(&intel_broadwell_gt1_info),
699 INTEL_BDW_GT2_IDS(&intel_broadwell_gt2_info),
700 INTEL_BDW_GT3_IDS(&intel_broadwell_gt3_info),
701 INTEL_BDW_RSVD_IDS(&intel_broadwell_rsvd_info),
702 INTEL_CHV_IDS(&intel_cherryview_info),
703 INTEL_SKL_GT1_IDS(&intel_skylake_gt1_info),
704 INTEL_SKL_GT2_IDS(&intel_skylake_gt2_info),
705 INTEL_SKL_GT3_IDS(&intel_skylake_gt3_info),
706 INTEL_SKL_GT4_IDS(&intel_skylake_gt4_info),
707 INTEL_BXT_IDS(&intel_broxton_info),
708 INTEL_GLK_IDS(&intel_geminilake_info),
709 INTEL_KBL_GT1_IDS(&intel_kabylake_gt1_info),
710 INTEL_KBL_GT2_IDS(&intel_kabylake_gt2_info),
711 INTEL_KBL_GT3_IDS(&intel_kabylake_gt3_info),
712 INTEL_KBL_GT4_IDS(&intel_kabylake_gt3_info),
713 INTEL_AML_KBL_GT2_IDS(&intel_kabylake_gt2_info),
714 INTEL_CFL_S_GT1_IDS(&intel_coffeelake_gt1_info),
715 INTEL_CFL_S_GT2_IDS(&intel_coffeelake_gt2_info),
716 INTEL_CFL_H_GT1_IDS(&intel_coffeelake_gt1_info),
717 INTEL_CFL_H_GT2_IDS(&intel_coffeelake_gt2_info),
718 INTEL_CFL_U_GT2_IDS(&intel_coffeelake_gt2_info),
719 INTEL_CFL_U_GT3_IDS(&intel_coffeelake_gt3_info),
720 INTEL_WHL_U_GT1_IDS(&intel_coffeelake_gt1_info),
721 INTEL_WHL_U_GT2_IDS(&intel_coffeelake_gt2_info),
722 INTEL_AML_CFL_GT2_IDS(&intel_coffeelake_gt2_info),
723 INTEL_WHL_U_GT3_IDS(&intel_coffeelake_gt3_info),
724 INTEL_CNL_IDS(&intel_cannonlake_info),
725 INTEL_ICL_11_IDS(&intel_icelake_11_info),
728 MODULE_DEVICE_TABLE(pci, pciidlist);
730 static void i915_pci_remove(struct pci_dev *pdev)
732 struct drm_device *dev;
734 dev = pci_get_drvdata(pdev);
735 if (!dev) /* driver load aborted, nothing to cleanup */
738 i915_driver_unload(dev);
741 pci_set_drvdata(pdev, NULL);
744 static int i915_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
746 struct intel_device_info *intel_info =
747 (struct intel_device_info *) ent->driver_data;
750 if (IS_ALPHA_SUPPORT(intel_info) && !i915_modparams.alpha_support) {
751 DRM_INFO("The driver support for your hardware in this kernel version is alpha quality\n"
752 "See CONFIG_DRM_I915_ALPHA_SUPPORT or i915.alpha_support module parameter\n"
753 "to enable support in this kernel version, or check for kernel updates.\n");
757 /* Only bind to function 0 of the device. Early generations
758 * used function 1 as a placeholder for multi-head. This causes
759 * us confusion instead, especially on the systems where both
760 * functions have the same PCI-ID!
762 if (PCI_FUNC(pdev->devfn))
766 * apple-gmux is needed on dual GPU MacBook Pro
767 * to probe the panel if we're the inactive GPU.
769 if (vga_switcheroo_client_probe_defer(pdev))
770 return -EPROBE_DEFER;
772 err = i915_driver_load(pdev, ent);
776 if (i915_inject_load_failure()) {
777 i915_pci_remove(pdev);
781 err = i915_live_selftests(pdev);
783 i915_pci_remove(pdev);
784 return err > 0 ? -ENOTTY : err;
790 static struct pci_driver i915_pci_driver = {
792 .id_table = pciidlist,
793 .probe = i915_pci_probe,
794 .remove = i915_pci_remove,
795 .driver.pm = &i915_pm_ops,
798 static int __init i915_init(void)
803 err = i915_mock_selftests();
805 return err > 0 ? 0 : err;
808 * Enable KMS by default, unless explicitly overriden by
809 * either the i915.modeset prarameter or by the
810 * vga_text_mode_force boot option.
813 if (i915_modparams.modeset == 0)
816 if (vgacon_text_force() && i915_modparams.modeset == -1)
820 /* Silently fail loading to not upset userspace. */
821 DRM_DEBUG_DRIVER("KMS disabled.\n");
825 return pci_register_driver(&i915_pci_driver);
828 static void __exit i915_exit(void)
830 if (!i915_pci_driver.driver.owner)
833 pci_unregister_driver(&i915_pci_driver);
836 module_init(i915_init);
837 module_exit(i915_exit);
839 MODULE_AUTHOR("Tungsten Graphics, Inc.");
840 MODULE_AUTHOR("Intel Corporation");
842 MODULE_DESCRIPTION(DRIVER_DESC);
843 MODULE_LICENSE("GPL and additional rights");