intel_drv.h 37 KB

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