i915_pci.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579
  1. /*
  2. * Copyright © 2016 Intel Corporation
  3. *
  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:
  10. *
  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
  13. * Software.
  14. *
  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
  21. * IN THE SOFTWARE.
  22. *
  23. */
  24. #include <linux/console.h>
  25. #include <linux/vgaarb.h>
  26. #include <linux/vga_switcheroo.h>
  27. #include "i915_drv.h"
  28. #include "i915_selftest.h"
  29. #define GEN_DEFAULT_PIPEOFFSETS \
  30. .pipe_offsets = { PIPE_A_OFFSET, PIPE_B_OFFSET, \
  31. PIPE_C_OFFSET, PIPE_EDP_OFFSET }, \
  32. .trans_offsets = { TRANSCODER_A_OFFSET, TRANSCODER_B_OFFSET, \
  33. TRANSCODER_C_OFFSET, TRANSCODER_EDP_OFFSET }, \
  34. .palette_offsets = { PALETTE_A_OFFSET, PALETTE_B_OFFSET }
  35. #define GEN_CHV_PIPEOFFSETS \
  36. .pipe_offsets = { PIPE_A_OFFSET, PIPE_B_OFFSET, \
  37. CHV_PIPE_C_OFFSET }, \
  38. .trans_offsets = { TRANSCODER_A_OFFSET, TRANSCODER_B_OFFSET, \
  39. CHV_TRANSCODER_C_OFFSET, }, \
  40. .palette_offsets = { PALETTE_A_OFFSET, PALETTE_B_OFFSET, \
  41. CHV_PALETTE_C_OFFSET }
  42. #define CURSOR_OFFSETS \
  43. .cursor_offsets = { CURSOR_A_OFFSET, CURSOR_B_OFFSET, CHV_CURSOR_C_OFFSET }
  44. #define IVB_CURSOR_OFFSETS \
  45. .cursor_offsets = { CURSOR_A_OFFSET, IVB_CURSOR_B_OFFSET, IVB_CURSOR_C_OFFSET }
  46. #define BDW_COLORS \
  47. .color = { .degamma_lut_size = 512, .gamma_lut_size = 512 }
  48. #define CHV_COLORS \
  49. .color = { .degamma_lut_size = 65, .gamma_lut_size = 257 }
  50. /* Keep in gen based order, and chronological order within a gen */
  51. #define GEN2_FEATURES \
  52. .gen = 2, .num_pipes = 1, \
  53. .has_overlay = 1, .overlay_needs_physical = 1, \
  54. .has_gmch_display = 1, \
  55. .hws_needs_physical = 1, \
  56. .ring_mask = RENDER_RING, \
  57. GEN_DEFAULT_PIPEOFFSETS, \
  58. CURSOR_OFFSETS
  59. static const struct intel_device_info intel_i830_info = {
  60. GEN2_FEATURES,
  61. .platform = INTEL_I830,
  62. .is_mobile = 1, .cursor_needs_physical = 1,
  63. .num_pipes = 2, /* legal, last one wins */
  64. };
  65. static const struct intel_device_info intel_i845g_info = {
  66. GEN2_FEATURES,
  67. .platform = INTEL_I845G,
  68. };
  69. static const struct intel_device_info intel_i85x_info = {
  70. GEN2_FEATURES,
  71. .platform = INTEL_I85X, .is_mobile = 1,
  72. .num_pipes = 2, /* legal, last one wins */
  73. .cursor_needs_physical = 1,
  74. .has_fbc = 1,
  75. };
  76. static const struct intel_device_info intel_i865g_info = {
  77. GEN2_FEATURES,
  78. .platform = INTEL_I865G,
  79. };
  80. #define GEN3_FEATURES \
  81. .gen = 3, .num_pipes = 2, \
  82. .has_gmch_display = 1, \
  83. .ring_mask = RENDER_RING, \
  84. GEN_DEFAULT_PIPEOFFSETS, \
  85. CURSOR_OFFSETS
  86. static const struct intel_device_info intel_i915g_info = {
  87. GEN3_FEATURES,
  88. .platform = INTEL_I915G, .cursor_needs_physical = 1,
  89. .has_overlay = 1, .overlay_needs_physical = 1,
  90. .hws_needs_physical = 1,
  91. };
  92. static const struct intel_device_info intel_i915gm_info = {
  93. GEN3_FEATURES,
  94. .platform = INTEL_I915GM,
  95. .is_mobile = 1,
  96. .cursor_needs_physical = 1,
  97. .has_overlay = 1, .overlay_needs_physical = 1,
  98. .supports_tv = 1,
  99. .has_fbc = 1,
  100. .hws_needs_physical = 1,
  101. };
  102. static const struct intel_device_info intel_i945g_info = {
  103. GEN3_FEATURES,
  104. .platform = INTEL_I945G,
  105. .has_hotplug = 1, .cursor_needs_physical = 1,
  106. .has_overlay = 1, .overlay_needs_physical = 1,
  107. .hws_needs_physical = 1,
  108. };
  109. static const struct intel_device_info intel_i945gm_info = {
  110. GEN3_FEATURES,
  111. .platform = INTEL_I945GM, .is_mobile = 1,
  112. .has_hotplug = 1, .cursor_needs_physical = 1,
  113. .has_overlay = 1, .overlay_needs_physical = 1,
  114. .supports_tv = 1,
  115. .has_fbc = 1,
  116. .hws_needs_physical = 1,
  117. };
  118. static const struct intel_device_info intel_g33_info = {
  119. GEN3_FEATURES,
  120. .platform = INTEL_G33,
  121. .has_hotplug = 1,
  122. .has_overlay = 1,
  123. };
  124. static const struct intel_device_info intel_pineview_info = {
  125. GEN3_FEATURES,
  126. .platform = INTEL_PINEVIEW, .is_mobile = 1,
  127. .has_hotplug = 1,
  128. .has_overlay = 1,
  129. };
  130. #define GEN4_FEATURES \
  131. .gen = 4, .num_pipes = 2, \
  132. .has_hotplug = 1, \
  133. .has_gmch_display = 1, \
  134. .ring_mask = RENDER_RING, \
  135. GEN_DEFAULT_PIPEOFFSETS, \
  136. CURSOR_OFFSETS
  137. static const struct intel_device_info intel_i965g_info = {
  138. GEN4_FEATURES,
  139. .platform = INTEL_I965G,
  140. .has_overlay = 1,
  141. .hws_needs_physical = 1,
  142. };
  143. static const struct intel_device_info intel_i965gm_info = {
  144. GEN4_FEATURES,
  145. .platform = INTEL_I965GM,
  146. .is_mobile = 1, .has_fbc = 1,
  147. .has_overlay = 1,
  148. .supports_tv = 1,
  149. .hws_needs_physical = 1,
  150. };
  151. static const struct intel_device_info intel_g45_info = {
  152. GEN4_FEATURES,
  153. .platform = INTEL_G45,
  154. .has_pipe_cxsr = 1,
  155. .ring_mask = RENDER_RING | BSD_RING,
  156. };
  157. static const struct intel_device_info intel_gm45_info = {
  158. GEN4_FEATURES,
  159. .platform = INTEL_GM45,
  160. .is_mobile = 1, .has_fbc = 1,
  161. .has_pipe_cxsr = 1,
  162. .supports_tv = 1,
  163. .ring_mask = RENDER_RING | BSD_RING,
  164. };
  165. #define GEN5_FEATURES \
  166. .gen = 5, .num_pipes = 2, \
  167. .has_hotplug = 1, \
  168. .has_gmbus_irq = 1, \
  169. .ring_mask = RENDER_RING | BSD_RING, \
  170. GEN_DEFAULT_PIPEOFFSETS, \
  171. CURSOR_OFFSETS
  172. static const struct intel_device_info intel_ironlake_d_info = {
  173. GEN5_FEATURES,
  174. .platform = INTEL_IRONLAKE,
  175. };
  176. static const struct intel_device_info intel_ironlake_m_info = {
  177. GEN5_FEATURES,
  178. .platform = INTEL_IRONLAKE,
  179. .is_mobile = 1,
  180. };
  181. #define GEN6_FEATURES \
  182. .gen = 6, .num_pipes = 2, \
  183. .has_hotplug = 1, \
  184. .has_fbc = 1, \
  185. .ring_mask = RENDER_RING | BSD_RING | BLT_RING, \
  186. .has_llc = 1, \
  187. .has_rc6 = 1, \
  188. .has_rc6p = 1, \
  189. .has_gmbus_irq = 1, \
  190. .has_hw_contexts = 1, \
  191. .has_aliasing_ppgtt = 1, \
  192. GEN_DEFAULT_PIPEOFFSETS, \
  193. CURSOR_OFFSETS
  194. static const struct intel_device_info intel_sandybridge_d_info = {
  195. GEN6_FEATURES,
  196. .platform = INTEL_SANDYBRIDGE,
  197. };
  198. static const struct intel_device_info intel_sandybridge_m_info = {
  199. GEN6_FEATURES,
  200. .platform = INTEL_SANDYBRIDGE,
  201. .is_mobile = 1,
  202. };
  203. #define GEN7_FEATURES \
  204. .gen = 7, .num_pipes = 3, \
  205. .has_hotplug = 1, \
  206. .has_fbc = 1, \
  207. .ring_mask = RENDER_RING | BSD_RING | BLT_RING, \
  208. .has_llc = 1, \
  209. .has_rc6 = 1, \
  210. .has_rc6p = 1, \
  211. .has_gmbus_irq = 1, \
  212. .has_hw_contexts = 1, \
  213. .has_aliasing_ppgtt = 1, \
  214. .has_full_ppgtt = 1, \
  215. GEN_DEFAULT_PIPEOFFSETS, \
  216. IVB_CURSOR_OFFSETS
  217. static const struct intel_device_info intel_ivybridge_d_info = {
  218. GEN7_FEATURES,
  219. .platform = INTEL_IVYBRIDGE,
  220. .has_l3_dpf = 1,
  221. };
  222. static const struct intel_device_info intel_ivybridge_m_info = {
  223. GEN7_FEATURES,
  224. .platform = INTEL_IVYBRIDGE,
  225. .is_mobile = 1,
  226. .has_l3_dpf = 1,
  227. };
  228. static const struct intel_device_info intel_ivybridge_q_info = {
  229. GEN7_FEATURES,
  230. .platform = INTEL_IVYBRIDGE,
  231. .num_pipes = 0, /* legal, last one wins */
  232. .has_l3_dpf = 1,
  233. };
  234. static const struct intel_device_info intel_valleyview_info = {
  235. .platform = INTEL_VALLEYVIEW,
  236. .gen = 7,
  237. .is_lp = 1,
  238. .num_pipes = 2,
  239. .has_psr = 1,
  240. .has_runtime_pm = 1,
  241. .has_rc6 = 1,
  242. .has_gmbus_irq = 1,
  243. .has_hw_contexts = 1,
  244. .has_gmch_display = 1,
  245. .has_hotplug = 1,
  246. .has_aliasing_ppgtt = 1,
  247. .has_full_ppgtt = 1,
  248. .ring_mask = RENDER_RING | BSD_RING | BLT_RING,
  249. .display_mmio_offset = VLV_DISPLAY_BASE,
  250. GEN_DEFAULT_PIPEOFFSETS,
  251. CURSOR_OFFSETS
  252. };
  253. #define HSW_FEATURES \
  254. GEN7_FEATURES, \
  255. .ring_mask = RENDER_RING | BSD_RING | BLT_RING | VEBOX_RING, \
  256. .has_ddi = 1, \
  257. .has_fpga_dbg = 1, \
  258. .has_psr = 1, \
  259. .has_resource_streamer = 1, \
  260. .has_dp_mst = 1, \
  261. .has_rc6p = 0 /* RC6p removed-by HSW */, \
  262. .has_runtime_pm = 1
  263. static const struct intel_device_info intel_haswell_info = {
  264. HSW_FEATURES,
  265. .platform = INTEL_HASWELL,
  266. .has_l3_dpf = 1,
  267. };
  268. #define BDW_FEATURES \
  269. HSW_FEATURES, \
  270. BDW_COLORS, \
  271. .has_logical_ring_contexts = 1, \
  272. .has_full_48bit_ppgtt = 1, \
  273. .has_64bit_reloc = 1
  274. static const struct intel_device_info intel_broadwell_info = {
  275. BDW_FEATURES,
  276. .gen = 8,
  277. .platform = INTEL_BROADWELL,
  278. };
  279. static const struct intel_device_info intel_broadwell_gt3_info = {
  280. BDW_FEATURES,
  281. .gen = 8,
  282. .platform = INTEL_BROADWELL,
  283. .ring_mask = RENDER_RING | BSD_RING | BLT_RING | VEBOX_RING | BSD2_RING,
  284. };
  285. static const struct intel_device_info intel_cherryview_info = {
  286. .gen = 8, .num_pipes = 3,
  287. .has_hotplug = 1,
  288. .is_lp = 1,
  289. .ring_mask = RENDER_RING | BSD_RING | BLT_RING | VEBOX_RING,
  290. .platform = INTEL_CHERRYVIEW,
  291. .has_64bit_reloc = 1,
  292. .has_psr = 1,
  293. .has_runtime_pm = 1,
  294. .has_resource_streamer = 1,
  295. .has_rc6 = 1,
  296. .has_gmbus_irq = 1,
  297. .has_hw_contexts = 1,
  298. .has_logical_ring_contexts = 1,
  299. .has_gmch_display = 1,
  300. .has_aliasing_ppgtt = 1,
  301. .has_full_ppgtt = 1,
  302. .display_mmio_offset = VLV_DISPLAY_BASE,
  303. GEN_CHV_PIPEOFFSETS,
  304. CURSOR_OFFSETS,
  305. CHV_COLORS,
  306. };
  307. static const struct intel_device_info intel_skylake_info = {
  308. BDW_FEATURES,
  309. .platform = INTEL_SKYLAKE,
  310. .gen = 9,
  311. .has_csr = 1,
  312. .has_guc = 1,
  313. .ddb_size = 896,
  314. };
  315. static const struct intel_device_info intel_skylake_gt3_info = {
  316. BDW_FEATURES,
  317. .platform = INTEL_SKYLAKE,
  318. .gen = 9,
  319. .has_csr = 1,
  320. .has_guc = 1,
  321. .ddb_size = 896,
  322. .ring_mask = RENDER_RING | BSD_RING | BLT_RING | VEBOX_RING | BSD2_RING,
  323. };
  324. #define GEN9_LP_FEATURES \
  325. .gen = 9, \
  326. .is_lp = 1, \
  327. .has_hotplug = 1, \
  328. .ring_mask = RENDER_RING | BSD_RING | BLT_RING | VEBOX_RING, \
  329. .num_pipes = 3, \
  330. .has_64bit_reloc = 1, \
  331. .has_ddi = 1, \
  332. .has_fpga_dbg = 1, \
  333. .has_fbc = 1, \
  334. .has_runtime_pm = 1, \
  335. .has_pooled_eu = 0, \
  336. .has_csr = 1, \
  337. .has_resource_streamer = 1, \
  338. .has_rc6 = 1, \
  339. .has_dp_mst = 1, \
  340. .has_gmbus_irq = 1, \
  341. .has_hw_contexts = 1, \
  342. .has_logical_ring_contexts = 1, \
  343. .has_guc = 1, \
  344. .has_decoupled_mmio = 1, \
  345. .has_aliasing_ppgtt = 1, \
  346. .has_full_ppgtt = 1, \
  347. .has_full_48bit_ppgtt = 1, \
  348. GEN_DEFAULT_PIPEOFFSETS, \
  349. IVB_CURSOR_OFFSETS, \
  350. BDW_COLORS
  351. static const struct intel_device_info intel_broxton_info = {
  352. GEN9_LP_FEATURES,
  353. .platform = INTEL_BROXTON,
  354. .ddb_size = 512,
  355. };
  356. static const struct intel_device_info intel_geminilake_info = {
  357. GEN9_LP_FEATURES,
  358. .platform = INTEL_GEMINILAKE,
  359. .is_alpha_support = 1,
  360. .ddb_size = 1024,
  361. .color = { .degamma_lut_size = 0, .gamma_lut_size = 1024 }
  362. };
  363. static const struct intel_device_info intel_kabylake_info = {
  364. BDW_FEATURES,
  365. .platform = INTEL_KABYLAKE,
  366. .gen = 9,
  367. .has_csr = 1,
  368. .has_guc = 1,
  369. .ddb_size = 896,
  370. };
  371. static const struct intel_device_info intel_kabylake_gt3_info = {
  372. BDW_FEATURES,
  373. .platform = INTEL_KABYLAKE,
  374. .gen = 9,
  375. .has_csr = 1,
  376. .has_guc = 1,
  377. .ddb_size = 896,
  378. .ring_mask = RENDER_RING | BSD_RING | BLT_RING | VEBOX_RING | BSD2_RING,
  379. };
  380. /*
  381. * Make sure any device matches here are from most specific to most
  382. * general. For example, since the Quanta match is based on the subsystem
  383. * and subvendor IDs, we need it to come before the more general IVB
  384. * PCI ID matches, otherwise we'll use the wrong info struct above.
  385. */
  386. static const struct pci_device_id pciidlist[] = {
  387. INTEL_I830_IDS(&intel_i830_info),
  388. INTEL_I845G_IDS(&intel_i845g_info),
  389. INTEL_I85X_IDS(&intel_i85x_info),
  390. INTEL_I865G_IDS(&intel_i865g_info),
  391. INTEL_I915G_IDS(&intel_i915g_info),
  392. INTEL_I915GM_IDS(&intel_i915gm_info),
  393. INTEL_I945G_IDS(&intel_i945g_info),
  394. INTEL_I945GM_IDS(&intel_i945gm_info),
  395. INTEL_I965G_IDS(&intel_i965g_info),
  396. INTEL_G33_IDS(&intel_g33_info),
  397. INTEL_I965GM_IDS(&intel_i965gm_info),
  398. INTEL_GM45_IDS(&intel_gm45_info),
  399. INTEL_G45_IDS(&intel_g45_info),
  400. INTEL_PINEVIEW_IDS(&intel_pineview_info),
  401. INTEL_IRONLAKE_D_IDS(&intel_ironlake_d_info),
  402. INTEL_IRONLAKE_M_IDS(&intel_ironlake_m_info),
  403. INTEL_SNB_D_IDS(&intel_sandybridge_d_info),
  404. INTEL_SNB_M_IDS(&intel_sandybridge_m_info),
  405. INTEL_IVB_Q_IDS(&intel_ivybridge_q_info), /* must be first IVB */
  406. INTEL_IVB_M_IDS(&intel_ivybridge_m_info),
  407. INTEL_IVB_D_IDS(&intel_ivybridge_d_info),
  408. INTEL_HSW_IDS(&intel_haswell_info),
  409. INTEL_VLV_IDS(&intel_valleyview_info),
  410. INTEL_BDW_GT12_IDS(&intel_broadwell_info),
  411. INTEL_BDW_GT3_IDS(&intel_broadwell_gt3_info),
  412. INTEL_BDW_RSVD_IDS(&intel_broadwell_info),
  413. INTEL_CHV_IDS(&intel_cherryview_info),
  414. INTEL_SKL_GT1_IDS(&intel_skylake_info),
  415. INTEL_SKL_GT2_IDS(&intel_skylake_info),
  416. INTEL_SKL_GT3_IDS(&intel_skylake_gt3_info),
  417. INTEL_SKL_GT4_IDS(&intel_skylake_gt3_info),
  418. INTEL_BXT_IDS(&intel_broxton_info),
  419. INTEL_GLK_IDS(&intel_geminilake_info),
  420. INTEL_KBL_GT1_IDS(&intel_kabylake_info),
  421. INTEL_KBL_GT2_IDS(&intel_kabylake_info),
  422. INTEL_KBL_GT3_IDS(&intel_kabylake_gt3_info),
  423. INTEL_KBL_GT4_IDS(&intel_kabylake_gt3_info),
  424. {0, 0, 0}
  425. };
  426. MODULE_DEVICE_TABLE(pci, pciidlist);
  427. static void i915_pci_remove(struct pci_dev *pdev)
  428. {
  429. struct drm_device *dev = pci_get_drvdata(pdev);
  430. i915_driver_unload(dev);
  431. drm_dev_unref(dev);
  432. }
  433. static int i915_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
  434. {
  435. struct intel_device_info *intel_info =
  436. (struct intel_device_info *) ent->driver_data;
  437. int err;
  438. if (IS_ALPHA_SUPPORT(intel_info) && !i915.alpha_support) {
  439. DRM_INFO("The driver support for your hardware in this kernel version is alpha quality\n"
  440. "See CONFIG_DRM_I915_ALPHA_SUPPORT or i915.alpha_support module parameter\n"
  441. "to enable support in this kernel version, or check for kernel updates.\n");
  442. return -ENODEV;
  443. }
  444. /* Only bind to function 0 of the device. Early generations
  445. * used function 1 as a placeholder for multi-head. This causes
  446. * us confusion instead, especially on the systems where both
  447. * functions have the same PCI-ID!
  448. */
  449. if (PCI_FUNC(pdev->devfn))
  450. return -ENODEV;
  451. /*
  452. * apple-gmux is needed on dual GPU MacBook Pro
  453. * to probe the panel if we're the inactive GPU.
  454. */
  455. if (vga_switcheroo_client_probe_defer(pdev))
  456. return -EPROBE_DEFER;
  457. err = i915_driver_load(pdev, ent);
  458. if (err)
  459. return err;
  460. err = i915_live_selftests(pdev);
  461. if (err) {
  462. i915_pci_remove(pdev);
  463. return err > 0 ? -ENOTTY : err;
  464. }
  465. return 0;
  466. }
  467. static struct pci_driver i915_pci_driver = {
  468. .name = DRIVER_NAME,
  469. .id_table = pciidlist,
  470. .probe = i915_pci_probe,
  471. .remove = i915_pci_remove,
  472. .driver.pm = &i915_pm_ops,
  473. };
  474. static int __init i915_init(void)
  475. {
  476. bool use_kms = true;
  477. int err;
  478. err = i915_mock_selftests();
  479. if (err)
  480. return err > 0 ? 0 : err;
  481. /*
  482. * Enable KMS by default, unless explicitly overriden by
  483. * either the i915.modeset prarameter or by the
  484. * vga_text_mode_force boot option.
  485. */
  486. if (i915.modeset == 0)
  487. use_kms = false;
  488. if (vgacon_text_force() && i915.modeset == -1)
  489. use_kms = false;
  490. if (!use_kms) {
  491. /* Silently fail loading to not upset userspace. */
  492. DRM_DEBUG_DRIVER("KMS disabled.\n");
  493. return 0;
  494. }
  495. return pci_register_driver(&i915_pci_driver);
  496. }
  497. static void __exit i915_exit(void)
  498. {
  499. if (!i915_pci_driver.driver.owner)
  500. return;
  501. pci_unregister_driver(&i915_pci_driver);
  502. }
  503. module_init(i915_init);
  504. module_exit(i915_exit);
  505. MODULE_AUTHOR("Tungsten Graphics, Inc.");
  506. MODULE_AUTHOR("Intel Corporation");
  507. MODULE_DESCRIPTION(DRIVER_DESC);
  508. MODULE_LICENSE("GPL and additional rights");