intel_drv.h 36 KB

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