intel_crt.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587
  1. /*
  2. * Copyright © 2006-2007 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
  21. * DEALINGS IN THE SOFTWARE.
  22. *
  23. * Authors:
  24. * Eric Anholt <eric@anholt.net>
  25. */
  26. #include <linux/i2c.h>
  27. #include <linux/slab.h>
  28. #include "drmP.h"
  29. #include "drm.h"
  30. #include "drm_crtc.h"
  31. #include "drm_crtc_helper.h"
  32. #include "intel_drv.h"
  33. #include "i915_drm.h"
  34. #include "i915_drv.h"
  35. static void intel_crt_dpms(struct drm_encoder *encoder, int mode)
  36. {
  37. struct drm_device *dev = encoder->dev;
  38. struct drm_i915_private *dev_priv = dev->dev_private;
  39. u32 temp, reg;
  40. if (HAS_PCH_SPLIT(dev))
  41. reg = PCH_ADPA;
  42. else
  43. reg = ADPA;
  44. temp = I915_READ(reg);
  45. temp &= ~(ADPA_HSYNC_CNTL_DISABLE | ADPA_VSYNC_CNTL_DISABLE);
  46. temp &= ~ADPA_DAC_ENABLE;
  47. switch(mode) {
  48. case DRM_MODE_DPMS_ON:
  49. temp |= ADPA_DAC_ENABLE;
  50. break;
  51. case DRM_MODE_DPMS_STANDBY:
  52. temp |= ADPA_DAC_ENABLE | ADPA_HSYNC_CNTL_DISABLE;
  53. break;
  54. case DRM_MODE_DPMS_SUSPEND:
  55. temp |= ADPA_DAC_ENABLE | ADPA_VSYNC_CNTL_DISABLE;
  56. break;
  57. case DRM_MODE_DPMS_OFF:
  58. temp |= ADPA_HSYNC_CNTL_DISABLE | ADPA_VSYNC_CNTL_DISABLE;
  59. break;
  60. }
  61. I915_WRITE(reg, temp);
  62. }
  63. static int intel_crt_mode_valid(struct drm_connector *connector,
  64. struct drm_display_mode *mode)
  65. {
  66. struct drm_device *dev = connector->dev;
  67. int max_clock = 0;
  68. if (mode->flags & DRM_MODE_FLAG_DBLSCAN)
  69. return MODE_NO_DBLESCAN;
  70. if (mode->clock < 25000)
  71. return MODE_CLOCK_LOW;
  72. if (!IS_I9XX(dev))
  73. max_clock = 350000;
  74. else
  75. max_clock = 400000;
  76. if (mode->clock > max_clock)
  77. return MODE_CLOCK_HIGH;
  78. return MODE_OK;
  79. }
  80. static bool intel_crt_mode_fixup(struct drm_encoder *encoder,
  81. struct drm_display_mode *mode,
  82. struct drm_display_mode *adjusted_mode)
  83. {
  84. return true;
  85. }
  86. static void intel_crt_mode_set(struct drm_encoder *encoder,
  87. struct drm_display_mode *mode,
  88. struct drm_display_mode *adjusted_mode)
  89. {
  90. struct drm_device *dev = encoder->dev;
  91. struct drm_crtc *crtc = encoder->crtc;
  92. struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
  93. struct drm_i915_private *dev_priv = dev->dev_private;
  94. int dpll_md_reg;
  95. u32 adpa, dpll_md;
  96. u32 adpa_reg;
  97. if (intel_crtc->pipe == 0)
  98. dpll_md_reg = DPLL_A_MD;
  99. else
  100. dpll_md_reg = DPLL_B_MD;
  101. if (HAS_PCH_SPLIT(dev))
  102. adpa_reg = PCH_ADPA;
  103. else
  104. adpa_reg = ADPA;
  105. /*
  106. * Disable separate mode multiplier used when cloning SDVO to CRT
  107. * XXX this needs to be adjusted when we really are cloning
  108. */
  109. if (IS_I965G(dev) && !HAS_PCH_SPLIT(dev)) {
  110. dpll_md = I915_READ(dpll_md_reg);
  111. I915_WRITE(dpll_md_reg,
  112. dpll_md & ~DPLL_MD_UDI_MULTIPLIER_MASK);
  113. }
  114. adpa = 0;
  115. if (adjusted_mode->flags & DRM_MODE_FLAG_PHSYNC)
  116. adpa |= ADPA_HSYNC_ACTIVE_HIGH;
  117. if (adjusted_mode->flags & DRM_MODE_FLAG_PVSYNC)
  118. adpa |= ADPA_VSYNC_ACTIVE_HIGH;
  119. if (intel_crtc->pipe == 0) {
  120. if (HAS_PCH_CPT(dev))
  121. adpa |= PORT_TRANS_A_SEL_CPT;
  122. else
  123. adpa |= ADPA_PIPE_A_SELECT;
  124. if (!HAS_PCH_SPLIT(dev))
  125. I915_WRITE(BCLRPAT_A, 0);
  126. } else {
  127. if (HAS_PCH_CPT(dev))
  128. adpa |= PORT_TRANS_B_SEL_CPT;
  129. else
  130. adpa |= ADPA_PIPE_B_SELECT;
  131. if (!HAS_PCH_SPLIT(dev))
  132. I915_WRITE(BCLRPAT_B, 0);
  133. }
  134. I915_WRITE(adpa_reg, adpa);
  135. }
  136. static bool intel_ironlake_crt_detect_hotplug(struct drm_connector *connector)
  137. {
  138. struct drm_device *dev = connector->dev;
  139. struct drm_i915_private *dev_priv = dev->dev_private;
  140. u32 adpa, temp;
  141. bool ret;
  142. temp = adpa = I915_READ(PCH_ADPA);
  143. if (HAS_PCH_CPT(dev)) {
  144. /* Disable DAC before force detect */
  145. I915_WRITE(PCH_ADPA, adpa & ~ADPA_DAC_ENABLE);
  146. (void)I915_READ(PCH_ADPA);
  147. } else {
  148. adpa &= ~ADPA_CRT_HOTPLUG_MASK;
  149. /* disable HPD first */
  150. I915_WRITE(PCH_ADPA, adpa);
  151. (void)I915_READ(PCH_ADPA);
  152. }
  153. adpa |= (ADPA_CRT_HOTPLUG_PERIOD_128 |
  154. ADPA_CRT_HOTPLUG_WARMUP_10MS |
  155. ADPA_CRT_HOTPLUG_SAMPLE_4S |
  156. ADPA_CRT_HOTPLUG_VOLTAGE_50 | /* default */
  157. ADPA_CRT_HOTPLUG_VOLREF_325MV |
  158. ADPA_CRT_HOTPLUG_ENABLE |
  159. ADPA_CRT_HOTPLUG_FORCE_TRIGGER);
  160. DRM_DEBUG_KMS("pch crt adpa 0x%x", adpa);
  161. I915_WRITE(PCH_ADPA, adpa);
  162. while ((I915_READ(PCH_ADPA) & ADPA_CRT_HOTPLUG_FORCE_TRIGGER) != 0)
  163. ;
  164. if (HAS_PCH_CPT(dev)) {
  165. I915_WRITE(PCH_ADPA, temp);
  166. (void)I915_READ(PCH_ADPA);
  167. }
  168. /* Check the status to see if both blue and green are on now */
  169. adpa = I915_READ(PCH_ADPA);
  170. adpa &= ADPA_CRT_HOTPLUG_MONITOR_MASK;
  171. if ((adpa == ADPA_CRT_HOTPLUG_MONITOR_COLOR) ||
  172. (adpa == ADPA_CRT_HOTPLUG_MONITOR_MONO))
  173. ret = true;
  174. else
  175. ret = false;
  176. return ret;
  177. }
  178. /**
  179. * Uses CRT_HOTPLUG_EN and CRT_HOTPLUG_STAT to detect CRT presence.
  180. *
  181. * Not for i915G/i915GM
  182. *
  183. * \return true if CRT is connected.
  184. * \return false if CRT is disconnected.
  185. */
  186. static bool intel_crt_detect_hotplug(struct drm_connector *connector)
  187. {
  188. struct drm_device *dev = connector->dev;
  189. struct drm_i915_private *dev_priv = dev->dev_private;
  190. u32 hotplug_en, orig, stat;
  191. bool ret = false;
  192. int i, tries = 0;
  193. if (HAS_PCH_SPLIT(dev))
  194. return intel_ironlake_crt_detect_hotplug(connector);
  195. /*
  196. * On 4 series desktop, CRT detect sequence need to be done twice
  197. * to get a reliable result.
  198. */
  199. if (IS_G4X(dev) && !IS_GM45(dev))
  200. tries = 2;
  201. else
  202. tries = 1;
  203. hotplug_en = orig = I915_READ(PORT_HOTPLUG_EN);
  204. hotplug_en |= CRT_HOTPLUG_FORCE_DETECT;
  205. for (i = 0; i < tries ; i++) {
  206. unsigned long timeout;
  207. /* turn on the FORCE_DETECT */
  208. I915_WRITE(PORT_HOTPLUG_EN, hotplug_en);
  209. timeout = jiffies + msecs_to_jiffies(1000);
  210. /* wait for FORCE_DETECT to go off */
  211. do {
  212. if (!(I915_READ(PORT_HOTPLUG_EN) &
  213. CRT_HOTPLUG_FORCE_DETECT))
  214. break;
  215. msleep(1);
  216. } while (time_after(timeout, jiffies));
  217. }
  218. stat = I915_READ(PORT_HOTPLUG_STAT);
  219. if ((stat & CRT_HOTPLUG_MONITOR_MASK) != CRT_HOTPLUG_MONITOR_NONE)
  220. ret = true;
  221. /* clear the interrupt we just generated, if any */
  222. I915_WRITE(PORT_HOTPLUG_STAT, CRT_HOTPLUG_INT_STATUS);
  223. /* and put the bits back */
  224. I915_WRITE(PORT_HOTPLUG_EN, orig);
  225. return ret;
  226. }
  227. static bool intel_crt_detect_ddc(struct drm_encoder *encoder)
  228. {
  229. struct intel_encoder *intel_encoder = enc_to_intel_encoder(encoder);
  230. /* CRT should always be at 0, but check anyway */
  231. if (intel_encoder->type != INTEL_OUTPUT_ANALOG)
  232. return false;
  233. return intel_ddc_probe(intel_encoder);
  234. }
  235. static enum drm_connector_status
  236. intel_crt_load_detect(struct drm_crtc *crtc, struct intel_encoder *intel_encoder)
  237. {
  238. struct drm_encoder *encoder = &intel_encoder->enc;
  239. struct drm_device *dev = encoder->dev;
  240. struct drm_i915_private *dev_priv = dev->dev_private;
  241. struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
  242. uint32_t pipe = intel_crtc->pipe;
  243. uint32_t save_bclrpat;
  244. uint32_t save_vtotal;
  245. uint32_t vtotal, vactive;
  246. uint32_t vsample;
  247. uint32_t vblank, vblank_start, vblank_end;
  248. uint32_t dsl;
  249. uint32_t bclrpat_reg;
  250. uint32_t vtotal_reg;
  251. uint32_t vblank_reg;
  252. uint32_t vsync_reg;
  253. uint32_t pipeconf_reg;
  254. uint32_t pipe_dsl_reg;
  255. uint8_t st00;
  256. enum drm_connector_status status;
  257. if (pipe == 0) {
  258. bclrpat_reg = BCLRPAT_A;
  259. vtotal_reg = VTOTAL_A;
  260. vblank_reg = VBLANK_A;
  261. vsync_reg = VSYNC_A;
  262. pipeconf_reg = PIPEACONF;
  263. pipe_dsl_reg = PIPEADSL;
  264. } else {
  265. bclrpat_reg = BCLRPAT_B;
  266. vtotal_reg = VTOTAL_B;
  267. vblank_reg = VBLANK_B;
  268. vsync_reg = VSYNC_B;
  269. pipeconf_reg = PIPEBCONF;
  270. pipe_dsl_reg = PIPEBDSL;
  271. }
  272. save_bclrpat = I915_READ(bclrpat_reg);
  273. save_vtotal = I915_READ(vtotal_reg);
  274. vblank = I915_READ(vblank_reg);
  275. vtotal = ((save_vtotal >> 16) & 0xfff) + 1;
  276. vactive = (save_vtotal & 0x7ff) + 1;
  277. vblank_start = (vblank & 0xfff) + 1;
  278. vblank_end = ((vblank >> 16) & 0xfff) + 1;
  279. /* Set the border color to purple. */
  280. I915_WRITE(bclrpat_reg, 0x500050);
  281. if (IS_I9XX(dev)) {
  282. uint32_t pipeconf = I915_READ(pipeconf_reg);
  283. I915_WRITE(pipeconf_reg, pipeconf | PIPECONF_FORCE_BORDER);
  284. /* Wait for next Vblank to substitue
  285. * border color for Color info */
  286. intel_wait_for_vblank(dev);
  287. st00 = I915_READ8(VGA_MSR_WRITE);
  288. status = ((st00 & (1 << 4)) != 0) ?
  289. connector_status_connected :
  290. connector_status_disconnected;
  291. I915_WRITE(pipeconf_reg, pipeconf);
  292. } else {
  293. bool restore_vblank = false;
  294. int count, detect;
  295. /*
  296. * If there isn't any border, add some.
  297. * Yes, this will flicker
  298. */
  299. if (vblank_start <= vactive && vblank_end >= vtotal) {
  300. uint32_t vsync = I915_READ(vsync_reg);
  301. uint32_t vsync_start = (vsync & 0xffff) + 1;
  302. vblank_start = vsync_start;
  303. I915_WRITE(vblank_reg,
  304. (vblank_start - 1) |
  305. ((vblank_end - 1) << 16));
  306. restore_vblank = true;
  307. }
  308. /* sample in the vertical border, selecting the larger one */
  309. if (vblank_start - vactive >= vtotal - vblank_end)
  310. vsample = (vblank_start + vactive) >> 1;
  311. else
  312. vsample = (vtotal + vblank_end) >> 1;
  313. /*
  314. * Wait for the border to be displayed
  315. */
  316. while (I915_READ(pipe_dsl_reg) >= vactive)
  317. ;
  318. while ((dsl = I915_READ(pipe_dsl_reg)) <= vsample)
  319. ;
  320. /*
  321. * Watch ST00 for an entire scanline
  322. */
  323. detect = 0;
  324. count = 0;
  325. do {
  326. count++;
  327. /* Read the ST00 VGA status register */
  328. st00 = I915_READ8(VGA_MSR_WRITE);
  329. if (st00 & (1 << 4))
  330. detect++;
  331. } while ((I915_READ(pipe_dsl_reg) == dsl));
  332. /* restore vblank if necessary */
  333. if (restore_vblank)
  334. I915_WRITE(vblank_reg, vblank);
  335. /*
  336. * If more than 3/4 of the scanline detected a monitor,
  337. * then it is assumed to be present. This works even on i830,
  338. * where there isn't any way to force the border color across
  339. * the screen
  340. */
  341. status = detect * 4 > count * 3 ?
  342. connector_status_connected :
  343. connector_status_disconnected;
  344. }
  345. /* Restore previous settings */
  346. I915_WRITE(bclrpat_reg, save_bclrpat);
  347. return status;
  348. }
  349. static enum drm_connector_status intel_crt_detect(struct drm_connector *connector)
  350. {
  351. struct drm_device *dev = connector->dev;
  352. struct drm_encoder *encoder = intel_attached_encoder(connector);
  353. struct intel_encoder *intel_encoder = enc_to_intel_encoder(encoder);
  354. struct drm_crtc *crtc;
  355. int dpms_mode;
  356. enum drm_connector_status status;
  357. if (IS_I9XX(dev) && !IS_I915G(dev) && !IS_I915GM(dev)) {
  358. if (intel_crt_detect_hotplug(connector))
  359. return connector_status_connected;
  360. else
  361. return connector_status_disconnected;
  362. }
  363. if (intel_crt_detect_ddc(encoder))
  364. return connector_status_connected;
  365. /* for pre-945g platforms use load detect */
  366. if (encoder->crtc && encoder->crtc->enabled) {
  367. status = intel_crt_load_detect(encoder->crtc, intel_encoder);
  368. } else {
  369. crtc = intel_get_load_detect_pipe(intel_encoder, connector,
  370. NULL, &dpms_mode);
  371. if (crtc) {
  372. status = intel_crt_load_detect(crtc, intel_encoder);
  373. intel_release_load_detect_pipe(intel_encoder,
  374. connector, dpms_mode);
  375. } else
  376. status = connector_status_unknown;
  377. }
  378. return status;
  379. }
  380. static void intel_crt_destroy(struct drm_connector *connector)
  381. {
  382. drm_sysfs_connector_remove(connector);
  383. drm_connector_cleanup(connector);
  384. kfree(connector);
  385. }
  386. static int intel_crt_get_modes(struct drm_connector *connector)
  387. {
  388. int ret;
  389. struct drm_encoder *encoder = intel_attached_encoder(connector);
  390. struct intel_encoder *intel_encoder = enc_to_intel_encoder(encoder);
  391. struct i2c_adapter *ddc_bus;
  392. struct drm_device *dev = connector->dev;
  393. ret = intel_ddc_get_modes(connector, intel_encoder->ddc_bus);
  394. if (ret || !IS_G4X(dev))
  395. goto end;
  396. /* Try to probe digital port for output in DVI-I -> VGA mode. */
  397. ddc_bus = intel_i2c_create(connector->dev, GPIOD, "CRTDDC_D");
  398. if (!ddc_bus) {
  399. dev_printk(KERN_ERR, &connector->dev->pdev->dev,
  400. "DDC bus registration failed for CRTDDC_D.\n");
  401. goto end;
  402. }
  403. /* Try to get modes by GPIOD port */
  404. ret = intel_ddc_get_modes(connector, ddc_bus);
  405. intel_i2c_destroy(ddc_bus);
  406. end:
  407. return ret;
  408. }
  409. static int intel_crt_set_property(struct drm_connector *connector,
  410. struct drm_property *property,
  411. uint64_t value)
  412. {
  413. return 0;
  414. }
  415. /*
  416. * Routines for controlling stuff on the analog port
  417. */
  418. static const struct drm_encoder_helper_funcs intel_crt_helper_funcs = {
  419. .dpms = intel_crt_dpms,
  420. .mode_fixup = intel_crt_mode_fixup,
  421. .prepare = intel_encoder_prepare,
  422. .commit = intel_encoder_commit,
  423. .mode_set = intel_crt_mode_set,
  424. };
  425. static const struct drm_connector_funcs intel_crt_connector_funcs = {
  426. .dpms = drm_helper_connector_dpms,
  427. .detect = intel_crt_detect,
  428. .fill_modes = drm_helper_probe_single_connector_modes,
  429. .destroy = intel_crt_destroy,
  430. .set_property = intel_crt_set_property,
  431. };
  432. static const struct drm_connector_helper_funcs intel_crt_connector_helper_funcs = {
  433. .mode_valid = intel_crt_mode_valid,
  434. .get_modes = intel_crt_get_modes,
  435. .best_encoder = intel_attached_encoder,
  436. };
  437. static void intel_crt_enc_destroy(struct drm_encoder *encoder)
  438. {
  439. struct intel_encoder *intel_encoder = enc_to_intel_encoder(encoder);
  440. intel_i2c_destroy(intel_encoder->ddc_bus);
  441. drm_encoder_cleanup(encoder);
  442. kfree(intel_encoder);
  443. }
  444. static const struct drm_encoder_funcs intel_crt_enc_funcs = {
  445. .destroy = intel_crt_enc_destroy,
  446. };
  447. void intel_crt_init(struct drm_device *dev)
  448. {
  449. struct drm_connector *connector;
  450. struct intel_encoder *intel_encoder;
  451. struct intel_connector *intel_connector;
  452. struct drm_i915_private *dev_priv = dev->dev_private;
  453. u32 i2c_reg;
  454. intel_encoder = kzalloc(sizeof(struct intel_encoder), GFP_KERNEL);
  455. if (!intel_encoder)
  456. return;
  457. intel_connector = kzalloc(sizeof(struct intel_connector), GFP_KERNEL);
  458. if (!intel_connector) {
  459. kfree(intel_encoder);
  460. return;
  461. }
  462. connector = &intel_connector->base;
  463. drm_connector_init(dev, &intel_connector->base,
  464. &intel_crt_connector_funcs, DRM_MODE_CONNECTOR_VGA);
  465. drm_encoder_init(dev, &intel_encoder->enc, &intel_crt_enc_funcs,
  466. DRM_MODE_ENCODER_DAC);
  467. drm_mode_connector_attach_encoder(&intel_connector->base,
  468. &intel_encoder->enc);
  469. /* Set up the DDC bus. */
  470. if (HAS_PCH_SPLIT(dev))
  471. i2c_reg = PCH_GPIOA;
  472. else {
  473. i2c_reg = GPIOA;
  474. /* Use VBT information for CRT DDC if available */
  475. if (dev_priv->crt_ddc_bus != 0)
  476. i2c_reg = dev_priv->crt_ddc_bus;
  477. }
  478. intel_encoder->ddc_bus = intel_i2c_create(dev, i2c_reg, "CRTDDC_A");
  479. if (!intel_encoder->ddc_bus) {
  480. dev_printk(KERN_ERR, &dev->pdev->dev, "DDC bus registration "
  481. "failed.\n");
  482. return;
  483. }
  484. intel_encoder->type = INTEL_OUTPUT_ANALOG;
  485. intel_encoder->clone_mask = (1 << INTEL_SDVO_NON_TV_CLONE_BIT) |
  486. (1 << INTEL_ANALOG_CLONE_BIT) |
  487. (1 << INTEL_SDVO_LVDS_CLONE_BIT);
  488. intel_encoder->crtc_mask = (1 << 0) | (1 << 1);
  489. connector->interlace_allowed = 1;
  490. connector->doublescan_allowed = 0;
  491. drm_encoder_helper_add(&intel_encoder->enc, &intel_crt_helper_funcs);
  492. drm_connector_helper_add(connector, &intel_crt_connector_helper_funcs);
  493. drm_sysfs_connector_add(connector);
  494. if (I915_HAS_HOTPLUG(dev))
  495. connector->polled = DRM_CONNECTOR_POLL_HPD;
  496. else
  497. connector->polled = DRM_CONNECTOR_POLL_CONNECT;
  498. dev_priv->hotplug_supported_mask |= CRT_HOTPLUG_INT_STATUS;
  499. }