intel_drv.h 36 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105
  1. /*
  2. * Copyright (c) 2006 Dave Airlie <airlied@linux.ie>
  3. * Copyright (c) 2007-2008 Intel Corporation
  4. * Jesse Barnes <jesse.barnes@intel.com>
  5. *
  6. * Permission is hereby granted, free of charge, to any person obtaining a
  7. * copy of this software and associated documentation files (the "Software"),
  8. * to deal in the Software without restriction, including without limitation
  9. * the rights to use, copy, modify, merge, publish, distribute, sublicense,
  10. * and/or sell copies of the Software, and to permit persons to whom the
  11. * Software is furnished to do so, subject to the following conditions:
  12. *
  13. * The above copyright notice and this permission notice (including the next
  14. * paragraph) shall be included in all copies or substantial portions of the
  15. * Software.
  16. *
  17. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  18. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  19. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
  20. * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  21. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  22. * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
  23. * IN THE SOFTWARE.
  24. */
  25. #ifndef __INTEL_DRV_H__
  26. #define __INTEL_DRV_H__
  27. #include <linux/i2c.h>
  28. #include <linux/hdmi.h>
  29. #include <drm/i915_drm.h>
  30. #include "i915_drv.h"
  31. #include <drm/drm_crtc.h>
  32. #include <drm/drm_crtc_helper.h>
  33. #include <drm/drm_fb_helper.h>
  34. #include <drm/drm_dp_mst_helper.h>
  35. /**
  36. * _wait_for - magic (register) wait macro
  37. *
  38. * Does the right thing for modeset paths when run under kdgb or similar atomic
  39. * contexts. Note that it's important that we check the condition again after
  40. * having timed out, since the timeout could be due to preemption or similar and
  41. * we've never had a chance to check the condition before the timeout.
  42. */
  43. #define _wait_for(COND, MS, W) ({ \
  44. unsigned long timeout__ = jiffies + msecs_to_jiffies(MS) + 1; \
  45. int ret__ = 0; \
  46. while (!(COND)) { \
  47. if (time_after(jiffies, timeout__)) { \
  48. if (!(COND)) \
  49. ret__ = -ETIMEDOUT; \
  50. break; \
  51. } \
  52. if (W && drm_can_sleep()) { \
  53. msleep(W); \
  54. } else { \
  55. cpu_relax(); \
  56. } \
  57. } \
  58. ret__; \
  59. })
  60. #define wait_for(COND, MS) _wait_for(COND, MS, 1)
  61. #define wait_for_atomic(COND, MS) _wait_for(COND, MS, 0)
  62. #define wait_for_atomic_us(COND, US) _wait_for((COND), \
  63. DIV_ROUND_UP((US), 1000), 0)
  64. #define KHz(x) (1000 * (x))
  65. #define MHz(x) KHz(1000 * (x))
  66. /*
  67. * Display related stuff
  68. */
  69. /* store information about an Ixxx DVO */
  70. /* The i830->i865 use multiple DVOs with multiple i2cs */
  71. /* the i915, i945 have a single sDVO i2c bus - which is different */
  72. #define MAX_OUTPUTS 6
  73. /* maximum connectors per crtcs in the mode set */
  74. /* Maximum cursor sizes */
  75. #define GEN2_CURSOR_WIDTH 64
  76. #define GEN2_CURSOR_HEIGHT 64
  77. #define MAX_CURSOR_WIDTH 256
  78. #define MAX_CURSOR_HEIGHT 256
  79. #define INTEL_I2C_BUS_DVO 1
  80. #define INTEL_I2C_BUS_SDVO 2
  81. /* these are outputs from the chip - integrated only
  82. external chips are via DVO or SDVO output */
  83. #define INTEL_OUTPUT_UNUSED 0
  84. #define INTEL_OUTPUT_ANALOG 1
  85. #define INTEL_OUTPUT_DVO 2
  86. #define INTEL_OUTPUT_SDVO 3
  87. #define INTEL_OUTPUT_LVDS 4
  88. #define INTEL_OUTPUT_TVOUT 5
  89. #define INTEL_OUTPUT_HDMI 6
  90. #define INTEL_OUTPUT_DISPLAYPORT 7
  91. #define INTEL_OUTPUT_EDP 8
  92. #define INTEL_OUTPUT_DSI 9
  93. #define INTEL_OUTPUT_UNKNOWN 10
  94. #define INTEL_OUTPUT_DP_MST 11
  95. #define INTEL_DVO_CHIP_NONE 0
  96. #define INTEL_DVO_CHIP_LVDS 1
  97. #define INTEL_DVO_CHIP_TMDS 2
  98. #define INTEL_DVO_CHIP_TVOUT 4
  99. #define INTEL_DSI_VIDEO_MODE 0
  100. #define INTEL_DSI_COMMAND_MODE 1
  101. struct intel_framebuffer {
  102. struct drm_framebuffer base;
  103. struct drm_i915_gem_object *obj;
  104. };
  105. struct intel_fbdev {
  106. struct drm_fb_helper helper;
  107. struct intel_framebuffer *fb;
  108. struct list_head fbdev_list;
  109. struct drm_display_mode *our_mode;
  110. int preferred_bpp;
  111. };
  112. struct intel_encoder {
  113. struct drm_encoder base;
  114. /*
  115. * The new crtc this encoder will be driven from. Only differs from
  116. * base->crtc while a modeset is in progress.
  117. */
  118. struct intel_crtc *new_crtc;
  119. int type;
  120. unsigned int cloneable;
  121. bool connectors_active;
  122. void (*hot_plug)(struct intel_encoder *);
  123. bool (*compute_config)(struct intel_encoder *,
  124. struct intel_crtc_config *);
  125. void (*pre_pll_enable)(struct intel_encoder *);
  126. void (*pre_enable)(struct intel_encoder *);
  127. void (*enable)(struct intel_encoder *);
  128. void (*mode_set)(struct intel_encoder *intel_encoder);
  129. void (*disable)(struct intel_encoder *);
  130. void (*post_disable)(struct intel_encoder *);
  131. /* Read out the current hw state of this connector, returning true if
  132. * the encoder is active. If the encoder is enabled it also set the pipe
  133. * it is connected to in the pipe parameter. */
  134. bool (*get_hw_state)(struct intel_encoder *, enum pipe *pipe);
  135. /* Reconstructs the equivalent mode flags for the current hardware
  136. * state. This must be called _after_ display->get_pipe_config has
  137. * pre-filled the pipe config. Note that intel_encoder->base.crtc must
  138. * be set correctly before calling this function. */
  139. void (*get_config)(struct intel_encoder *,
  140. struct intel_crtc_config *pipe_config);
  141. /*
  142. * Called during system suspend after all pending requests for the
  143. * encoder are flushed (for example for DP AUX transactions) and
  144. * device interrupts are disabled.
  145. */
  146. void (*suspend)(struct intel_encoder *);
  147. int crtc_mask;
  148. enum hpd_pin hpd_pin;
  149. };
  150. struct intel_panel {
  151. struct drm_display_mode *fixed_mode;
  152. struct drm_display_mode *downclock_mode;
  153. int fitting_mode;
  154. /* backlight */
  155. struct {
  156. bool present;
  157. u32 level;
  158. u32 min;
  159. u32 max;
  160. bool enabled;
  161. bool combination_mode; /* gen 2/4 only */
  162. bool active_low_pwm;
  163. struct backlight_device *device;
  164. } backlight;
  165. };
  166. struct intel_connector {
  167. struct drm_connector base;
  168. /*
  169. * The fixed encoder this connector is connected to.
  170. */
  171. struct intel_encoder *encoder;
  172. /*
  173. * The new encoder this connector will be driven. Only differs from
  174. * encoder while a modeset is in progress.
  175. */
  176. struct intel_encoder *new_encoder;
  177. /* Reads out the current hw, returning true if the connector is enabled
  178. * and active (i.e. dpms ON state). */
  179. bool (*get_hw_state)(struct intel_connector *);
  180. /*
  181. * Removes all interfaces through which the connector is accessible
  182. * - like sysfs, debugfs entries -, so that no new operations can be
  183. * started on the connector. Also makes sure all currently pending
  184. * operations finish before returing.
  185. */
  186. void (*unregister)(struct intel_connector *);
  187. /* Panel info for eDP and LVDS */
  188. struct intel_panel panel;
  189. /* Cached EDID for eDP and LVDS. May hold ERR_PTR for invalid EDID. */
  190. struct edid *edid;
  191. /* since POLL and HPD connectors may use the same HPD line keep the native
  192. state of connector->polled in case hotplug storm detection changes it */
  193. u8 polled;
  194. void *port; /* store this opaque as its illegal to dereference it */
  195. struct intel_dp *mst_port;
  196. };
  197. typedef struct dpll {
  198. /* given values */
  199. int n;
  200. int m1, m2;
  201. int p1, p2;
  202. /* derived values */
  203. int dot;
  204. int vco;
  205. int m;
  206. int p;
  207. } intel_clock_t;
  208. struct intel_plane_config {
  209. bool tiled;
  210. int size;
  211. u32 base;
  212. };
  213. struct intel_crtc_config {
  214. /**
  215. * quirks - bitfield with hw state readout quirks
  216. *
  217. * For various reasons the hw state readout code might not be able to
  218. * completely faithfully read out the current state. These cases are
  219. * tracked with quirk flags so that fastboot and state checker can act
  220. * accordingly.
  221. */
  222. #define PIPE_CONFIG_QUIRK_MODE_SYNC_FLAGS (1<<0) /* unreliable sync mode.flags */
  223. #define PIPE_CONFIG_QUIRK_INHERITED_MODE (1<<1) /* mode inherited from firmware */
  224. unsigned long quirks;
  225. /* User requested mode, only valid as a starting point to
  226. * compute adjusted_mode, except in the case of (S)DVO where
  227. * it's also for the output timings of the (S)DVO chip.
  228. * adjusted_mode will then correspond to the S(DVO) chip's
  229. * preferred input timings. */
  230. struct drm_display_mode requested_mode;
  231. /* Actual pipe timings ie. what we program into the pipe timing
  232. * registers. adjusted_mode.crtc_clock is the pipe pixel clock. */
  233. struct drm_display_mode adjusted_mode;
  234. /* Pipe source size (ie. panel fitter input size)
  235. * All planes will be positioned inside this space,
  236. * and get clipped at the edges. */
  237. int pipe_src_w, pipe_src_h;
  238. /* Whether to set up the PCH/FDI. Note that we never allow sharing
  239. * between pch encoders and cpu encoders. */
  240. bool has_pch_encoder;
  241. /* CPU Transcoder for the pipe. Currently this can only differ from the
  242. * pipe on Haswell (where we have a special eDP transcoder). */
  243. enum transcoder cpu_transcoder;
  244. /*
  245. * Use reduced/limited/broadcast rbg range, compressing from the full
  246. * range fed into the crtcs.
  247. */
  248. bool limited_color_range;
  249. /* DP has a bunch of special case unfortunately, so mark the pipe
  250. * accordingly. */
  251. bool has_dp_encoder;
  252. /* Whether we should send NULL infoframes. Required for audio. */
  253. bool has_hdmi_sink;
  254. /* Audio enabled on this pipe. Only valid if either has_hdmi_sink or
  255. * has_dp_encoder is set. */
  256. bool has_audio;
  257. /*
  258. * Enable dithering, used when the selected pipe bpp doesn't match the
  259. * plane bpp.
  260. */
  261. bool dither;
  262. /* Controls for the clock computation, to override various stages. */
  263. bool clock_set;
  264. /* SDVO TV has a bunch of special case. To make multifunction encoders
  265. * work correctly, we need to track this at runtime.*/
  266. bool sdvo_tv_clock;
  267. /*
  268. * crtc bandwidth limit, don't increase pipe bpp or clock if not really
  269. * required. This is set in the 2nd loop of calling encoder's
  270. * ->compute_config if the first pick doesn't work out.
  271. */
  272. bool bw_constrained;
  273. /* Settings for the intel dpll used on pretty much everything but
  274. * haswell. */
  275. struct dpll dpll;
  276. /* Selected dpll when shared or DPLL_ID_PRIVATE. */
  277. enum intel_dpll_id shared_dpll;
  278. /* PORT_CLK_SEL for DDI ports. */
  279. uint32_t ddi_pll_sel;
  280. /* Actual register state of the dpll, for shared dpll cross-checking. */
  281. struct intel_dpll_hw_state dpll_hw_state;
  282. int pipe_bpp;
  283. struct intel_link_m_n dp_m_n;
  284. /* m2_n2 for eDP downclock */
  285. struct intel_link_m_n dp_m2_n2;
  286. /*
  287. * Frequence the dpll for the port should run at. Differs from the
  288. * adjusted dotclock e.g. for DP or 12bpc hdmi mode. This is also
  289. * already multiplied by pixel_multiplier.
  290. */
  291. int port_clock;
  292. /* Used by SDVO (and if we ever fix it, HDMI). */
  293. unsigned pixel_multiplier;
  294. /* Panel fitter controls for gen2-gen4 + VLV */
  295. struct {
  296. u32 control;
  297. u32 pgm_ratios;
  298. u32 lvds_border_bits;
  299. } gmch_pfit;
  300. /* Panel fitter placement and size for Ironlake+ */
  301. struct {
  302. u32 pos;
  303. u32 size;
  304. bool enabled;
  305. bool force_thru;
  306. } pch_pfit;
  307. /* FDI configuration, only valid if has_pch_encoder is set. */
  308. int fdi_lanes;
  309. struct intel_link_m_n fdi_m_n;
  310. bool ips_enabled;
  311. bool double_wide;
  312. bool dp_encoder_is_mst;
  313. int pbn;
  314. };
  315. struct intel_pipe_wm {
  316. struct intel_wm_level wm[5];
  317. uint32_t linetime;
  318. bool fbc_wm_enabled;
  319. bool pipe_enabled;
  320. bool sprites_enabled;
  321. bool sprites_scaled;
  322. };
  323. struct intel_mmio_flip {
  324. u32 seqno;
  325. u32 ring_id;
  326. };
  327. struct intel_crtc {
  328. struct drm_crtc base;
  329. enum pipe pipe;
  330. enum plane plane;
  331. u8 lut_r[256], lut_g[256], lut_b[256];
  332. /*
  333. * Whether the crtc and the connected output pipeline is active. Implies
  334. * that crtc->enabled is set, i.e. the current mode configuration has
  335. * some outputs connected to this crtc.
  336. */
  337. bool active;
  338. unsigned long enabled_power_domains;
  339. bool primary_enabled; /* is the primary plane (partially) visible? */
  340. bool lowfreq_avail;
  341. struct intel_overlay *overlay;
  342. struct intel_unpin_work *unpin_work;
  343. atomic_t unpin_work_count;
  344. /* Display surface base address adjustement for pageflips. Note that on
  345. * gen4+ this only adjusts up to a tile, offsets within a tile are
  346. * handled in the hw itself (with the TILEOFF register). */
  347. unsigned long dspaddr_offset;
  348. struct drm_i915_gem_object *cursor_bo;
  349. uint32_t cursor_addr;
  350. int16_t cursor_width, cursor_height;
  351. uint32_t cursor_cntl;
  352. uint32_t cursor_base;
  353. struct intel_plane_config plane_config;
  354. struct intel_crtc_config config;
  355. struct intel_crtc_config *new_config;
  356. bool new_enabled;
  357. /* reset counter value when the last flip was submitted */
  358. unsigned int reset_counter;
  359. /* Access to these should be protected by dev_priv->irq_lock. */
  360. bool cpu_fifo_underrun_disabled;
  361. bool pch_fifo_underrun_disabled;
  362. /* per-pipe watermark state */
  363. struct {
  364. /* watermarks currently being used */
  365. struct intel_pipe_wm active;
  366. } wm;
  367. wait_queue_head_t vbl_wait;
  368. int scanline_offset;
  369. struct intel_mmio_flip mmio_flip;
  370. };
  371. struct intel_plane_wm_parameters {
  372. uint32_t horiz_pixels;
  373. uint32_t vert_pixels;
  374. uint8_t bytes_per_pixel;
  375. bool enabled;
  376. bool scaled;
  377. };
  378. struct intel_plane {
  379. struct drm_plane base;
  380. int plane;
  381. enum pipe pipe;
  382. struct drm_i915_gem_object *obj;
  383. bool can_scale;
  384. int max_downscale;
  385. int crtc_x, crtc_y;
  386. unsigned int crtc_w, crtc_h;
  387. uint32_t src_x, src_y;
  388. uint32_t src_w, src_h;
  389. /* Since we need to change the watermarks before/after
  390. * enabling/disabling the planes, we need to store the parameters here
  391. * as the other pieces of the struct may not reflect the values we want
  392. * for the watermark calculations. Currently only Haswell uses this.
  393. */
  394. struct intel_plane_wm_parameters wm;
  395. void (*update_plane)(struct drm_plane *plane,
  396. struct drm_crtc *crtc,
  397. struct drm_framebuffer *fb,
  398. struct drm_i915_gem_object *obj,
  399. int crtc_x, int crtc_y,
  400. unsigned int crtc_w, unsigned int crtc_h,
  401. uint32_t x, uint32_t y,
  402. uint32_t src_w, uint32_t src_h);
  403. void (*disable_plane)(struct drm_plane *plane,
  404. struct drm_crtc *crtc);
  405. int (*update_colorkey)(struct drm_plane *plane,
  406. struct drm_intel_sprite_colorkey *key);
  407. void (*get_colorkey)(struct drm_plane *plane,
  408. struct drm_intel_sprite_colorkey *key);
  409. };
  410. struct intel_watermark_params {
  411. unsigned long fifo_size;
  412. unsigned long max_wm;
  413. unsigned long default_wm;
  414. unsigned long guard_size;
  415. unsigned long cacheline_size;
  416. };
  417. struct cxsr_latency {
  418. int is_desktop;
  419. int is_ddr3;
  420. unsigned long fsb_freq;
  421. unsigned long mem_freq;
  422. unsigned long display_sr;
  423. unsigned long display_hpll_disable;
  424. unsigned long cursor_sr;
  425. unsigned long cursor_hpll_disable;
  426. };
  427. #define to_intel_crtc(x) container_of(x, struct intel_crtc, base)
  428. #define to_intel_connector(x) container_of(x, struct intel_connector, base)
  429. #define to_intel_encoder(x) container_of(x, struct intel_encoder, base)
  430. #define to_intel_framebuffer(x) container_of(x, struct intel_framebuffer, base)
  431. #define to_intel_plane(x) container_of(x, struct intel_plane, base)
  432. #define intel_fb_obj(x) (x ? to_intel_framebuffer(x)->obj : NULL)
  433. struct intel_hdmi {
  434. u32 hdmi_reg;
  435. int ddc_bus;
  436. uint32_t color_range;
  437. bool color_range_auto;
  438. bool has_hdmi_sink;
  439. bool has_audio;
  440. enum hdmi_force_audio force_audio;
  441. bool rgb_quant_range_selectable;
  442. enum hdmi_picture_aspect aspect_ratio;
  443. void (*write_infoframe)(struct drm_encoder *encoder,
  444. enum hdmi_infoframe_type type,
  445. const void *frame, ssize_t len);
  446. void (*set_infoframes)(struct drm_encoder *encoder,
  447. bool enable,
  448. struct drm_display_mode *adjusted_mode);
  449. };
  450. struct intel_dp_mst_encoder;
  451. #define DP_MAX_DOWNSTREAM_PORTS 0x10
  452. /**
  453. * HIGH_RR is the highest eDP panel refresh rate read from EDID
  454. * LOW_RR is the lowest eDP panel refresh rate found from EDID
  455. * parsing for same resolution.
  456. */
  457. enum edp_drrs_refresh_rate_type {
  458. DRRS_HIGH_RR,
  459. DRRS_LOW_RR,
  460. DRRS_MAX_RR, /* RR count */
  461. };
  462. struct intel_dp {
  463. uint32_t output_reg;
  464. uint32_t aux_ch_ctl_reg;
  465. uint32_t DP;
  466. bool has_audio;
  467. enum hdmi_force_audio force_audio;
  468. uint32_t color_range;
  469. bool color_range_auto;
  470. uint8_t link_bw;
  471. uint8_t lane_count;
  472. uint8_t dpcd[DP_RECEIVER_CAP_SIZE];
  473. uint8_t psr_dpcd[EDP_PSR_RECEIVER_CAP_SIZE];
  474. uint8_t downstream_ports[DP_MAX_DOWNSTREAM_PORTS];
  475. struct drm_dp_aux aux;
  476. uint8_t train_set[4];
  477. int panel_power_up_delay;
  478. int panel_power_down_delay;
  479. int panel_power_cycle_delay;
  480. int backlight_on_delay;
  481. int backlight_off_delay;
  482. struct delayed_work panel_vdd_work;
  483. bool want_panel_vdd;
  484. unsigned long last_power_cycle;
  485. unsigned long last_power_on;
  486. unsigned long last_backlight_off;
  487. struct notifier_block edp_notifier;
  488. bool use_tps3;
  489. bool can_mst; /* this port supports mst */
  490. bool is_mst;
  491. int active_mst_links;
  492. /* connector directly attached - won't be use for modeset in mst world */
  493. struct intel_connector *attached_connector;
  494. /* mst connector list */
  495. struct intel_dp_mst_encoder *mst_encoders[I915_MAX_PIPES];
  496. struct drm_dp_mst_topology_mgr mst_mgr;
  497. uint32_t (*get_aux_clock_divider)(struct intel_dp *dp, int index);
  498. /*
  499. * This function returns the value we have to program the AUX_CTL
  500. * register with to kick off an AUX transaction.
  501. */
  502. uint32_t (*get_aux_send_ctl)(struct intel_dp *dp,
  503. bool has_aux_irq,
  504. int send_bytes,
  505. uint32_t aux_clock_divider);
  506. struct {
  507. enum drrs_support_type type;
  508. enum edp_drrs_refresh_rate_type refresh_rate_type;
  509. struct mutex mutex;
  510. } drrs_state;
  511. };
  512. struct intel_digital_port {
  513. struct intel_encoder base;
  514. enum port port;
  515. u32 saved_port_bits;
  516. struct intel_dp dp;
  517. struct intel_hdmi hdmi;
  518. bool (*hpd_pulse)(struct intel_digital_port *, bool);
  519. };
  520. struct intel_dp_mst_encoder {
  521. struct intel_encoder base;
  522. enum pipe pipe;
  523. struct intel_digital_port *primary;
  524. void *port; /* store this opaque as its illegal to dereference it */
  525. };
  526. static inline int
  527. vlv_dport_to_channel(struct intel_digital_port *dport)
  528. {
  529. switch (dport->port) {
  530. case PORT_B:
  531. case PORT_D:
  532. return DPIO_CH0;
  533. case PORT_C:
  534. return DPIO_CH1;
  535. default:
  536. BUG();
  537. }
  538. }
  539. static inline int
  540. vlv_pipe_to_channel(enum pipe pipe)
  541. {
  542. switch (pipe) {
  543. case PIPE_A:
  544. case PIPE_C:
  545. return DPIO_CH0;
  546. case PIPE_B:
  547. return DPIO_CH1;
  548. default:
  549. BUG();
  550. }
  551. }
  552. static inline struct drm_crtc *
  553. intel_get_crtc_for_pipe(struct drm_device *dev, int pipe)
  554. {
  555. struct drm_i915_private *dev_priv = dev->dev_private;
  556. return dev_priv->pipe_to_crtc_mapping[pipe];
  557. }
  558. static inline struct drm_crtc *
  559. intel_get_crtc_for_plane(struct drm_device *dev, int plane)
  560. {
  561. struct drm_i915_private *dev_priv = dev->dev_private;
  562. return dev_priv->plane_to_crtc_mapping[plane];
  563. }
  564. struct intel_unpin_work {
  565. struct work_struct work;
  566. struct drm_crtc *crtc;
  567. struct drm_i915_gem_object *old_fb_obj;
  568. struct drm_i915_gem_object *pending_flip_obj;
  569. struct drm_pending_vblank_event *event;
  570. atomic_t pending;
  571. #define INTEL_FLIP_INACTIVE 0
  572. #define INTEL_FLIP_PENDING 1
  573. #define INTEL_FLIP_COMPLETE 2
  574. u32 flip_count;
  575. u32 gtt_offset;
  576. bool enable_stall_check;
  577. };
  578. struct intel_set_config {
  579. struct drm_encoder **save_connector_encoders;
  580. struct drm_crtc **save_encoder_crtcs;
  581. bool *save_crtc_enabled;
  582. bool fb_changed;
  583. bool mode_changed;
  584. };
  585. struct intel_load_detect_pipe {
  586. struct drm_framebuffer *release_fb;
  587. bool load_detect_temp;
  588. int dpms_mode;
  589. };
  590. static inline struct intel_encoder *
  591. intel_attached_encoder(struct drm_connector *connector)
  592. {
  593. return to_intel_connector(connector)->encoder;
  594. }
  595. static inline struct intel_digital_port *
  596. enc_to_dig_port(struct drm_encoder *encoder)
  597. {
  598. return container_of(encoder, struct intel_digital_port, base.base);
  599. }
  600. static inline struct intel_dp_mst_encoder *
  601. enc_to_mst(struct drm_encoder *encoder)
  602. {
  603. return container_of(encoder, struct intel_dp_mst_encoder, base.base);
  604. }
  605. static inline struct intel_dp *enc_to_intel_dp(struct drm_encoder *encoder)
  606. {
  607. return &enc_to_dig_port(encoder)->dp;
  608. }
  609. static inline struct intel_digital_port *
  610. dp_to_dig_port(struct intel_dp *intel_dp)
  611. {
  612. return container_of(intel_dp, struct intel_digital_port, dp);
  613. }
  614. static inline struct intel_digital_port *
  615. hdmi_to_dig_port(struct intel_hdmi *intel_hdmi)
  616. {
  617. return container_of(intel_hdmi, struct intel_digital_port, hdmi);
  618. }
  619. /* i915_irq.c */
  620. bool intel_set_cpu_fifo_underrun_reporting(struct drm_device *dev,
  621. enum pipe pipe, bool enable);
  622. bool intel_set_pch_fifo_underrun_reporting(struct drm_device *dev,
  623. enum transcoder pch_transcoder,
  624. bool enable);
  625. void gen5_enable_gt_irq(struct drm_i915_private *dev_priv, uint32_t mask);
  626. void gen5_disable_gt_irq(struct drm_i915_private *dev_priv, uint32_t mask);
  627. void gen6_enable_pm_irq(struct drm_i915_private *dev_priv, uint32_t mask);
  628. void gen6_disable_pm_irq(struct drm_i915_private *dev_priv, uint32_t mask);
  629. void gen8_enable_pm_irq(struct drm_i915_private *dev_priv, uint32_t mask);
  630. void gen8_disable_pm_irq(struct drm_i915_private *dev_priv, uint32_t mask);
  631. void intel_runtime_pm_disable_interrupts(struct drm_device *dev);
  632. void intel_runtime_pm_restore_interrupts(struct drm_device *dev);
  633. static inline bool intel_irqs_enabled(struct drm_i915_private *dev_priv)
  634. {
  635. /*
  636. * We only use drm_irq_uninstall() at unload and VT switch, so
  637. * this is the only thing we need to check.
  638. */
  639. return !dev_priv->pm._irqs_disabled;
  640. }
  641. int intel_get_crtc_scanline(struct intel_crtc *crtc);
  642. void i9xx_check_fifo_underruns(struct drm_device *dev);
  643. void gen8_irq_power_well_post_enable(struct drm_i915_private *dev_priv);
  644. /* intel_crt.c */
  645. void intel_crt_init(struct drm_device *dev);
  646. /* intel_ddi.c */
  647. void intel_prepare_ddi(struct drm_device *dev);
  648. void hsw_fdi_link_train(struct drm_crtc *crtc);
  649. void intel_ddi_init(struct drm_device *dev, enum port port);
  650. enum port intel_ddi_get_encoder_port(struct intel_encoder *intel_encoder);
  651. bool intel_ddi_get_hw_state(struct intel_encoder *encoder, enum pipe *pipe);
  652. int intel_ddi_get_cdclk_freq(struct drm_i915_private *dev_priv);
  653. void intel_ddi_pll_init(struct drm_device *dev);
  654. void intel_ddi_enable_transcoder_func(struct drm_crtc *crtc);
  655. void intel_ddi_disable_transcoder_func(struct drm_i915_private *dev_priv,
  656. enum transcoder cpu_transcoder);
  657. void intel_ddi_enable_pipe_clock(struct intel_crtc *intel_crtc);
  658. void intel_ddi_disable_pipe_clock(struct intel_crtc *intel_crtc);
  659. bool intel_ddi_pll_select(struct intel_crtc *crtc);
  660. void intel_ddi_set_pipe_settings(struct drm_crtc *crtc);
  661. void intel_ddi_prepare_link_retrain(struct drm_encoder *encoder);
  662. bool intel_ddi_connector_get_hw_state(struct intel_connector *intel_connector);
  663. void intel_ddi_fdi_disable(struct drm_crtc *crtc);
  664. void intel_ddi_get_config(struct intel_encoder *encoder,
  665. struct intel_crtc_config *pipe_config);
  666. void intel_ddi_init_dp_buf_reg(struct intel_encoder *encoder);
  667. void intel_ddi_clock_get(struct intel_encoder *encoder,
  668. struct intel_crtc_config *pipe_config);
  669. void intel_ddi_set_vc_payload_alloc(struct drm_crtc *crtc, bool state);
  670. /* intel_display.c */
  671. const char *intel_output_name(int output);
  672. bool intel_has_pending_fb_unpin(struct drm_device *dev);
  673. int intel_pch_rawclk(struct drm_device *dev);
  674. void intel_mark_busy(struct drm_device *dev);
  675. void intel_fb_obj_invalidate(struct drm_i915_gem_object *obj,
  676. struct intel_engine_cs *ring);
  677. void intel_frontbuffer_flip_prepare(struct drm_device *dev,
  678. unsigned frontbuffer_bits);
  679. void intel_frontbuffer_flip_complete(struct drm_device *dev,
  680. unsigned frontbuffer_bits);
  681. void intel_frontbuffer_flush(struct drm_device *dev,
  682. unsigned frontbuffer_bits);
  683. /**
  684. * intel_frontbuffer_flip - prepare frontbuffer flip
  685. * @dev: DRM device
  686. * @frontbuffer_bits: frontbuffer plane tracking bits
  687. *
  688. * This function gets called after scheduling a flip on @obj. This is for
  689. * synchronous plane updates which will happen on the next vblank and which will
  690. * not get delayed by pending gpu rendering.
  691. *
  692. * Can be called without any locks held.
  693. */
  694. static inline
  695. void intel_frontbuffer_flip(struct drm_device *dev,
  696. unsigned frontbuffer_bits)
  697. {
  698. intel_frontbuffer_flush(dev, frontbuffer_bits);
  699. }
  700. void intel_fb_obj_flush(struct drm_i915_gem_object *obj, bool retire);
  701. void intel_mark_idle(struct drm_device *dev);
  702. void intel_crtc_restore_mode(struct drm_crtc *crtc);
  703. void intel_crtc_control(struct drm_crtc *crtc, bool enable);
  704. void intel_crtc_update_dpms(struct drm_crtc *crtc);
  705. void intel_encoder_destroy(struct drm_encoder *encoder);
  706. void intel_connector_dpms(struct drm_connector *, int mode);
  707. bool intel_connector_get_hw_state(struct intel_connector *connector);
  708. void intel_modeset_check_state(struct drm_device *dev);
  709. bool ibx_digital_port_connected(struct drm_i915_private *dev_priv,
  710. struct intel_digital_port *port);
  711. void intel_connector_attach_encoder(struct intel_connector *connector,
  712. struct intel_encoder *encoder);
  713. struct drm_encoder *intel_best_encoder(struct drm_connector *connector);
  714. struct drm_display_mode *intel_crtc_mode_get(struct drm_device *dev,
  715. struct drm_crtc *crtc);
  716. enum pipe intel_get_pipe_from_connector(struct intel_connector *connector);
  717. int intel_get_pipe_from_crtc_id(struct drm_device *dev, void *data,
  718. struct drm_file *file_priv);
  719. enum transcoder intel_pipe_to_cpu_transcoder(struct drm_i915_private *dev_priv,
  720. enum pipe pipe);
  721. void intel_wait_for_vblank(struct drm_device *dev, int pipe);
  722. void intel_wait_for_pipe_off(struct drm_device *dev, int pipe);
  723. int ironlake_get_lanes_required(int target_clock, int link_bw, int bpp);
  724. void vlv_wait_port_ready(struct drm_i915_private *dev_priv,
  725. struct intel_digital_port *dport);
  726. bool intel_get_load_detect_pipe(struct drm_connector *connector,
  727. struct drm_display_mode *mode,
  728. struct intel_load_detect_pipe *old,
  729. struct drm_modeset_acquire_ctx *ctx);
  730. void intel_release_load_detect_pipe(struct drm_connector *connector,
  731. struct intel_load_detect_pipe *old);
  732. int intel_pin_and_fence_fb_obj(struct drm_device *dev,
  733. struct drm_i915_gem_object *obj,
  734. struct intel_engine_cs *pipelined);
  735. void intel_unpin_fb_obj(struct drm_i915_gem_object *obj);
  736. struct drm_framebuffer *
  737. __intel_framebuffer_create(struct drm_device *dev,
  738. struct drm_mode_fb_cmd2 *mode_cmd,
  739. struct drm_i915_gem_object *obj);
  740. void intel_prepare_page_flip(struct drm_device *dev, int plane);
  741. void intel_finish_page_flip(struct drm_device *dev, int pipe);
  742. void intel_finish_page_flip_plane(struct drm_device *dev, int plane);
  743. /* shared dpll functions */
  744. struct intel_shared_dpll *intel_crtc_to_shared_dpll(struct intel_crtc *crtc);
  745. void assert_shared_dpll(struct drm_i915_private *dev_priv,
  746. struct intel_shared_dpll *pll,
  747. bool state);
  748. #define assert_shared_dpll_enabled(d, p) assert_shared_dpll(d, p, true)
  749. #define assert_shared_dpll_disabled(d, p) assert_shared_dpll(d, p, false)
  750. struct intel_shared_dpll *intel_get_shared_dpll(struct intel_crtc *crtc);
  751. void intel_put_shared_dpll(struct intel_crtc *crtc);
  752. /* modesetting asserts */
  753. void assert_pll(struct drm_i915_private *dev_priv,
  754. enum pipe pipe, bool state);
  755. #define assert_pll_enabled(d, p) assert_pll(d, p, true)
  756. #define assert_pll_disabled(d, p) assert_pll(d, p, false)
  757. void assert_fdi_rx_pll(struct drm_i915_private *dev_priv,
  758. enum pipe pipe, bool state);
  759. #define assert_fdi_rx_pll_enabled(d, p) assert_fdi_rx_pll(d, p, true)
  760. #define assert_fdi_rx_pll_disabled(d, p) assert_fdi_rx_pll(d, p, false)
  761. void assert_pipe(struct drm_i915_private *dev_priv, enum pipe pipe, bool state);
  762. #define assert_pipe_enabled(d, p) assert_pipe(d, p, true)
  763. #define assert_pipe_disabled(d, p) assert_pipe(d, p, false)
  764. void intel_write_eld(struct drm_encoder *encoder,
  765. struct drm_display_mode *mode);
  766. unsigned long intel_gen4_compute_page_offset(int *x, int *y,
  767. unsigned int tiling_mode,
  768. unsigned int bpp,
  769. unsigned int pitch);
  770. void intel_display_handle_reset(struct drm_device *dev);
  771. void hsw_enable_pc8(struct drm_i915_private *dev_priv);
  772. void hsw_disable_pc8(struct drm_i915_private *dev_priv);
  773. void intel_dp_get_m_n(struct intel_crtc *crtc,
  774. struct intel_crtc_config *pipe_config);
  775. int intel_dotclock_calculate(int link_freq, const struct intel_link_m_n *m_n);
  776. void
  777. ironlake_check_encoder_dotclock(const struct intel_crtc_config *pipe_config,
  778. int dotclock);
  779. bool intel_crtc_active(struct drm_crtc *crtc);
  780. void hsw_enable_ips(struct intel_crtc *crtc);
  781. void hsw_disable_ips(struct intel_crtc *crtc);
  782. void intel_display_set_init_power(struct drm_i915_private *dev, bool enable);
  783. enum intel_display_power_domain
  784. intel_display_port_power_domain(struct intel_encoder *intel_encoder);
  785. void intel_mode_from_pipe_config(struct drm_display_mode *mode,
  786. struct intel_crtc_config *pipe_config);
  787. int intel_format_to_fourcc(int format);
  788. void intel_crtc_wait_for_pending_flips(struct drm_crtc *crtc);
  789. /* intel_dp.c */
  790. void intel_dp_init(struct drm_device *dev, int output_reg, enum port port);
  791. bool intel_dp_init_connector(struct intel_digital_port *intel_dig_port,
  792. struct intel_connector *intel_connector);
  793. void intel_dp_start_link_train(struct intel_dp *intel_dp);
  794. void intel_dp_complete_link_train(struct intel_dp *intel_dp);
  795. void intel_dp_stop_link_train(struct intel_dp *intel_dp);
  796. void intel_dp_sink_dpms(struct intel_dp *intel_dp, int mode);
  797. void intel_dp_encoder_destroy(struct drm_encoder *encoder);
  798. void intel_dp_check_link_status(struct intel_dp *intel_dp);
  799. int intel_dp_sink_crc(struct intel_dp *intel_dp, u8 *crc);
  800. bool intel_dp_compute_config(struct intel_encoder *encoder,
  801. struct intel_crtc_config *pipe_config);
  802. bool intel_dp_is_edp(struct drm_device *dev, enum port port);
  803. bool intel_dp_hpd_pulse(struct intel_digital_port *intel_dig_port,
  804. bool long_hpd);
  805. void intel_edp_backlight_on(struct intel_dp *intel_dp);
  806. void intel_edp_backlight_off(struct intel_dp *intel_dp);
  807. void intel_edp_panel_vdd_on(struct intel_dp *intel_dp);
  808. void intel_edp_panel_vdd_sanitize(struct intel_encoder *intel_encoder);
  809. void intel_edp_panel_on(struct intel_dp *intel_dp);
  810. void intel_edp_panel_off(struct intel_dp *intel_dp);
  811. void intel_edp_psr_enable(struct intel_dp *intel_dp);
  812. void intel_edp_psr_disable(struct intel_dp *intel_dp);
  813. void intel_dp_set_drrs_state(struct drm_device *dev, int refresh_rate);
  814. void intel_edp_psr_invalidate(struct drm_device *dev,
  815. unsigned frontbuffer_bits);
  816. void intel_edp_psr_flush(struct drm_device *dev,
  817. unsigned frontbuffer_bits);
  818. void intel_edp_psr_init(struct drm_device *dev);
  819. int intel_dp_handle_hpd_irq(struct intel_digital_port *digport, bool long_hpd);
  820. void intel_dp_add_properties(struct intel_dp *intel_dp, struct drm_connector *connector);
  821. void intel_dp_mst_suspend(struct drm_device *dev);
  822. void intel_dp_mst_resume(struct drm_device *dev);
  823. int intel_dp_max_link_bw(struct intel_dp *intel_dp);
  824. void intel_dp_hot_plug(struct intel_encoder *intel_encoder);
  825. /* intel_dp_mst.c */
  826. int intel_dp_mst_encoder_init(struct intel_digital_port *intel_dig_port, int conn_id);
  827. void intel_dp_mst_encoder_cleanup(struct intel_digital_port *intel_dig_port);
  828. /* intel_dsi.c */
  829. void intel_dsi_init(struct drm_device *dev);
  830. /* intel_dvo.c */
  831. void intel_dvo_init(struct drm_device *dev);
  832. /* legacy fbdev emulation in intel_fbdev.c */
  833. #ifdef CONFIG_DRM_I915_FBDEV
  834. extern int intel_fbdev_init(struct drm_device *dev);
  835. extern void intel_fbdev_initial_config(struct drm_device *dev);
  836. extern void intel_fbdev_fini(struct drm_device *dev);
  837. extern void intel_fbdev_set_suspend(struct drm_device *dev, int state);
  838. extern void intel_fbdev_output_poll_changed(struct drm_device *dev);
  839. extern void intel_fbdev_restore_mode(struct drm_device *dev);
  840. #else
  841. static inline int intel_fbdev_init(struct drm_device *dev)
  842. {
  843. return 0;
  844. }
  845. static inline void intel_fbdev_initial_config(struct drm_device *dev)
  846. {
  847. }
  848. static inline void intel_fbdev_fini(struct drm_device *dev)
  849. {
  850. }
  851. static inline void intel_fbdev_set_suspend(struct drm_device *dev, int state)
  852. {
  853. }
  854. static inline void intel_fbdev_restore_mode(struct drm_device *dev)
  855. {
  856. }
  857. #endif
  858. /* intel_hdmi.c */
  859. void intel_hdmi_init(struct drm_device *dev, int hdmi_reg, enum port port);
  860. void intel_hdmi_init_connector(struct intel_digital_port *intel_dig_port,
  861. struct intel_connector *intel_connector);
  862. struct intel_hdmi *enc_to_intel_hdmi(struct drm_encoder *encoder);
  863. bool intel_hdmi_compute_config(struct intel_encoder *encoder,
  864. struct intel_crtc_config *pipe_config);
  865. /* intel_lvds.c */
  866. void intel_lvds_init(struct drm_device *dev);
  867. bool intel_is_dual_link_lvds(struct drm_device *dev);
  868. /* intel_modes.c */
  869. int intel_connector_update_modes(struct drm_connector *connector,
  870. struct edid *edid);
  871. int intel_ddc_get_modes(struct drm_connector *c, struct i2c_adapter *adapter);
  872. void intel_attach_force_audio_property(struct drm_connector *connector);
  873. void intel_attach_broadcast_rgb_property(struct drm_connector *connector);
  874. /* intel_overlay.c */
  875. void intel_setup_overlay(struct drm_device *dev);
  876. void intel_cleanup_overlay(struct drm_device *dev);
  877. int intel_overlay_switch_off(struct intel_overlay *overlay);
  878. int intel_overlay_put_image(struct drm_device *dev, void *data,
  879. struct drm_file *file_priv);
  880. int intel_overlay_attrs(struct drm_device *dev, void *data,
  881. struct drm_file *file_priv);
  882. /* intel_panel.c */
  883. int intel_panel_init(struct intel_panel *panel,
  884. struct drm_display_mode *fixed_mode,
  885. struct drm_display_mode *downclock_mode);
  886. void intel_panel_fini(struct intel_panel *panel);
  887. void intel_fixed_panel_mode(const struct drm_display_mode *fixed_mode,
  888. struct drm_display_mode *adjusted_mode);
  889. void intel_pch_panel_fitting(struct intel_crtc *crtc,
  890. struct intel_crtc_config *pipe_config,
  891. int fitting_mode);
  892. void intel_gmch_panel_fitting(struct intel_crtc *crtc,
  893. struct intel_crtc_config *pipe_config,
  894. int fitting_mode);
  895. void intel_panel_set_backlight_acpi(struct intel_connector *connector,
  896. u32 level, u32 max);
  897. int intel_panel_setup_backlight(struct drm_connector *connector);
  898. void intel_panel_enable_backlight(struct intel_connector *connector);
  899. void intel_panel_disable_backlight(struct intel_connector *connector);
  900. void intel_panel_destroy_backlight(struct drm_connector *connector);
  901. void intel_panel_init_backlight_funcs(struct drm_device *dev);
  902. enum drm_connector_status intel_panel_detect(struct drm_device *dev);
  903. extern struct drm_display_mode *intel_find_panel_downclock(
  904. struct drm_device *dev,
  905. struct drm_display_mode *fixed_mode,
  906. struct drm_connector *connector);
  907. /* intel_pm.c */
  908. void intel_init_clock_gating(struct drm_device *dev);
  909. void intel_suspend_hw(struct drm_device *dev);
  910. int ilk_wm_max_level(const struct drm_device *dev);
  911. void intel_update_watermarks(struct drm_crtc *crtc);
  912. void intel_update_sprite_watermarks(struct drm_plane *plane,
  913. struct drm_crtc *crtc,
  914. uint32_t sprite_width,
  915. uint32_t sprite_height,
  916. int pixel_size,
  917. bool enabled, bool scaled);
  918. void intel_init_pm(struct drm_device *dev);
  919. void intel_pm_setup(struct drm_device *dev);
  920. bool intel_fbc_enabled(struct drm_device *dev);
  921. void intel_update_fbc(struct drm_device *dev);
  922. void intel_gpu_ips_init(struct drm_i915_private *dev_priv);
  923. void intel_gpu_ips_teardown(void);
  924. int intel_power_domains_init(struct drm_i915_private *);
  925. void intel_power_domains_remove(struct drm_i915_private *);
  926. bool intel_display_power_enabled(struct drm_i915_private *dev_priv,
  927. enum intel_display_power_domain domain);
  928. bool intel_display_power_enabled_unlocked(struct drm_i915_private *dev_priv,
  929. enum intel_display_power_domain domain);
  930. void intel_display_power_get(struct drm_i915_private *dev_priv,
  931. enum intel_display_power_domain domain);
  932. void intel_display_power_put(struct drm_i915_private *dev_priv,
  933. enum intel_display_power_domain domain);
  934. void intel_power_domains_init_hw(struct drm_i915_private *dev_priv);
  935. void intel_init_gt_powersave(struct drm_device *dev);
  936. void intel_cleanup_gt_powersave(struct drm_device *dev);
  937. void intel_enable_gt_powersave(struct drm_device *dev);
  938. void intel_disable_gt_powersave(struct drm_device *dev);
  939. void intel_suspend_gt_powersave(struct drm_device *dev);
  940. void intel_reset_gt_powersave(struct drm_device *dev);
  941. void ironlake_teardown_rc6(struct drm_device *dev);
  942. void gen6_update_ring_freq(struct drm_device *dev);
  943. void gen6_rps_idle(struct drm_i915_private *dev_priv);
  944. void gen6_rps_boost(struct drm_i915_private *dev_priv);
  945. void intel_aux_display_runtime_get(struct drm_i915_private *dev_priv);
  946. void intel_aux_display_runtime_put(struct drm_i915_private *dev_priv);
  947. void intel_runtime_pm_get(struct drm_i915_private *dev_priv);
  948. void intel_runtime_pm_get_noresume(struct drm_i915_private *dev_priv);
  949. void intel_runtime_pm_put(struct drm_i915_private *dev_priv);
  950. void intel_init_runtime_pm(struct drm_i915_private *dev_priv);
  951. void intel_fini_runtime_pm(struct drm_i915_private *dev_priv);
  952. void ilk_wm_get_hw_state(struct drm_device *dev);
  953. /* intel_sdvo.c */
  954. bool intel_sdvo_init(struct drm_device *dev, uint32_t sdvo_reg, bool is_sdvob);
  955. /* intel_sprite.c */
  956. int intel_plane_init(struct drm_device *dev, enum pipe pipe, int plane);
  957. void intel_flush_primary_plane(struct drm_i915_private *dev_priv,
  958. enum plane plane);
  959. void intel_plane_restore(struct drm_plane *plane);
  960. void intel_plane_disable(struct drm_plane *plane);
  961. int intel_sprite_set_colorkey(struct drm_device *dev, void *data,
  962. struct drm_file *file_priv);
  963. int intel_sprite_get_colorkey(struct drm_device *dev, void *data,
  964. struct drm_file *file_priv);
  965. /* intel_tv.c */
  966. void intel_tv_init(struct drm_device *dev);
  967. #endif /* __INTEL_DRV_H__ */