Rev 3746 | Rev 4126 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 3746 | Rev 4104 | ||
---|---|---|---|
Line 86... | Line 86... | ||
86 | PLANE_B, |
86 | PLANE_B, |
87 | PLANE_C, |
87 | PLANE_C, |
88 | }; |
88 | }; |
89 | #define plane_name(p) ((p) + 'A') |
89 | #define plane_name(p) ((p) + 'A') |
Line -... | Line 90... | ||
- | 90 | ||
- | 91 | #define sprite_name(p, s) ((p) * dev_priv->num_plane + (s) + 'A') |
|
90 | 92 | ||
91 | enum port { |
93 | enum port { |
92 | PORT_A = 0, |
94 | PORT_A = 0, |
93 | PORT_B, |
95 | PORT_B, |
94 | PORT_C, |
96 | PORT_C, |
95 | PORT_D, |
97 | PORT_D, |
96 | PORT_E, |
98 | PORT_E, |
97 | I915_MAX_PORTS |
99 | I915_MAX_PORTS |
98 | }; |
100 | }; |
Line -... | Line 101... | ||
- | 101 | #define port_name(p) ((p) + 'A') |
|
- | 102 | ||
- | 103 | enum intel_display_power_domain { |
|
- | 104 | POWER_DOMAIN_PIPE_A, |
|
- | 105 | POWER_DOMAIN_PIPE_B, |
|
- | 106 | POWER_DOMAIN_PIPE_C, |
|
- | 107 | POWER_DOMAIN_PIPE_A_PANEL_FITTER, |
|
- | 108 | POWER_DOMAIN_PIPE_B_PANEL_FITTER, |
|
- | 109 | POWER_DOMAIN_PIPE_C_PANEL_FITTER, |
|
- | 110 | POWER_DOMAIN_TRANSCODER_A, |
|
- | 111 | POWER_DOMAIN_TRANSCODER_B, |
|
- | 112 | POWER_DOMAIN_TRANSCODER_C, |
|
- | 113 | POWER_DOMAIN_TRANSCODER_EDP = POWER_DOMAIN_TRANSCODER_A + 0xF, |
|
- | 114 | }; |
|
- | 115 | ||
- | 116 | #define POWER_DOMAIN_PIPE(pipe) ((pipe) + POWER_DOMAIN_PIPE_A) |
|
- | 117 | #define POWER_DOMAIN_PIPE_PANEL_FITTER(pipe) \ |
|
- | 118 | ((pipe) + POWER_DOMAIN_PIPE_A_PANEL_FITTER) |
|
99 | #define port_name(p) ((p) + 'A') |
119 | #define POWER_DOMAIN_TRANSCODER(tran) ((tran) + POWER_DOMAIN_TRANSCODER_A) |
100 | 120 | ||
101 | enum hpd_pin { |
121 | enum hpd_pin { |
102 | HPD_NONE = 0, |
122 | HPD_NONE = 0, |
103 | HPD_PORT_A = HPD_NONE, /* PORT_A is internal */ |
123 | HPD_PORT_A = HPD_NONE, /* PORT_A is internal */ |
Line 122... | Line 142... | ||
122 | 142 | ||
123 | #define for_each_encoder_on_crtc(dev, __crtc, intel_encoder) \ |
143 | #define for_each_encoder_on_crtc(dev, __crtc, intel_encoder) \ |
124 | list_for_each_entry((intel_encoder), &(dev)->mode_config.encoder_list, base.head) \ |
144 | list_for_each_entry((intel_encoder), &(dev)->mode_config.encoder_list, base.head) \ |
Line -... | Line 145... | ||
- | 145 | if ((intel_encoder)->base.crtc == (__crtc)) |
|
- | 146 | ||
- | 147 | struct drm_i915_private; |
|
- | 148 | ||
- | 149 | enum intel_dpll_id { |
|
- | 150 | DPLL_ID_PRIVATE = -1, /* non-shared dpll in use */ |
|
- | 151 | /* real shared dpll ids must be >= 0 */ |
|
- | 152 | DPLL_ID_PCH_PLL_A, |
|
- | 153 | DPLL_ID_PCH_PLL_B, |
|
- | 154 | }; |
|
- | 155 | #define I915_NUM_PLLS 2 |
|
- | 156 | ||
- | 157 | struct intel_dpll_hw_state { |
|
- | 158 | uint32_t dpll; |
|
- | 159 | uint32_t dpll_md; |
|
- | 160 | uint32_t fp0; |
|
- | 161 | uint32_t fp1; |
|
125 | if ((intel_encoder)->base.crtc == (__crtc)) |
162 | }; |
126 | 163 | ||
127 | struct intel_pch_pll { |
164 | struct intel_shared_dpll { |
128 | int refcount; /* count of number of CRTCs sharing this PLL */ |
165 | int refcount; /* count of number of CRTCs sharing this PLL */ |
129 | int active; /* count of number of active CRTCs (i.e. DPMS on) */ |
166 | int active; /* count of number of active CRTCs (i.e. DPMS on) */ |
- | 167 | bool on; /* is the PLL actually active? Disabled during modeset */ |
|
130 | bool on; /* is the PLL actually active? Disabled during modeset */ |
168 | const char *name; |
- | 169 | /* should match the index in the dev_priv->shared_dplls array */ |
|
- | 170 | enum intel_dpll_id id; |
|
- | 171 | struct intel_dpll_hw_state hw_state; |
|
- | 172 | void (*mode_set)(struct drm_i915_private *dev_priv, |
|
- | 173 | struct intel_shared_dpll *pll); |
|
- | 174 | void (*enable)(struct drm_i915_private *dev_priv, |
|
131 | int pll_reg; |
175 | struct intel_shared_dpll *pll); |
- | 176 | void (*disable)(struct drm_i915_private *dev_priv, |
|
- | 177 | struct intel_shared_dpll *pll); |
|
- | 178 | bool (*get_hw_state)(struct drm_i915_private *dev_priv, |
|
132 | int fp0_reg; |
179 | struct intel_shared_dpll *pll, |
133 | int fp1_reg; |
- | |
Line 134... | Line 180... | ||
134 | }; |
180 | struct intel_dpll_hw_state *hw_state); |
135 | #define I915_NUM_PLLS 2 |
181 | }; |
136 | 182 | ||
137 | /* Used by dp and fdi links */ |
183 | /* Used by dp and fdi links */ |
Line 165... | Line 211... | ||
165 | */ |
211 | */ |
166 | #define DRIVER_MAJOR 1 |
212 | #define DRIVER_MAJOR 1 |
167 | #define DRIVER_MINOR 6 |
213 | #define DRIVER_MINOR 6 |
168 | #define DRIVER_PATCHLEVEL 0 |
214 | #define DRIVER_PATCHLEVEL 0 |
Line 169... | Line -... | ||
169 | - | ||
170 | #define WATCH_COHERENCY 0 |
215 | |
171 | #define WATCH_LISTS 0 |
216 | #define WATCH_LISTS 0 |
Line 172... | Line 217... | ||
172 | #define WATCH_GTT 0 |
217 | #define WATCH_GTT 0 |
173 | 218 | ||
Line 185... | Line 230... | ||
185 | 230 | ||
186 | struct opregion_header; |
231 | struct opregion_header; |
187 | struct opregion_acpi; |
232 | struct opregion_acpi; |
188 | struct opregion_swsci; |
233 | struct opregion_swsci; |
189 | struct opregion_asle; |
- | |
Line 190... | Line 234... | ||
190 | struct drm_i915_private; |
234 | struct opregion_asle; |
191 | 235 | ||
192 | struct intel_opregion { |
236 | struct intel_opregion { |
193 | struct opregion_header __iomem *header; |
237 | struct opregion_header __iomem *header; |
Line 288... | Line 332... | ||
288 | u32 tiling:2; |
332 | u32 tiling:2; |
289 | u32 dirty:1; |
333 | u32 dirty:1; |
290 | u32 purgeable:1; |
334 | u32 purgeable:1; |
291 | s32 ring:4; |
335 | s32 ring:4; |
292 | u32 cache_level:2; |
336 | u32 cache_level:2; |
293 | } *active_bo, *pinned_bo; |
337 | } **active_bo, **pinned_bo; |
294 | u32 active_bo_count, pinned_bo_count; |
338 | u32 *active_bo_count, *pinned_bo_count; |
295 | struct intel_overlay_error_state *overlay; |
339 | struct intel_overlay_error_state *overlay; |
296 | struct intel_display_error_state *display; |
340 | struct intel_display_error_state *display; |
297 | }; |
341 | }; |
Line 298... | Line 342... | ||
298 | 342 | ||
299 | struct intel_crtc_config; |
343 | struct intel_crtc_config; |
- | 344 | struct intel_crtc; |
|
- | 345 | struct intel_limit; |
|
Line 300... | Line 346... | ||
300 | struct intel_crtc; |
346 | struct dpll; |
301 | 347 | ||
302 | struct drm_i915_display_funcs { |
348 | struct drm_i915_display_funcs { |
303 | bool (*fbc_enabled)(struct drm_device *dev); |
349 | bool (*fbc_enabled)(struct drm_device *dev); |
304 | void (*enable_fbc)(struct drm_crtc *crtc, unsigned long interval); |
350 | void (*enable_fbc)(struct drm_crtc *crtc, unsigned long interval); |
305 | void (*disable_fbc)(struct drm_device *dev); |
351 | void (*disable_fbc)(struct drm_device *dev); |
- | 352 | int (*get_display_clock_speed)(struct drm_device *dev); |
|
- | 353 | int (*get_fifo_size)(struct drm_device *dev, int plane); |
|
- | 354 | /** |
|
- | 355 | * find_dpll() - Find the best values for the PLL |
|
- | 356 | * @limit: limits for the PLL |
|
- | 357 | * @crtc: current CRTC |
|
- | 358 | * @target: target frequency in kHz |
|
- | 359 | * @refclk: reference clock frequency in kHz |
|
- | 360 | * @match_clock: if provided, @best_clock P divider must |
|
- | 361 | * match the P divider from @match_clock |
|
- | 362 | * used for LVDS downclocking |
|
- | 363 | * @best_clock: best PLL values found |
|
- | 364 | * |
|
- | 365 | * Returns true on success, false on failure. |
|
- | 366 | */ |
|
- | 367 | bool (*find_dpll)(const struct intel_limit *limit, |
|
- | 368 | struct drm_crtc *crtc, |
|
- | 369 | int target, int refclk, |
|
306 | int (*get_display_clock_speed)(struct drm_device *dev); |
370 | struct dpll *match_clock, |
307 | int (*get_fifo_size)(struct drm_device *dev, int plane); |
371 | struct dpll *best_clock); |
- | 372 | void (*update_wm)(struct drm_device *dev); |
|
308 | void (*update_wm)(struct drm_device *dev); |
373 | void (*update_sprite_wm)(struct drm_plane *plane, |
309 | void (*update_sprite_wm)(struct drm_device *dev, int pipe, |
- | |
310 | uint32_t sprite_width, int pixel_size); |
374 | struct drm_crtc *crtc, |
311 | void (*update_linetime_wm)(struct drm_device *dev, int pipe, |
375 | uint32_t sprite_width, int pixel_size, |
312 | struct drm_display_mode *mode); |
376 | bool enable, bool scaled); |
313 | void (*modeset_global_resources)(struct drm_device *dev); |
377 | void (*modeset_global_resources)(struct drm_device *dev); |
314 | /* Returns the active state of the crtc, and if the crtc is active, |
378 | /* Returns the active state of the crtc, and if the crtc is active, |
315 | * fills out the pipe-config with the hw state. */ |
379 | * fills out the pipe-config with the hw state. */ |
- | 380 | bool (*get_pipe_config)(struct intel_crtc *, |
|
316 | bool (*get_pipe_config)(struct intel_crtc *, |
381 | struct intel_crtc_config *); |
317 | struct intel_crtc_config *); |
382 | void (*get_clock)(struct intel_crtc *, struct intel_crtc_config *); |
318 | int (*crtc_mode_set)(struct drm_crtc *crtc, |
383 | int (*crtc_mode_set)(struct drm_crtc *crtc, |
319 | int x, int y, |
384 | int x, int y, |
320 | struct drm_framebuffer *old_fb); |
385 | struct drm_framebuffer *old_fb); |
Line 325... | Line 390... | ||
325 | struct drm_crtc *crtc); |
390 | struct drm_crtc *crtc); |
326 | void (*fdi_link_train)(struct drm_crtc *crtc); |
391 | void (*fdi_link_train)(struct drm_crtc *crtc); |
327 | void (*init_clock_gating)(struct drm_device *dev); |
392 | void (*init_clock_gating)(struct drm_device *dev); |
328 | int (*queue_flip)(struct drm_device *dev, struct drm_crtc *crtc, |
393 | int (*queue_flip)(struct drm_device *dev, struct drm_crtc *crtc, |
329 | struct drm_framebuffer *fb, |
394 | struct drm_framebuffer *fb, |
330 | struct drm_i915_gem_object *obj); |
395 | struct drm_i915_gem_object *obj, |
- | 396 | uint32_t flags); |
|
331 | int (*update_plane)(struct drm_crtc *crtc, struct drm_framebuffer *fb, |
397 | int (*update_plane)(struct drm_crtc *crtc, struct drm_framebuffer *fb, |
332 | int x, int y); |
398 | int x, int y); |
333 | void (*hpd_irq_setup)(struct drm_device *dev); |
399 | void (*hpd_irq_setup)(struct drm_device *dev); |
334 | /* clock updates for mode set */ |
400 | /* clock updates for mode set */ |
335 | /* cursor updates */ |
401 | /* cursor updates */ |
336 | /* render clock increase/decrease */ |
402 | /* render clock increase/decrease */ |
337 | /* display clock increase/decrease */ |
403 | /* display clock increase/decrease */ |
338 | /* pll clock increase/decrease */ |
404 | /* pll clock increase/decrease */ |
339 | }; |
405 | }; |
Line 340... | Line 406... | ||
340 | 406 | ||
341 | struct drm_i915_gt_funcs { |
407 | struct intel_uncore_funcs { |
342 | void (*force_wake_get)(struct drm_i915_private *dev_priv); |
408 | void (*force_wake_get)(struct drm_i915_private *dev_priv); |
343 | void (*force_wake_put)(struct drm_i915_private *dev_priv); |
409 | void (*force_wake_put)(struct drm_i915_private *dev_priv); |
Line -... | Line 410... | ||
- | 410 | }; |
|
- | 411 | ||
- | 412 | struct intel_uncore { |
|
- | 413 | spinlock_t lock; /** lock is also taken in irq contexts. */ |
|
- | 414 | ||
- | 415 | struct intel_uncore_funcs funcs; |
|
- | 416 | ||
- | 417 | unsigned fifo_count; |
|
- | 418 | unsigned forcewake_count; |
|
344 | }; |
419 | }; |
345 | 420 | ||
346 | #define DEV_INFO_FLAGS \ |
421 | #define DEV_INFO_FOR_EACH_FLAG(func, sep) \ |
347 | DEV_INFO_FLAG(is_mobile) DEV_INFO_SEP \ |
422 | func(is_mobile) sep \ |
348 | DEV_INFO_FLAG(is_i85x) DEV_INFO_SEP \ |
423 | func(is_i85x) sep \ |
349 | DEV_INFO_FLAG(is_i915g) DEV_INFO_SEP \ |
424 | func(is_i915g) sep \ |
350 | DEV_INFO_FLAG(is_i945gm) DEV_INFO_SEP \ |
425 | func(is_i945gm) sep \ |
351 | DEV_INFO_FLAG(is_g33) DEV_INFO_SEP \ |
426 | func(is_g33) sep \ |
352 | DEV_INFO_FLAG(need_gfx_hws) DEV_INFO_SEP \ |
427 | func(need_gfx_hws) sep \ |
353 | DEV_INFO_FLAG(is_g4x) DEV_INFO_SEP \ |
428 | func(is_g4x) sep \ |
354 | DEV_INFO_FLAG(is_pineview) DEV_INFO_SEP \ |
429 | func(is_pineview) sep \ |
355 | DEV_INFO_FLAG(is_broadwater) DEV_INFO_SEP \ |
430 | func(is_broadwater) sep \ |
356 | DEV_INFO_FLAG(is_crestline) DEV_INFO_SEP \ |
431 | func(is_crestline) sep \ |
357 | DEV_INFO_FLAG(is_ivybridge) DEV_INFO_SEP \ |
432 | func(is_ivybridge) sep \ |
358 | DEV_INFO_FLAG(is_valleyview) DEV_INFO_SEP \ |
433 | func(is_valleyview) sep \ |
359 | DEV_INFO_FLAG(is_haswell) DEV_INFO_SEP \ |
434 | func(is_haswell) sep \ |
360 | DEV_INFO_FLAG(has_force_wake) DEV_INFO_SEP \ |
435 | func(has_force_wake) sep \ |
361 | DEV_INFO_FLAG(has_fbc) DEV_INFO_SEP \ |
436 | func(has_fbc) sep \ |
362 | DEV_INFO_FLAG(has_pipe_cxsr) DEV_INFO_SEP \ |
437 | func(has_pipe_cxsr) sep \ |
363 | DEV_INFO_FLAG(has_hotplug) DEV_INFO_SEP \ |
438 | func(has_hotplug) sep \ |
364 | DEV_INFO_FLAG(cursor_needs_physical) DEV_INFO_SEP \ |
439 | func(cursor_needs_physical) sep \ |
365 | DEV_INFO_FLAG(has_overlay) DEV_INFO_SEP \ |
440 | func(has_overlay) sep \ |
366 | DEV_INFO_FLAG(overlay_needs_physical) DEV_INFO_SEP \ |
441 | func(overlay_needs_physical) sep \ |
367 | DEV_INFO_FLAG(supports_tv) DEV_INFO_SEP \ |
442 | func(supports_tv) sep \ |
- | 443 | func(has_bsd_ring) sep \ |
|
- | 444 | func(has_blt_ring) sep \ |
|
- | 445 | func(has_vebox_ring) sep \ |
|
368 | DEV_INFO_FLAG(has_bsd_ring) DEV_INFO_SEP \ |
446 | func(has_llc) sep \ |
- | 447 | func(has_ddi) sep \ |
|
- | 448 | func(has_fpga_dbg) |
|
- | 449 | ||
Line 369... | Line 450... | ||
369 | DEV_INFO_FLAG(has_blt_ring) DEV_INFO_SEP \ |
450 | #define DEFINE_FLAG(name) u8 name:1 |
370 | DEV_INFO_FLAG(has_llc) |
451 | #define SEP_SEMICOLON ; |
371 | 452 | ||
372 | struct intel_device_info { |
453 | struct intel_device_info { |
373 | u32 display_mmio_offset; |
- | |
374 | u8 num_pipes:3; |
- | |
375 | u8 gen; |
- | |
376 | u8 is_mobile:1; |
- | |
377 | u8 is_i85x:1; |
- | |
378 | u8 is_i915g:1; |
- | |
379 | u8 is_i945gm:1; |
- | |
380 | u8 is_g33:1; |
- | |
381 | u8 need_gfx_hws:1; |
- | |
382 | u8 is_g4x:1; |
- | |
383 | u8 is_pineview:1; |
- | |
384 | u8 is_broadwater:1; |
- | |
385 | u8 is_crestline:1; |
- | |
386 | u8 is_ivybridge:1; |
- | |
387 | u8 is_valleyview:1; |
- | |
388 | u8 has_force_wake:1; |
- | |
389 | u8 is_haswell:1; |
- | |
390 | u8 has_fbc:1; |
- | |
391 | u8 has_pipe_cxsr:1; |
- | |
392 | u8 has_hotplug:1; |
454 | u32 display_mmio_offset; |
393 | u8 cursor_needs_physical:1; |
- | |
394 | u8 has_overlay:1; |
- | |
395 | u8 overlay_needs_physical:1; |
- | |
396 | u8 supports_tv:1; |
- | |
397 | u8 has_bsd_ring:1; |
455 | u8 num_pipes:3; |
Line -... | Line 456... | ||
- | 456 | u8 gen; |
|
- | 457 | DEV_INFO_FOR_EACH_FLAG(DEFINE_FLAG, SEP_SEMICOLON); |
|
- | 458 | }; |
|
398 | u8 has_blt_ring:1; |
459 | |
399 | u8 has_llc:1; |
460 | #undef DEFINE_FLAG |
- | 461 | #undef SEP_SEMICOLON |
|
- | 462 | ||
- | 463 | enum i915_cache_level { |
|
- | 464 | I915_CACHE_NONE = 0, |
|
- | 465 | I915_CACHE_LLC, /* also used for snoopable memory on non-LLC */ |
|
- | 466 | I915_CACHE_L3_LLC, /* gen7+, L3 sits between the domain specifc |
|
- | 467 | caches, eg sampler/render caches, and the |
|
- | 468 | large Last-Level-Cache. LLC is coherent with |
|
- | 469 | the CPU, but L3 is only visible to the GPU. */ |
|
- | 470 | I915_CACHE_WT, /* hsw:gt3e WriteThrough for scanouts */ |
|
- | 471 | }; |
|
400 | }; |
472 | |
- | 473 | typedef uint32_t gen6_gtt_pte_t; |
|
- | 474 | ||
- | 475 | struct i915_address_space { |
|
- | 476 | struct drm_mm mm; |
|
- | 477 | struct drm_device *dev; |
|
- | 478 | struct list_head global_link; |
|
- | 479 | unsigned long start; /* Start offset always 0 for dri2 */ |
|
- | 480 | size_t total; /* size addr space maps (ex. 2GB for ggtt) */ |
|
- | 481 | ||
- | 482 | struct { |
|
- | 483 | dma_addr_t addr; |
|
- | 484 | struct page *page; |
|
- | 485 | } scratch; |
|
- | 486 | ||
- | 487 | /** |
|
- | 488 | * List of objects currently involved in rendering. |
|
- | 489 | * |
|
- | 490 | * Includes buffers having the contents of their GPU caches |
|
- | 491 | * flushed, not necessarily primitives. last_rendering_seqno |
|
- | 492 | * represents when the rendering involved will be completed. |
|
- | 493 | * |
|
- | 494 | * A reference is held on the buffer while on this list. |
|
- | 495 | */ |
|
- | 496 | struct list_head active_list; |
|
- | 497 | ||
- | 498 | /** |
|
- | 499 | * LRU list of objects which are not in the ringbuffer and |
|
- | 500 | * are ready to unbind, but are still in the GTT. |
|
- | 501 | * |
|
- | 502 | * last_rendering_seqno is 0 while an object is in this list. |
|
- | 503 | * |
|
- | 504 | * A reference is not held on the buffer while on this list, |
|
- | 505 | * as merely being GTT-bound shouldn't prevent its being |
|
401 | 506 | * freed, and we'll pull it off the list in the free path. |
|
- | 507 | */ |
|
- | 508 | struct list_head inactive_list; |
|
- | 509 | ||
- | 510 | /* FIXME: Need a more generic return type */ |
|
- | 511 | gen6_gtt_pte_t (*pte_encode)(dma_addr_t addr, |
|
- | 512 | enum i915_cache_level level); |
|
- | 513 | void (*clear_range)(struct i915_address_space *vm, |
|
- | 514 | unsigned int first_entry, |
|
- | 515 | unsigned int num_entries); |
|
- | 516 | void (*insert_entries)(struct i915_address_space *vm, |
|
402 | enum i915_cache_level { |
517 | struct sg_table *st, |
Line 403... | Line 518... | ||
403 | I915_CACHE_NONE = 0, |
518 | unsigned int first_entry, |
404 | I915_CACHE_LLC, |
519 | enum i915_cache_level cache_level); |
405 | I915_CACHE_LLC_MLC, /* gen6+, in docs at least! */ |
520 | void (*cleanup)(struct i915_address_space *vm); |
406 | }; |
521 | }; |
407 | 522 | ||
408 | /* The Graphics Translation Table is the way in which GEN hardware translates a |
523 | /* The Graphics Translation Table is the way in which GEN hardware translates a |
409 | * Graphics Virtual Address into a Physical Address. In addition to the normal |
524 | * Graphics Virtual Address into a Physical Address. In addition to the normal |
410 | * collateral associated with any va->pa translations GEN hardware also has a |
525 | * collateral associated with any va->pa translations GEN hardware also has a |
411 | * portion of the GTT which can be mapped by the CPU and remain both coherent |
- | |
412 | * and correct (in cases like swizzling). That region is referred to as GMADR in |
526 | * portion of the GTT which can be mapped by the CPU and remain both coherent |
413 | * the spec. |
527 | * and correct (in cases like swizzling). That region is referred to as GMADR in |
Line 414... | Line 528... | ||
414 | */ |
528 | * the spec. |
415 | struct i915_gtt { |
529 | */ |
416 | unsigned long start; /* Start offset of used GTT */ |
530 | struct i915_gtt { |
Line 417... | Line 531... | ||
417 | size_t total; /* Total size GTT can map */ |
531 | struct i915_address_space base; |
418 | size_t stolen_size; /* Total size of stolen memory */ |
532 | size_t stolen_size; /* Total size of stolen memory */ |
Line 419... | Line 533... | ||
419 | 533 | ||
420 | unsigned long mappable_end; /* End offset that we can CPU map */ |
- | |
- | 534 | unsigned long mappable_end; /* End offset that we can CPU map */ |
|
421 | struct io_mapping *mappable; /* Mapping to our CPU mappable region */ |
535 | struct io_mapping *mappable; /* Mapping to our CPU mappable region */ |
Line 422... | Line 536... | ||
422 | phys_addr_t mappable_base; /* PA of our GMADR */ |
536 | phys_addr_t mappable_base; /* PA of our GMADR */ |
423 | 537 | ||
424 | /** "Graphics Stolen Memory" holds the global PTEs */ |
538 | /** "Graphics Stolen Memory" holds the global PTEs */ |
425 | void __iomem *gsm; |
539 | void __iomem *gsm; |
426 | - | ||
427 | bool do_idle_maps; |
- | |
428 | dma_addr_t scratch_page_dma; |
- | |
429 | struct page *scratch_page; |
- | |
430 | - | ||
431 | /* global gtt ops */ |
- | |
432 | int (*gtt_probe)(struct drm_device *dev, size_t *gtt_total, |
- | |
433 | size_t *stolen, phys_addr_t *mappable_base, |
- | |
434 | unsigned long *mappable_end); |
540 | |
435 | void (*gtt_remove)(struct drm_device *dev); |
541 | bool do_idle_maps; |
Line 436... | Line -... | ||
436 | void (*gtt_clear_range)(struct drm_device *dev, |
- | |
437 | unsigned int first_entry, |
- | |
438 | unsigned int num_entries); |
542 | |
439 | void (*gtt_insert_entries)(struct drm_device *dev, |
543 | int mtrr; |
440 | struct sg_table *st, |
544 | |
441 | unsigned int pg_start, |
545 | /* global gtt ops */ |
442 | enum i915_cache_level cache_level); |
546 | int (*gtt_probe)(struct drm_device *dev, size_t *gtt_total, |
443 | }; |
547 | size_t *stolen, phys_addr_t *mappable_base, |
444 | #define gtt_total_entries(gtt) ((gtt).total >> PAGE_SHIFT) |
- | |
Line 445... | Line -... | ||
445 | - | ||
446 | #define I915_PPGTT_PD_ENTRIES 512 |
- | |
447 | #define I915_PPGTT_PT_ENTRIES 1024 |
- | |
448 | struct i915_hw_ppgtt { |
- | |
449 | struct drm_device *dev; |
- | |
450 | unsigned num_pd_entries; |
- | |
451 | struct page **pt_pages; |
- | |
452 | uint32_t pd_offset; |
- | |
453 | dma_addr_t *pt_dma_addr; |
548 | unsigned long *mappable_end); |
454 | dma_addr_t scratch_page_dma_addr; |
- | |
455 | 549 | }; |
|
Line -... | Line 550... | ||
- | 550 | #define gtt_total_entries(gtt) ((gtt).base.total >> PAGE_SHIFT) |
|
- | 551 | ||
- | 552 | struct i915_hw_ppgtt { |
|
- | 553 | struct i915_address_space base; |
|
- | 554 | unsigned num_pd_entries; |
|
- | 555 | struct page **pt_pages; |
|
- | 556 | uint32_t pd_offset; |
|
- | 557 | dma_addr_t *pt_dma_addr; |
|
- | 558 | ||
- | 559 | int (*enable)(struct drm_device *dev); |
|
- | 560 | }; |
|
- | 561 | ||
- | 562 | /** |
|
- | 563 | * A VMA represents a GEM BO that is bound into an address space. Therefore, a |
|
- | 564 | * VMA's presence cannot be guaranteed before binding, or after unbinding the |
|
- | 565 | * object into/from the address space. |
|
- | 566 | * |
|
- | 567 | * To make things as simple as possible (ie. no refcounting), a VMA's lifetime |
|
- | 568 | * will always be <= an objects lifetime. So object refcounting should cover us. |
|
- | 569 | */ |
|
- | 570 | struct i915_vma { |
|
- | 571 | struct drm_mm_node node; |
|
- | 572 | struct drm_i915_gem_object *obj; |
|
- | 573 | struct i915_address_space *vm; |
|
- | 574 | ||
- | 575 | /** This object's place on the active/inactive lists */ |
|
- | 576 | struct list_head mm_list; |
|
- | 577 | ||
- | 578 | struct list_head vma_link; /* Link in the object's VMA list */ |
|
- | 579 | ||
Line 456... | Line 580... | ||
456 | /* pte functions, mirroring the interface of the global gtt. */ |
580 | /** This vma's place in the batchbuffer or on the eviction list */ |
457 | void (*clear_range)(struct i915_hw_ppgtt *ppgtt, |
581 | struct list_head exec_list; |
458 | unsigned int first_entry, |
582 | |
- | 583 | }; |
|
459 | unsigned int num_entries); |
584 | |
460 | void (*insert_entries)(struct i915_hw_ppgtt *ppgtt, |
585 | struct i915_ctx_hang_stats { |
461 | struct sg_table *st, |
586 | /* This context had batch pending when hang was declared */ |
462 | unsigned int pg_start, |
587 | unsigned batch_pending; |
463 | enum i915_cache_level cache_level); |
588 | |
- | 589 | /* This context had batch active when hang was declared */ |
|
464 | int (*enable)(struct drm_device *dev); |
590 | unsigned batch_active; |
Line -... | Line 591... | ||
- | 591 | }; |
|
- | 592 | ||
- | 593 | /* This must match up with the value previously used for execbuf2.rsvd1. */ |
|
- | 594 | #define DEFAULT_CONTEXT_ID 0 |
|
- | 595 | struct i915_hw_context { |
|
- | 596 | struct kref ref; |
|
- | 597 | int id; |
|
- | 598 | bool is_initialized; |
|
- | 599 | struct drm_i915_file_private *file_priv; |
|
- | 600 | struct intel_ring_buffer *ring; |
|
- | 601 | struct drm_i915_gem_object *obj; |
|
- | 602 | struct i915_ctx_hang_stats hang_stats; |
|
- | 603 | }; |
|
- | 604 | ||
- | 605 | struct i915_fbc { |
|
- | 606 | unsigned long size; |
|
465 | void (*cleanup)(struct i915_hw_ppgtt *ppgtt); |
607 | unsigned int fb_id; |
- | 608 | enum plane plane; |
|
- | 609 | int y; |
|
466 | }; |
610 | |
467 | 611 | struct drm_mm_node *compressed_fb; |
|
468 | 612 | struct drm_mm_node *compressed_llb; |
|
469 | /* This must match up with the value previously used for execbuf2.rsvd1. */ |
613 | |
470 | #define DEFAULT_CONTEXT_ID 0 |
614 | struct intel_fbc_work { |
471 | struct i915_hw_context { |
615 | struct delayed_work work; |
472 | int id; |
616 | struct drm_crtc *crtc; |
473 | bool is_initialized; |
617 | struct drm_framebuffer *fb; |
- | 618 | int interval; |
|
- | 619 | } *fbc_work; |
|
- | 620 | ||
- | 621 | enum no_fbc_reason { |
|
- | 622 | FBC_OK, /* FBC is enabled */ |
|
- | 623 | FBC_UNSUPPORTED, /* FBC is not supported by this chipset */ |
|
- | 624 | FBC_NO_OUTPUT, /* no outputs enabled to compress */ |
|
- | 625 | FBC_STOLEN_TOO_SMALL, /* not enough space for buffers */ |
|
- | 626 | FBC_UNSUPPORTED_MODE, /* interlace or doublescanned mode */ |
|
- | 627 | FBC_MODE_TOO_LARGE, /* mode too large for compression */ |
|
- | 628 | FBC_BAD_PLANE, /* fbc not supported on plane */ |
|
- | 629 | FBC_NOT_TILED, /* buffer not tiled */ |
|
- | 630 | FBC_MULTIPLE_PIPES, /* more than one pipe active */ |
|
- | 631 | FBC_MODULE_PARAM, |
|
- | 632 | FBC_CHIP_DEFAULT, /* disabled by default on this chip */ |
|
474 | struct drm_i915_file_private *file_priv; |
633 | } no_fbc_reason; |
Line 475... | Line 634... | ||
475 | struct intel_ring_buffer *ring; |
634 | }; |
476 | struct drm_i915_gem_object *obj; |
635 | |
477 | }; |
636 | enum no_psr_reason { |
Line 501... | Line 660... | ||
501 | }; |
660 | }; |
Line 502... | Line 661... | ||
502 | 661 | ||
503 | #define QUIRK_PIPEA_FORCE (1<<0) |
662 | #define QUIRK_PIPEA_FORCE (1<<0) |
504 | #define QUIRK_LVDS_SSC_DISABLE (1<<1) |
663 | #define QUIRK_LVDS_SSC_DISABLE (1<<1) |
- | 664 | #define QUIRK_INVERT_BRIGHTNESS (1<<2) |
|
Line 505... | Line 665... | ||
505 | #define QUIRK_INVERT_BRIGHTNESS (1<<2) |
665 | #define QUIRK_NO_PCH_PWM_ENABLE (1<<3) |
506 | 666 | ||
Line 507... | Line 667... | ||
507 | struct intel_fbdev; |
667 | struct intel_fbdev; |
Line 667... | Line 827... | ||
667 | u32 saveMCHBAR_RENDER_STANDBY; |
827 | u32 saveMCHBAR_RENDER_STANDBY; |
668 | u32 savePCH_PORT_HOTPLUG; |
828 | u32 savePCH_PORT_HOTPLUG; |
669 | }; |
829 | }; |
Line 670... | Line 830... | ||
670 | 830 | ||
- | 831 | struct intel_gen6_power_mgmt { |
|
671 | struct intel_gen6_power_mgmt { |
832 | /* work and pm_iir are protected by dev_priv->irq_lock */ |
672 | struct work_struct work; |
833 | struct work_struct work; |
- | 834 | u32 pm_iir; |
|
673 | u32 pm_iir; |
835 | |
674 | /* lock - irqsave spinlock that protectects the work_struct and |
- | |
675 | * pm_iir. */ |
836 | /* On vlv we need to manually drop to Vmin with a delayed work. */ |
Line 676... | Line 837... | ||
676 | spinlock_t lock; |
837 | struct delayed_work vlv_work; |
677 | 838 | ||
678 | /* The below variables an all the rps hw state are protected by |
839 | /* The below variables an all the rps hw state are protected by |
679 | * dev->struct mutext. */ |
840 | * dev->struct mutext. */ |
680 | u8 cur_delay; |
841 | u8 cur_delay; |
- | 842 | u8 min_delay; |
|
681 | u8 min_delay; |
843 | u8 max_delay; |
Line 682... | Line 844... | ||
682 | u8 max_delay; |
844 | u8 rpe_delay; |
Line 683... | Line 845... | ||
683 | u8 hw_max; |
845 | u8 hw_max; |
Line 714... | Line 876... | ||
714 | 876 | ||
715 | struct drm_i915_gem_object *pwrctx; |
877 | struct drm_i915_gem_object *pwrctx; |
716 | struct drm_i915_gem_object *renderctx; |
878 | struct drm_i915_gem_object *renderctx; |
Line -... | Line 879... | ||
- | 879 | }; |
|
- | 880 | ||
- | 881 | /* Power well structure for haswell */ |
|
- | 882 | struct i915_power_well { |
|
- | 883 | struct drm_device *device; |
|
- | 884 | spinlock_t lock; |
|
- | 885 | /* power well enable/disable usage count */ |
|
- | 886 | int count; |
|
- | 887 | int i915_request; |
|
717 | }; |
888 | }; |
718 | 889 | ||
719 | struct i915_dri1_state { |
890 | struct i915_dri1_state { |
Line 720... | Line 891... | ||
720 | unsigned allow_batchbuffer : 1; |
891 | unsigned allow_batchbuffer : 1; |
Line 727... | Line 898... | ||
727 | int page_flipping; |
898 | int page_flipping; |
Line 728... | Line 899... | ||
728 | 899 | ||
729 | uint32_t counter; |
900 | uint32_t counter; |
Line -... | Line 901... | ||
- | 901 | }; |
|
- | 902 | ||
- | 903 | struct i915_ums_state { |
|
- | 904 | /** |
|
- | 905 | * Flag if the X Server, and thus DRM, is not currently in |
|
- | 906 | * control of the device. |
|
- | 907 | * |
|
- | 908 | * This is set between LeaveVT and EnterVT. It needs to be |
|
- | 909 | * replaced with a semaphore. It also needs to be |
|
- | 910 | * transitioned away from for kernel modesetting. |
|
- | 911 | */ |
|
- | 912 | int mm_suspended; |
|
730 | }; |
913 | }; |
731 | 914 | ||
732 | struct intel_l3_parity { |
915 | struct intel_l3_parity { |
733 | u32 *remap_info; |
916 | u32 *remap_info; |
Line 734... | Line 917... | ||
734 | struct work_struct error_work; |
917 | struct work_struct error_work; |
735 | }; |
918 | }; |
736 | 919 | ||
737 | struct i915_gem_mm { |
- | |
738 | /** Memory allocator for GTT stolen memory */ |
- | |
739 | struct drm_mm stolen; |
920 | struct i915_gem_mm { |
740 | /** Memory allocator for GTT */ |
921 | /** Memory allocator for GTT stolen memory */ |
741 | struct drm_mm gtt_space; |
922 | struct drm_mm stolen; |
742 | /** List of all objects in gtt_space. Used to restore gtt |
923 | /** List of all objects in gtt_space. Used to restore gtt |
743 | * mappings on resume */ |
924 | * mappings on resume */ |
Line 750... | Line 931... | ||
750 | struct list_head unbound_list; |
931 | struct list_head unbound_list; |
Line 751... | Line 932... | ||
751 | 932 | ||
752 | /** Usable portion of the GTT for GEM */ |
933 | /** Usable portion of the GTT for GEM */ |
Line 753... | Line -... | ||
753 | unsigned long stolen_base; /* limited to low memory (32-bit) */ |
- | |
754 | - | ||
755 | int gtt_mtrr; |
934 | unsigned long stolen_base; /* limited to low memory (32-bit) */ |
756 | 935 | ||
Line 757... | Line 936... | ||
757 | /** PPGTT used for aliasing the PPGTT with the GTT */ |
936 | /** PPGTT used for aliasing the PPGTT with the GTT */ |
Line 758... | Line -... | ||
758 | struct i915_hw_ppgtt *aliasing_ppgtt; |
- | |
759 | - | ||
760 | bool shrinker_no_lock_stealing; |
- | |
761 | - | ||
762 | /** |
- | |
763 | * List of objects currently involved in rendering. |
- | |
764 | * |
- | |
765 | * Includes buffers having the contents of their GPU caches |
- | |
766 | * flushed, not necessarily primitives. last_rendering_seqno |
- | |
767 | * represents when the rendering involved will be completed. |
- | |
768 | * |
- | |
769 | * A reference is held on the buffer while on this list. |
- | |
770 | */ |
- | |
771 | struct list_head active_list; |
- | |
772 | - | ||
773 | /** |
- | |
774 | * LRU list of objects which are not in the ringbuffer and |
- | |
775 | * are ready to unbind, but are still in the GTT. |
- | |
776 | * |
- | |
777 | * last_rendering_seqno is 0 while an object is in this list. |
- | |
778 | * |
- | |
779 | * A reference is not held on the buffer while on this list, |
- | |
780 | * as merely being GTT-bound shouldn't prevent its being |
- | |
781 | * freed, and we'll pull it off the list in the free path. |
937 | struct i915_hw_ppgtt *aliasing_ppgtt; |
782 | */ |
938 | |
Line 783... | Line 939... | ||
783 | struct list_head inactive_list; |
939 | bool shrinker_no_lock_stealing; |
784 | 940 | ||
Line 798... | Line 954... | ||
798 | * Are we in a non-interruptible section of code like |
954 | * Are we in a non-interruptible section of code like |
799 | * modesetting? |
955 | * modesetting? |
800 | */ |
956 | */ |
801 | bool interruptible; |
957 | bool interruptible; |
Line 802... | Line -... | ||
802 | - | ||
803 | /** |
- | |
804 | * Flag if the X Server, and thus DRM, is not currently in |
- | |
805 | * control of the device. |
- | |
806 | * |
- | |
807 | * This is set between LeaveVT and EnterVT. It needs to be |
- | |
808 | * replaced with a semaphore. It also needs to be |
- | |
809 | * transitioned away from for kernel modesetting. |
- | |
810 | */ |
- | |
811 | int suspended; |
- | |
812 | 958 | ||
813 | /** Bit 6 swizzling required for X tiling */ |
959 | /** Bit 6 swizzling required for X tiling */ |
814 | uint32_t bit_6_swizzle_x; |
960 | uint32_t bit_6_swizzle_x; |
815 | /** Bit 6 swizzling required for Y tiling */ |
961 | /** Bit 6 swizzling required for Y tiling */ |
Line 816... | Line 962... | ||
816 | uint32_t bit_6_swizzle_y; |
962 | uint32_t bit_6_swizzle_y; |
817 | 963 | ||
Line 818... | Line 964... | ||
818 | /* storage for physical objects */ |
964 | /* storage for physical objects */ |
- | 965 | struct drm_i915_gem_phys_object *phys_objs[I915_MAX_PHYS_OBJECT]; |
|
819 | struct drm_i915_gem_phys_object *phys_objs[I915_MAX_PHYS_OBJECT]; |
966 | |
820 | 967 | /* accounting, useful for userland debugging */ |
|
821 | /* accounting, useful for userland debugging */ |
968 | spinlock_t object_stat_lock; |
Line -... | Line 969... | ||
- | 969 | size_t object_memory; |
|
- | 970 | u32 object_count; |
|
- | 971 | }; |
|
- | 972 | ||
- | 973 | struct drm_i915_error_state_buf { |
|
- | 974 | unsigned bytes; |
|
- | 975 | unsigned size; |
|
- | 976 | int err; |
|
- | 977 | u8 *buf; |
|
- | 978 | loff_t start; |
|
- | 979 | loff_t pos; |
|
- | 980 | }; |
|
- | 981 | ||
- | 982 | struct i915_error_state_file_priv { |
|
822 | size_t object_memory; |
983 | struct drm_device *dev; |
823 | u32 object_count; |
984 | struct drm_i915_error_state *error; |
824 | }; |
985 | }; |
825 | 986 | ||
826 | struct i915_gpu_error { |
987 | struct i915_gpu_error { |
827 | /* For hangcheck timer */ |
- | |
828 | #define DRM_I915_HANGCHECK_PERIOD 1500 /* in ms */ |
- | |
829 | #define DRM_I915_HANGCHECK_JIFFIES msecs_to_jiffies(DRM_I915_HANGCHECK_PERIOD) |
- | |
Line 830... | Line 988... | ||
830 | struct timer_list hangcheck_timer; |
988 | /* For hangcheck timer */ |
831 | int hangcheck_count; |
989 | #define DRM_I915_HANGCHECK_PERIOD 1500 /* in ms */ |
832 | uint32_t last_acthd[I915_NUM_RINGS]; |
990 | #define DRM_I915_HANGCHECK_JIFFIES msecs_to_jiffies(DRM_I915_HANGCHECK_PERIOD) |
833 | uint32_t prev_instdone[I915_NUM_INSTDONE_REG]; |
991 | struct timer_list hangcheck_timer; |
Line 884... | Line 1042... | ||
884 | MODESET_ON_LID_OPEN, |
1042 | MODESET_ON_LID_OPEN, |
885 | MODESET_DONE, |
1043 | MODESET_DONE, |
886 | MODESET_SUSPENDED, |
1044 | MODESET_SUSPENDED, |
887 | }; |
1045 | }; |
Line -... | Line 1046... | ||
- | 1046 | ||
- | 1047 | struct intel_vbt_data { |
|
- | 1048 | struct drm_display_mode *lfp_lvds_vbt_mode; /* if any */ |
|
- | 1049 | struct drm_display_mode *sdvo_lvds_vbt_mode; /* if any */ |
|
- | 1050 | ||
- | 1051 | /* Feature bits */ |
|
- | 1052 | unsigned int int_tv_support:1; |
|
- | 1053 | unsigned int lvds_dither:1; |
|
- | 1054 | unsigned int lvds_vbt:1; |
|
- | 1055 | unsigned int int_crt_support:1; |
|
- | 1056 | unsigned int lvds_use_ssc:1; |
|
- | 1057 | unsigned int display_clock_mode:1; |
|
- | 1058 | unsigned int fdi_rx_polarity_inverted:1; |
|
- | 1059 | int lvds_ssc_freq; |
|
- | 1060 | unsigned int bios_lvds_val; /* initial [PCH_]LVDS reg val in VBIOS */ |
|
- | 1061 | ||
- | 1062 | /* eDP */ |
|
- | 1063 | int edp_rate; |
|
- | 1064 | int edp_lanes; |
|
- | 1065 | int edp_preemphasis; |
|
- | 1066 | int edp_vswing; |
|
- | 1067 | bool edp_initialized; |
|
- | 1068 | bool edp_support; |
|
- | 1069 | int edp_bpp; |
|
- | 1070 | struct edp_power_seq edp_pps; |
|
- | 1071 | ||
- | 1072 | int crt_ddc_pin; |
|
- | 1073 | ||
- | 1074 | int child_dev_num; |
|
- | 1075 | struct child_device_config *child_dev; |
|
- | 1076 | }; |
|
- | 1077 | ||
- | 1078 | enum intel_ddb_partitioning { |
|
- | 1079 | INTEL_DDB_PART_1_2, |
|
- | 1080 | INTEL_DDB_PART_5_6, /* IVB+ */ |
|
- | 1081 | }; |
|
- | 1082 | ||
- | 1083 | struct intel_wm_level { |
|
- | 1084 | bool enable; |
|
- | 1085 | uint32_t pri_val; |
|
- | 1086 | uint32_t spr_val; |
|
- | 1087 | uint32_t cur_val; |
|
- | 1088 | uint32_t fbc_val; |
|
- | 1089 | }; |
|
- | 1090 | ||
- | 1091 | /* |
|
- | 1092 | * This struct tracks the state needed for the Package C8+ feature. |
|
- | 1093 | * |
|
- | 1094 | * Package states C8 and deeper are really deep PC states that can only be |
|
- | 1095 | * reached when all the devices on the system allow it, so even if the graphics |
|
- | 1096 | * device allows PC8+, it doesn't mean the system will actually get to these |
|
- | 1097 | * states. |
|
- | 1098 | * |
|
- | 1099 | * Our driver only allows PC8+ when all the outputs are disabled, the power well |
|
- | 1100 | * is disabled and the GPU is idle. When these conditions are met, we manually |
|
- | 1101 | * do the other conditions: disable the interrupts, clocks and switch LCPLL |
|
- | 1102 | * refclk to Fclk. |
|
- | 1103 | * |
|
- | 1104 | * When we really reach PC8 or deeper states (not just when we allow it) we lose |
|
- | 1105 | * the state of some registers, so when we come back from PC8+ we need to |
|
- | 1106 | * restore this state. We don't get into PC8+ if we're not in RC6, so we don't |
|
- | 1107 | * need to take care of the registers kept by RC6. |
|
- | 1108 | * |
|
- | 1109 | * The interrupt disabling is part of the requirements. We can only leave the |
|
- | 1110 | * PCH HPD interrupts enabled. If we're in PC8+ and we get another interrupt we |
|
- | 1111 | * can lock the machine. |
|
- | 1112 | * |
|
- | 1113 | * Ideally every piece of our code that needs PC8+ disabled would call |
|
- | 1114 | * hsw_disable_package_c8, which would increment disable_count and prevent the |
|
- | 1115 | * system from reaching PC8+. But we don't have a symmetric way to do this for |
|
- | 1116 | * everything, so we have the requirements_met and gpu_idle variables. When we |
|
- | 1117 | * switch requirements_met or gpu_idle to true we decrease disable_count, and |
|
- | 1118 | * increase it in the opposite case. The requirements_met variable is true when |
|
- | 1119 | * all the CRTCs, encoders and the power well are disabled. The gpu_idle |
|
- | 1120 | * variable is true when the GPU is idle. |
|
- | 1121 | * |
|
- | 1122 | * In addition to everything, we only actually enable PC8+ if disable_count |
|
- | 1123 | * stays at zero for at least some seconds. This is implemented with the |
|
- | 1124 | * enable_work variable. We do this so we don't enable/disable PC8 dozens of |
|
- | 1125 | * consecutive times when all screens are disabled and some background app |
|
- | 1126 | * queries the state of our connectors, or we have some application constantly |
|
- | 1127 | * waking up to use the GPU. Only after the enable_work function actually |
|
- | 1128 | * enables PC8+ the "enable" variable will become true, which means that it can |
|
- | 1129 | * be false even if disable_count is 0. |
|
- | 1130 | * |
|
- | 1131 | * The irqs_disabled variable becomes true exactly after we disable the IRQs and |
|
- | 1132 | * goes back to false exactly before we reenable the IRQs. We use this variable |
|
- | 1133 | * to check if someone is trying to enable/disable IRQs while they're supposed |
|
- | 1134 | * to be disabled. This shouldn't happen and we'll print some error messages in |
|
- | 1135 | * case it happens, but if it actually happens we'll also update the variables |
|
- | 1136 | * inside struct regsave so when we restore the IRQs they will contain the |
|
- | 1137 | * latest expected values. |
|
- | 1138 | * |
|
- | 1139 | * For more, read "Display Sequences for Package C8" on our documentation. |
|
- | 1140 | */ |
|
- | 1141 | struct i915_package_c8 { |
|
- | 1142 | bool requirements_met; |
|
- | 1143 | bool gpu_idle; |
|
- | 1144 | bool irqs_disabled; |
|
- | 1145 | /* Only true after the delayed work task actually enables it. */ |
|
- | 1146 | bool enabled; |
|
- | 1147 | int disable_count; |
|
- | 1148 | struct mutex lock; |
|
- | 1149 | struct delayed_work enable_work; |
|
- | 1150 | ||
- | 1151 | struct { |
|
- | 1152 | uint32_t deimr; |
|
- | 1153 | uint32_t sdeimr; |
|
- | 1154 | uint32_t gtimr; |
|
- | 1155 | uint32_t gtier; |
|
- | 1156 | uint32_t gen6_pmimr; |
|
- | 1157 | } regsave; |
|
- | 1158 | }; |
|
888 | 1159 | ||
889 | typedef struct drm_i915_private { |
1160 | typedef struct drm_i915_private { |
Line 890... | Line 1161... | ||
890 | struct drm_device *dev; |
1161 | struct drm_device *dev; |
Line 891... | Line 1162... | ||
891 | 1162 | ||
Line 892... | Line 1163... | ||
892 | const struct intel_device_info *info; |
1163 | const struct intel_device_info *info; |
Line 893... | Line 1164... | ||
893 | 1164 | ||
894 | int relative_constants_mode; |
- | |
895 | - | ||
896 | void __iomem *regs; |
- | |
897 | - | ||
898 | struct drm_i915_gt_funcs gt; |
- | |
899 | /** gt_fifo_count and the subsequent register write are synchronized |
- | |
900 | * with dev->struct_mutex. */ |
- | |
Line 901... | Line 1165... | ||
901 | unsigned gt_fifo_count; |
1165 | int relative_constants_mode; |
Line 902... | Line 1166... | ||
902 | /** forcewake_count is protected by gt_lock */ |
1166 | |
Line 937... | Line 1201... | ||
937 | struct mutex dpio_lock; |
1201 | struct mutex dpio_lock; |
Line 938... | Line 1202... | ||
938 | 1202 | ||
939 | /** Cached value of IMR to avoid reads in updating the bitfield */ |
1203 | /** Cached value of IMR to avoid reads in updating the bitfield */ |
940 | u32 irq_mask; |
1204 | u32 irq_mask; |
- | 1205 | u32 gt_irq_mask; |
|
Line 941... | Line 1206... | ||
941 | u32 gt_irq_mask; |
1206 | u32 pm_irq_mask; |
942 | 1207 | ||
943 | struct work_struct hotplug_work; |
1208 | struct work_struct hotplug_work; |
944 | bool enable_hotplug_processing; |
1209 | bool enable_hotplug_processing; |
Line 949... | Line 1214... | ||
949 | HPD_ENABLED = 0, |
1214 | HPD_ENABLED = 0, |
950 | HPD_DISABLED = 1, |
1215 | HPD_DISABLED = 1, |
951 | HPD_MARK_DISABLED = 2 |
1216 | HPD_MARK_DISABLED = 2 |
952 | } hpd_mark; |
1217 | } hpd_mark; |
953 | } hpd_stats[HPD_NUM_PINS]; |
1218 | } hpd_stats[HPD_NUM_PINS]; |
- | 1219 | u32 hpd_event_bits; |
|
Line 954... | Line -... | ||
954 | - | ||
955 | int num_pch_pll; |
1220 | |
Line 956... | Line -... | ||
956 | int num_plane; |
- | |
957 | - | ||
958 | unsigned long cfb_size; |
- | |
959 | unsigned int cfb_fb; |
- | |
960 | enum plane cfb_plane; |
1221 | int num_plane; |
961 | int cfb_y; |
- | |
962 | struct intel_fbc_work *fbc_work; |
1222 | |
- | 1223 | struct i915_fbc fbc; |
|
Line 963... | Line 1224... | ||
963 | 1224 | struct intel_opregion opregion; |
|
964 | struct intel_opregion opregion; |
1225 | struct intel_vbt_data vbt; |
965 | 1226 | ||
Line 966... | Line 1227... | ||
966 | /* overlay */ |
1227 | /* overlay */ |
967 | struct intel_overlay *overlay; |
1228 | struct intel_overlay *overlay; |
968 | unsigned int sprite_scaling_enabled; |
1229 | unsigned int sprite_scaling_enabled; |
969 | 1230 | ||
- | 1231 | /* backlight */ |
|
970 | /* backlight */ |
1232 | struct { |
971 | struct { |
1233 | int level; |
Line 972... | Line 1234... | ||
972 | int level; |
1234 | bool enabled; |
973 | bool enabled; |
- | |
974 | struct backlight_device *device; |
- | |
975 | } backlight; |
- | |
976 | - | ||
977 | /* LVDS info */ |
- | |
978 | struct drm_display_mode *lfp_lvds_vbt_mode; /* if any */ |
- | |
979 | struct drm_display_mode *sdvo_lvds_vbt_mode; /* if any */ |
- | |
980 | - | ||
981 | /* Feature bits from the VBIOS */ |
- | |
982 | unsigned int int_tv_support:1; |
- | |
983 | unsigned int lvds_dither:1; |
- | |
984 | unsigned int lvds_vbt:1; |
- | |
985 | unsigned int int_crt_support:1; |
- | |
986 | unsigned int lvds_use_ssc:1; |
- | |
987 | unsigned int display_clock_mode:1; |
- | |
988 | unsigned int fdi_rx_polarity_inverted:1; |
- | |
989 | int lvds_ssc_freq; |
- | |
990 | unsigned int bios_lvds_val; /* initial [PCH_]LVDS reg val in VBIOS */ |
- | |
991 | struct { |
- | |
992 | int rate; |
- | |
993 | int lanes; |
- | |
994 | int preemphasis; |
- | |
995 | int vswing; |
- | |
996 | - | ||
997 | bool initialized; |
1235 | spinlock_t lock; /* bl registers and the above bl fields */ |
Line 998... | Line -... | ||
998 | bool support; |
- | |
999 | int bpp; |
1236 | struct backlight_device *device; |
1000 | struct edp_power_seq pps; |
1237 | } backlight; |
1001 | } edp; |
1238 | |
Line 1002... | Line 1239... | ||
1002 | bool no_aux_handshake; |
1239 | /* LVDS info */ |
Line -... | Line 1240... | ||
- | 1240 | bool no_aux_handshake; |
|
- | 1241 | ||
- | 1242 | struct drm_i915_fence_reg fence_regs[I915_MAX_NUM_FENCES]; /* assume 965 */ |
|
- | 1243 | int fence_reg_start; /* 4 if userland hasn't ioctl'd us yet */ |
|
- | 1244 | int num_fence_regs; /* 8 on pre-965, 16 otherwise */ |
|
- | 1245 | ||
- | 1246 | unsigned int fsb_freq, mem_freq, is_ddr3; |
|
1003 | 1247 | ||
Line 1004... | Line 1248... | ||
1004 | int crt_ddc_pin; |
1248 | /** |
1005 | struct drm_i915_fence_reg fence_regs[I915_MAX_NUM_FENCES]; /* assume 965 */ |
1249 | * wq - Driver workqueue for GEM. |
Line 1020... | Line 1264... | ||
1020 | unsigned long quirks; |
1264 | unsigned long quirks; |
Line 1021... | Line 1265... | ||
1021 | 1265 | ||
1022 | enum modeset_restore modeset_restore; |
1266 | enum modeset_restore modeset_restore; |
Line -... | Line 1267... | ||
- | 1267 | struct mutex modeset_restore_lock; |
|
1023 | struct mutex modeset_restore_lock; |
1268 | |
Line 1024... | Line 1269... | ||
1024 | 1269 | struct list_head vm_list; /* Global list of all address spaces */ |
|
Line 1025... | Line 1270... | ||
1025 | struct i915_gtt gtt; |
1270 | struct i915_gtt gtt; /* VMA representing the global address space */ |
Line 1026... | Line 1271... | ||
1026 | 1271 | ||
1027 | struct i915_gem_mm mm; |
- | |
1028 | - | ||
1029 | /* Kernel Modesetting */ |
- | |
1030 | - | ||
Line 1031... | Line 1272... | ||
1031 | struct sdvo_device_mapping sdvo_mappings[2]; |
1272 | struct i915_gem_mm mm; |
1032 | /* indicate whether the LVDS_BORDER should be enabled or not */ |
1273 | |
1033 | unsigned int lvds_border_bits; |
1274 | /* Kernel Modesetting */ |
Line -... | Line 1275... | ||
- | 1275 | ||
1034 | /* Panel fitter placement and size for Ironlake+ */ |
1276 | struct sdvo_device_mapping sdvo_mappings[2]; |
1035 | u32 pch_pf_pos, pch_pf_size; |
1277 | |
Line 1036... | Line 1278... | ||
1036 | 1278 | struct drm_crtc *plane_to_crtc_mapping[3]; |
|
1037 | struct drm_crtc *plane_to_crtc_mapping[3]; |
1279 | struct drm_crtc *pipe_to_crtc_mapping[3]; |
1038 | struct drm_crtc *pipe_to_crtc_mapping[3]; |
1280 | wait_queue_head_t pending_flip_queue; |
1039 | wait_queue_head_t pending_flip_queue; |
1281 | |
1040 | 1282 | int num_shared_dpll; |
|
1041 | struct intel_pch_pll pch_plls[I915_NUM_PLLS]; |
1283 | struct intel_shared_dpll shared_dplls[I915_NUM_PLLS]; |
1042 | struct intel_ddi_plls ddi_plls; |
- | |
1043 | - | ||
Line 1044... | Line 1284... | ||
1044 | /* Reclocking support */ |
1284 | struct intel_ddi_plls ddi_plls; |
Line 1045... | Line 1285... | ||
1045 | bool render_reclock_avail; |
1285 | |
Line -... | Line 1286... | ||
- | 1286 | /* Reclocking support */ |
|
- | 1287 | bool render_reclock_avail; |
|
- | 1288 | bool lvds_downclock_avail; |
|
1046 | bool lvds_downclock_avail; |
1289 | /* indicates the reduced downclock for LVDS*/ |
1047 | /* indicates the reduced downclock for LVDS*/ |
1290 | int lvds_downclock; |
Line 1048... | Line 1291... | ||
1048 | int lvds_downclock; |
1291 | u16 orig_clock; |
1049 | u16 orig_clock; |
1292 | |
1050 | int child_dev_num; |
1293 | bool mchbar_need_disable; |
Line -... | Line 1294... | ||
- | 1294 | ||
1051 | struct child_device_config *child_dev; |
1295 | struct intel_l3_parity l3_parity; |
Line 1052... | Line 1296... | ||
1052 | 1296 | ||
1053 | bool mchbar_need_disable; |
- | |
Line 1054... | Line 1297... | ||
1054 | 1297 | /* Cannot be determined by PCIID. You must always read a register. */ |
|
Line -... | Line 1298... | ||
- | 1298 | size_t ellc_size; |
|
- | 1299 | ||
1055 | struct intel_l3_parity l3_parity; |
1300 | /* gen6+ rps state */ |
1056 | 1301 | struct intel_gen6_power_mgmt rps; |
|
Line 1057... | Line 1302... | ||
1057 | /* gen6+ rps state */ |
1302 | |
1058 | struct intel_gen6_power_mgmt rps; |
1303 | /* ilk-only ips/rps state. Everything in here is protected by the global |
Line 1085... | Line 1330... | ||
1085 | 1330 | ||
Line 1086... | Line 1331... | ||
1086 | u32 fdi_rx_config; |
1331 | u32 fdi_rx_config; |
Line -... | Line 1332... | ||
- | 1332 | ||
- | 1333 | struct i915_suspend_saved_registers regfile; |
|
- | 1334 | ||
- | 1335 | struct { |
|
- | 1336 | /* |
|
- | 1337 | * Raw watermark latency values: |
|
- | 1338 | * in 0.1us units for WM0, |
|
- | 1339 | * in 0.5us units for WM1+. |
|
- | 1340 | */ |
|
- | 1341 | /* primary */ |
|
- | 1342 | uint16_t pri_latency[5]; |
|
- | 1343 | /* sprite */ |
|
- | 1344 | uint16_t spr_latency[5]; |
|
- | 1345 | /* cursor */ |
|
- | 1346 | uint16_t cur_latency[5]; |
|
- | 1347 | } wm; |
|
1087 | 1348 | ||
1088 | struct i915_suspend_saved_registers regfile; |
1349 | struct i915_package_c8 pc8; |
1089 | 1350 | ||
- | 1351 | /* Old dri1 support infrastructure, beware the dragons ya fools entering |
|
- | 1352 | * here! */ |
|
1090 | /* Old dri1 support infrastructure, beware the dragons ya fools entering |
1353 | struct i915_dri1_state dri1; |
Line -... | Line 1354... | ||
- | 1354 | /* Old ums support infrastructure, same warning applies. */ |
|
- | 1355 | struct i915_ums_state ums; |
|
- | 1356 | } drm_i915_private_t; |
|
- | 1357 | ||
- | 1358 | static inline struct drm_i915_private *to_i915(const struct drm_device *dev) |
|
1091 | * here! */ |
1359 | { |
1092 | struct i915_dri1_state dri1; |
1360 | return dev->dev_private; |
1093 | } drm_i915_private_t; |
1361 | } |
1094 | 1362 | ||
Line 1102... | Line 1370... | ||
1102 | HDMI_AUDIO_OFF, /* force turn off HDMI audio */ |
1370 | HDMI_AUDIO_OFF, /* force turn off HDMI audio */ |
1103 | HDMI_AUDIO_AUTO, /* trust EDID */ |
1371 | HDMI_AUDIO_AUTO, /* trust EDID */ |
1104 | HDMI_AUDIO_ON, /* force turn on HDMI audio */ |
1372 | HDMI_AUDIO_ON, /* force turn on HDMI audio */ |
1105 | }; |
1373 | }; |
Line 1106... | Line 1374... | ||
1106 | 1374 | ||
Line 1107... | Line 1375... | ||
1107 | #define I915_GTT_RESERVED ((struct drm_mm_node *)0x1) |
1375 | #define I915_GTT_OFFSET_NONE ((u32)-1) |
1108 | 1376 | ||
1109 | struct drm_i915_gem_object_ops { |
1377 | struct drm_i915_gem_object_ops { |
1110 | /* Interface between the GEM object and its backing storage. |
1378 | /* Interface between the GEM object and its backing storage. |
Line 1127... | Line 1395... | ||
1127 | struct drm_i915_gem_object { |
1395 | struct drm_i915_gem_object { |
1128 | struct drm_gem_object base; |
1396 | struct drm_gem_object base; |
Line 1129... | Line 1397... | ||
1129 | 1397 | ||
Line 1130... | Line 1398... | ||
1130 | const struct drm_i915_gem_object_ops *ops; |
1398 | const struct drm_i915_gem_object_ops *ops; |
1131 | 1399 | ||
- | 1400 | /** List of VMAs backed by this object */ |
|
1132 | /** Current space allocated to this object in the GTT, if any. */ |
1401 | struct list_head vma_list; |
1133 | struct drm_mm_node *gtt_space; |
1402 | |
1134 | /** Stolen memory for this object, instead of being backed by shmem. */ |
1403 | /** Stolen memory for this object, instead of being backed by shmem. */ |
Line 1135... | Line -... | ||
1135 | struct drm_mm_node *stolen; |
- | |
1136 | struct list_head gtt_list; |
1404 | struct drm_mm_node *stolen; |
- | 1405 | struct list_head global_list; |
|
1137 | 1406 | ||
1138 | /** This object's place on the active/inactive lists */ |
1407 | struct list_head ring_list; |
1139 | struct list_head ring_list; |
1408 | /** Used in execbuf to temporarily hold a ref */ |
Line 1140... | Line 1409... | ||
1140 | struct list_head mm_list; |
1409 | struct list_head obj_exec_link; |
1141 | /** This object's place in the batchbuffer or on the eviction list */ |
1410 | /** This object's place in the batchbuffer or on the eviction list */ |
Line 1202... | Line 1471... | ||
1202 | * mappable by accident). Track pin and fault separate for a more |
1471 | * mappable by accident). Track pin and fault separate for a more |
1203 | * accurate mappable working set. |
1472 | * accurate mappable working set. |
1204 | */ |
1473 | */ |
1205 | unsigned int fault_mappable:1; |
1474 | unsigned int fault_mappable:1; |
1206 | unsigned int pin_mappable:1; |
1475 | unsigned int pin_mappable:1; |
- | 1476 | unsigned int pin_display:1; |
|
Line 1207... | Line 1477... | ||
1207 | 1477 | ||
1208 | /* |
1478 | /* |
1209 | * Is the GPU currently using a fence to access this buffer, |
1479 | * Is the GPU currently using a fence to access this buffer, |
1210 | */ |
1480 | */ |
1211 | unsigned int pending_fenced_gpu_access:1; |
1481 | unsigned int pending_fenced_gpu_access:1; |
Line 1212... | Line 1482... | ||
1212 | unsigned int fenced_gpu_access:1; |
1482 | unsigned int fenced_gpu_access:1; |
Line 1213... | Line 1483... | ||
1213 | 1483 | ||
1214 | unsigned int cache_level:2; |
1484 | unsigned int cache_level:3; |
1215 | 1485 | ||
Line 1229... | Line 1499... | ||
1229 | */ |
1499 | */ |
1230 | struct hlist_node exec_node; |
1500 | struct hlist_node exec_node; |
1231 | unsigned long exec_handle; |
1501 | unsigned long exec_handle; |
1232 | struct drm_i915_gem_exec_object2 *exec_entry; |
1502 | struct drm_i915_gem_exec_object2 *exec_entry; |
Line 1233... | Line -... | ||
1233 | - | ||
1234 | /** |
- | |
1235 | * Current offset of the object in GTT space. |
- | |
1236 | * |
- | |
1237 | * This is the same as gtt_space->start |
- | |
1238 | */ |
- | |
1239 | uint32_t gtt_offset; |
- | |
1240 | 1503 | ||
Line 1241... | Line 1504... | ||
1241 | struct intel_ring_buffer *ring; |
1504 | struct intel_ring_buffer *ring; |
1242 | 1505 | ||
1243 | /** Breadcrumb of last rendering to the buffer. */ |
1506 | /** Breadcrumb of last rendering to the buffer. */ |
Line 1278... | Line 1541... | ||
1278 | struct intel_ring_buffer *ring; |
1541 | struct intel_ring_buffer *ring; |
Line 1279... | Line 1542... | ||
1279 | 1542 | ||
1280 | /** GEM sequence number associated with this request. */ |
1543 | /** GEM sequence number associated with this request. */ |
Line -... | Line 1544... | ||
- | 1544 | uint32_t seqno; |
|
- | 1545 | ||
- | 1546 | /** Position in the ringbuffer of the start of the request */ |
|
1281 | uint32_t seqno; |
1547 | u32 head; |
1282 | 1548 | ||
Line -... | Line 1549... | ||
- | 1549 | /** Position in the ringbuffer of the end of the request */ |
|
- | 1550 | u32 tail; |
|
- | 1551 | ||
- | 1552 | /** Context related to this request */ |
|
- | 1553 | struct i915_hw_context *ctx; |
|
- | 1554 | ||
1283 | /** Postion in the ringbuffer of the end of the request */ |
1555 | /** Batch buffer related to this request if any */ |
1284 | u32 tail; |
1556 | struct drm_i915_gem_object *batch_obj; |
Line 1285... | Line 1557... | ||
1285 | 1557 | ||
1286 | /** Time at which this request was emitted, in jiffies. */ |
1558 | /** Time at which this request was emitted, in jiffies. */ |
Line 1298... | Line 1570... | ||
1298 | struct { |
1570 | struct { |
1299 | spinlock_t lock; |
1571 | spinlock_t lock; |
1300 | struct list_head request_list; |
1572 | struct list_head request_list; |
1301 | } mm; |
1573 | } mm; |
1302 | struct idr context_idr; |
1574 | struct idr context_idr; |
- | 1575 | ||
- | 1576 | struct i915_ctx_hang_stats hang_stats; |
|
1303 | }; |
1577 | }; |
Line 1304... | Line 1578... | ||
1304 | 1578 | ||
Line 1305... | Line 1579... | ||
1305 | #define INTEL_INFO(dev) (((struct drm_i915_private *) (dev)->dev_private)->info) |
1579 | #define INTEL_INFO(dev) (to_i915(dev)->info) |
1306 | 1580 | ||
1307 | #define IS_I830(dev) ((dev)->pci_device == 0x3577) |
1581 | #define IS_I830(dev) ((dev)->pci_device == 0x3577) |
1308 | #define IS_845G(dev) ((dev)->pci_device == 0x2562) |
1582 | #define IS_845G(dev) ((dev)->pci_device == 0x2562) |
Line 1318... | Line 1592... | ||
1318 | #define IS_G4X(dev) (INTEL_INFO(dev)->is_g4x) |
1592 | #define IS_G4X(dev) (INTEL_INFO(dev)->is_g4x) |
1319 | #define IS_PINEVIEW_G(dev) ((dev)->pci_device == 0xa001) |
1593 | #define IS_PINEVIEW_G(dev) ((dev)->pci_device == 0xa001) |
1320 | #define IS_PINEVIEW_M(dev) ((dev)->pci_device == 0xa011) |
1594 | #define IS_PINEVIEW_M(dev) ((dev)->pci_device == 0xa011) |
1321 | #define IS_PINEVIEW(dev) (INTEL_INFO(dev)->is_pineview) |
1595 | #define IS_PINEVIEW(dev) (INTEL_INFO(dev)->is_pineview) |
1322 | #define IS_G33(dev) (INTEL_INFO(dev)->is_g33) |
1596 | #define IS_G33(dev) (INTEL_INFO(dev)->is_g33) |
1323 | #define IS_IRONLAKE_D(dev) ((dev)->pci_device == 0x0042) |
- | |
1324 | #define IS_IRONLAKE_M(dev) ((dev)->pci_device == 0x0046) |
1597 | #define IS_IRONLAKE_M(dev) ((dev)->pci_device == 0x0046) |
1325 | #define IS_IVYBRIDGE(dev) (INTEL_INFO(dev)->is_ivybridge) |
1598 | #define IS_IVYBRIDGE(dev) (INTEL_INFO(dev)->is_ivybridge) |
1326 | #define IS_IVB_GT1(dev) ((dev)->pci_device == 0x0156 || \ |
1599 | #define IS_IVB_GT1(dev) ((dev)->pci_device == 0x0156 || \ |
1327 | (dev)->pci_device == 0x0152 || \ |
1600 | (dev)->pci_device == 0x0152 || \ |
1328 | (dev)->pci_device == 0x015a) |
1601 | (dev)->pci_device == 0x015a) |
Line 1330... | Line 1603... | ||
1330 | (dev)->pci_device == 0x0106 || \ |
1603 | (dev)->pci_device == 0x0106 || \ |
1331 | (dev)->pci_device == 0x010A) |
1604 | (dev)->pci_device == 0x010A) |
1332 | #define IS_VALLEYVIEW(dev) (INTEL_INFO(dev)->is_valleyview) |
1605 | #define IS_VALLEYVIEW(dev) (INTEL_INFO(dev)->is_valleyview) |
1333 | #define IS_HASWELL(dev) (INTEL_INFO(dev)->is_haswell) |
1606 | #define IS_HASWELL(dev) (INTEL_INFO(dev)->is_haswell) |
1334 | #define IS_MOBILE(dev) (INTEL_INFO(dev)->is_mobile) |
1607 | #define IS_MOBILE(dev) (INTEL_INFO(dev)->is_mobile) |
- | 1608 | #define IS_HSW_EARLY_SDV(dev) (IS_HASWELL(dev) && \ |
|
- | 1609 | ((dev)->pci_device & 0xFF00) == 0x0C00) |
|
1335 | #define IS_ULT(dev) (IS_HASWELL(dev) && \ |
1610 | #define IS_ULT(dev) (IS_HASWELL(dev) && \ |
1336 | ((dev)->pci_device & 0xFF00) == 0x0A00) |
1611 | ((dev)->pci_device & 0xFF00) == 0x0A00) |
Line 1337... | Line 1612... | ||
1337 | 1612 | ||
1338 | /* |
1613 | /* |
Line 1348... | Line 1623... | ||
1348 | #define IS_GEN6(dev) (INTEL_INFO(dev)->gen == 6) |
1623 | #define IS_GEN6(dev) (INTEL_INFO(dev)->gen == 6) |
1349 | #define IS_GEN7(dev) (INTEL_INFO(dev)->gen == 7) |
1624 | #define IS_GEN7(dev) (INTEL_INFO(dev)->gen == 7) |
Line 1350... | Line 1625... | ||
1350 | 1625 | ||
1351 | #define HAS_BSD(dev) (INTEL_INFO(dev)->has_bsd_ring) |
1626 | #define HAS_BSD(dev) (INTEL_INFO(dev)->has_bsd_ring) |
- | 1627 | #define HAS_BLT(dev) (INTEL_INFO(dev)->has_blt_ring) |
|
1352 | #define HAS_BLT(dev) (INTEL_INFO(dev)->has_blt_ring) |
1628 | #define HAS_VEBOX(dev) (INTEL_INFO(dev)->has_vebox_ring) |
- | 1629 | #define HAS_LLC(dev) (INTEL_INFO(dev)->has_llc) |
|
1353 | #define HAS_LLC(dev) (INTEL_INFO(dev)->has_llc) |
1630 | #define HAS_WT(dev) (IS_HASWELL(dev) && to_i915(dev)->ellc_size) |
Line 1354... | Line 1631... | ||
1354 | #define I915_NEED_GFX_HWS(dev) (INTEL_INFO(dev)->need_gfx_hws) |
1631 | #define I915_NEED_GFX_HWS(dev) (INTEL_INFO(dev)->need_gfx_hws) |
1355 | 1632 | ||
Line 1371... | Line 1648... | ||
1371 | #define SUPPORTS_INTEGRATED_HDMI(dev) (IS_G4X(dev) || IS_GEN5(dev)) |
1648 | #define SUPPORTS_INTEGRATED_HDMI(dev) (IS_G4X(dev) || IS_GEN5(dev)) |
1372 | #define SUPPORTS_INTEGRATED_DP(dev) (IS_G4X(dev) || IS_GEN5(dev)) |
1649 | #define SUPPORTS_INTEGRATED_DP(dev) (IS_G4X(dev) || IS_GEN5(dev)) |
1373 | #define SUPPORTS_EDP(dev) (IS_IRONLAKE_M(dev)) |
1650 | #define SUPPORTS_EDP(dev) (IS_IRONLAKE_M(dev)) |
1374 | #define SUPPORTS_TV(dev) (INTEL_INFO(dev)->supports_tv) |
1651 | #define SUPPORTS_TV(dev) (INTEL_INFO(dev)->supports_tv) |
1375 | #define I915_HAS_HOTPLUG(dev) (INTEL_INFO(dev)->has_hotplug) |
1652 | #define I915_HAS_HOTPLUG(dev) (INTEL_INFO(dev)->has_hotplug) |
1376 | /* dsparb controlled by hw only */ |
- | |
1377 | #define DSPARB_HWCONTROL(dev) (IS_G4X(dev) || IS_IRONLAKE(dev)) |
- | |
Line 1378... | Line 1653... | ||
1378 | 1653 | ||
1379 | #define HAS_FW_BLC(dev) (INTEL_INFO(dev)->gen > 2) |
1654 | #define HAS_FW_BLC(dev) (INTEL_INFO(dev)->gen > 2) |
1380 | #define HAS_PIPE_CXSR(dev) (INTEL_INFO(dev)->has_pipe_cxsr) |
1655 | #define HAS_PIPE_CXSR(dev) (INTEL_INFO(dev)->has_pipe_cxsr) |
Line 1381... | Line 1656... | ||
1381 | #define I915_HAS_FBC(dev) (INTEL_INFO(dev)->has_fbc) |
1656 | #define I915_HAS_FBC(dev) (INTEL_INFO(dev)->has_fbc) |
Line 1382... | Line 1657... | ||
1382 | 1657 | ||
1383 | #define HAS_PIPE_CONTROL(dev) (INTEL_INFO(dev)->gen >= 5) |
1658 | #define HAS_IPS(dev) (IS_ULT(dev)) |
- | 1659 | ||
Line 1384... | Line 1660... | ||
1384 | 1660 | #define HAS_DDI(dev) (INTEL_INFO(dev)->has_ddi) |
|
1385 | #define HAS_DDI(dev) (IS_HASWELL(dev)) |
1661 | #define HAS_POWER_WELL(dev) (IS_HASWELL(dev)) |
1386 | #define HAS_POWER_WELL(dev) (IS_HASWELL(dev)) |
1662 | #define HAS_FPGA_DBG_UNCLAIMED(dev) (INTEL_INFO(dev)->has_fpga_dbg) |
1387 | 1663 | ||
1388 | #define INTEL_PCH_DEVICE_ID_MASK 0xff00 |
1664 | #define INTEL_PCH_DEVICE_ID_MASK 0xff00 |
1389 | #define INTEL_PCH_IBX_DEVICE_ID_TYPE 0x3b00 |
1665 | #define INTEL_PCH_IBX_DEVICE_ID_TYPE 0x3b00 |
Line 1390... | Line 1666... | ||
1390 | #define INTEL_PCH_CPT_DEVICE_ID_TYPE 0x1c00 |
1666 | #define INTEL_PCH_CPT_DEVICE_ID_TYPE 0x1c00 |
1391 | #define INTEL_PCH_PPT_DEVICE_ID_TYPE 0x1e00 |
1667 | #define INTEL_PCH_PPT_DEVICE_ID_TYPE 0x1e00 |
1392 | #define INTEL_PCH_LPT_DEVICE_ID_TYPE 0x8c00 |
1668 | #define INTEL_PCH_LPT_DEVICE_ID_TYPE 0x8c00 |
1393 | #define INTEL_PCH_LPT_LP_DEVICE_ID_TYPE 0x9c00 |
1669 | #define INTEL_PCH_LPT_LP_DEVICE_ID_TYPE 0x9c00 |
1394 | 1670 | ||
1395 | #define INTEL_PCH_TYPE(dev) (((struct drm_i915_private *)(dev)->dev_private)->pch_type) |
1671 | #define INTEL_PCH_TYPE(dev) (to_i915(dev)->pch_type) |
Line 1438... | Line 1714... | ||
1438 | extern int i915_vbt_sdvo_panel_type __read_mostly; |
1714 | extern int i915_vbt_sdvo_panel_type __read_mostly; |
1439 | extern int i915_enable_rc6 __read_mostly; |
1715 | extern int i915_enable_rc6 __read_mostly; |
1440 | extern int i915_enable_fbc __read_mostly; |
1716 | extern int i915_enable_fbc __read_mostly; |
1441 | extern bool i915_enable_hangcheck __read_mostly; |
1717 | extern bool i915_enable_hangcheck __read_mostly; |
1442 | extern int i915_enable_ppgtt __read_mostly; |
1718 | extern int i915_enable_ppgtt __read_mostly; |
- | 1719 | extern int i915_enable_psr __read_mostly; |
|
1443 | extern unsigned int i915_preliminary_hw_support __read_mostly; |
1720 | extern unsigned int i915_preliminary_hw_support __read_mostly; |
1444 | extern int i915_disable_power_well __read_mostly; |
1721 | extern int i915_disable_power_well __read_mostly; |
- | 1722 | extern int i915_enable_ips __read_mostly; |
|
- | 1723 | extern bool i915_fastboot __read_mostly; |
|
- | 1724 | extern int i915_enable_pc8 __read_mostly; |
|
- | 1725 | extern int i915_pc8_timeout __read_mostly; |
|
- | 1726 | extern bool i915_prefault_disable __read_mostly; |
|
Line 1445... | Line 1727... | ||
1445 | 1727 | ||
1446 | extern int i915_master_create(struct drm_device *dev, struct drm_master *master); |
1728 | extern int i915_master_create(struct drm_device *dev, struct drm_master *master); |
Line 1447... | Line 1729... | ||
1447 | extern void i915_master_destroy(struct drm_device *dev, struct drm_master *master); |
1729 | extern void i915_master_destroy(struct drm_device *dev, struct drm_master *master); |
Line 1470... | Line 1752... | ||
1470 | extern unsigned long i915_chipset_val(struct drm_i915_private *dev_priv); |
1752 | extern unsigned long i915_chipset_val(struct drm_i915_private *dev_priv); |
1471 | extern unsigned long i915_mch_val(struct drm_i915_private *dev_priv); |
1753 | extern unsigned long i915_mch_val(struct drm_i915_private *dev_priv); |
1472 | extern unsigned long i915_gfx_val(struct drm_i915_private *dev_priv); |
1754 | extern unsigned long i915_gfx_val(struct drm_i915_private *dev_priv); |
1473 | extern void i915_update_gfx_val(struct drm_i915_private *dev_priv); |
1755 | extern void i915_update_gfx_val(struct drm_i915_private *dev_priv); |
Line -... | Line 1756... | ||
- | 1756 | ||
Line 1474... | Line 1757... | ||
1474 | 1757 | extern void intel_console_resume(struct work_struct *work); |
|
1475 | 1758 | ||
1476 | /* i915_irq.c */ |
1759 | /* i915_irq.c */ |
Line 1477... | Line 1760... | ||
1477 | void i915_hangcheck_elapsed(unsigned long data); |
1760 | void i915_queue_hangcheck(struct drm_device *dev); |
- | 1761 | void i915_handle_error(struct drm_device *dev, bool wedged); |
|
1478 | void i915_handle_error(struct drm_device *dev, bool wedged); |
1762 | |
1479 | 1763 | extern void intel_irq_init(struct drm_device *dev); |
|
1480 | extern void intel_irq_init(struct drm_device *dev); |
- | |
Line 1481... | Line 1764... | ||
1481 | extern void intel_hpd_init(struct drm_device *dev); |
1764 | extern void intel_pm_init(struct drm_device *dev); |
- | 1765 | extern void intel_hpd_init(struct drm_device *dev); |
|
- | 1766 | extern void intel_pm_init(struct drm_device *dev); |
|
- | 1767 | ||
- | 1768 | extern void intel_uncore_sanitize(struct drm_device *dev); |
|
Line 1482... | Line 1769... | ||
1482 | extern void intel_gt_init(struct drm_device *dev); |
1769 | extern void intel_uncore_early_sanitize(struct drm_device *dev); |
1483 | extern void intel_gt_reset(struct drm_device *dev); |
1770 | extern void intel_uncore_init(struct drm_device *dev); |
Line 1484... | Line 1771... | ||
1484 | 1771 | extern void intel_uncore_clear_errors(struct drm_device *dev); |
|
1485 | void i915_error_state_free(struct kref *error_ref); |
1772 | extern void intel_uncore_check_errors(struct drm_device *dev); |
Line 1486... | Line -... | ||
1486 | - | ||
1487 | void |
- | |
1488 | i915_enable_pipestat(drm_i915_private_t *dev_priv, int pipe, u32 mask); |
- | |
1489 | - | ||
1490 | void |
- | |
1491 | i915_disable_pipestat(drm_i915_private_t *dev_priv, int pipe, u32 mask); |
- | |
1492 | - | ||
1493 | void intel_enable_asle(struct drm_device *dev); |
- | |
1494 | - | ||
1495 | #ifdef CONFIG_DEBUG_FS |
1773 | |
1496 | extern void i915_destroy_error_state(struct drm_device *dev); |
1774 | void |
1497 | #else |
1775 | i915_enable_pipestat(drm_i915_private_t *dev_priv, int pipe, u32 mask); |
1498 | #define i915_destroy_error_state(x) |
1776 | |
1499 | #endif |
1777 | void |
Line 1553... | Line 1831... | ||
1553 | void i915_gem_object_init(struct drm_i915_gem_object *obj, |
1831 | void i915_gem_object_init(struct drm_i915_gem_object *obj, |
1554 | const struct drm_i915_gem_object_ops *ops); |
1832 | const struct drm_i915_gem_object_ops *ops); |
1555 | struct drm_i915_gem_object *i915_gem_alloc_object(struct drm_device *dev, |
1833 | struct drm_i915_gem_object *i915_gem_alloc_object(struct drm_device *dev, |
1556 | size_t size); |
1834 | size_t size); |
1557 | void i915_gem_free_object(struct drm_gem_object *obj); |
1835 | void i915_gem_free_object(struct drm_gem_object *obj); |
- | 1836 | struct i915_vma *i915_gem_vma_create(struct drm_i915_gem_object *obj, |
|
- | 1837 | struct i915_address_space *vm); |
|
- | 1838 | void i915_gem_vma_destroy(struct i915_vma *vma); |
|
Line 1558... | Line 1839... | ||
1558 | 1839 | ||
- | 1840 | int __must_check i915_gem_object_pin(struct drm_i915_gem_object *obj, |
|
1559 | int __must_check i915_gem_object_pin(struct drm_i915_gem_object *obj, |
1841 | struct i915_address_space *vm, |
1560 | uint32_t alignment, |
1842 | uint32_t alignment, |
1561 | bool map_and_fenceable, |
1843 | bool map_and_fenceable, |
1562 | bool nonblocking); |
1844 | bool nonblocking); |
- | 1845 | void i915_gem_object_unpin(struct drm_i915_gem_object *obj); |
|
1563 | void i915_gem_object_unpin(struct drm_i915_gem_object *obj); |
1846 | int __must_check i915_vma_unbind(struct i915_vma *vma); |
1564 | int __must_check i915_gem_object_unbind(struct drm_i915_gem_object *obj); |
1847 | int __must_check i915_gem_object_ggtt_unbind(struct drm_i915_gem_object *obj); |
1565 | int i915_gem_object_put_pages(struct drm_i915_gem_object *obj); |
1848 | int i915_gem_object_put_pages(struct drm_i915_gem_object *obj); |
1566 | void i915_gem_release_mmap(struct drm_i915_gem_object *obj); |
1849 | void i915_gem_release_mmap(struct drm_i915_gem_object *obj); |
Line 1567... | Line 1850... | ||
1567 | void i915_gem_lastclose(struct drm_device *dev); |
1850 | void i915_gem_lastclose(struct drm_device *dev); |
Line 1596... | Line 1879... | ||
1596 | int i915_gem_dumb_create(struct drm_file *file_priv, |
1879 | int i915_gem_dumb_create(struct drm_file *file_priv, |
1597 | struct drm_device *dev, |
1880 | struct drm_device *dev, |
1598 | struct drm_mode_create_dumb *args); |
1881 | struct drm_mode_create_dumb *args); |
1599 | int i915_gem_mmap_gtt(struct drm_file *file_priv, struct drm_device *dev, |
1882 | int i915_gem_mmap_gtt(struct drm_file *file_priv, struct drm_device *dev, |
1600 | uint32_t handle, uint64_t *offset); |
1883 | uint32_t handle, uint64_t *offset); |
1601 | int i915_gem_dumb_destroy(struct drm_file *file_priv, struct drm_device *dev, |
- | |
1602 | uint32_t handle); |
- | |
1603 | /** |
1884 | /** |
1604 | * Returns true if seq1 is later than seq2. |
1885 | * Returns true if seq1 is later than seq2. |
1605 | */ |
1886 | */ |
1606 | static inline bool |
1887 | static inline bool |
1607 | i915_seqno_passed(uint32_t seq1, uint32_t seq2) |
1888 | i915_seqno_passed(uint32_t seq1, uint32_t seq2) |
Line 1628... | Line 1909... | ||
1628 | static inline void |
1909 | static inline void |
1629 | i915_gem_object_unpin_fence(struct drm_i915_gem_object *obj) |
1910 | i915_gem_object_unpin_fence(struct drm_i915_gem_object *obj) |
1630 | { |
1911 | { |
1631 | if (obj->fence_reg != I915_FENCE_REG_NONE) { |
1912 | if (obj->fence_reg != I915_FENCE_REG_NONE) { |
1632 | struct drm_i915_private *dev_priv = obj->base.dev->dev_private; |
1913 | struct drm_i915_private *dev_priv = obj->base.dev->dev_private; |
- | 1914 | WARN_ON(dev_priv->fence_regs[obj->fence_reg].pin_count <= 0); |
|
1633 | dev_priv->fence_regs[obj->fence_reg].pin_count--; |
1915 | dev_priv->fence_regs[obj->fence_reg].pin_count--; |
1634 | } |
1916 | } |
1635 | } |
1917 | } |
Line 1636... | Line 1918... | ||
1636 | 1918 | ||
Line 1648... | Line 1930... | ||
1648 | { |
1930 | { |
1649 | return atomic_read(&error->reset_counter) == I915_WEDGED; |
1931 | return atomic_read(&error->reset_counter) == I915_WEDGED; |
1650 | } |
1932 | } |
Line 1651... | Line 1933... | ||
1651 | 1933 | ||
1652 | void i915_gem_reset(struct drm_device *dev); |
1934 | void i915_gem_reset(struct drm_device *dev); |
1653 | void i915_gem_clflush_object(struct drm_i915_gem_object *obj); |
- | |
1654 | int __must_check i915_gem_object_set_domain(struct drm_i915_gem_object *obj, |
- | |
1655 | uint32_t read_domains, |
- | |
1656 | uint32_t write_domain); |
1935 | bool i915_gem_clflush_object(struct drm_i915_gem_object *obj, bool force); |
1657 | int __must_check i915_gem_object_finish_gpu(struct drm_i915_gem_object *obj); |
1936 | int __must_check i915_gem_object_finish_gpu(struct drm_i915_gem_object *obj); |
1658 | int __must_check i915_gem_init(struct drm_device *dev); |
1937 | int __must_check i915_gem_init(struct drm_device *dev); |
1659 | int __must_check i915_gem_init_hw(struct drm_device *dev); |
1938 | int __must_check i915_gem_init_hw(struct drm_device *dev); |
1660 | void i915_gem_l3_remap(struct drm_device *dev); |
1939 | void i915_gem_l3_remap(struct drm_device *dev); |
1661 | void i915_gem_init_swizzling(struct drm_device *dev); |
1940 | void i915_gem_init_swizzling(struct drm_device *dev); |
1662 | void i915_gem_cleanup_ringbuffer(struct drm_device *dev); |
1941 | void i915_gem_cleanup_ringbuffer(struct drm_device *dev); |
1663 | int __must_check i915_gpu_idle(struct drm_device *dev); |
1942 | int __must_check i915_gpu_idle(struct drm_device *dev); |
1664 | int __must_check i915_gem_idle(struct drm_device *dev); |
1943 | int __must_check i915_gem_idle(struct drm_device *dev); |
1665 | int i915_add_request(struct intel_ring_buffer *ring, |
1944 | int __i915_add_request(struct intel_ring_buffer *ring, |
- | 1945 | struct drm_file *file, |
|
1666 | struct drm_file *file, |
1946 | struct drm_i915_gem_object *batch_obj, |
- | 1947 | u32 *seqno); |
|
- | 1948 | #define i915_add_request(ring, seqno) \ |
|
1667 | u32 *seqno); |
1949 | __i915_add_request(ring, NULL, NULL, seqno) |
1668 | int __must_check i915_wait_seqno(struct intel_ring_buffer *ring, |
1950 | int __must_check i915_wait_seqno(struct intel_ring_buffer *ring, |
1669 | uint32_t seqno); |
1951 | uint32_t seqno); |
1670 | int i915_gem_fault(struct vm_area_struct *vma, struct vm_fault *vmf); |
1952 | int i915_gem_fault(struct vm_area_struct *vma, struct vm_fault *vmf); |
1671 | int __must_check |
1953 | int __must_check |
Line 1675... | Line 1957... | ||
1675 | i915_gem_object_set_to_cpu_domain(struct drm_i915_gem_object *obj, bool write); |
1957 | i915_gem_object_set_to_cpu_domain(struct drm_i915_gem_object *obj, bool write); |
1676 | int __must_check |
1958 | int __must_check |
1677 | i915_gem_object_pin_to_display_plane(struct drm_i915_gem_object *obj, |
1959 | i915_gem_object_pin_to_display_plane(struct drm_i915_gem_object *obj, |
1678 | u32 alignment, |
1960 | u32 alignment, |
1679 | struct intel_ring_buffer *pipelined); |
1961 | struct intel_ring_buffer *pipelined); |
- | 1962 | void i915_gem_object_unpin_from_display_plane(struct drm_i915_gem_object *obj); |
|
1680 | int i915_gem_attach_phys_object(struct drm_device *dev, |
1963 | int i915_gem_attach_phys_object(struct drm_device *dev, |
1681 | struct drm_i915_gem_object *obj, |
1964 | struct drm_i915_gem_object *obj, |
1682 | int id, |
1965 | int id, |
1683 | int align); |
1966 | int align); |
1684 | void i915_gem_detach_phys_object(struct drm_device *dev, |
1967 | void i915_gem_detach_phys_object(struct drm_device *dev, |
Line 1693... | Line 1976... | ||
1693 | int tiling_mode, bool fenced); |
1976 | int tiling_mode, bool fenced); |
Line 1694... | Line 1977... | ||
1694 | 1977 | ||
1695 | int i915_gem_object_set_cache_level(struct drm_i915_gem_object *obj, |
1978 | int i915_gem_object_set_cache_level(struct drm_i915_gem_object *obj, |
Line -... | Line 1979... | ||
- | 1979 | enum i915_cache_level cache_level); |
|
- | 1980 | ||
Line 1696... | Line 1981... | ||
1696 | enum i915_cache_level cache_level); |
1981 | struct drm_gem_object *i915_gem_prime_import(struct drm_device *dev, |
1697 | 1982 | struct dma_buf *dma_buf); |
|
Line 1698... | Line 1983... | ||
1698 | 1983 | ||
Line -... | Line 1984... | ||
- | 1984 | struct dma_buf *i915_gem_prime_export(struct drm_device *dev, |
|
- | 1985 | struct drm_gem_object *gem_obj, int flags); |
|
- | 1986 | ||
- | 1987 | void i915_gem_restore_fences(struct drm_device *dev); |
|
- | 1988 | ||
- | 1989 | unsigned long i915_gem_obj_offset(struct drm_i915_gem_object *o, |
|
- | 1990 | struct i915_address_space *vm); |
|
- | 1991 | bool i915_gem_obj_bound_any(struct drm_i915_gem_object *o); |
|
- | 1992 | bool i915_gem_obj_bound(struct drm_i915_gem_object *o, |
|
- | 1993 | struct i915_address_space *vm); |
|
- | 1994 | unsigned long i915_gem_obj_size(struct drm_i915_gem_object *o, |
|
- | 1995 | struct i915_address_space *vm); |
|
- | 1996 | struct i915_vma *i915_gem_obj_to_vma(struct drm_i915_gem_object *obj, |
|
- | 1997 | struct i915_address_space *vm); |
|
- | 1998 | struct i915_vma * |
|
- | 1999 | i915_gem_obj_lookup_or_create_vma(struct drm_i915_gem_object *obj, |
|
- | 2000 | struct i915_address_space *vm); |
|
- | 2001 | /* Some GGTT VM helpers */ |
|
- | 2002 | #define obj_to_ggtt(obj) \ |
|
- | 2003 | (&((struct drm_i915_private *)(obj)->base.dev->dev_private)->gtt.base) |
|
- | 2004 | static inline bool i915_is_ggtt(struct i915_address_space *vm) |
|
- | 2005 | { |
|
- | 2006 | struct i915_address_space *ggtt = |
|
- | 2007 | &((struct drm_i915_private *)(vm)->dev->dev_private)->gtt.base; |
|
- | 2008 | return vm == ggtt; |
|
- | 2009 | } |
|
- | 2010 | ||
- | 2011 | static inline bool i915_gem_obj_ggtt_bound(struct drm_i915_gem_object *obj) |
|
- | 2012 | { |
|
- | 2013 | return i915_gem_obj_bound(obj, obj_to_ggtt(obj)); |
|
- | 2014 | } |
|
- | 2015 | ||
- | 2016 | static inline unsigned long |
|
- | 2017 | i915_gem_obj_ggtt_offset(struct drm_i915_gem_object *obj) |
|
- | 2018 | { |
|
- | 2019 | return i915_gem_obj_offset(obj, obj_to_ggtt(obj)); |
|
- | 2020 | } |
|
- | 2021 | ||
- | 2022 | static inline unsigned long |
|
- | 2023 | i915_gem_obj_ggtt_size(struct drm_i915_gem_object *obj) |
|
- | 2024 | { |
|
- | 2025 | return i915_gem_obj_size(obj, obj_to_ggtt(obj)); |
|
- | 2026 | } |
|
- | 2027 | ||
- | 2028 | static inline int __must_check |
|
- | 2029 | i915_gem_obj_ggtt_pin(struct drm_i915_gem_object *obj, |
|
- | 2030 | uint32_t alignment, |
|
- | 2031 | bool map_and_fenceable, |
|
- | 2032 | bool nonblocking) |
|
- | 2033 | { |
|
1699 | struct dma_buf *i915_gem_prime_export(struct drm_device *dev, |
2034 | return i915_gem_object_pin(obj, obj_to_ggtt(obj), alignment, |
1700 | struct drm_gem_object *gem_obj, int flags); |
2035 | map_and_fenceable, nonblocking); |
1701 | 2036 | } |
|
1702 | void i915_gem_restore_fences(struct drm_device *dev); |
2037 | #undef obj_to_ggtt |
1703 | 2038 | ||
1704 | /* i915_gem_context.c */ |
2039 | /* i915_gem_context.c */ |
- | 2040 | void i915_gem_context_init(struct drm_device *dev); |
|
- | 2041 | void i915_gem_context_fini(struct drm_device *dev); |
|
- | 2042 | void i915_gem_context_close(struct drm_device *dev, struct drm_file *file); |
|
- | 2043 | int i915_switch_context(struct intel_ring_buffer *ring, |
|
- | 2044 | struct drm_file *file, int to_id); |
|
- | 2045 | void i915_gem_context_free(struct kref *ctx_ref); |
|
- | 2046 | static inline void i915_gem_context_reference(struct i915_hw_context *ctx) |
|
- | 2047 | { |
|
- | 2048 | kref_get(&ctx->ref); |
|
- | 2049 | } |
|
- | 2050 | ||
- | 2051 | static inline void i915_gem_context_unreference(struct i915_hw_context *ctx) |
|
- | 2052 | { |
|
- | 2053 | kref_put(&ctx->ref, i915_gem_context_free); |
|
- | 2054 | } |
|
1705 | void i915_gem_context_init(struct drm_device *dev); |
2055 | |
1706 | void i915_gem_context_fini(struct drm_device *dev); |
2056 | struct i915_ctx_hang_stats * __must_check |
1707 | void i915_gem_context_close(struct drm_device *dev, struct drm_file *file); |
2057 | i915_gem_context_get_hang_stats(struct drm_device *dev, |
1708 | int i915_switch_context(struct intel_ring_buffer *ring, |
2058 | struct drm_file *file, |
Line 1736... | Line 2086... | ||
1736 | intel_gtt_chipset_flush(); |
2086 | intel_gtt_chipset_flush(); |
1737 | } |
2087 | } |
Line 1738... | Line 2088... | ||
1738 | 2088 | ||
1739 | 2089 | ||
- | 2090 | /* i915_gem_evict.c */ |
|
- | 2091 | int __must_check i915_gem_evict_something(struct drm_device *dev, |
|
1740 | /* i915_gem_evict.c */ |
2092 | struct i915_address_space *vm, |
1741 | int __must_check i915_gem_evict_something(struct drm_device *dev, int min_size, |
2093 | int min_size, |
1742 | unsigned alignment, |
2094 | unsigned alignment, |
1743 | unsigned cache_level, |
2095 | unsigned cache_level, |
1744 | bool mappable, |
2096 | bool mappable, |
Line 1758... | Line 2110... | ||
1758 | u32 gtt_offset, |
2110 | u32 gtt_offset, |
1759 | u32 size); |
2111 | u32 size); |
1760 | void i915_gem_object_release_stolen(struct drm_i915_gem_object *obj); |
2112 | void i915_gem_object_release_stolen(struct drm_i915_gem_object *obj); |
Line 1761... | Line 2113... | ||
1761 | 2113 | ||
1762 | /* i915_gem_tiling.c */ |
2114 | /* i915_gem_tiling.c */ |
1763 | inline static bool i915_gem_object_needs_bit17_swizzle(struct drm_i915_gem_object *obj) |
2115 | static inline bool i915_gem_object_needs_bit17_swizzle(struct drm_i915_gem_object *obj) |
1764 | { |
2116 | { |
Line 1765... | Line 2117... | ||
1765 | drm_i915_private_t *dev_priv = obj->base.dev->dev_private; |
2117 | drm_i915_private_t *dev_priv = obj->base.dev->dev_private; |
1766 | 2118 | ||
Line 1771... | Line 2123... | ||
1771 | void i915_gem_detect_bit_6_swizzle(struct drm_device *dev); |
2123 | void i915_gem_detect_bit_6_swizzle(struct drm_device *dev); |
1772 | void i915_gem_object_do_bit_17_swizzle(struct drm_i915_gem_object *obj); |
2124 | void i915_gem_object_do_bit_17_swizzle(struct drm_i915_gem_object *obj); |
1773 | void i915_gem_object_save_bit_17_swizzle(struct drm_i915_gem_object *obj); |
2125 | void i915_gem_object_save_bit_17_swizzle(struct drm_i915_gem_object *obj); |
Line 1774... | Line 2126... | ||
1774 | 2126 | ||
1775 | /* i915_gem_debug.c */ |
- | |
1776 | void i915_gem_dump_object(struct drm_i915_gem_object *obj, int len, |
- | |
1777 | const char *where, uint32_t mark); |
2127 | /* i915_gem_debug.c */ |
1778 | #if WATCH_LISTS |
2128 | #if WATCH_LISTS |
1779 | int i915_verify_lists(struct drm_device *dev); |
2129 | int i915_verify_lists(struct drm_device *dev); |
1780 | #else |
2130 | #else |
1781 | #define i915_verify_lists(dev) 0 |
2131 | #define i915_verify_lists(dev) 0 |
1782 | #endif |
- | |
1783 | void i915_gem_object_check_coherency(struct drm_i915_gem_object *obj, |
- | |
1784 | int handle); |
- | |
1785 | void i915_gem_dump_object(struct drm_i915_gem_object *obj, int len, |
- | |
Line 1786... | Line 2132... | ||
1786 | const char *where, uint32_t mark); |
2132 | #endif |
1787 | 2133 | ||
1788 | /* i915_debugfs.c */ |
2134 | /* i915_debugfs.c */ |
Line -... | Line 2135... | ||
- | 2135 | int i915_debugfs_init(struct drm_minor *minor); |
|
- | 2136 | void i915_debugfs_cleanup(struct drm_minor *minor); |
|
- | 2137 | ||
- | 2138 | /* i915_gpu_error.c */ |
|
- | 2139 | __printf(2, 3) |
|
- | 2140 | void i915_error_printf(struct drm_i915_error_state_buf *e, const char *f, ...); |
|
- | 2141 | int i915_error_state_to_str(struct drm_i915_error_state_buf *estr, |
|
- | 2142 | const struct i915_error_state_file_priv *error); |
|
- | 2143 | int i915_error_state_buf_init(struct drm_i915_error_state_buf *eb, |
|
- | 2144 | size_t count, loff_t pos); |
|
- | 2145 | static inline void i915_error_state_buf_release( |
|
- | 2146 | struct drm_i915_error_state_buf *eb) |
|
- | 2147 | { |
|
- | 2148 | kfree(eb->buf); |
|
- | 2149 | } |
|
- | 2150 | void i915_capture_error_state(struct drm_device *dev); |
|
- | 2151 | void i915_error_state_get(struct drm_device *dev, |
|
- | 2152 | struct i915_error_state_file_priv *error_priv); |
|
- | 2153 | void i915_error_state_put(struct i915_error_state_file_priv *error_priv); |
|
- | 2154 | void i915_destroy_error_state(struct drm_device *dev); |
|
- | 2155 | ||
1789 | int i915_debugfs_init(struct drm_minor *minor); |
2156 | void i915_get_extra_instdone(struct drm_device *dev, uint32_t *instdone); |
1790 | void i915_debugfs_cleanup(struct drm_minor *minor); |
2157 | const char *i915_cache_level_str(int type); |
1791 | 2158 | ||
Line 1792... | Line 2159... | ||
1792 | /* i915_suspend.c */ |
2159 | /* i915_suspend.c */ |
Line 1802... | Line 2169... | ||
1802 | void i915_teardown_sysfs(struct drm_device *dev_priv); |
2169 | void i915_teardown_sysfs(struct drm_device *dev_priv); |
Line 1803... | Line 2170... | ||
1803 | 2170 | ||
1804 | /* intel_i2c.c */ |
2171 | /* intel_i2c.c */ |
1805 | extern int intel_setup_gmbus(struct drm_device *dev); |
2172 | extern int intel_setup_gmbus(struct drm_device *dev); |
1806 | extern void intel_teardown_gmbus(struct drm_device *dev); |
2173 | extern void intel_teardown_gmbus(struct drm_device *dev); |
1807 | extern inline bool intel_gmbus_is_port_valid(unsigned port) |
2174 | static inline bool intel_gmbus_is_port_valid(unsigned port) |
1808 | { |
2175 | { |
1809 | return (port >= GMBUS_PORT_SSC && port <= GMBUS_PORT_DPD); |
2176 | return (port >= GMBUS_PORT_SSC && port <= GMBUS_PORT_DPD); |
Line 1810... | Line 2177... | ||
1810 | } |
2177 | } |
1811 | 2178 | ||
1812 | extern struct i2c_adapter *intel_gmbus_get_adapter( |
2179 | extern struct i2c_adapter *intel_gmbus_get_adapter( |
1813 | struct drm_i915_private *dev_priv, unsigned port); |
2180 | struct drm_i915_private *dev_priv, unsigned port); |
1814 | extern void intel_gmbus_set_speed(struct i2c_adapter *adapter, int speed); |
2181 | extern void intel_gmbus_set_speed(struct i2c_adapter *adapter, int speed); |
1815 | extern void intel_gmbus_force_bit(struct i2c_adapter *adapter, bool force_bit); |
2182 | extern void intel_gmbus_force_bit(struct i2c_adapter *adapter, bool force_bit); |
1816 | extern inline bool intel_gmbus_is_forced_bit(struct i2c_adapter *adapter) |
2183 | static inline bool intel_gmbus_is_forced_bit(struct i2c_adapter *adapter) |
1817 | { |
2184 | { |
1818 | return container_of(adapter, struct intel_gmbus, adapter)->force_bit; |
2185 | return container_of(adapter, struct intel_gmbus, adapter)->force_bit; |
Line 1823... | Line 2190... | ||
1823 | extern int intel_opregion_setup(struct drm_device *dev); |
2190 | extern int intel_opregion_setup(struct drm_device *dev); |
1824 | #ifdef CONFIG_ACPI |
2191 | #ifdef CONFIG_ACPI |
1825 | extern void intel_opregion_init(struct drm_device *dev); |
2192 | extern void intel_opregion_init(struct drm_device *dev); |
1826 | extern void intel_opregion_fini(struct drm_device *dev); |
2193 | extern void intel_opregion_fini(struct drm_device *dev); |
1827 | extern void intel_opregion_asle_intr(struct drm_device *dev); |
2194 | extern void intel_opregion_asle_intr(struct drm_device *dev); |
1828 | extern void intel_opregion_gse_intr(struct drm_device *dev); |
- | |
1829 | extern void intel_opregion_enable_asle(struct drm_device *dev); |
- | |
1830 | #else |
2195 | #else |
1831 | static inline void intel_opregion_init(struct drm_device *dev) { return; } |
2196 | static inline void intel_opregion_init(struct drm_device *dev) { return; } |
1832 | static inline void intel_opregion_fini(struct drm_device *dev) { return; } |
2197 | static inline void intel_opregion_fini(struct drm_device *dev) { return; } |
1833 | static inline void intel_opregion_asle_intr(struct drm_device *dev) { return; } |
2198 | static inline void intel_opregion_asle_intr(struct drm_device *dev) { return; } |
1834 | static inline void intel_opregion_gse_intr(struct drm_device *dev) { return; } |
- | |
1835 | static inline void intel_opregion_enable_asle(struct drm_device *dev) { return; } |
- | |
1836 | #endif |
2199 | #endif |
Line 1837... | Line 2200... | ||
1837 | 2200 | ||
1838 | /* intel_acpi.c */ |
2201 | /* intel_acpi.c */ |
1839 | #ifdef CONFIG_ACPI |
2202 | #ifdef CONFIG_ACPI |
Line 1844... | Line 2207... | ||
1844 | static inline void intel_unregister_dsm_handler(void) { return; } |
2207 | static inline void intel_unregister_dsm_handler(void) { return; } |
1845 | #endif /* CONFIG_ACPI */ |
2208 | #endif /* CONFIG_ACPI */ |
Line 1846... | Line 2209... | ||
1846 | 2209 | ||
1847 | /* modesetting */ |
2210 | /* modesetting */ |
- | 2211 | extern void intel_modeset_init_hw(struct drm_device *dev); |
|
1848 | extern void intel_modeset_init_hw(struct drm_device *dev); |
2212 | extern void intel_modeset_suspend_hw(struct drm_device *dev); |
1849 | extern void intel_modeset_init(struct drm_device *dev); |
2213 | extern void intel_modeset_init(struct drm_device *dev); |
1850 | extern void intel_modeset_gem_init(struct drm_device *dev); |
2214 | extern void intel_modeset_gem_init(struct drm_device *dev); |
1851 | extern void intel_modeset_cleanup(struct drm_device *dev); |
2215 | extern void intel_modeset_cleanup(struct drm_device *dev); |
1852 | extern int intel_modeset_vga_set_state(struct drm_device *dev, bool state); |
2216 | extern int intel_modeset_vga_set_state(struct drm_device *dev, bool state); |
Line 1856... | Line 2220... | ||
1856 | extern bool intel_fbc_enabled(struct drm_device *dev); |
2220 | extern bool intel_fbc_enabled(struct drm_device *dev); |
1857 | extern void intel_disable_fbc(struct drm_device *dev); |
2221 | extern void intel_disable_fbc(struct drm_device *dev); |
1858 | extern bool ironlake_set_drps(struct drm_device *dev, u8 val); |
2222 | extern bool ironlake_set_drps(struct drm_device *dev, u8 val); |
1859 | extern void intel_init_pch_refclk(struct drm_device *dev); |
2223 | extern void intel_init_pch_refclk(struct drm_device *dev); |
1860 | extern void gen6_set_rps(struct drm_device *dev, u8 val); |
2224 | extern void gen6_set_rps(struct drm_device *dev, u8 val); |
- | 2225 | extern void valleyview_set_rps(struct drm_device *dev, u8 val); |
|
- | 2226 | extern int valleyview_rps_max_freq(struct drm_i915_private *dev_priv); |
|
- | 2227 | extern int valleyview_rps_min_freq(struct drm_i915_private *dev_priv); |
|
1861 | extern void intel_detect_pch(struct drm_device *dev); |
2228 | extern void intel_detect_pch(struct drm_device *dev); |
1862 | extern int intel_trans_dp_port_sel(struct drm_crtc *crtc); |
2229 | extern int intel_trans_dp_port_sel(struct drm_crtc *crtc); |
1863 | extern int intel_enable_rc6(const struct drm_device *dev); |
2230 | extern int intel_enable_rc6(const struct drm_device *dev); |
Line 1864... | Line 2231... | ||
1864 | 2231 | ||
Line 1867... | Line 2234... | ||
1867 | struct drm_file *file); |
2234 | struct drm_file *file); |
Line 1868... | Line 2235... | ||
1868 | 2235 | ||
1869 | /* overlay */ |
2236 | /* overlay */ |
1870 | #ifdef CONFIG_DEBUG_FS |
2237 | #ifdef CONFIG_DEBUG_FS |
1871 | extern struct intel_overlay_error_state *intel_overlay_capture_error_state(struct drm_device *dev); |
2238 | extern struct intel_overlay_error_state *intel_overlay_capture_error_state(struct drm_device *dev); |
- | 2239 | extern void intel_overlay_print_error_state(struct drm_i915_error_state_buf *e, |
|
Line 1872... | Line 2240... | ||
1872 | extern void intel_overlay_print_error_state(struct seq_file *m, struct intel_overlay_error_state *error); |
2240 | struct intel_overlay_error_state *error); |
1873 | 2241 | ||
1874 | extern struct intel_display_error_state *intel_display_capture_error_state(struct drm_device *dev); |
2242 | extern struct intel_display_error_state *intel_display_capture_error_state(struct drm_device *dev); |
1875 | extern void intel_display_print_error_state(struct seq_file *m, |
2243 | extern void intel_display_print_error_state(struct drm_i915_error_state_buf *e, |
1876 | struct drm_device *dev, |
2244 | struct drm_device *dev, |
Line 1877... | Line 2245... | ||
1877 | struct intel_display_error_state *error); |
2245 | struct intel_display_error_state *error); |
1878 | #endif |
2246 | #endif |
1879 | 2247 | ||
1880 | /* On SNB platform, before reading ring registers forcewake bit |
2248 | /* On SNB platform, before reading ring registers forcewake bit |
1881 | * must be set to prevent GT core from power down and stale values being |
2249 | * must be set to prevent GT core from power down and stale values being |
1882 | * returned. |
2250 | * returned. |
1883 | */ |
- | |
Line 1884... | Line 2251... | ||
1884 | void gen6_gt_force_wake_get(struct drm_i915_private *dev_priv); |
2251 | */ |
1885 | void gen6_gt_force_wake_put(struct drm_i915_private *dev_priv); |
2252 | void gen6_gt_force_wake_get(struct drm_i915_private *dev_priv); |
1886 | int __gen6_gt_wait_for_fifo(struct drm_i915_private *dev_priv); |
- | |
1887 | - | ||
Line 1888... | Line 2253... | ||
1888 | int sandybridge_pcode_read(struct drm_i915_private *dev_priv, u8 mbox, u32 *val); |
2253 | void gen6_gt_force_wake_put(struct drm_i915_private *dev_priv); |
- | 2254 | ||
- | 2255 | int sandybridge_pcode_read(struct drm_i915_private *dev_priv, u8 mbox, u32 *val); |
|
- | 2256 | int sandybridge_pcode_write(struct drm_i915_private *dev_priv, u8 mbox, u32 val); |
|
1889 | int sandybridge_pcode_write(struct drm_i915_private *dev_priv, u8 mbox, u32 val); |
2257 | |
- | 2258 | /* intel_sideband.c */ |
|
- | 2259 | u32 vlv_punit_read(struct drm_i915_private *dev_priv, u8 addr); |
|
- | 2260 | void vlv_punit_write(struct drm_i915_private *dev_priv, u8 addr, u32 val); |
|
- | 2261 | u32 vlv_nc_read(struct drm_i915_private *dev_priv, u8 addr); |
|
- | 2262 | u32 vlv_dpio_read(struct drm_i915_private *dev_priv, int reg); |
|
- | 2263 | void vlv_dpio_write(struct drm_i915_private *dev_priv, int reg, u32 val); |
|
- | 2264 | u32 intel_sbi_read(struct drm_i915_private *dev_priv, u16 reg, |
|
- | 2265 | enum intel_sbi_destination destination); |
|
1890 | int valleyview_punit_read(struct drm_i915_private *dev_priv, u8 addr, u32 *val); |
2266 | void intel_sbi_write(struct drm_i915_private *dev_priv, u16 reg, u32 value, |
- | 2267 | enum intel_sbi_destination destination); |
|
- | 2268 | ||
1891 | int valleyview_punit_write(struct drm_i915_private *dev_priv, u8 addr, u32 val); |
2269 | int vlv_gpu_freq(int ddr_freq, int val); |
1892 | 2270 | int vlv_freq_opcode(int ddr_freq, int val); |
|
1893 | #define __i915_read(x, y) \ |
2271 | |
1894 | u##x i915_read##x(struct drm_i915_private *dev_priv, u32 reg); |
2272 | #define __i915_read(x) \ |
1895 | 2273 | u##x i915_read##x(struct drm_i915_private *dev_priv, u32 reg, bool trace); |
|
Line 1896... | Line 2274... | ||
1896 | __i915_read(8, b) |
2274 | __i915_read(8) |
1897 | __i915_read(16, w) |
2275 | __i915_read(16) |
1898 | __i915_read(32, l) |
- | |
1899 | __i915_read(64, q) |
2276 | __i915_read(32) |
1900 | #undef __i915_read |
2277 | __i915_read(64) |
1901 | 2278 | #undef __i915_read |
|
1902 | #define __i915_write(x, y) \ |
2279 | |
1903 | void i915_write##x(struct drm_i915_private *dev_priv, u32 reg, u##x val); |
2280 | #define __i915_write(x) \ |
Line 1904... | Line 2281... | ||
1904 | 2281 | void i915_write##x(struct drm_i915_private *dev_priv, u32 reg, u##x val, bool trace); |
|
1905 | __i915_write(8, b) |
2282 | __i915_write(8) |
Line 1906... | Line 2283... | ||
1906 | __i915_write(16, w) |
2283 | __i915_write(16) |
1907 | __i915_write(32, l) |
2284 | __i915_write(32) |
1908 | __i915_write(64, q) |
2285 | __i915_write(64) |
1909 | #undef __i915_write |
2286 | #undef __i915_write |
1910 | 2287 | ||
1911 | #define I915_READ8(reg) i915_read8(dev_priv, (reg)) |
2288 | #define I915_READ8(reg) i915_read8(dev_priv, (reg), true) |
1912 | #define I915_WRITE8(reg, val) i915_write8(dev_priv, (reg), (val)) |
2289 | #define I915_WRITE8(reg, val) i915_write8(dev_priv, (reg), (val), true) |
1913 | 2290 | ||
1914 | #define I915_READ16(reg) i915_read16(dev_priv, (reg)) |
2291 | #define I915_READ16(reg) i915_read16(dev_priv, (reg), true) |
Line 1915... | Line 2292... | ||
1915 | #define I915_WRITE16(reg, val) i915_write16(dev_priv, (reg), (val)) |
2292 | #define I915_WRITE16(reg, val) i915_write16(dev_priv, (reg), (val), true) |
1916 | #define I915_READ16_NOTRACE(reg) readw(dev_priv->regs + (reg)) |
2293 | #define I915_READ16_NOTRACE(reg) i915_read16(dev_priv, (reg), false) |
Line 1917... | Line 2294... | ||
1917 | #define I915_WRITE16_NOTRACE(reg, val) writew(val, dev_priv->regs + (reg)) |
2294 | #define I915_WRITE16_NOTRACE(reg, val) i915_write16(dev_priv, (reg), (val), false) |
1918 | 2295 | ||
Line 1919... | Line 2296... | ||
1919 | #define I915_READ(reg) i915_read32(dev_priv, (reg)) |
2296 | #define I915_READ(reg) i915_read32(dev_priv, (reg), true) |