intel_crt.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593
  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_MASK;
  205. hotplug_en |= CRT_HOTPLUG_FORCE_DETECT;
  206. if (IS_G4X(dev))
  207. hotplug_en |= CRT_HOTPLUG_ACTIVATION_PERIOD_64;
  208. hotplug_en |= CRT_HOTPLUG_VOLTAGE_COMPARE_50;
  209. for (i = 0; i < tries ; i++) {
  210. unsigned long timeout;
  211. /* turn on the FORCE_DETECT */
  212. I915_WRITE(PORT_HOTPLUG_EN, hotplug_en);
  213. timeout = jiffies + msecs_to_jiffies(1000);
  214. /* wait for FORCE_DETECT to go off */
  215. do {
  216. if (!(I915_READ(PORT_HOTPLUG_EN) &
  217. CRT_HOTPLUG_FORCE_DETECT))
  218. break;
  219. msleep(1);
  220. } while (time_after(timeout, jiffies));
  221. }
  222. stat = I915_READ(PORT_HOTPLUG_STAT);
  223. if ((stat & CRT_HOTPLUG_MONITOR_MASK) != CRT_HOTPLUG_MONITOR_NONE)
  224. ret = true;
  225. /* clear the interrupt we just generated, if any */
  226. I915_WRITE(PORT_HOTPLUG_STAT, CRT_HOTPLUG_INT_STATUS);
  227. /* and put the bits back */
  228. I915_WRITE(PORT_HOTPLUG_EN, orig);
  229. return ret;
  230. }
  231. static bool intel_crt_detect_ddc(struct drm_encoder *encoder)
  232. {
  233. struct intel_encoder *intel_encoder = enc_to_intel_encoder(encoder);
  234. /* CRT should always be at 0, but check anyway */
  235. if (intel_encoder->type != INTEL_OUTPUT_ANALOG)
  236. return false;
  237. return intel_ddc_probe(intel_encoder);
  238. }
  239. static enum drm_connector_status
  240. intel_crt_load_detect(struct drm_crtc *crtc, struct intel_encoder *intel_encoder)
  241. {
  242. struct drm_encoder *encoder = &intel_encoder->enc;
  243. struct drm_device *dev = encoder->dev;
  244. struct drm_i915_private *dev_priv = dev->dev_private;
  245. struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
  246. uint32_t pipe = intel_crtc->pipe;
  247. uint32_t save_bclrpat;
  248. uint32_t save_vtotal;
  249. uint32_t vtotal, vactive;
  250. uint32_t vsample;
  251. uint32_t vblank, vblank_start, vblank_end;
  252. uint32_t dsl;
  253. uint32_t bclrpat_reg;
  254. uint32_t vtotal_reg;
  255. uint32_t vblank_reg;
  256. uint32_t vsync_reg;
  257. uint32_t pipeconf_reg;
  258. uint32_t pipe_dsl_reg;
  259. uint8_t st00;
  260. enum drm_connector_status status;
  261. if (pipe == 0) {
  262. bclrpat_reg = BCLRPAT_A;
  263. vtotal_reg = VTOTAL_A;
  264. vblank_reg = VBLANK_A;
  265. vsync_reg = VSYNC_A;
  266. pipeconf_reg = PIPEACONF;
  267. pipe_dsl_reg = PIPEADSL;
  268. } else {
  269. bclrpat_reg = BCLRPAT_B;
  270. vtotal_reg = VTOTAL_B;
  271. vblank_reg = VBLANK_B;
  272. vsync_reg = VSYNC_B;
  273. pipeconf_reg = PIPEBCONF;
  274. pipe_dsl_reg = PIPEBDSL;
  275. }
  276. save_bclrpat = I915_READ(bclrpat_reg);
  277. save_vtotal = I915_READ(vtotal_reg);
  278. vblank = I915_READ(vblank_reg);
  279. vtotal = ((save_vtotal >> 16) & 0xfff) + 1;
  280. vactive = (save_vtotal & 0x7ff) + 1;
  281. vblank_start = (vblank & 0xfff) + 1;
  282. vblank_end = ((vblank >> 16) & 0xfff) + 1;
  283. /* Set the border color to purple. */
  284. I915_WRITE(bclrpat_reg, 0x500050);
  285. if (IS_I9XX(dev)) {
  286. uint32_t pipeconf = I915_READ(pipeconf_reg);
  287. I915_WRITE(pipeconf_reg, pipeconf | PIPECONF_FORCE_BORDER);
  288. /* Wait for next Vblank to substitue
  289. * border color for Color info */
  290. intel_wait_for_vblank(dev);
  291. st00 = I915_READ8(VGA_MSR_WRITE);
  292. status = ((st00 & (1 << 4)) != 0) ?
  293. connector_status_connected :
  294. connector_status_disconnected;
  295. I915_WRITE(pipeconf_reg, pipeconf);
  296. } else {
  297. bool restore_vblank = false;
  298. int count, detect;
  299. /*
  300. * If there isn't any border, add some.
  301. * Yes, this will flicker
  302. */
  303. if (vblank_start <= vactive && vblank_end >= vtotal) {
  304. uint32_t vsync = I915_READ(vsync_reg);
  305. uint32_t vsync_start = (vsync & 0xffff) + 1;
  306. vblank_start = vsync_start;
  307. I915_WRITE(vblank_reg,
  308. (vblank_start - 1) |
  309. ((vblank_end - 1) << 16));
  310. restore_vblank = true;
  311. }
  312. /* sample in the vertical border, selecting the larger one */
  313. if (vblank_start - vactive >= vtotal - vblank_end)
  314. vsample = (vblank_start + vactive) >> 1;
  315. else
  316. vsample = (vtotal + vblank_end) >> 1;
  317. /*
  318. * Wait for the border to be displayed
  319. */
  320. while (I915_READ(pipe_dsl_reg) >= vactive)
  321. ;
  322. while ((dsl = I915_READ(pipe_dsl_reg)) <= vsample)
  323. ;
  324. /*
  325. * Watch ST00 for an entire scanline
  326. */
  327. detect = 0;
  328. count = 0;
  329. do {
  330. count++;
  331. /* Read the ST00 VGA status register */
  332. st00 = I915_READ8(VGA_MSR_WRITE);
  333. if (st00 & (1 << 4))
  334. detect++;
  335. } while ((I915_READ(pipe_dsl_reg) == dsl));
  336. /* restore vblank if necessary */
  337. if (restore_vblank)
  338. I915_WRITE(vblank_reg, vblank);
  339. /*
  340. * If more than 3/4 of the scanline detected a monitor,
  341. * then it is assumed to be present. This works even on i830,
  342. * where there isn't any way to force the border color across
  343. * the screen
  344. */
  345. status = detect * 4 > count * 3 ?
  346. connector_status_connected :
  347. connector_status_disconnected;
  348. }
  349. /* Restore previous settings */
  350. I915_WRITE(bclrpat_reg, save_bclrpat);
  351. return status;
  352. }
  353. static enum drm_connector_status intel_crt_detect(struct drm_connector *connector)
  354. {
  355. struct drm_device *dev = connector->dev;
  356. struct drm_encoder *encoder = intel_attached_encoder(connector);
  357. struct intel_encoder *intel_encoder = enc_to_intel_encoder(encoder);
  358. struct drm_crtc *crtc;
  359. int dpms_mode;
  360. enum drm_connector_status status;
  361. if (IS_I9XX(dev) && !IS_I915G(dev) && !IS_I915GM(dev)) {
  362. if (intel_crt_detect_hotplug(connector))
  363. return connector_status_connected;
  364. else
  365. return connector_status_disconnected;
  366. }
  367. if (intel_crt_detect_ddc(encoder))
  368. return connector_status_connected;
  369. /* for pre-945g platforms use load detect */
  370. if (encoder->crtc && encoder->crtc->enabled) {
  371. status = intel_crt_load_detect(encoder->crtc, intel_encoder);
  372. } else {
  373. crtc = intel_get_load_detect_pipe(intel_encoder, connector,
  374. NULL, &dpms_mode);
  375. if (crtc) {
  376. status = intel_crt_load_detect(crtc, intel_encoder);
  377. intel_release_load_detect_pipe(intel_encoder,
  378. connector, dpms_mode);
  379. } else
  380. status = connector_status_unknown;
  381. }
  382. return status;
  383. }
  384. static void intel_crt_destroy(struct drm_connector *connector)
  385. {
  386. drm_sysfs_connector_remove(connector);
  387. drm_connector_cleanup(connector);
  388. kfree(connector);
  389. }
  390. static int intel_crt_get_modes(struct drm_connector *connector)
  391. {
  392. int ret;
  393. struct drm_encoder *encoder = intel_attached_encoder(connector);
  394. struct intel_encoder *intel_encoder = enc_to_intel_encoder(encoder);
  395. struct i2c_adapter *ddc_bus;
  396. struct drm_device *dev = connector->dev;
  397. ret = intel_ddc_get_modes(connector, intel_encoder->ddc_bus);
  398. if (ret || !IS_G4X(dev))
  399. goto end;
  400. /* Try to probe digital port for output in DVI-I -> VGA mode. */
  401. ddc_bus = intel_i2c_create(connector->dev, GPIOD, "CRTDDC_D");
  402. if (!ddc_bus) {
  403. dev_printk(KERN_ERR, &connector->dev->pdev->dev,
  404. "DDC bus registration failed for CRTDDC_D.\n");
  405. goto end;
  406. }
  407. /* Try to get modes by GPIOD port */
  408. ret = intel_ddc_get_modes(connector, ddc_bus);
  409. intel_i2c_destroy(ddc_bus);
  410. end:
  411. return ret;
  412. }
  413. static int intel_crt_set_property(struct drm_connector *connector,
  414. struct drm_property *property,
  415. uint64_t value)
  416. {
  417. return 0;
  418. }
  419. /*
  420. * Routines for controlling stuff on the analog port
  421. */
  422. static const struct drm_encoder_helper_funcs intel_crt_helper_funcs = {
  423. .dpms = intel_crt_dpms,
  424. .mode_fixup = intel_crt_mode_fixup,
  425. .prepare = intel_encoder_prepare,
  426. .commit = intel_encoder_commit,
  427. .mode_set = intel_crt_mode_set,
  428. };
  429. static const struct drm_connector_funcs intel_crt_connector_funcs = {
  430. .dpms = drm_helper_connector_dpms,
  431. .detect = intel_crt_detect,
  432. .fill_modes = drm_helper_probe_single_connector_modes,
  433. .destroy = intel_crt_destroy,
  434. .set_property = intel_crt_set_property,
  435. };
  436. static const struct drm_connector_helper_funcs intel_crt_connector_helper_funcs = {
  437. .mode_valid = intel_crt_mode_valid,
  438. .get_modes = intel_crt_get_modes,
  439. .best_encoder = intel_attached_encoder,
  440. };
  441. static void intel_crt_enc_destroy(struct drm_encoder *encoder)
  442. {
  443. struct intel_encoder *intel_encoder = enc_to_intel_encoder(encoder);
  444. intel_i2c_destroy(intel_encoder->ddc_bus);
  445. drm_encoder_cleanup(encoder);
  446. kfree(intel_encoder);
  447. }
  448. static const struct drm_encoder_funcs intel_crt_enc_funcs = {
  449. .destroy = intel_crt_enc_destroy,
  450. };
  451. void intel_crt_init(struct drm_device *dev)
  452. {
  453. struct drm_connector *connector;
  454. struct intel_encoder *intel_encoder;
  455. struct intel_connector *intel_connector;
  456. struct drm_i915_private *dev_priv = dev->dev_private;
  457. u32 i2c_reg;
  458. intel_encoder = kzalloc(sizeof(struct intel_encoder), GFP_KERNEL);
  459. if (!intel_encoder)
  460. return;
  461. intel_connector = kzalloc(sizeof(struct intel_connector), GFP_KERNEL);
  462. if (!intel_connector) {
  463. kfree(intel_encoder);
  464. return;
  465. }
  466. connector = &intel_connector->base;
  467. drm_connector_init(dev, &intel_connector->base,
  468. &intel_crt_connector_funcs, DRM_MODE_CONNECTOR_VGA);
  469. drm_encoder_init(dev, &intel_encoder->enc, &intel_crt_enc_funcs,
  470. DRM_MODE_ENCODER_DAC);
  471. drm_mode_connector_attach_encoder(&intel_connector->base,
  472. &intel_encoder->enc);
  473. /* Set up the DDC bus. */
  474. if (HAS_PCH_SPLIT(dev))
  475. i2c_reg = PCH_GPIOA;
  476. else {
  477. i2c_reg = GPIOA;
  478. /* Use VBT information for CRT DDC if available */
  479. if (dev_priv->crt_ddc_bus != 0)
  480. i2c_reg = dev_priv->crt_ddc_bus;
  481. }
  482. intel_encoder->ddc_bus = intel_i2c_create(dev, i2c_reg, "CRTDDC_A");
  483. if (!intel_encoder->ddc_bus) {
  484. dev_printk(KERN_ERR, &dev->pdev->dev, "DDC bus registration "
  485. "failed.\n");
  486. return;
  487. }
  488. intel_encoder->type = INTEL_OUTPUT_ANALOG;
  489. intel_encoder->clone_mask = (1 << INTEL_SDVO_NON_TV_CLONE_BIT) |
  490. (1 << INTEL_ANALOG_CLONE_BIT) |
  491. (1 << INTEL_SDVO_LVDS_CLONE_BIT);
  492. intel_encoder->crtc_mask = (1 << 0) | (1 << 1);
  493. connector->interlace_allowed = 1;
  494. connector->doublescan_allowed = 0;
  495. drm_encoder_helper_add(&intel_encoder->enc, &intel_crt_helper_funcs);
  496. drm_connector_helper_add(connector, &intel_crt_connector_helper_funcs);
  497. drm_sysfs_connector_add(connector);
  498. if (I915_HAS_HOTPLUG(dev))
  499. connector->polled = DRM_CONNECTOR_POLL_HPD;
  500. else
  501. connector->polled = DRM_CONNECTOR_POLL_CONNECT;
  502. dev_priv->hotplug_supported_mask |= CRT_HOTPLUG_INT_STATUS;
  503. }