oaktrail_crtc.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578
  1. /*
  2. * Copyright © 2009 Intel Corporation
  3. *
  4. * This program is free software; you can redistribute it and/or modify it
  5. * under the terms and conditions of the GNU General Public License,
  6. * version 2, as published by the Free Software Foundation.
  7. *
  8. * This program is distributed in the hope it will be useful, but WITHOUT
  9. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  10. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  11. * more details.
  12. *
  13. * You should have received a copy of the GNU General Public License along with
  14. * this program; if not, write to the Free Software Foundation, Inc.,
  15. * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
  16. */
  17. #include <linux/i2c.h>
  18. #include <linux/pm_runtime.h>
  19. #include <drm/drmP.h>
  20. #include "framebuffer.h"
  21. #include "psb_drv.h"
  22. #include "psb_intel_drv.h"
  23. #include "psb_intel_reg.h"
  24. #include "psb_intel_display.h"
  25. #include "power.h"
  26. struct psb_intel_range_t {
  27. int min, max;
  28. };
  29. struct oaktrail_limit_t {
  30. struct psb_intel_range_t dot, m, p1;
  31. };
  32. struct oaktrail_clock_t {
  33. /* derived values */
  34. int dot;
  35. int m;
  36. int p1;
  37. };
  38. #define MRST_LIMIT_LVDS_100L 0
  39. #define MRST_LIMIT_LVDS_83 1
  40. #define MRST_LIMIT_LVDS_100 2
  41. #define MRST_DOT_MIN 19750
  42. #define MRST_DOT_MAX 120000
  43. #define MRST_M_MIN_100L 20
  44. #define MRST_M_MIN_100 10
  45. #define MRST_M_MIN_83 12
  46. #define MRST_M_MAX_100L 34
  47. #define MRST_M_MAX_100 17
  48. #define MRST_M_MAX_83 20
  49. #define MRST_P1_MIN 2
  50. #define MRST_P1_MAX_0 7
  51. #define MRST_P1_MAX_1 8
  52. static const struct oaktrail_limit_t oaktrail_limits[] = {
  53. { /* MRST_LIMIT_LVDS_100L */
  54. .dot = {.min = MRST_DOT_MIN, .max = MRST_DOT_MAX},
  55. .m = {.min = MRST_M_MIN_100L, .max = MRST_M_MAX_100L},
  56. .p1 = {.min = MRST_P1_MIN, .max = MRST_P1_MAX_1},
  57. },
  58. { /* MRST_LIMIT_LVDS_83L */
  59. .dot = {.min = MRST_DOT_MIN, .max = MRST_DOT_MAX},
  60. .m = {.min = MRST_M_MIN_83, .max = MRST_M_MAX_83},
  61. .p1 = {.min = MRST_P1_MIN, .max = MRST_P1_MAX_0},
  62. },
  63. { /* MRST_LIMIT_LVDS_100 */
  64. .dot = {.min = MRST_DOT_MIN, .max = MRST_DOT_MAX},
  65. .m = {.min = MRST_M_MIN_100, .max = MRST_M_MAX_100},
  66. .p1 = {.min = MRST_P1_MIN, .max = MRST_P1_MAX_1},
  67. },
  68. };
  69. #define MRST_M_MIN 10
  70. static const u32 oaktrail_m_converts[] = {
  71. 0x2B, 0x15, 0x2A, 0x35, 0x1A, 0x0D, 0x26, 0x33, 0x19, 0x2C,
  72. 0x36, 0x3B, 0x1D, 0x2E, 0x37, 0x1B, 0x2D, 0x16, 0x0B, 0x25,
  73. 0x12, 0x09, 0x24, 0x32, 0x39, 0x1c,
  74. };
  75. static const struct oaktrail_limit_t *oaktrail_limit(struct drm_crtc *crtc)
  76. {
  77. const struct oaktrail_limit_t *limit = NULL;
  78. struct drm_device *dev = crtc->dev;
  79. struct drm_psb_private *dev_priv = dev->dev_private;
  80. if (psb_intel_pipe_has_type(crtc, INTEL_OUTPUT_LVDS)
  81. || psb_intel_pipe_has_type(crtc, INTEL_OUTPUT_MIPI)) {
  82. switch (dev_priv->core_freq) {
  83. case 100:
  84. limit = &oaktrail_limits[MRST_LIMIT_LVDS_100L];
  85. break;
  86. case 166:
  87. limit = &oaktrail_limits[MRST_LIMIT_LVDS_83];
  88. break;
  89. case 200:
  90. limit = &oaktrail_limits[MRST_LIMIT_LVDS_100];
  91. break;
  92. }
  93. } else {
  94. limit = NULL;
  95. dev_err(dev->dev, "oaktrail_limit Wrong display type.\n");
  96. }
  97. return limit;
  98. }
  99. /** Derive the pixel clock for the given refclk and divisors for 8xx chips. */
  100. static void oaktrail_clock(int refclk, struct oaktrail_clock_t *clock)
  101. {
  102. clock->dot = (refclk * clock->m) / (14 * clock->p1);
  103. }
  104. static void mrstPrintPll(char *prefix, struct oaktrail_clock_t *clock)
  105. {
  106. pr_debug("%s: dotclock = %d, m = %d, p1 = %d.\n",
  107. prefix, clock->dot, clock->m, clock->p1);
  108. }
  109. /**
  110. * Returns a set of divisors for the desired target clock with the given refclk,
  111. * or FALSE. Divisor values are the actual divisors for
  112. */
  113. static bool
  114. mrstFindBestPLL(struct drm_crtc *crtc, int target, int refclk,
  115. struct oaktrail_clock_t *best_clock)
  116. {
  117. struct oaktrail_clock_t clock;
  118. const struct oaktrail_limit_t *limit = oaktrail_limit(crtc);
  119. int err = target;
  120. memset(best_clock, 0, sizeof(*best_clock));
  121. for (clock.m = limit->m.min; clock.m <= limit->m.max; clock.m++) {
  122. for (clock.p1 = limit->p1.min; clock.p1 <= limit->p1.max;
  123. clock.p1++) {
  124. int this_err;
  125. oaktrail_clock(refclk, &clock);
  126. this_err = abs(clock.dot - target);
  127. if (this_err < err) {
  128. *best_clock = clock;
  129. err = this_err;
  130. }
  131. }
  132. }
  133. dev_dbg(crtc->dev->dev, "mrstFindBestPLL err = %d.\n", err);
  134. return err != target;
  135. }
  136. /**
  137. * Sets the power management mode of the pipe and plane.
  138. *
  139. * This code should probably grow support for turning the cursor off and back
  140. * on appropriately at the same time as we're turning the pipe off/on.
  141. */
  142. static void oaktrail_crtc_dpms(struct drm_crtc *crtc, int mode)
  143. {
  144. struct drm_device *dev = crtc->dev;
  145. struct drm_psb_private *dev_priv = dev->dev_private;
  146. struct psb_intel_crtc *psb_intel_crtc = to_psb_intel_crtc(crtc);
  147. int pipe = psb_intel_crtc->pipe;
  148. const struct psb_offset *map = &dev_priv->regmap[pipe];
  149. u32 temp;
  150. if (!gma_power_begin(dev, true))
  151. return;
  152. /* XXX: When our outputs are all unaware of DPMS modes other than off
  153. * and on, we should map those modes to DRM_MODE_DPMS_OFF in the CRTC.
  154. */
  155. switch (mode) {
  156. case DRM_MODE_DPMS_ON:
  157. case DRM_MODE_DPMS_STANDBY:
  158. case DRM_MODE_DPMS_SUSPEND:
  159. /* Enable the DPLL */
  160. temp = REG_READ(map->dpll);
  161. if ((temp & DPLL_VCO_ENABLE) == 0) {
  162. REG_WRITE(map->dpll, temp);
  163. REG_READ(map->dpll);
  164. /* Wait for the clocks to stabilize. */
  165. udelay(150);
  166. REG_WRITE(map->dpll, temp | DPLL_VCO_ENABLE);
  167. REG_READ(map->dpll);
  168. /* Wait for the clocks to stabilize. */
  169. udelay(150);
  170. REG_WRITE(map->dpll, temp | DPLL_VCO_ENABLE);
  171. REG_READ(map->dpll);
  172. /* Wait for the clocks to stabilize. */
  173. udelay(150);
  174. }
  175. /* Enable the pipe */
  176. temp = REG_READ(map->conf);
  177. if ((temp & PIPEACONF_ENABLE) == 0)
  178. REG_WRITE(map->conf, temp | PIPEACONF_ENABLE);
  179. /* Enable the plane */
  180. temp = REG_READ(map->cntr);
  181. if ((temp & DISPLAY_PLANE_ENABLE) == 0) {
  182. REG_WRITE(map->cntr,
  183. temp | DISPLAY_PLANE_ENABLE);
  184. /* Flush the plane changes */
  185. REG_WRITE(map->base, REG_READ(map->base));
  186. }
  187. psb_intel_crtc_load_lut(crtc);
  188. /* Give the overlay scaler a chance to enable
  189. if it's on this pipe */
  190. /* psb_intel_crtc_dpms_video(crtc, true); TODO */
  191. break;
  192. case DRM_MODE_DPMS_OFF:
  193. /* Give the overlay scaler a chance to disable
  194. * if it's on this pipe */
  195. /* psb_intel_crtc_dpms_video(crtc, FALSE); TODO */
  196. /* Disable the VGA plane that we never use */
  197. REG_WRITE(VGACNTRL, VGA_DISP_DISABLE);
  198. /* Disable display plane */
  199. temp = REG_READ(map->cntr);
  200. if ((temp & DISPLAY_PLANE_ENABLE) != 0) {
  201. REG_WRITE(map->cntr,
  202. temp & ~DISPLAY_PLANE_ENABLE);
  203. /* Flush the plane changes */
  204. REG_WRITE(map->base, REG_READ(map->base));
  205. REG_READ(map->base);
  206. }
  207. /* Next, disable display pipes */
  208. temp = REG_READ(map->conf);
  209. if ((temp & PIPEACONF_ENABLE) != 0) {
  210. REG_WRITE(map->conf, temp & ~PIPEACONF_ENABLE);
  211. REG_READ(map->conf);
  212. }
  213. /* Wait for for the pipe disable to take effect. */
  214. psb_intel_wait_for_vblank(dev);
  215. temp = REG_READ(map->dpll);
  216. if ((temp & DPLL_VCO_ENABLE) != 0) {
  217. REG_WRITE(map->dpll, temp & ~DPLL_VCO_ENABLE);
  218. REG_READ(map->dpll);
  219. }
  220. /* Wait for the clocks to turn off. */
  221. udelay(150);
  222. break;
  223. }
  224. /*Set FIFO Watermarks*/
  225. REG_WRITE(DSPARB, 0x3FFF);
  226. REG_WRITE(DSPFW1, 0x3F88080A);
  227. REG_WRITE(DSPFW2, 0x0b060808);
  228. REG_WRITE(DSPFW3, 0x0);
  229. REG_WRITE(DSPFW4, 0x08030404);
  230. REG_WRITE(DSPFW5, 0x04040404);
  231. REG_WRITE(DSPFW6, 0x78);
  232. REG_WRITE(0x70400, REG_READ(0x70400) | 0x4000);
  233. /* Must write Bit 14 of the Chicken Bit Register */
  234. gma_power_end(dev);
  235. }
  236. /**
  237. * Return the pipe currently connected to the panel fitter,
  238. * or -1 if the panel fitter is not present or not in use
  239. */
  240. static int oaktrail_panel_fitter_pipe(struct drm_device *dev)
  241. {
  242. u32 pfit_control;
  243. pfit_control = REG_READ(PFIT_CONTROL);
  244. /* See if the panel fitter is in use */
  245. if ((pfit_control & PFIT_ENABLE) == 0)
  246. return -1;
  247. return (pfit_control >> 29) & 3;
  248. }
  249. static int oaktrail_crtc_mode_set(struct drm_crtc *crtc,
  250. struct drm_display_mode *mode,
  251. struct drm_display_mode *adjusted_mode,
  252. int x, int y,
  253. struct drm_framebuffer *old_fb)
  254. {
  255. struct drm_device *dev = crtc->dev;
  256. struct psb_intel_crtc *psb_intel_crtc = to_psb_intel_crtc(crtc);
  257. struct drm_psb_private *dev_priv = dev->dev_private;
  258. int pipe = psb_intel_crtc->pipe;
  259. const struct psb_offset *map = &dev_priv->regmap[pipe];
  260. int refclk = 0;
  261. struct oaktrail_clock_t clock;
  262. u32 dpll = 0, fp = 0, dspcntr, pipeconf;
  263. bool ok, is_sdvo = false;
  264. bool is_lvds = false;
  265. bool is_mipi = false;
  266. struct drm_mode_config *mode_config = &dev->mode_config;
  267. struct psb_intel_encoder *psb_intel_encoder = NULL;
  268. uint64_t scalingType = DRM_MODE_SCALE_FULLSCREEN;
  269. struct drm_connector *connector;
  270. if (!gma_power_begin(dev, true))
  271. return 0;
  272. memcpy(&psb_intel_crtc->saved_mode,
  273. mode,
  274. sizeof(struct drm_display_mode));
  275. memcpy(&psb_intel_crtc->saved_adjusted_mode,
  276. adjusted_mode,
  277. sizeof(struct drm_display_mode));
  278. list_for_each_entry(connector, &mode_config->connector_list, head) {
  279. if (!connector->encoder || connector->encoder->crtc != crtc)
  280. continue;
  281. psb_intel_encoder = psb_intel_attached_encoder(connector);
  282. switch (psb_intel_encoder->type) {
  283. case INTEL_OUTPUT_LVDS:
  284. is_lvds = true;
  285. break;
  286. case INTEL_OUTPUT_SDVO:
  287. is_sdvo = true;
  288. break;
  289. case INTEL_OUTPUT_MIPI:
  290. is_mipi = true;
  291. break;
  292. }
  293. }
  294. /* Disable the VGA plane that we never use */
  295. REG_WRITE(VGACNTRL, VGA_DISP_DISABLE);
  296. /* Disable the panel fitter if it was on our pipe */
  297. if (oaktrail_panel_fitter_pipe(dev) == pipe)
  298. REG_WRITE(PFIT_CONTROL, 0);
  299. REG_WRITE(map->src,
  300. ((mode->crtc_hdisplay - 1) << 16) |
  301. (mode->crtc_vdisplay - 1));
  302. if (psb_intel_encoder)
  303. drm_connector_property_get_value(connector,
  304. dev->mode_config.scaling_mode_property, &scalingType);
  305. if (scalingType == DRM_MODE_SCALE_NO_SCALE) {
  306. /* Moorestown doesn't have register support for centering so
  307. * we need to mess with the h/vblank and h/vsync start and
  308. * ends to get centering */
  309. int offsetX = 0, offsetY = 0;
  310. offsetX = (adjusted_mode->crtc_hdisplay -
  311. mode->crtc_hdisplay) / 2;
  312. offsetY = (adjusted_mode->crtc_vdisplay -
  313. mode->crtc_vdisplay) / 2;
  314. REG_WRITE(map->htotal, (mode->crtc_hdisplay - 1) |
  315. ((adjusted_mode->crtc_htotal - 1) << 16));
  316. REG_WRITE(map->vtotal, (mode->crtc_vdisplay - 1) |
  317. ((adjusted_mode->crtc_vtotal - 1) << 16));
  318. REG_WRITE(map->hblank,
  319. (adjusted_mode->crtc_hblank_start - offsetX - 1) |
  320. ((adjusted_mode->crtc_hblank_end - offsetX - 1) << 16));
  321. REG_WRITE(map->hsync,
  322. (adjusted_mode->crtc_hsync_start - offsetX - 1) |
  323. ((adjusted_mode->crtc_hsync_end - offsetX - 1) << 16));
  324. REG_WRITE(map->vblank,
  325. (adjusted_mode->crtc_vblank_start - offsetY - 1) |
  326. ((adjusted_mode->crtc_vblank_end - offsetY - 1) << 16));
  327. REG_WRITE(map->vsync,
  328. (adjusted_mode->crtc_vsync_start - offsetY - 1) |
  329. ((adjusted_mode->crtc_vsync_end - offsetY - 1) << 16));
  330. } else {
  331. REG_WRITE(map->htotal, (adjusted_mode->crtc_hdisplay - 1) |
  332. ((adjusted_mode->crtc_htotal - 1) << 16));
  333. REG_WRITE(map->vtotal, (adjusted_mode->crtc_vdisplay - 1) |
  334. ((adjusted_mode->crtc_vtotal - 1) << 16));
  335. REG_WRITE(map->hblank, (adjusted_mode->crtc_hblank_start - 1) |
  336. ((adjusted_mode->crtc_hblank_end - 1) << 16));
  337. REG_WRITE(map->hsync, (adjusted_mode->crtc_hsync_start - 1) |
  338. ((adjusted_mode->crtc_hsync_end - 1) << 16));
  339. REG_WRITE(map->vblank, (adjusted_mode->crtc_vblank_start - 1) |
  340. ((adjusted_mode->crtc_vblank_end - 1) << 16));
  341. REG_WRITE(map->vsync, (adjusted_mode->crtc_vsync_start - 1) |
  342. ((adjusted_mode->crtc_vsync_end - 1) << 16));
  343. }
  344. /* Flush the plane changes */
  345. {
  346. struct drm_crtc_helper_funcs *crtc_funcs =
  347. crtc->helper_private;
  348. crtc_funcs->mode_set_base(crtc, x, y, old_fb);
  349. }
  350. /* setup pipeconf */
  351. pipeconf = REG_READ(map->conf);
  352. /* Set up the display plane register */
  353. dspcntr = REG_READ(map->cntr);
  354. dspcntr |= DISPPLANE_GAMMA_ENABLE;
  355. if (pipe == 0)
  356. dspcntr |= DISPPLANE_SEL_PIPE_A;
  357. else
  358. dspcntr |= DISPPLANE_SEL_PIPE_B;
  359. if (is_mipi)
  360. goto oaktrail_crtc_mode_set_exit;
  361. refclk = dev_priv->core_freq * 1000;
  362. dpll = 0; /*BIT16 = 0 for 100MHz reference */
  363. ok = mrstFindBestPLL(crtc, adjusted_mode->clock, refclk, &clock);
  364. if (!ok) {
  365. dev_dbg(dev->dev, "mrstFindBestPLL fail in oaktrail_crtc_mode_set.\n");
  366. } else {
  367. dev_dbg(dev->dev, "oaktrail_crtc_mode_set pixel clock = %d,"
  368. "m = %x, p1 = %x.\n", clock.dot, clock.m,
  369. clock.p1);
  370. }
  371. fp = oaktrail_m_converts[(clock.m - MRST_M_MIN)] << 8;
  372. dpll |= DPLL_VGA_MODE_DIS;
  373. dpll |= DPLL_VCO_ENABLE;
  374. if (is_lvds)
  375. dpll |= DPLLA_MODE_LVDS;
  376. else
  377. dpll |= DPLLB_MODE_DAC_SERIAL;
  378. if (is_sdvo) {
  379. int sdvo_pixel_multiply =
  380. adjusted_mode->clock / mode->clock;
  381. dpll |= DPLL_DVO_HIGH_SPEED;
  382. dpll |=
  383. (sdvo_pixel_multiply -
  384. 1) << SDVO_MULTIPLIER_SHIFT_HIRES;
  385. }
  386. /* compute bitmask from p1 value */
  387. dpll |= (1 << (clock.p1 - 2)) << 17;
  388. dpll |= DPLL_VCO_ENABLE;
  389. mrstPrintPll("chosen", &clock);
  390. if (dpll & DPLL_VCO_ENABLE) {
  391. REG_WRITE(map->fp0, fp);
  392. REG_WRITE(map->dpll, dpll & ~DPLL_VCO_ENABLE);
  393. REG_READ(map->dpll);
  394. /* Check the DPLLA lock bit PIPEACONF[29] */
  395. udelay(150);
  396. }
  397. REG_WRITE(map->fp0, fp);
  398. REG_WRITE(map->dpll, dpll);
  399. REG_READ(map->dpll);
  400. /* Wait for the clocks to stabilize. */
  401. udelay(150);
  402. /* write it again -- the BIOS does, after all */
  403. REG_WRITE(map->dpll, dpll);
  404. REG_READ(map->dpll);
  405. /* Wait for the clocks to stabilize. */
  406. udelay(150);
  407. REG_WRITE(map->conf, pipeconf);
  408. REG_READ(map->conf);
  409. psb_intel_wait_for_vblank(dev);
  410. REG_WRITE(map->cntr, dspcntr);
  411. psb_intel_wait_for_vblank(dev);
  412. oaktrail_crtc_mode_set_exit:
  413. gma_power_end(dev);
  414. return 0;
  415. }
  416. static bool oaktrail_crtc_mode_fixup(struct drm_crtc *crtc,
  417. struct drm_display_mode *mode,
  418. struct drm_display_mode *adjusted_mode)
  419. {
  420. return true;
  421. }
  422. static int oaktrail_pipe_set_base(struct drm_crtc *crtc,
  423. int x, int y, struct drm_framebuffer *old_fb)
  424. {
  425. struct drm_device *dev = crtc->dev;
  426. struct drm_psb_private *dev_priv = dev->dev_private;
  427. struct psb_intel_crtc *psb_intel_crtc = to_psb_intel_crtc(crtc);
  428. struct psb_framebuffer *psbfb = to_psb_fb(crtc->fb);
  429. int pipe = psb_intel_crtc->pipe;
  430. const struct psb_offset *map = &dev_priv->regmap[pipe];
  431. unsigned long start, offset;
  432. u32 dspcntr;
  433. int ret = 0;
  434. /* no fb bound */
  435. if (!crtc->fb) {
  436. dev_dbg(dev->dev, "No FB bound\n");
  437. return 0;
  438. }
  439. if (!gma_power_begin(dev, true))
  440. return 0;
  441. start = psbfb->gtt->offset;
  442. offset = y * crtc->fb->pitches[0] + x * (crtc->fb->bits_per_pixel / 8);
  443. REG_WRITE(map->stride, crtc->fb->pitches[0]);
  444. dspcntr = REG_READ(map->cntr);
  445. dspcntr &= ~DISPPLANE_PIXFORMAT_MASK;
  446. switch (crtc->fb->bits_per_pixel) {
  447. case 8:
  448. dspcntr |= DISPPLANE_8BPP;
  449. break;
  450. case 16:
  451. if (crtc->fb->depth == 15)
  452. dspcntr |= DISPPLANE_15_16BPP;
  453. else
  454. dspcntr |= DISPPLANE_16BPP;
  455. break;
  456. case 24:
  457. case 32:
  458. dspcntr |= DISPPLANE_32BPP_NO_ALPHA;
  459. break;
  460. default:
  461. dev_err(dev->dev, "Unknown color depth\n");
  462. ret = -EINVAL;
  463. goto pipe_set_base_exit;
  464. }
  465. REG_WRITE(map->cntr, dspcntr);
  466. REG_WRITE(map->base, offset);
  467. REG_READ(map->base);
  468. REG_WRITE(map->surf, start);
  469. REG_READ(map->surf);
  470. pipe_set_base_exit:
  471. gma_power_end(dev);
  472. return ret;
  473. }
  474. static void oaktrail_crtc_prepare(struct drm_crtc *crtc)
  475. {
  476. struct drm_crtc_helper_funcs *crtc_funcs = crtc->helper_private;
  477. crtc_funcs->dpms(crtc, DRM_MODE_DPMS_OFF);
  478. }
  479. static void oaktrail_crtc_commit(struct drm_crtc *crtc)
  480. {
  481. struct drm_crtc_helper_funcs *crtc_funcs = crtc->helper_private;
  482. crtc_funcs->dpms(crtc, DRM_MODE_DPMS_ON);
  483. }
  484. const struct drm_crtc_helper_funcs oaktrail_helper_funcs = {
  485. .dpms = oaktrail_crtc_dpms,
  486. .mode_fixup = oaktrail_crtc_mode_fixup,
  487. .mode_set = oaktrail_crtc_mode_set,
  488. .mode_set_base = oaktrail_pipe_set_base,
  489. .prepare = oaktrail_crtc_prepare,
  490. .commit = oaktrail_crtc_commit,
  491. };