intel_drv.h 38 KB

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