Rev 4104 | Rev 4560 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 4104 | Rev 4280 | ||
---|---|---|---|
1 | /* |
1 | /* |
2 | * Copyright (c) 2006 Dave Airlie |
2 | * Copyright (c) 2006 Dave Airlie |
3 | * Copyright (c) 2007-2008 Intel Corporation |
3 | * Copyright (c) 2007-2008 Intel Corporation |
4 | * Jesse Barnes |
4 | * Jesse Barnes |
5 | * |
5 | * |
6 | * Permission is hereby granted, free of charge, to any person obtaining a |
6 | * Permission is hereby granted, free of charge, to any person obtaining a |
7 | * copy of this software and associated documentation files (the "Software"), |
7 | * copy of this software and associated documentation files (the "Software"), |
8 | * to deal in the Software without restriction, including without limitation |
8 | * to deal in the Software without restriction, including without limitation |
9 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, |
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 |
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: |
11 | * Software is furnished to do so, subject to the following conditions: |
12 | * |
12 | * |
13 | * The above copyright notice and this permission notice (including the next |
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 |
14 | * paragraph) shall be included in all copies or substantial portions of the |
15 | * Software. |
15 | * Software. |
16 | * |
16 | * |
17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
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, |
18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
19 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
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 |
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 |
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 |
22 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS |
23 | * IN THE SOFTWARE. |
23 | * IN THE SOFTWARE. |
24 | */ |
24 | */ |
25 | #ifndef __INTEL_DRV_H__ |
25 | #ifndef __INTEL_DRV_H__ |
26 | #define __INTEL_DRV_H__ |
26 | #define __INTEL_DRV_H__ |
27 | 27 | ||
28 | #include |
28 | #include |
29 | #include |
29 | #include |
30 | #include |
30 | #include |
31 | #include "i915_drv.h" |
31 | #include "i915_drv.h" |
32 | #include |
32 | #include |
33 | #include |
33 | #include |
34 | #include |
34 | #include |
35 | #include |
35 | #include |
36 | 36 | ||
37 | #define KBUILD_MODNAME "i915.dll" |
37 | #define KBUILD_MODNAME "i915.dll" |
38 | 38 | ||
39 | 39 | ||
40 | #define cpu_relax() asm volatile("rep; nop") |
40 | #define cpu_relax() asm volatile("rep; nop") |
41 | 41 | ||
42 | /** |
42 | /** |
43 | * _wait_for - magic (register) wait macro |
43 | * _wait_for - magic (register) wait macro |
44 | * |
44 | * |
45 | * Does the right thing for modeset paths when run under kdgb or similar atomic |
45 | * Does the right thing for modeset paths when run under kdgb or similar atomic |
46 | * contexts. Note that it's important that we check the condition again after |
46 | * contexts. Note that it's important that we check the condition again after |
47 | * having timed out, since the timeout could be due to preemption or similar and |
47 | * having timed out, since the timeout could be due to preemption or similar and |
48 | * we've never had a chance to check the condition before the timeout. |
48 | * we've never had a chance to check the condition before the timeout. |
49 | */ |
49 | */ |
50 | #define _wait_for(COND, MS, W) ({ \ |
50 | #define _wait_for(COND, MS, W) ({ \ |
51 | unsigned long timeout__ = GetTimerTicks() + msecs_to_jiffies(MS); \ |
51 | unsigned long timeout__ = GetTimerTicks() + msecs_to_jiffies(MS); \ |
52 | int ret__ = 0; \ |
52 | int ret__ = 0; \ |
53 | while (!(COND)) { \ |
53 | while (!(COND)) { \ |
54 | if (time_after(GetTimerTicks(), timeout__)) { \ |
54 | if (time_after(GetTimerTicks(), timeout__)) { \ |
55 | if (!(COND)) \ |
55 | if (!(COND)) \ |
56 | ret__ = -ETIMEDOUT; \ |
56 | ret__ = -ETIMEDOUT; \ |
57 | break; \ |
57 | break; \ |
58 | } \ |
58 | } \ |
59 | if (W ) { \ |
59 | if (W ) { \ |
60 | msleep(W); \ |
60 | msleep(W); \ |
61 | } else { \ |
61 | } else { \ |
62 | cpu_relax(); \ |
62 | cpu_relax(); \ |
63 | } \ |
63 | } \ |
64 | } \ |
64 | } \ |
65 | ret__; \ |
65 | ret__; \ |
66 | }) |
66 | }) |
67 | 67 | ||
68 | #define wait_for(COND, MS) _wait_for(COND, MS, 1) |
68 | #define wait_for(COND, MS) _wait_for(COND, MS, 1) |
69 | #define wait_for_atomic(COND, MS) _wait_for(COND, MS, 0) |
69 | #define wait_for_atomic(COND, MS) _wait_for(COND, MS, 0) |
70 | #define wait_for_atomic_us(COND, US) _wait_for((COND), \ |
70 | #define wait_for_atomic_us(COND, US) _wait_for((COND), \ |
71 | DIV_ROUND_UP((US), 1000), 0) |
71 | DIV_ROUND_UP((US), 1000), 0) |
72 | 72 | ||
73 | #define KHz(x) (1000*x) |
73 | #define KHz(x) (1000*x) |
74 | #define MHz(x) KHz(1000*x) |
74 | #define MHz(x) KHz(1000*x) |
75 | 75 | ||
76 | /* |
76 | /* |
77 | * Display related stuff |
77 | * Display related stuff |
78 | */ |
78 | */ |
79 | 79 | ||
80 | /* store information about an Ixxx DVO */ |
80 | /* store information about an Ixxx DVO */ |
81 | /* The i830->i865 use multiple DVOs with multiple i2cs */ |
81 | /* The i830->i865 use multiple DVOs with multiple i2cs */ |
82 | /* the i915, i945 have a single sDVO i2c bus - which is different */ |
82 | /* the i915, i945 have a single sDVO i2c bus - which is different */ |
83 | #define MAX_OUTPUTS 6 |
83 | #define MAX_OUTPUTS 6 |
84 | /* maximum connectors per crtcs in the mode set */ |
84 | /* maximum connectors per crtcs in the mode set */ |
85 | #define INTELFB_CONN_LIMIT 4 |
85 | #define INTELFB_CONN_LIMIT 4 |
86 | 86 | ||
87 | #define INTEL_I2C_BUS_DVO 1 |
87 | #define INTEL_I2C_BUS_DVO 1 |
88 | #define INTEL_I2C_BUS_SDVO 2 |
88 | #define INTEL_I2C_BUS_SDVO 2 |
89 | 89 | ||
90 | /* these are outputs from the chip - integrated only |
90 | /* these are outputs from the chip - integrated only |
91 | external chips are via DVO or SDVO output */ |
91 | external chips are via DVO or SDVO output */ |
92 | #define INTEL_OUTPUT_UNUSED 0 |
92 | #define INTEL_OUTPUT_UNUSED 0 |
93 | #define INTEL_OUTPUT_ANALOG 1 |
93 | #define INTEL_OUTPUT_ANALOG 1 |
94 | #define INTEL_OUTPUT_DVO 2 |
94 | #define INTEL_OUTPUT_DVO 2 |
95 | #define INTEL_OUTPUT_SDVO 3 |
95 | #define INTEL_OUTPUT_SDVO 3 |
96 | #define INTEL_OUTPUT_LVDS 4 |
96 | #define INTEL_OUTPUT_LVDS 4 |
97 | #define INTEL_OUTPUT_TVOUT 5 |
97 | #define INTEL_OUTPUT_TVOUT 5 |
98 | #define INTEL_OUTPUT_HDMI 6 |
98 | #define INTEL_OUTPUT_HDMI 6 |
99 | #define INTEL_OUTPUT_DISPLAYPORT 7 |
99 | #define INTEL_OUTPUT_DISPLAYPORT 7 |
100 | #define INTEL_OUTPUT_EDP 8 |
100 | #define INTEL_OUTPUT_EDP 8 |
101 | #define INTEL_OUTPUT_UNKNOWN 9 |
101 | #define INTEL_OUTPUT_UNKNOWN 9 |
102 | 102 | ||
103 | #define INTEL_DVO_CHIP_NONE 0 |
103 | #define INTEL_DVO_CHIP_NONE 0 |
104 | #define INTEL_DVO_CHIP_LVDS 1 |
104 | #define INTEL_DVO_CHIP_LVDS 1 |
105 | #define INTEL_DVO_CHIP_TMDS 2 |
105 | #define INTEL_DVO_CHIP_TMDS 2 |
106 | #define INTEL_DVO_CHIP_TVOUT 4 |
106 | #define INTEL_DVO_CHIP_TVOUT 4 |
107 | 107 | ||
108 | struct intel_framebuffer { |
108 | struct intel_framebuffer { |
109 | struct drm_framebuffer base; |
109 | struct drm_framebuffer base; |
110 | struct drm_i915_gem_object *obj; |
110 | struct drm_i915_gem_object *obj; |
111 | }; |
111 | }; |
112 | 112 | ||
113 | struct intel_fbdev { |
113 | struct intel_fbdev { |
114 | struct drm_fb_helper helper; |
114 | struct drm_fb_helper helper; |
115 | struct intel_framebuffer ifb; |
115 | struct intel_framebuffer ifb; |
116 | struct list_head fbdev_list; |
116 | struct list_head fbdev_list; |
117 | struct drm_display_mode *our_mode; |
117 | struct drm_display_mode *our_mode; |
118 | }; |
118 | }; |
119 | 119 | ||
120 | struct intel_encoder { |
120 | struct intel_encoder { |
121 | struct drm_encoder base; |
121 | struct drm_encoder base; |
122 | /* |
122 | /* |
123 | * The new crtc this encoder will be driven from. Only differs from |
123 | * The new crtc this encoder will be driven from. Only differs from |
124 | * base->crtc while a modeset is in progress. |
124 | * base->crtc while a modeset is in progress. |
125 | */ |
125 | */ |
126 | struct intel_crtc *new_crtc; |
126 | struct intel_crtc *new_crtc; |
127 | 127 | ||
128 | int type; |
128 | int type; |
129 | /* |
129 | /* |
130 | * Intel hw has only one MUX where encoders could be clone, hence a |
130 | * Intel hw has only one MUX where encoders could be clone, hence a |
131 | * simple flag is enough to compute the possible_clones mask. |
131 | * simple flag is enough to compute the possible_clones mask. |
132 | */ |
132 | */ |
133 | bool cloneable; |
133 | bool cloneable; |
134 | bool connectors_active; |
134 | bool connectors_active; |
135 | void (*hot_plug)(struct intel_encoder *); |
135 | void (*hot_plug)(struct intel_encoder *); |
136 | bool (*compute_config)(struct intel_encoder *, |
136 | bool (*compute_config)(struct intel_encoder *, |
137 | struct intel_crtc_config *); |
137 | struct intel_crtc_config *); |
138 | void (*pre_pll_enable)(struct intel_encoder *); |
138 | void (*pre_pll_enable)(struct intel_encoder *); |
139 | void (*pre_enable)(struct intel_encoder *); |
139 | void (*pre_enable)(struct intel_encoder *); |
140 | void (*enable)(struct intel_encoder *); |
140 | void (*enable)(struct intel_encoder *); |
141 | void (*mode_set)(struct intel_encoder *intel_encoder); |
141 | void (*mode_set)(struct intel_encoder *intel_encoder); |
142 | void (*disable)(struct intel_encoder *); |
142 | void (*disable)(struct intel_encoder *); |
143 | void (*post_disable)(struct intel_encoder *); |
143 | void (*post_disable)(struct intel_encoder *); |
144 | /* Read out the current hw state of this connector, returning true if |
144 | /* Read out the current hw state of this connector, returning true if |
145 | * the encoder is active. If the encoder is enabled it also set the pipe |
145 | * the encoder is active. If the encoder is enabled it also set the pipe |
146 | * it is connected to in the pipe parameter. */ |
146 | * it is connected to in the pipe parameter. */ |
147 | bool (*get_hw_state)(struct intel_encoder *, enum pipe *pipe); |
147 | bool (*get_hw_state)(struct intel_encoder *, enum pipe *pipe); |
148 | /* Reconstructs the equivalent mode flags for the current hardware |
148 | /* Reconstructs the equivalent mode flags for the current hardware |
149 | * state. This must be called _after_ display->get_pipe_config has |
149 | * state. This must be called _after_ display->get_pipe_config has |
150 | * pre-filled the pipe config. Note that intel_encoder->base.crtc must |
150 | * pre-filled the pipe config. Note that intel_encoder->base.crtc must |
151 | * be set correctly before calling this function. */ |
151 | * be set correctly before calling this function. */ |
152 | void (*get_config)(struct intel_encoder *, |
152 | void (*get_config)(struct intel_encoder *, |
153 | struct intel_crtc_config *pipe_config); |
153 | struct intel_crtc_config *pipe_config); |
154 | int crtc_mask; |
154 | int crtc_mask; |
155 | enum hpd_pin hpd_pin; |
155 | enum hpd_pin hpd_pin; |
156 | }; |
156 | }; |
157 | 157 | ||
158 | struct intel_panel { |
158 | struct intel_panel { |
159 | struct drm_display_mode *fixed_mode; |
159 | struct drm_display_mode *fixed_mode; |
160 | int fitting_mode; |
160 | int fitting_mode; |
161 | }; |
161 | }; |
162 | 162 | ||
163 | struct intel_connector { |
163 | struct intel_connector { |
164 | struct drm_connector base; |
164 | struct drm_connector base; |
165 | /* |
165 | /* |
166 | * The fixed encoder this connector is connected to. |
166 | * The fixed encoder this connector is connected to. |
167 | */ |
167 | */ |
168 | struct intel_encoder *encoder; |
168 | struct intel_encoder *encoder; |
169 | 169 | ||
170 | /* |
170 | /* |
171 | * The new encoder this connector will be driven. Only differs from |
171 | * The new encoder this connector will be driven. Only differs from |
172 | * encoder while a modeset is in progress. |
172 | * encoder while a modeset is in progress. |
173 | */ |
173 | */ |
174 | struct intel_encoder *new_encoder; |
174 | struct intel_encoder *new_encoder; |
175 | 175 | ||
176 | /* Reads out the current hw, returning true if the connector is enabled |
176 | /* Reads out the current hw, returning true if the connector is enabled |
177 | * and active (i.e. dpms ON state). */ |
177 | * and active (i.e. dpms ON state). */ |
178 | bool (*get_hw_state)(struct intel_connector *); |
178 | bool (*get_hw_state)(struct intel_connector *); |
179 | 179 | ||
180 | /* Panel info for eDP and LVDS */ |
180 | /* Panel info for eDP and LVDS */ |
181 | struct intel_panel panel; |
181 | struct intel_panel panel; |
182 | 182 | ||
183 | /* Cached EDID for eDP and LVDS. May hold ERR_PTR for invalid EDID. */ |
183 | /* Cached EDID for eDP and LVDS. May hold ERR_PTR for invalid EDID. */ |
184 | struct edid *edid; |
184 | struct edid *edid; |
185 | 185 | ||
186 | /* since POLL and HPD connectors may use the same HPD line keep the native |
186 | /* since POLL and HPD connectors may use the same HPD line keep the native |
187 | state of connector->polled in case hotplug storm detection changes it */ |
187 | state of connector->polled in case hotplug storm detection changes it */ |
188 | u8 polled; |
188 | u8 polled; |
189 | }; |
189 | }; |
190 | 190 | ||
191 | typedef struct dpll { |
191 | typedef struct dpll { |
192 | /* given values */ |
192 | /* given values */ |
193 | int n; |
193 | int n; |
194 | int m1, m2; |
194 | int m1, m2; |
195 | int p1, p2; |
195 | int p1, p2; |
196 | /* derived values */ |
196 | /* derived values */ |
197 | int dot; |
197 | int dot; |
198 | int vco; |
198 | int vco; |
199 | int m; |
199 | int m; |
200 | int p; |
200 | int p; |
201 | } intel_clock_t; |
201 | } intel_clock_t; |
202 | 202 | ||
203 | struct intel_crtc_config { |
203 | struct intel_crtc_config { |
204 | /** |
204 | /** |
205 | * quirks - bitfield with hw state readout quirks |
205 | * quirks - bitfield with hw state readout quirks |
206 | * |
206 | * |
207 | * For various reasons the hw state readout code might not be able to |
207 | * For various reasons the hw state readout code might not be able to |
208 | * completely faithfully read out the current state. These cases are |
208 | * completely faithfully read out the current state. These cases are |
209 | * tracked with quirk flags so that fastboot and state checker can act |
209 | * tracked with quirk flags so that fastboot and state checker can act |
210 | * accordingly. |
210 | * accordingly. |
211 | */ |
211 | */ |
212 | #define PIPE_CONFIG_QUIRK_MODE_SYNC_FLAGS (1<<0) /* unreliable sync mode.flags */ |
212 | #define PIPE_CONFIG_QUIRK_MODE_SYNC_FLAGS (1<<0) /* unreliable sync mode.flags */ |
213 | unsigned long quirks; |
213 | unsigned long quirks; |
214 | 214 | ||
215 | struct drm_display_mode requested_mode; |
215 | struct drm_display_mode requested_mode; |
216 | struct drm_display_mode adjusted_mode; |
216 | struct drm_display_mode adjusted_mode; |
217 | /* Whether to set up the PCH/FDI. Note that we never allow sharing |
217 | /* Whether to set up the PCH/FDI. Note that we never allow sharing |
218 | * between pch encoders and cpu encoders. */ |
218 | * between pch encoders and cpu encoders. */ |
219 | bool has_pch_encoder; |
219 | bool has_pch_encoder; |
220 | 220 | ||
221 | /* CPU Transcoder for the pipe. Currently this can only differ from the |
221 | /* CPU Transcoder for the pipe. Currently this can only differ from the |
222 | * pipe on Haswell (where we have a special eDP transcoder). */ |
222 | * pipe on Haswell (where we have a special eDP transcoder). */ |
223 | enum transcoder cpu_transcoder; |
223 | enum transcoder cpu_transcoder; |
224 | 224 | ||
225 | /* |
225 | /* |
226 | * Use reduced/limited/broadcast rbg range, compressing from the full |
226 | * Use reduced/limited/broadcast rbg range, compressing from the full |
227 | * range fed into the crtcs. |
227 | * range fed into the crtcs. |
228 | */ |
228 | */ |
229 | bool limited_color_range; |
229 | bool limited_color_range; |
230 | 230 | ||
231 | /* DP has a bunch of special case unfortunately, so mark the pipe |
231 | /* DP has a bunch of special case unfortunately, so mark the pipe |
232 | * accordingly. */ |
232 | * accordingly. */ |
233 | bool has_dp_encoder; |
233 | bool has_dp_encoder; |
234 | 234 | ||
235 | /* |
235 | /* |
236 | * Enable dithering, used when the selected pipe bpp doesn't match the |
236 | * Enable dithering, used when the selected pipe bpp doesn't match the |
237 | * plane bpp. |
237 | * plane bpp. |
238 | */ |
238 | */ |
239 | bool dither; |
239 | bool dither; |
240 | 240 | ||
241 | /* Controls for the clock computation, to override various stages. */ |
241 | /* Controls for the clock computation, to override various stages. */ |
242 | bool clock_set; |
242 | bool clock_set; |
243 | 243 | ||
244 | /* SDVO TV has a bunch of special case. To make multifunction encoders |
244 | /* SDVO TV has a bunch of special case. To make multifunction encoders |
245 | * work correctly, we need to track this at runtime.*/ |
245 | * work correctly, we need to track this at runtime.*/ |
246 | bool sdvo_tv_clock; |
246 | bool sdvo_tv_clock; |
247 | 247 | ||
248 | /* |
248 | /* |
249 | * crtc bandwidth limit, don't increase pipe bpp or clock if not really |
249 | * crtc bandwidth limit, don't increase pipe bpp or clock if not really |
250 | * required. This is set in the 2nd loop of calling encoder's |
250 | * required. This is set in the 2nd loop of calling encoder's |
251 | * ->compute_config if the first pick doesn't work out. |
251 | * ->compute_config if the first pick doesn't work out. |
252 | */ |
252 | */ |
253 | bool bw_constrained; |
253 | bool bw_constrained; |
254 | 254 | ||
255 | /* Settings for the intel dpll used on pretty much everything but |
255 | /* Settings for the intel dpll used on pretty much everything but |
256 | * haswell. */ |
256 | * haswell. */ |
257 | struct dpll dpll; |
257 | struct dpll dpll; |
258 | 258 | ||
259 | /* Selected dpll when shared or DPLL_ID_PRIVATE. */ |
259 | /* Selected dpll when shared or DPLL_ID_PRIVATE. */ |
260 | enum intel_dpll_id shared_dpll; |
260 | enum intel_dpll_id shared_dpll; |
261 | 261 | ||
262 | /* Actual register state of the dpll, for shared dpll cross-checking. */ |
262 | /* Actual register state of the dpll, for shared dpll cross-checking. */ |
263 | struct intel_dpll_hw_state dpll_hw_state; |
263 | struct intel_dpll_hw_state dpll_hw_state; |
264 | 264 | ||
265 | int pipe_bpp; |
265 | int pipe_bpp; |
266 | struct intel_link_m_n dp_m_n; |
266 | struct intel_link_m_n dp_m_n; |
267 | 267 | ||
268 | /* |
268 | /* |
269 | * Frequence the dpll for the port should run at. Differs from the |
269 | * Frequence the dpll for the port should run at. Differs from the |
270 | * adjusted dotclock e.g. for DP or 12bpc hdmi mode. |
270 | * adjusted dotclock e.g. for DP or 12bpc hdmi mode. |
271 | */ |
271 | */ |
272 | int port_clock; |
272 | int port_clock; |
273 | 273 | ||
274 | /* Used by SDVO (and if we ever fix it, HDMI). */ |
274 | /* Used by SDVO (and if we ever fix it, HDMI). */ |
275 | unsigned pixel_multiplier; |
275 | unsigned pixel_multiplier; |
276 | 276 | ||
277 | /* Panel fitter controls for gen2-gen4 + VLV */ |
277 | /* Panel fitter controls for gen2-gen4 + VLV */ |
278 | struct { |
278 | struct { |
279 | u32 control; |
279 | u32 control; |
280 | u32 pgm_ratios; |
280 | u32 pgm_ratios; |
281 | u32 lvds_border_bits; |
281 | u32 lvds_border_bits; |
282 | } gmch_pfit; |
282 | } gmch_pfit; |
283 | 283 | ||
284 | /* Panel fitter placement and size for Ironlake+ */ |
284 | /* Panel fitter placement and size for Ironlake+ */ |
285 | struct { |
285 | struct { |
286 | u32 pos; |
286 | u32 pos; |
287 | u32 size; |
287 | u32 size; |
288 | bool enabled; |
288 | bool enabled; |
289 | } pch_pfit; |
289 | } pch_pfit; |
290 | 290 | ||
291 | /* FDI configuration, only valid if has_pch_encoder is set. */ |
291 | /* FDI configuration, only valid if has_pch_encoder is set. */ |
292 | int fdi_lanes; |
292 | int fdi_lanes; |
293 | struct intel_link_m_n fdi_m_n; |
293 | struct intel_link_m_n fdi_m_n; |
294 | 294 | ||
295 | bool ips_enabled; |
295 | bool ips_enabled; |
296 | }; |
296 | }; |
297 | 297 | ||
298 | struct intel_crtc { |
298 | struct intel_crtc { |
299 | struct drm_crtc base; |
299 | struct drm_crtc base; |
300 | enum pipe pipe; |
300 | enum pipe pipe; |
301 | enum plane plane; |
301 | enum plane plane; |
302 | u8 lut_r[256], lut_g[256], lut_b[256]; |
302 | u8 lut_r[256], lut_g[256], lut_b[256]; |
303 | /* |
303 | /* |
304 | * Whether the crtc and the connected output pipeline is active. Implies |
304 | * Whether the crtc and the connected output pipeline is active. Implies |
305 | * that crtc->enabled is set, i.e. the current mode configuration has |
305 | * that crtc->enabled is set, i.e. the current mode configuration has |
306 | * some outputs connected to this crtc. |
306 | * some outputs connected to this crtc. |
307 | */ |
307 | */ |
308 | bool active; |
308 | bool active; |
309 | bool eld_vld; |
309 | bool eld_vld; |
310 | bool primary_disabled; /* is the crtc obscured by a plane? */ |
310 | bool primary_disabled; /* is the crtc obscured by a plane? */ |
311 | bool lowfreq_avail; |
311 | bool lowfreq_avail; |
312 | struct intel_overlay *overlay; |
312 | struct intel_overlay *overlay; |
313 | struct intel_unpin_work *unpin_work; |
313 | struct intel_unpin_work *unpin_work; |
314 | 314 | ||
315 | atomic_t unpin_work_count; |
315 | atomic_t unpin_work_count; |
316 | 316 | ||
317 | /* Display surface base address adjustement for pageflips. Note that on |
317 | /* Display surface base address adjustement for pageflips. Note that on |
318 | * gen4+ this only adjusts up to a tile, offsets within a tile are |
318 | * gen4+ this only adjusts up to a tile, offsets within a tile are |
319 | * handled in the hw itself (with the TILEOFF register). */ |
319 | * handled in the hw itself (with the TILEOFF register). */ |
320 | unsigned long dspaddr_offset; |
320 | unsigned long dspaddr_offset; |
321 | 321 | ||
322 | struct drm_i915_gem_object *cursor_bo; |
322 | struct drm_i915_gem_object *cursor_bo; |
323 | uint32_t cursor_addr; |
323 | uint32_t cursor_addr; |
324 | int16_t cursor_x, cursor_y; |
324 | int16_t cursor_x, cursor_y; |
325 | int16_t cursor_width, cursor_height; |
325 | int16_t cursor_width, cursor_height; |
326 | bool cursor_visible; |
326 | bool cursor_visible; |
327 | 327 | ||
328 | struct intel_crtc_config config; |
328 | struct intel_crtc_config config; |
329 | 329 | ||
330 | uint32_t ddi_pll_sel; |
330 | uint32_t ddi_pll_sel; |
331 | 331 | ||
332 | /* reset counter value when the last flip was submitted */ |
332 | /* reset counter value when the last flip was submitted */ |
333 | unsigned int reset_counter; |
333 | unsigned int reset_counter; |
334 | 334 | ||
335 | /* Access to these should be protected by dev_priv->irq_lock. */ |
335 | /* Access to these should be protected by dev_priv->irq_lock. */ |
336 | bool cpu_fifo_underrun_disabled; |
336 | bool cpu_fifo_underrun_disabled; |
337 | bool pch_fifo_underrun_disabled; |
337 | bool pch_fifo_underrun_disabled; |
338 | }; |
338 | }; |
339 | 339 | ||
340 | struct intel_plane_wm_parameters { |
340 | struct intel_plane_wm_parameters { |
341 | uint32_t horiz_pixels; |
341 | uint32_t horiz_pixels; |
342 | uint8_t bytes_per_pixel; |
342 | uint8_t bytes_per_pixel; |
343 | bool enabled; |
343 | bool enabled; |
344 | bool scaled; |
344 | bool scaled; |
345 | }; |
345 | }; |
346 | 346 | ||
347 | struct intel_plane { |
347 | struct intel_plane { |
348 | struct drm_plane base; |
348 | struct drm_plane base; |
349 | int plane; |
349 | int plane; |
350 | enum pipe pipe; |
350 | enum pipe pipe; |
351 | struct drm_i915_gem_object *obj; |
351 | struct drm_i915_gem_object *obj; |
352 | bool can_scale; |
352 | bool can_scale; |
353 | int max_downscale; |
353 | int max_downscale; |
354 | u32 lut_r[1024], lut_g[1024], lut_b[1024]; |
354 | u32 lut_r[1024], lut_g[1024], lut_b[1024]; |
355 | int crtc_x, crtc_y; |
355 | int crtc_x, crtc_y; |
356 | unsigned int crtc_w, crtc_h; |
356 | unsigned int crtc_w, crtc_h; |
357 | uint32_t src_x, src_y; |
357 | uint32_t src_x, src_y; |
358 | uint32_t src_w, src_h; |
358 | uint32_t src_w, src_h; |
359 | 359 | ||
360 | /* Since we need to change the watermarks before/after |
360 | /* Since we need to change the watermarks before/after |
361 | * enabling/disabling the planes, we need to store the parameters here |
361 | * enabling/disabling the planes, we need to store the parameters here |
362 | * as the other pieces of the struct may not reflect the values we want |
362 | * as the other pieces of the struct may not reflect the values we want |
363 | * for the watermark calculations. Currently only Haswell uses this. |
363 | * for the watermark calculations. Currently only Haswell uses this. |
364 | */ |
364 | */ |
365 | struct intel_plane_wm_parameters wm; |
365 | struct intel_plane_wm_parameters wm; |
366 | 366 | ||
367 | void (*update_plane)(struct drm_plane *plane, |
367 | void (*update_plane)(struct drm_plane *plane, |
368 | struct drm_crtc *crtc, |
368 | struct drm_crtc *crtc, |
369 | struct drm_framebuffer *fb, |
369 | struct drm_framebuffer *fb, |
370 | struct drm_i915_gem_object *obj, |
370 | struct drm_i915_gem_object *obj, |
371 | int crtc_x, int crtc_y, |
371 | int crtc_x, int crtc_y, |
372 | unsigned int crtc_w, unsigned int crtc_h, |
372 | unsigned int crtc_w, unsigned int crtc_h, |
373 | uint32_t x, uint32_t y, |
373 | uint32_t x, uint32_t y, |
374 | uint32_t src_w, uint32_t src_h); |
374 | uint32_t src_w, uint32_t src_h); |
375 | void (*disable_plane)(struct drm_plane *plane, |
375 | void (*disable_plane)(struct drm_plane *plane, |
376 | struct drm_crtc *crtc); |
376 | struct drm_crtc *crtc); |
377 | int (*update_colorkey)(struct drm_plane *plane, |
377 | int (*update_colorkey)(struct drm_plane *plane, |
378 | struct drm_intel_sprite_colorkey *key); |
378 | struct drm_intel_sprite_colorkey *key); |
379 | void (*get_colorkey)(struct drm_plane *plane, |
379 | void (*get_colorkey)(struct drm_plane *plane, |
380 | struct drm_intel_sprite_colorkey *key); |
380 | struct drm_intel_sprite_colorkey *key); |
381 | }; |
381 | }; |
382 | 382 | ||
383 | struct intel_watermark_params { |
383 | struct intel_watermark_params { |
384 | unsigned long fifo_size; |
384 | unsigned long fifo_size; |
385 | unsigned long max_wm; |
385 | unsigned long max_wm; |
386 | unsigned long default_wm; |
386 | unsigned long default_wm; |
387 | unsigned long guard_size; |
387 | unsigned long guard_size; |
388 | unsigned long cacheline_size; |
388 | unsigned long cacheline_size; |
389 | }; |
389 | }; |
390 | 390 | ||
391 | struct cxsr_latency { |
391 | struct cxsr_latency { |
392 | int is_desktop; |
392 | int is_desktop; |
393 | int is_ddr3; |
393 | int is_ddr3; |
394 | unsigned long fsb_freq; |
394 | unsigned long fsb_freq; |
395 | unsigned long mem_freq; |
395 | unsigned long mem_freq; |
396 | unsigned long display_sr; |
396 | unsigned long display_sr; |
397 | unsigned long display_hpll_disable; |
397 | unsigned long display_hpll_disable; |
398 | unsigned long cursor_sr; |
398 | unsigned long cursor_sr; |
399 | unsigned long cursor_hpll_disable; |
399 | unsigned long cursor_hpll_disable; |
400 | }; |
400 | }; |
401 | 401 | ||
402 | #define to_intel_crtc(x) container_of(x, struct intel_crtc, base) |
402 | #define to_intel_crtc(x) container_of(x, struct intel_crtc, base) |
403 | #define to_intel_connector(x) container_of(x, struct intel_connector, base) |
403 | #define to_intel_connector(x) container_of(x, struct intel_connector, base) |
404 | #define to_intel_encoder(x) container_of(x, struct intel_encoder, base) |
404 | #define to_intel_encoder(x) container_of(x, struct intel_encoder, base) |
405 | #define to_intel_framebuffer(x) container_of(x, struct intel_framebuffer, base) |
405 | #define to_intel_framebuffer(x) container_of(x, struct intel_framebuffer, base) |
406 | #define to_intel_plane(x) container_of(x, struct intel_plane, base) |
406 | #define to_intel_plane(x) container_of(x, struct intel_plane, base) |
407 | 407 | ||
408 | struct intel_hdmi { |
408 | struct intel_hdmi { |
409 | u32 hdmi_reg; |
409 | u32 hdmi_reg; |
410 | int ddc_bus; |
410 | int ddc_bus; |
411 | uint32_t color_range; |
411 | uint32_t color_range; |
412 | bool color_range_auto; |
412 | bool color_range_auto; |
413 | bool has_hdmi_sink; |
413 | bool has_hdmi_sink; |
414 | bool has_audio; |
414 | bool has_audio; |
415 | enum hdmi_force_audio force_audio; |
415 | enum hdmi_force_audio force_audio; |
416 | bool rgb_quant_range_selectable; |
416 | bool rgb_quant_range_selectable; |
417 | void (*write_infoframe)(struct drm_encoder *encoder, |
417 | void (*write_infoframe)(struct drm_encoder *encoder, |
418 | enum hdmi_infoframe_type type, |
418 | enum hdmi_infoframe_type type, |
419 | const uint8_t *frame, ssize_t len); |
419 | const uint8_t *frame, ssize_t len); |
420 | void (*set_infoframes)(struct drm_encoder *encoder, |
420 | void (*set_infoframes)(struct drm_encoder *encoder, |
421 | struct drm_display_mode *adjusted_mode); |
421 | struct drm_display_mode *adjusted_mode); |
422 | }; |
422 | }; |
423 | 423 | ||
424 | #define DP_MAX_DOWNSTREAM_PORTS 0x10 |
424 | #define DP_MAX_DOWNSTREAM_PORTS 0x10 |
425 | #define DP_LINK_CONFIGURATION_SIZE 9 |
425 | #define DP_LINK_CONFIGURATION_SIZE 9 |
426 | 426 | ||
427 | struct intel_dp { |
427 | struct intel_dp { |
428 | uint32_t output_reg; |
428 | uint32_t output_reg; |
429 | uint32_t aux_ch_ctl_reg; |
429 | uint32_t aux_ch_ctl_reg; |
430 | uint32_t DP; |
430 | uint32_t DP; |
431 | uint8_t link_configuration[DP_LINK_CONFIGURATION_SIZE]; |
431 | uint8_t link_configuration[DP_LINK_CONFIGURATION_SIZE]; |
432 | bool has_audio; |
432 | bool has_audio; |
433 | enum hdmi_force_audio force_audio; |
433 | enum hdmi_force_audio force_audio; |
434 | uint32_t color_range; |
434 | uint32_t color_range; |
435 | bool color_range_auto; |
435 | bool color_range_auto; |
436 | uint8_t link_bw; |
436 | uint8_t link_bw; |
437 | uint8_t lane_count; |
437 | uint8_t lane_count; |
438 | uint8_t dpcd[DP_RECEIVER_CAP_SIZE]; |
438 | uint8_t dpcd[DP_RECEIVER_CAP_SIZE]; |
439 | uint8_t psr_dpcd[EDP_PSR_RECEIVER_CAP_SIZE]; |
439 | uint8_t psr_dpcd[EDP_PSR_RECEIVER_CAP_SIZE]; |
440 | uint8_t downstream_ports[DP_MAX_DOWNSTREAM_PORTS]; |
440 | uint8_t downstream_ports[DP_MAX_DOWNSTREAM_PORTS]; |
441 | struct i2c_adapter adapter; |
441 | struct i2c_adapter adapter; |
442 | struct i2c_algo_dp_aux_data algo; |
442 | struct i2c_algo_dp_aux_data algo; |
443 | uint8_t train_set[4]; |
443 | uint8_t train_set[4]; |
444 | int panel_power_up_delay; |
444 | int panel_power_up_delay; |
445 | int panel_power_down_delay; |
445 | int panel_power_down_delay; |
446 | int panel_power_cycle_delay; |
446 | int panel_power_cycle_delay; |
447 | int backlight_on_delay; |
447 | int backlight_on_delay; |
448 | int backlight_off_delay; |
448 | int backlight_off_delay; |
449 | struct delayed_work panel_vdd_work; |
449 | struct delayed_work panel_vdd_work; |
450 | bool want_panel_vdd; |
450 | bool want_panel_vdd; |
451 | bool psr_setup_done; |
451 | bool psr_setup_done; |
452 | struct intel_connector *attached_connector; |
452 | struct intel_connector *attached_connector; |
453 | }; |
453 | }; |
454 | 454 | ||
455 | struct intel_digital_port { |
455 | struct intel_digital_port { |
456 | struct intel_encoder base; |
456 | struct intel_encoder base; |
457 | enum port port; |
457 | enum port port; |
458 | u32 saved_port_bits; |
458 | u32 saved_port_bits; |
459 | struct intel_dp dp; |
459 | struct intel_dp dp; |
460 | struct intel_hdmi hdmi; |
460 | struct intel_hdmi hdmi; |
461 | }; |
461 | }; |
462 | 462 | ||
463 | static inline int |
463 | static inline int |
464 | vlv_dport_to_channel(struct intel_digital_port *dport) |
464 | vlv_dport_to_channel(struct intel_digital_port *dport) |
465 | { |
465 | { |
466 | switch (dport->port) { |
466 | switch (dport->port) { |
467 | case PORT_B: |
467 | case PORT_B: |
468 | return 0; |
468 | return 0; |
469 | case PORT_C: |
469 | case PORT_C: |
470 | return 1; |
470 | return 1; |
471 | default: |
471 | default: |
472 | BUG(); |
472 | BUG(); |
473 | } |
473 | } |
474 | } |
474 | } |
475 | 475 | ||
476 | static inline struct drm_crtc * |
476 | static inline struct drm_crtc * |
477 | intel_get_crtc_for_pipe(struct drm_device *dev, int pipe) |
477 | intel_get_crtc_for_pipe(struct drm_device *dev, int pipe) |
478 | { |
478 | { |
479 | struct drm_i915_private *dev_priv = dev->dev_private; |
479 | struct drm_i915_private *dev_priv = dev->dev_private; |
480 | return dev_priv->pipe_to_crtc_mapping[pipe]; |
480 | return dev_priv->pipe_to_crtc_mapping[pipe]; |
481 | } |
481 | } |
482 | 482 | ||
483 | static inline struct drm_crtc * |
483 | static inline struct drm_crtc * |
484 | intel_get_crtc_for_plane(struct drm_device *dev, int plane) |
484 | intel_get_crtc_for_plane(struct drm_device *dev, int plane) |
485 | { |
485 | { |
486 | struct drm_i915_private *dev_priv = dev->dev_private; |
486 | struct drm_i915_private *dev_priv = dev->dev_private; |
487 | return dev_priv->plane_to_crtc_mapping[plane]; |
487 | return dev_priv->plane_to_crtc_mapping[plane]; |
488 | } |
488 | } |
489 | 489 | ||
490 | struct intel_unpin_work { |
490 | struct intel_unpin_work { |
491 | struct work_struct work; |
491 | struct work_struct work; |
492 | struct drm_crtc *crtc; |
492 | struct drm_crtc *crtc; |
493 | struct drm_i915_gem_object *old_fb_obj; |
493 | struct drm_i915_gem_object *old_fb_obj; |
494 | struct drm_i915_gem_object *pending_flip_obj; |
494 | struct drm_i915_gem_object *pending_flip_obj; |
495 | struct drm_pending_vblank_event *event; |
495 | struct drm_pending_vblank_event *event; |
496 | atomic_t pending; |
496 | atomic_t pending; |
497 | #define INTEL_FLIP_INACTIVE 0 |
497 | #define INTEL_FLIP_INACTIVE 0 |
498 | #define INTEL_FLIP_PENDING 1 |
498 | #define INTEL_FLIP_PENDING 1 |
499 | #define INTEL_FLIP_COMPLETE 2 |
499 | #define INTEL_FLIP_COMPLETE 2 |
500 | bool enable_stall_check; |
500 | bool enable_stall_check; |
501 | }; |
501 | }; |
502 | 502 | ||
503 | int intel_pch_rawclk(struct drm_device *dev); |
503 | int intel_pch_rawclk(struct drm_device *dev); |
504 | 504 | ||
505 | int intel_connector_update_modes(struct drm_connector *connector, |
505 | int intel_connector_update_modes(struct drm_connector *connector, |
506 | struct edid *edid); |
506 | struct edid *edid); |
507 | int intel_ddc_get_modes(struct drm_connector *c, struct i2c_adapter *adapter); |
507 | int intel_ddc_get_modes(struct drm_connector *c, struct i2c_adapter *adapter); |
508 | 508 | ||
509 | extern void intel_attach_force_audio_property(struct drm_connector *connector); |
509 | extern void intel_attach_force_audio_property(struct drm_connector *connector); |
510 | extern void intel_attach_broadcast_rgb_property(struct drm_connector *connector); |
510 | extern void intel_attach_broadcast_rgb_property(struct drm_connector *connector); |
511 | 511 | ||
512 | extern bool intel_pipe_has_type(struct drm_crtc *crtc, int type); |
512 | extern bool intel_pipe_has_type(struct drm_crtc *crtc, int type); |
513 | extern void intel_crt_init(struct drm_device *dev); |
513 | extern void intel_crt_init(struct drm_device *dev); |
514 | extern void intel_hdmi_init(struct drm_device *dev, |
514 | extern void intel_hdmi_init(struct drm_device *dev, |
515 | int hdmi_reg, enum port port); |
515 | int hdmi_reg, enum port port); |
516 | extern void intel_hdmi_init_connector(struct intel_digital_port *intel_dig_port, |
516 | extern void intel_hdmi_init_connector(struct intel_digital_port *intel_dig_port, |
517 | struct intel_connector *intel_connector); |
517 | struct intel_connector *intel_connector); |
518 | extern struct intel_hdmi *enc_to_intel_hdmi(struct drm_encoder *encoder); |
518 | extern struct intel_hdmi *enc_to_intel_hdmi(struct drm_encoder *encoder); |
519 | extern bool intel_hdmi_compute_config(struct intel_encoder *encoder, |
519 | extern bool intel_hdmi_compute_config(struct intel_encoder *encoder, |
520 | struct intel_crtc_config *pipe_config); |
520 | struct intel_crtc_config *pipe_config); |
521 | extern bool intel_sdvo_init(struct drm_device *dev, uint32_t sdvo_reg, |
521 | extern bool intel_sdvo_init(struct drm_device *dev, uint32_t sdvo_reg, |
522 | bool is_sdvob); |
522 | bool is_sdvob); |
523 | extern void intel_dvo_init(struct drm_device *dev); |
523 | extern void intel_dvo_init(struct drm_device *dev); |
524 | extern void intel_tv_init(struct drm_device *dev); |
524 | extern void intel_tv_init(struct drm_device *dev); |
525 | extern void intel_mark_busy(struct drm_device *dev); |
525 | extern void intel_mark_busy(struct drm_device *dev); |
526 | extern void intel_mark_fb_busy(struct drm_i915_gem_object *obj, |
526 | extern void intel_mark_fb_busy(struct drm_i915_gem_object *obj, |
527 | struct intel_ring_buffer *ring); |
527 | struct intel_ring_buffer *ring); |
528 | extern void intel_mark_idle(struct drm_device *dev); |
528 | extern void intel_mark_idle(struct drm_device *dev); |
529 | extern void intel_lvds_init(struct drm_device *dev); |
529 | extern void intel_lvds_init(struct drm_device *dev); |
530 | extern bool intel_is_dual_link_lvds(struct drm_device *dev); |
530 | extern bool intel_is_dual_link_lvds(struct drm_device *dev); |
531 | extern void intel_dp_init(struct drm_device *dev, int output_reg, |
531 | extern void intel_dp_init(struct drm_device *dev, int output_reg, |
532 | enum port port); |
532 | enum port port); |
533 | extern bool intel_dp_init_connector(struct intel_digital_port *intel_dig_port, |
533 | extern bool intel_dp_init_connector(struct intel_digital_port *intel_dig_port, |
534 | struct intel_connector *intel_connector); |
534 | struct intel_connector *intel_connector); |
535 | extern void intel_dp_init_link_config(struct intel_dp *intel_dp); |
535 | extern void intel_dp_init_link_config(struct intel_dp *intel_dp); |
536 | extern void intel_dp_start_link_train(struct intel_dp *intel_dp); |
536 | extern void intel_dp_start_link_train(struct intel_dp *intel_dp); |
537 | extern void intel_dp_complete_link_train(struct intel_dp *intel_dp); |
537 | extern void intel_dp_complete_link_train(struct intel_dp *intel_dp); |
538 | extern void intel_dp_stop_link_train(struct intel_dp *intel_dp); |
538 | extern void intel_dp_stop_link_train(struct intel_dp *intel_dp); |
539 | extern void intel_dp_sink_dpms(struct intel_dp *intel_dp, int mode); |
539 | extern void intel_dp_sink_dpms(struct intel_dp *intel_dp, int mode); |
540 | extern void intel_dp_encoder_destroy(struct drm_encoder *encoder); |
540 | extern void intel_dp_encoder_destroy(struct drm_encoder *encoder); |
541 | extern void intel_dp_check_link_status(struct intel_dp *intel_dp); |
541 | extern void intel_dp_check_link_status(struct intel_dp *intel_dp); |
542 | extern bool intel_dp_compute_config(struct intel_encoder *encoder, |
542 | extern bool intel_dp_compute_config(struct intel_encoder *encoder, |
543 | struct intel_crtc_config *pipe_config); |
543 | struct intel_crtc_config *pipe_config); |
544 | extern bool intel_dpd_is_edp(struct drm_device *dev); |
544 | extern bool intel_dpd_is_edp(struct drm_device *dev); |
545 | extern void ironlake_edp_backlight_on(struct intel_dp *intel_dp); |
545 | extern void ironlake_edp_backlight_on(struct intel_dp *intel_dp); |
546 | extern void ironlake_edp_backlight_off(struct intel_dp *intel_dp); |
546 | extern void ironlake_edp_backlight_off(struct intel_dp *intel_dp); |
547 | extern void ironlake_edp_panel_on(struct intel_dp *intel_dp); |
547 | extern void ironlake_edp_panel_on(struct intel_dp *intel_dp); |
548 | extern void ironlake_edp_panel_off(struct intel_dp *intel_dp); |
548 | extern void ironlake_edp_panel_off(struct intel_dp *intel_dp); |
549 | extern void ironlake_edp_panel_vdd_on(struct intel_dp *intel_dp); |
549 | extern void ironlake_edp_panel_vdd_on(struct intel_dp *intel_dp); |
550 | extern void ironlake_edp_panel_vdd_off(struct intel_dp *intel_dp, bool sync); |
550 | extern void ironlake_edp_panel_vdd_off(struct intel_dp *intel_dp, bool sync); |
551 | extern int intel_plane_init(struct drm_device *dev, enum pipe pipe, int plane); |
551 | extern int intel_plane_init(struct drm_device *dev, enum pipe pipe, int plane); |
552 | extern void intel_flush_display_plane(struct drm_i915_private *dev_priv, |
552 | extern void intel_flush_display_plane(struct drm_i915_private *dev_priv, |
553 | enum plane plane); |
553 | enum plane plane); |
554 | 554 | ||
555 | /* intel_panel.c */ |
555 | /* intel_panel.c */ |
556 | extern int intel_panel_init(struct intel_panel *panel, |
556 | extern int intel_panel_init(struct intel_panel *panel, |
557 | struct drm_display_mode *fixed_mode); |
557 | struct drm_display_mode *fixed_mode); |
558 | extern void intel_panel_fini(struct intel_panel *panel); |
558 | extern void intel_panel_fini(struct intel_panel *panel); |
559 | 559 | ||
560 | extern void intel_fixed_panel_mode(const struct drm_display_mode *fixed_mode, |
560 | extern void intel_fixed_panel_mode(const struct drm_display_mode *fixed_mode, |
561 | struct drm_display_mode *adjusted_mode); |
561 | struct drm_display_mode *adjusted_mode); |
562 | extern void intel_pch_panel_fitting(struct intel_crtc *crtc, |
562 | extern void intel_pch_panel_fitting(struct intel_crtc *crtc, |
563 | struct intel_crtc_config *pipe_config, |
563 | struct intel_crtc_config *pipe_config, |
564 | int fitting_mode); |
564 | int fitting_mode); |
565 | extern void intel_gmch_panel_fitting(struct intel_crtc *crtc, |
565 | extern void intel_gmch_panel_fitting(struct intel_crtc *crtc, |
566 | struct intel_crtc_config *pipe_config, |
566 | struct intel_crtc_config *pipe_config, |
567 | int fitting_mode); |
567 | int fitting_mode); |
568 | extern void intel_panel_set_backlight(struct drm_device *dev, |
568 | extern void intel_panel_set_backlight(struct drm_device *dev, |
569 | u32 level, u32 max); |
569 | u32 level, u32 max); |
570 | extern int intel_panel_setup_backlight(struct drm_connector *connector); |
570 | extern int intel_panel_setup_backlight(struct drm_connector *connector); |
571 | extern void intel_panel_enable_backlight(struct drm_device *dev, |
571 | extern void intel_panel_enable_backlight(struct drm_device *dev, |
572 | enum pipe pipe); |
572 | enum pipe pipe); |
573 | extern void intel_panel_disable_backlight(struct drm_device *dev); |
573 | extern void intel_panel_disable_backlight(struct drm_device *dev); |
574 | extern void intel_panel_destroy_backlight(struct drm_device *dev); |
574 | extern void intel_panel_destroy_backlight(struct drm_device *dev); |
575 | extern enum drm_connector_status intel_panel_detect(struct drm_device *dev); |
575 | extern enum drm_connector_status intel_panel_detect(struct drm_device *dev); |
576 | 576 | ||
577 | struct intel_set_config { |
577 | struct intel_set_config { |
578 | struct drm_encoder **save_connector_encoders; |
578 | struct drm_encoder **save_connector_encoders; |
579 | struct drm_crtc **save_encoder_crtcs; |
579 | struct drm_crtc **save_encoder_crtcs; |
580 | 580 | ||
581 | bool fb_changed; |
581 | bool fb_changed; |
582 | bool mode_changed; |
582 | bool mode_changed; |
583 | }; |
583 | }; |
584 | 584 | ||
585 | extern void intel_crtc_restore_mode(struct drm_crtc *crtc); |
585 | extern void intel_crtc_restore_mode(struct drm_crtc *crtc); |
586 | extern void intel_crtc_load_lut(struct drm_crtc *crtc); |
586 | extern void intel_crtc_load_lut(struct drm_crtc *crtc); |
587 | extern void intel_crtc_update_dpms(struct drm_crtc *crtc); |
587 | extern void intel_crtc_update_dpms(struct drm_crtc *crtc); |
588 | extern void intel_encoder_destroy(struct drm_encoder *encoder); |
588 | extern void intel_encoder_destroy(struct drm_encoder *encoder); |
589 | extern void intel_connector_dpms(struct drm_connector *, int mode); |
589 | extern void intel_connector_dpms(struct drm_connector *, int mode); |
590 | extern bool intel_connector_get_hw_state(struct intel_connector *connector); |
590 | extern bool intel_connector_get_hw_state(struct intel_connector *connector); |
591 | extern void intel_modeset_check_state(struct drm_device *dev); |
591 | extern void intel_modeset_check_state(struct drm_device *dev); |
592 | extern void intel_plane_restore(struct drm_plane *plane); |
592 | extern void intel_plane_restore(struct drm_plane *plane); |
593 | extern void intel_plane_disable(struct drm_plane *plane); |
593 | extern void intel_plane_disable(struct drm_plane *plane); |
594 | 594 | ||
595 | 595 | ||
596 | static inline struct intel_encoder *intel_attached_encoder(struct drm_connector *connector) |
596 | static inline struct intel_encoder *intel_attached_encoder(struct drm_connector *connector) |
597 | { |
597 | { |
598 | return to_intel_connector(connector)->encoder; |
598 | return to_intel_connector(connector)->encoder; |
599 | } |
599 | } |
600 | 600 | ||
601 | static inline struct intel_digital_port * |
601 | static inline struct intel_digital_port * |
602 | enc_to_dig_port(struct drm_encoder *encoder) |
602 | enc_to_dig_port(struct drm_encoder *encoder) |
603 | { |
603 | { |
604 | return container_of(encoder, struct intel_digital_port, base.base); |
604 | return container_of(encoder, struct intel_digital_port, base.base); |
605 | } |
605 | } |
606 | 606 | ||
607 | static inline struct intel_dp *enc_to_intel_dp(struct drm_encoder *encoder) |
607 | static inline struct intel_dp *enc_to_intel_dp(struct drm_encoder *encoder) |
608 | { |
608 | { |
609 | return &enc_to_dig_port(encoder)->dp; |
609 | return &enc_to_dig_port(encoder)->dp; |
610 | } |
610 | } |
611 | 611 | ||
612 | static inline struct intel_digital_port * |
612 | static inline struct intel_digital_port * |
613 | dp_to_dig_port(struct intel_dp *intel_dp) |
613 | dp_to_dig_port(struct intel_dp *intel_dp) |
614 | { |
614 | { |
615 | return container_of(intel_dp, struct intel_digital_port, dp); |
615 | return container_of(intel_dp, struct intel_digital_port, dp); |
616 | } |
616 | } |
617 | 617 | ||
618 | static inline struct intel_digital_port * |
618 | static inline struct intel_digital_port * |
619 | hdmi_to_dig_port(struct intel_hdmi *intel_hdmi) |
619 | hdmi_to_dig_port(struct intel_hdmi *intel_hdmi) |
620 | { |
620 | { |
621 | return container_of(intel_hdmi, struct intel_digital_port, hdmi); |
621 | return container_of(intel_hdmi, struct intel_digital_port, hdmi); |
622 | } |
622 | } |
623 | 623 | ||
624 | bool ibx_digital_port_connected(struct drm_i915_private *dev_priv, |
624 | bool ibx_digital_port_connected(struct drm_i915_private *dev_priv, |
625 | struct intel_digital_port *port); |
625 | struct intel_digital_port *port); |
626 | 626 | ||
627 | extern void intel_connector_attach_encoder(struct intel_connector *connector, |
627 | extern void intel_connector_attach_encoder(struct intel_connector *connector, |
628 | struct intel_encoder *encoder); |
628 | struct intel_encoder *encoder); |
629 | extern struct drm_encoder *intel_best_encoder(struct drm_connector *connector); |
629 | extern struct drm_encoder *intel_best_encoder(struct drm_connector *connector); |
630 | 630 | ||
631 | extern struct drm_display_mode *intel_crtc_mode_get(struct drm_device *dev, |
631 | extern struct drm_display_mode *intel_crtc_mode_get(struct drm_device *dev, |
632 | struct drm_crtc *crtc); |
632 | struct drm_crtc *crtc); |
633 | int intel_get_pipe_from_crtc_id(struct drm_device *dev, void *data, |
633 | int intel_get_pipe_from_crtc_id(struct drm_device *dev, void *data, |
634 | struct drm_file *file_priv); |
634 | struct drm_file *file_priv); |
635 | extern enum transcoder |
635 | extern enum transcoder |
636 | intel_pipe_to_cpu_transcoder(struct drm_i915_private *dev_priv, |
636 | intel_pipe_to_cpu_transcoder(struct drm_i915_private *dev_priv, |
637 | enum pipe pipe); |
637 | enum pipe pipe); |
638 | extern void intel_wait_for_vblank(struct drm_device *dev, int pipe); |
638 | extern void intel_wait_for_vblank(struct drm_device *dev, int pipe); |
639 | extern void intel_wait_for_pipe_off(struct drm_device *dev, int pipe); |
639 | extern void intel_wait_for_pipe_off(struct drm_device *dev, int pipe); |
640 | extern int ironlake_get_lanes_required(int target_clock, int link_bw, int bpp); |
640 | extern int ironlake_get_lanes_required(int target_clock, int link_bw, int bpp); |
641 | extern void vlv_wait_port_ready(struct drm_i915_private *dev_priv, int port); |
641 | extern void vlv_wait_port_ready(struct drm_i915_private *dev_priv, int port); |
642 | 642 | ||
643 | struct intel_load_detect_pipe { |
643 | struct intel_load_detect_pipe { |
644 | struct drm_framebuffer *release_fb; |
644 | struct drm_framebuffer *release_fb; |
645 | bool load_detect_temp; |
645 | bool load_detect_temp; |
646 | int dpms_mode; |
646 | int dpms_mode; |
647 | }; |
647 | }; |
648 | extern bool intel_get_load_detect_pipe(struct drm_connector *connector, |
648 | extern bool intel_get_load_detect_pipe(struct drm_connector *connector, |
649 | struct drm_display_mode *mode, |
649 | struct drm_display_mode *mode, |
650 | struct intel_load_detect_pipe *old); |
650 | struct intel_load_detect_pipe *old); |
651 | extern void intel_release_load_detect_pipe(struct drm_connector *connector, |
651 | extern void intel_release_load_detect_pipe(struct drm_connector *connector, |
652 | struct intel_load_detect_pipe *old); |
652 | struct intel_load_detect_pipe *old); |
653 | 653 | ||
654 | extern void intel_crtc_fb_gamma_set(struct drm_crtc *crtc, u16 red, u16 green, |
654 | extern void intel_crtc_fb_gamma_set(struct drm_crtc *crtc, u16 red, u16 green, |
655 | u16 blue, int regno); |
655 | u16 blue, int regno); |
656 | extern void intel_crtc_fb_gamma_get(struct drm_crtc *crtc, u16 *red, u16 *green, |
656 | extern void intel_crtc_fb_gamma_get(struct drm_crtc *crtc, u16 *red, u16 *green, |
657 | u16 *blue, int regno); |
657 | u16 *blue, int regno); |
658 | 658 | ||
659 | extern int intel_pin_and_fence_fb_obj(struct drm_device *dev, |
659 | extern int intel_pin_and_fence_fb_obj(struct drm_device *dev, |
660 | struct drm_i915_gem_object *obj, |
660 | struct drm_i915_gem_object *obj, |
661 | struct intel_ring_buffer *pipelined); |
661 | struct intel_ring_buffer *pipelined); |
662 | extern void intel_unpin_fb_obj(struct drm_i915_gem_object *obj); |
662 | extern void intel_unpin_fb_obj(struct drm_i915_gem_object *obj); |
663 | 663 | ||
664 | extern int intel_framebuffer_init(struct drm_device *dev, |
664 | extern int intel_framebuffer_init(struct drm_device *dev, |
665 | struct intel_framebuffer *ifb, |
665 | struct intel_framebuffer *ifb, |
666 | struct drm_mode_fb_cmd2 *mode_cmd, |
666 | struct drm_mode_fb_cmd2 *mode_cmd, |
667 | struct drm_i915_gem_object *obj); |
667 | struct drm_i915_gem_object *obj); |
668 | extern void intel_framebuffer_fini(struct intel_framebuffer *fb); |
668 | extern void intel_framebuffer_fini(struct intel_framebuffer *fb); |
669 | extern int intel_fbdev_init(struct drm_device *dev); |
669 | extern int intel_fbdev_init(struct drm_device *dev); |
670 | extern void intel_fbdev_initial_config(struct drm_device *dev); |
670 | extern void intel_fbdev_initial_config(struct drm_device *dev); |
671 | extern void intel_fbdev_fini(struct drm_device *dev); |
671 | extern void intel_fbdev_fini(struct drm_device *dev); |
672 | extern void intel_fbdev_set_suspend(struct drm_device *dev, int state); |
672 | extern void intel_fbdev_set_suspend(struct drm_device *dev, int state); |
673 | extern void intel_prepare_page_flip(struct drm_device *dev, int plane); |
673 | extern void intel_prepare_page_flip(struct drm_device *dev, int plane); |
674 | extern void intel_finish_page_flip(struct drm_device *dev, int pipe); |
674 | extern void intel_finish_page_flip(struct drm_device *dev, int pipe); |
675 | extern void intel_finish_page_flip_plane(struct drm_device *dev, int plane); |
675 | extern void intel_finish_page_flip_plane(struct drm_device *dev, int plane); |
676 | 676 | ||
677 | extern void intel_setup_overlay(struct drm_device *dev); |
677 | extern void intel_setup_overlay(struct drm_device *dev); |
678 | extern void intel_cleanup_overlay(struct drm_device *dev); |
678 | extern void intel_cleanup_overlay(struct drm_device *dev); |
679 | extern int intel_overlay_switch_off(struct intel_overlay *overlay); |
679 | extern int intel_overlay_switch_off(struct intel_overlay *overlay); |
680 | extern int intel_overlay_put_image(struct drm_device *dev, void *data, |
680 | extern int intel_overlay_put_image(struct drm_device *dev, void *data, |
681 | struct drm_file *file_priv); |
681 | struct drm_file *file_priv); |
682 | extern int intel_overlay_attrs(struct drm_device *dev, void *data, |
682 | extern int intel_overlay_attrs(struct drm_device *dev, void *data, |
683 | struct drm_file *file_priv); |
683 | struct drm_file *file_priv); |
684 | 684 | ||
685 | extern void intel_fb_output_poll_changed(struct drm_device *dev); |
685 | extern void intel_fb_output_poll_changed(struct drm_device *dev); |
686 | extern void intel_fb_restore_mode(struct drm_device *dev); |
686 | extern void intel_fb_restore_mode(struct drm_device *dev); |
687 | 687 | ||
688 | struct intel_shared_dpll * |
688 | struct intel_shared_dpll * |
689 | intel_crtc_to_shared_dpll(struct intel_crtc *crtc); |
689 | intel_crtc_to_shared_dpll(struct intel_crtc *crtc); |
690 | 690 | ||
691 | void assert_shared_dpll(struct drm_i915_private *dev_priv, |
691 | void assert_shared_dpll(struct drm_i915_private *dev_priv, |
692 | struct intel_shared_dpll *pll, |
692 | struct intel_shared_dpll *pll, |
693 | bool state); |
693 | bool state); |
694 | #define assert_shared_dpll_enabled(d, p) assert_shared_dpll(d, p, true) |
694 | #define assert_shared_dpll_enabled(d, p) assert_shared_dpll(d, p, true) |
695 | #define assert_shared_dpll_disabled(d, p) assert_shared_dpll(d, p, false) |
695 | #define assert_shared_dpll_disabled(d, p) assert_shared_dpll(d, p, false) |
696 | void assert_pll(struct drm_i915_private *dev_priv, |
696 | void assert_pll(struct drm_i915_private *dev_priv, |
697 | enum pipe pipe, bool state); |
697 | enum pipe pipe, bool state); |
698 | #define assert_pll_enabled(d, p) assert_pll(d, p, true) |
698 | #define assert_pll_enabled(d, p) assert_pll(d, p, true) |
699 | #define assert_pll_disabled(d, p) assert_pll(d, p, false) |
699 | #define assert_pll_disabled(d, p) assert_pll(d, p, false) |
700 | void assert_fdi_rx_pll(struct drm_i915_private *dev_priv, |
700 | void assert_fdi_rx_pll(struct drm_i915_private *dev_priv, |
701 | enum pipe pipe, bool state); |
701 | enum pipe pipe, bool state); |
702 | #define assert_fdi_rx_pll_enabled(d, p) assert_fdi_rx_pll(d, p, true) |
702 | #define assert_fdi_rx_pll_enabled(d, p) assert_fdi_rx_pll(d, p, true) |
703 | #define assert_fdi_rx_pll_disabled(d, p) assert_fdi_rx_pll(d, p, false) |
703 | #define assert_fdi_rx_pll_disabled(d, p) assert_fdi_rx_pll(d, p, false) |
704 | extern void assert_pipe(struct drm_i915_private *dev_priv, enum pipe pipe, |
704 | extern void assert_pipe(struct drm_i915_private *dev_priv, enum pipe pipe, |
705 | bool state); |
705 | bool state); |
706 | #define assert_pipe_enabled(d, p) assert_pipe(d, p, true) |
706 | #define assert_pipe_enabled(d, p) assert_pipe(d, p, true) |
707 | #define assert_pipe_disabled(d, p) assert_pipe(d, p, false) |
707 | #define assert_pipe_disabled(d, p) assert_pipe(d, p, false) |
708 | 708 | ||
709 | extern void intel_init_clock_gating(struct drm_device *dev); |
709 | extern void intel_init_clock_gating(struct drm_device *dev); |
710 | extern void intel_suspend_hw(struct drm_device *dev); |
710 | extern void intel_suspend_hw(struct drm_device *dev); |
711 | extern void intel_write_eld(struct drm_encoder *encoder, |
711 | extern void intel_write_eld(struct drm_encoder *encoder, |
712 | struct drm_display_mode *mode); |
712 | struct drm_display_mode *mode); |
713 | extern void intel_prepare_ddi(struct drm_device *dev); |
713 | extern void intel_prepare_ddi(struct drm_device *dev); |
714 | extern void hsw_fdi_link_train(struct drm_crtc *crtc); |
714 | extern void hsw_fdi_link_train(struct drm_crtc *crtc); |
715 | extern void intel_ddi_init(struct drm_device *dev, enum port port); |
715 | extern void intel_ddi_init(struct drm_device *dev, enum port port); |
716 | 716 | ||
717 | /* For use by IVB LP watermark workaround in intel_sprite.c */ |
717 | /* For use by IVB LP watermark workaround in intel_sprite.c */ |
718 | extern void intel_update_watermarks(struct drm_device *dev); |
718 | extern void intel_update_watermarks(struct drm_device *dev); |
719 | extern void intel_update_sprite_watermarks(struct drm_plane *plane, |
719 | extern void intel_update_sprite_watermarks(struct drm_plane *plane, |
720 | struct drm_crtc *crtc, |
720 | struct drm_crtc *crtc, |
721 | uint32_t sprite_width, int pixel_size, |
721 | uint32_t sprite_width, int pixel_size, |
722 | bool enabled, bool scaled); |
722 | bool enabled, bool scaled); |
723 | 723 | ||
724 | extern unsigned long intel_gen4_compute_page_offset(int *x, int *y, |
724 | extern unsigned long intel_gen4_compute_page_offset(int *x, int *y, |
725 | unsigned int tiling_mode, |
725 | unsigned int tiling_mode, |
726 | unsigned int bpp, |
726 | unsigned int bpp, |
727 | unsigned int pitch); |
727 | unsigned int pitch); |
728 | 728 | ||
729 | extern int intel_sprite_set_colorkey(struct drm_device *dev, void *data, |
729 | extern int intel_sprite_set_colorkey(struct drm_device *dev, void *data, |
730 | struct drm_file *file_priv); |
730 | struct drm_file *file_priv); |
731 | extern int intel_sprite_get_colorkey(struct drm_device *dev, void *data, |
731 | extern int intel_sprite_get_colorkey(struct drm_device *dev, void *data, |
732 | struct drm_file *file_priv); |
732 | struct drm_file *file_priv); |
733 | 733 | ||
734 | /* Power-related functions, located in intel_pm.c */ |
734 | /* Power-related functions, located in intel_pm.c */ |
735 | extern void intel_init_pm(struct drm_device *dev); |
735 | extern void intel_init_pm(struct drm_device *dev); |
736 | /* FBC */ |
736 | /* FBC */ |
737 | extern bool intel_fbc_enabled(struct drm_device *dev); |
737 | extern bool intel_fbc_enabled(struct drm_device *dev); |
738 | extern void intel_update_fbc(struct drm_device *dev); |
738 | extern void intel_update_fbc(struct drm_device *dev); |
739 | /* IPS */ |
739 | /* IPS */ |
740 | extern void intel_gpu_ips_init(struct drm_i915_private *dev_priv); |
740 | extern void intel_gpu_ips_init(struct drm_i915_private *dev_priv); |
741 | extern void intel_gpu_ips_teardown(void); |
741 | extern void intel_gpu_ips_teardown(void); |
742 | 742 | ||
743 | /* Power well */ |
743 | /* Power well */ |
744 | extern int i915_init_power_well(struct drm_device *dev); |
744 | extern int i915_init_power_well(struct drm_device *dev); |
745 | extern void i915_remove_power_well(struct drm_device *dev); |
745 | extern void i915_remove_power_well(struct drm_device *dev); |
746 | 746 | ||
747 | extern bool intel_display_power_enabled(struct drm_device *dev, |
747 | extern bool intel_display_power_enabled(struct drm_device *dev, |
748 | enum intel_display_power_domain domain); |
748 | enum intel_display_power_domain domain); |
749 | extern void intel_init_power_well(struct drm_device *dev); |
749 | extern void intel_init_power_well(struct drm_device *dev); |
750 | extern void intel_set_power_well(struct drm_device *dev, bool enable); |
750 | extern void intel_set_power_well(struct drm_device *dev, bool enable); |
751 | extern void intel_enable_gt_powersave(struct drm_device *dev); |
751 | extern void intel_enable_gt_powersave(struct drm_device *dev); |
752 | extern void intel_disable_gt_powersave(struct drm_device *dev); |
752 | extern void intel_disable_gt_powersave(struct drm_device *dev); |
753 | extern void ironlake_teardown_rc6(struct drm_device *dev); |
753 | extern void ironlake_teardown_rc6(struct drm_device *dev); |
754 | void gen6_update_ring_freq(struct drm_device *dev); |
754 | void gen6_update_ring_freq(struct drm_device *dev); |
755 | 755 | ||
756 | extern bool intel_ddi_get_hw_state(struct intel_encoder *encoder, |
756 | extern bool intel_ddi_get_hw_state(struct intel_encoder *encoder, |
757 | enum pipe *pipe); |
757 | enum pipe *pipe); |
758 | extern int intel_ddi_get_cdclk_freq(struct drm_i915_private *dev_priv); |
758 | extern int intel_ddi_get_cdclk_freq(struct drm_i915_private *dev_priv); |
759 | extern void intel_ddi_pll_init(struct drm_device *dev); |
759 | extern void intel_ddi_pll_init(struct drm_device *dev); |
760 | extern void intel_ddi_enable_transcoder_func(struct drm_crtc *crtc); |
760 | extern void intel_ddi_enable_transcoder_func(struct drm_crtc *crtc); |
761 | extern void intel_ddi_disable_transcoder_func(struct drm_i915_private *dev_priv, |
761 | extern void intel_ddi_disable_transcoder_func(struct drm_i915_private *dev_priv, |
762 | enum transcoder cpu_transcoder); |
762 | enum transcoder cpu_transcoder); |
763 | extern void intel_ddi_enable_pipe_clock(struct intel_crtc *intel_crtc); |
763 | extern void intel_ddi_enable_pipe_clock(struct intel_crtc *intel_crtc); |
764 | extern void intel_ddi_disable_pipe_clock(struct intel_crtc *intel_crtc); |
764 | extern void intel_ddi_disable_pipe_clock(struct intel_crtc *intel_crtc); |
765 | extern void intel_ddi_setup_hw_pll_state(struct drm_device *dev); |
765 | extern void intel_ddi_setup_hw_pll_state(struct drm_device *dev); |
766 | extern bool intel_ddi_pll_mode_set(struct drm_crtc *crtc); |
766 | extern bool intel_ddi_pll_mode_set(struct drm_crtc *crtc); |
767 | extern void intel_ddi_put_crtc_pll(struct drm_crtc *crtc); |
767 | extern void intel_ddi_put_crtc_pll(struct drm_crtc *crtc); |
768 | extern void intel_ddi_set_pipe_settings(struct drm_crtc *crtc); |
768 | extern void intel_ddi_set_pipe_settings(struct drm_crtc *crtc); |
769 | extern void intel_ddi_prepare_link_retrain(struct drm_encoder *encoder); |
769 | extern void intel_ddi_prepare_link_retrain(struct drm_encoder *encoder); |
770 | extern bool |
770 | extern bool |
771 | intel_ddi_connector_get_hw_state(struct intel_connector *intel_connector); |
771 | intel_ddi_connector_get_hw_state(struct intel_connector *intel_connector); |
772 | extern void intel_ddi_fdi_disable(struct drm_crtc *crtc); |
772 | extern void intel_ddi_fdi_disable(struct drm_crtc *crtc); |
- | 773 | extern void intel_ddi_get_config(struct intel_encoder *encoder, |
|
- | 774 | struct intel_crtc_config *pipe_config); |
|
773 | 775 | ||
774 | extern void intel_display_handle_reset(struct drm_device *dev); |
776 | extern void intel_display_handle_reset(struct drm_device *dev); |
775 | extern bool intel_set_cpu_fifo_underrun_reporting(struct drm_device *dev, |
777 | extern bool intel_set_cpu_fifo_underrun_reporting(struct drm_device *dev, |
776 | enum pipe pipe, |
778 | enum pipe pipe, |
777 | bool enable); |
779 | bool enable); |
778 | extern bool intel_set_pch_fifo_underrun_reporting(struct drm_device *dev, |
780 | extern bool intel_set_pch_fifo_underrun_reporting(struct drm_device *dev, |
779 | enum transcoder pch_transcoder, |
781 | enum transcoder pch_transcoder, |
780 | bool enable); |
782 | bool enable); |
781 | 783 | ||
782 | extern void intel_edp_psr_enable(struct intel_dp *intel_dp); |
784 | extern void intel_edp_psr_enable(struct intel_dp *intel_dp); |
783 | extern void intel_edp_psr_disable(struct intel_dp *intel_dp); |
785 | extern void intel_edp_psr_disable(struct intel_dp *intel_dp); |
784 | extern void intel_edp_psr_update(struct drm_device *dev); |
786 | extern void intel_edp_psr_update(struct drm_device *dev); |
785 | extern void hsw_disable_lcpll(struct drm_i915_private *dev_priv, |
787 | extern void hsw_disable_lcpll(struct drm_i915_private *dev_priv, |
786 | bool switch_to_fclk, bool allow_power_down); |
788 | bool switch_to_fclk, bool allow_power_down); |
787 | extern void hsw_restore_lcpll(struct drm_i915_private *dev_priv); |
789 | extern void hsw_restore_lcpll(struct drm_i915_private *dev_priv); |
788 | extern void ilk_enable_gt_irq(struct drm_i915_private *dev_priv, uint32_t mask); |
790 | extern void ilk_enable_gt_irq(struct drm_i915_private *dev_priv, uint32_t mask); |
789 | extern void ilk_disable_gt_irq(struct drm_i915_private *dev_priv, |
791 | extern void ilk_disable_gt_irq(struct drm_i915_private *dev_priv, |
790 | uint32_t mask); |
792 | uint32_t mask); |
791 | extern void snb_enable_pm_irq(struct drm_i915_private *dev_priv, uint32_t mask); |
793 | extern void snb_enable_pm_irq(struct drm_i915_private *dev_priv, uint32_t mask); |
792 | extern void snb_disable_pm_irq(struct drm_i915_private *dev_priv, |
794 | extern void snb_disable_pm_irq(struct drm_i915_private *dev_priv, |
793 | uint32_t mask); |
795 | uint32_t mask); |
794 | extern void hsw_enable_pc8_work(struct work_struct *__work); |
796 | extern void hsw_enable_pc8_work(struct work_struct *__work); |
795 | extern void hsw_enable_package_c8(struct drm_i915_private *dev_priv); |
797 | extern void hsw_enable_package_c8(struct drm_i915_private *dev_priv); |
796 | extern void hsw_disable_package_c8(struct drm_i915_private *dev_priv); |
798 | extern void hsw_disable_package_c8(struct drm_i915_private *dev_priv); |
797 | extern void hsw_pc8_disable_interrupts(struct drm_device *dev); |
799 | extern void hsw_pc8_disable_interrupts(struct drm_device *dev); |
798 | extern void hsw_pc8_restore_interrupts(struct drm_device *dev); |
800 | extern void hsw_pc8_restore_interrupts(struct drm_device *dev); |
799 | extern void intel_aux_display_runtime_get(struct drm_i915_private *dev_priv); |
801 | extern void intel_aux_display_runtime_get(struct drm_i915_private *dev_priv); |
800 | extern void intel_aux_display_runtime_put(struct drm_i915_private *dev_priv); |
802 | extern void intel_aux_display_runtime_put(struct drm_i915_private *dev_priv); |
801 | 803 | ||
802 | #endif /* __INTEL_DRV_H__ */0)><0)> |
804 | #endif /* __INTEL_DRV_H__ */0)><0)> |