intel_drv.h 37 KB

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