diff options
Diffstat (limited to 'drivers/gpu/drm/i915/i915_drv.h')
-rw-r--r-- | drivers/gpu/drm/i915/i915_drv.h | 80 |
1 files changed, 57 insertions, 23 deletions
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index a725f6591192..fbecac72f5bb 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h | |||
@@ -170,6 +170,8 @@ struct drm_i915_display_funcs { | |||
170 | /* clock gating init */ | 170 | /* clock gating init */ |
171 | }; | 171 | }; |
172 | 172 | ||
173 | struct intel_overlay; | ||
174 | |||
173 | typedef struct drm_i915_private { | 175 | typedef struct drm_i915_private { |
174 | struct drm_device *dev; | 176 | struct drm_device *dev; |
175 | 177 | ||
@@ -187,6 +189,7 @@ typedef struct drm_i915_private { | |||
187 | unsigned int status_gfx_addr; | 189 | unsigned int status_gfx_addr; |
188 | drm_local_map_t hws_map; | 190 | drm_local_map_t hws_map; |
189 | struct drm_gem_object *hws_obj; | 191 | struct drm_gem_object *hws_obj; |
192 | struct drm_gem_object *pwrctx; | ||
190 | 193 | ||
191 | struct resource mch_res; | 194 | struct resource mch_res; |
192 | 195 | ||
@@ -206,11 +209,13 @@ typedef struct drm_i915_private { | |||
206 | /** Cached value of IMR to avoid reads in updating the bitfield */ | 209 | /** Cached value of IMR to avoid reads in updating the bitfield */ |
207 | u32 irq_mask_reg; | 210 | u32 irq_mask_reg; |
208 | u32 pipestat[2]; | 211 | u32 pipestat[2]; |
209 | /** splitted irq regs for graphics and display engine on IGDNG, | 212 | /** splitted irq regs for graphics and display engine on Ironlake, |
210 | irq_mask_reg is still used for display irq. */ | 213 | irq_mask_reg is still used for display irq. */ |
211 | u32 gt_irq_mask_reg; | 214 | u32 gt_irq_mask_reg; |
212 | u32 gt_irq_enable_reg; | 215 | u32 gt_irq_enable_reg; |
213 | u32 de_irq_enable_reg; | 216 | u32 de_irq_enable_reg; |
217 | u32 pch_irq_mask_reg; | ||
218 | u32 pch_irq_enable_reg; | ||
214 | 219 | ||
215 | u32 hotplug_supported_mask; | 220 | u32 hotplug_supported_mask; |
216 | struct work_struct hotplug_work; | 221 | struct work_struct hotplug_work; |
@@ -240,6 +245,9 @@ typedef struct drm_i915_private { | |||
240 | 245 | ||
241 | struct intel_opregion opregion; | 246 | struct intel_opregion opregion; |
242 | 247 | ||
248 | /* overlay */ | ||
249 | struct intel_overlay *overlay; | ||
250 | |||
243 | /* LVDS info */ | 251 | /* LVDS info */ |
244 | int backlight_duty_cycle; /* restore backlight to this value */ | 252 | int backlight_duty_cycle; /* restore backlight to this value */ |
245 | bool panel_wants_dither; | 253 | bool panel_wants_dither; |
@@ -258,7 +266,7 @@ typedef struct drm_i915_private { | |||
258 | 266 | ||
259 | struct notifier_block lid_notifier; | 267 | struct notifier_block lid_notifier; |
260 | 268 | ||
261 | int crt_ddc_bus; /* -1 = unknown, else GPIO to use for CRT DDC */ | 269 | int crt_ddc_bus; /* 0 = unknown, else GPIO to use for CRT DDC */ |
262 | struct drm_i915_fence_reg fence_regs[16]; /* assume 965 */ | 270 | struct drm_i915_fence_reg fence_regs[16]; /* assume 965 */ |
263 | int fence_reg_start; /* 4 if userland hasn't ioctl'd us yet */ | 271 | int fence_reg_start; /* 4 if userland hasn't ioctl'd us yet */ |
264 | int num_fence_regs; /* 8 on pre-965, 16 otherwise */ | 272 | int num_fence_regs; /* 8 on pre-965, 16 otherwise */ |
@@ -280,6 +288,7 @@ typedef struct drm_i915_private { | |||
280 | u32 saveDSPBCNTR; | 288 | u32 saveDSPBCNTR; |
281 | u32 saveDSPARB; | 289 | u32 saveDSPARB; |
282 | u32 saveRENDERSTANDBY; | 290 | u32 saveRENDERSTANDBY; |
291 | u32 savePWRCTXA; | ||
283 | u32 saveHWS; | 292 | u32 saveHWS; |
284 | u32 savePIPEACONF; | 293 | u32 savePIPEACONF; |
285 | u32 savePIPEBCONF; | 294 | u32 savePIPEBCONF; |
@@ -374,8 +383,6 @@ typedef struct drm_i915_private { | |||
374 | u32 saveFDI_RXA_IMR; | 383 | u32 saveFDI_RXA_IMR; |
375 | u32 saveFDI_RXB_IMR; | 384 | u32 saveFDI_RXB_IMR; |
376 | u32 saveCACHE_MODE_0; | 385 | u32 saveCACHE_MODE_0; |
377 | u32 saveD_STATE; | ||
378 | u32 saveDSPCLK_GATE_D; | ||
379 | u32 saveMI_ARB_STATE; | 386 | u32 saveMI_ARB_STATE; |
380 | u32 saveSWF0[16]; | 387 | u32 saveSWF0[16]; |
381 | u32 saveSWF1[16]; | 388 | u32 saveSWF1[16]; |
@@ -539,13 +546,21 @@ typedef struct drm_i915_private { | |||
539 | /* indicate whether the LVDS_BORDER should be enabled or not */ | 546 | /* indicate whether the LVDS_BORDER should be enabled or not */ |
540 | unsigned int lvds_border_bits; | 547 | unsigned int lvds_border_bits; |
541 | 548 | ||
549 | struct drm_crtc *plane_to_crtc_mapping[2]; | ||
550 | struct drm_crtc *pipe_to_crtc_mapping[2]; | ||
551 | wait_queue_head_t pending_flip_queue; | ||
552 | |||
542 | /* Reclocking support */ | 553 | /* Reclocking support */ |
543 | bool render_reclock_avail; | 554 | bool render_reclock_avail; |
544 | bool lvds_downclock_avail; | 555 | bool lvds_downclock_avail; |
556 | /* indicates the reduced downclock for LVDS*/ | ||
557 | int lvds_downclock; | ||
545 | struct work_struct idle_work; | 558 | struct work_struct idle_work; |
546 | struct timer_list idle_timer; | 559 | struct timer_list idle_timer; |
547 | bool busy; | 560 | bool busy; |
548 | u16 orig_clock; | 561 | u16 orig_clock; |
562 | int child_dev_num; | ||
563 | struct child_device_config *child_dev; | ||
549 | } drm_i915_private_t; | 564 | } drm_i915_private_t; |
550 | 565 | ||
551 | /** driver private structure attached to each drm_gem_object */ | 566 | /** driver private structure attached to each drm_gem_object */ |
@@ -638,6 +653,13 @@ struct drm_i915_gem_object { | |||
638 | * Advice: are the backing pages purgeable? | 653 | * Advice: are the backing pages purgeable? |
639 | */ | 654 | */ |
640 | int madv; | 655 | int madv; |
656 | |||
657 | /** | ||
658 | * Number of crtcs where this object is currently the fb, but | ||
659 | * will be page flipped away on the next vblank. When it | ||
660 | * reaches 0, dev_priv->pending_flip_queue will be woken up. | ||
661 | */ | ||
662 | atomic_t pending_flip; | ||
641 | }; | 663 | }; |
642 | 664 | ||
643 | /** | 665 | /** |
@@ -738,6 +760,8 @@ i915_enable_pipestat(drm_i915_private_t *dev_priv, int pipe, u32 mask); | |||
738 | void | 760 | void |
739 | i915_disable_pipestat(drm_i915_private_t *dev_priv, int pipe, u32 mask); | 761 | i915_disable_pipestat(drm_i915_private_t *dev_priv, int pipe, u32 mask); |
740 | 762 | ||
763 | void intel_enable_asle (struct drm_device *dev); | ||
764 | |||
741 | 765 | ||
742 | /* i915_mem.c */ | 766 | /* i915_mem.c */ |
743 | extern int i915_mem_alloc(struct drm_device *dev, void *data, | 767 | extern int i915_mem_alloc(struct drm_device *dev, void *data, |
@@ -813,6 +837,9 @@ void i915_gem_cleanup_ringbuffer(struct drm_device *dev); | |||
813 | int i915_gem_do_init(struct drm_device *dev, unsigned long start, | 837 | int i915_gem_do_init(struct drm_device *dev, unsigned long start, |
814 | unsigned long end); | 838 | unsigned long end); |
815 | int i915_gem_idle(struct drm_device *dev); | 839 | int i915_gem_idle(struct drm_device *dev); |
840 | uint32_t i915_add_request(struct drm_device *dev, struct drm_file *file_priv, | ||
841 | uint32_t flush_domains); | ||
842 | int i915_do_wait_request(struct drm_device *dev, uint32_t seqno, int interruptible); | ||
816 | int i915_gem_fault(struct vm_area_struct *vma, struct vm_fault *vmf); | 843 | int i915_gem_fault(struct vm_area_struct *vma, struct vm_fault *vmf); |
817 | int i915_gem_object_set_to_gtt_domain(struct drm_gem_object *obj, | 844 | int i915_gem_object_set_to_gtt_domain(struct drm_gem_object *obj, |
818 | int write); | 845 | int write); |
@@ -824,6 +851,7 @@ void i915_gem_free_all_phys_object(struct drm_device *dev); | |||
824 | int i915_gem_object_get_pages(struct drm_gem_object *obj); | 851 | int i915_gem_object_get_pages(struct drm_gem_object *obj); |
825 | void i915_gem_object_put_pages(struct drm_gem_object *obj); | 852 | void i915_gem_object_put_pages(struct drm_gem_object *obj); |
826 | void i915_gem_release(struct drm_device * dev, struct drm_file *file_priv); | 853 | void i915_gem_release(struct drm_device * dev, struct drm_file *file_priv); |
854 | void i915_gem_object_flush_write_domain(struct drm_gem_object *obj); | ||
827 | 855 | ||
828 | void i915_gem_shrinker_init(void); | 856 | void i915_gem_shrinker_init(void); |
829 | void i915_gem_shrinker_exit(void); | 857 | void i915_gem_shrinker_exit(void); |
@@ -863,11 +891,13 @@ extern int i915_restore_state(struct drm_device *dev); | |||
863 | extern int intel_opregion_init(struct drm_device *dev, int resume); | 891 | extern int intel_opregion_init(struct drm_device *dev, int resume); |
864 | extern void intel_opregion_free(struct drm_device *dev, int suspend); | 892 | extern void intel_opregion_free(struct drm_device *dev, int suspend); |
865 | extern void opregion_asle_intr(struct drm_device *dev); | 893 | extern void opregion_asle_intr(struct drm_device *dev); |
894 | extern void ironlake_opregion_gse_intr(struct drm_device *dev); | ||
866 | extern void opregion_enable_asle(struct drm_device *dev); | 895 | extern void opregion_enable_asle(struct drm_device *dev); |
867 | #else | 896 | #else |
868 | static inline int intel_opregion_init(struct drm_device *dev, int resume) { return 0; } | 897 | static inline int intel_opregion_init(struct drm_device *dev, int resume) { return 0; } |
869 | static inline void intel_opregion_free(struct drm_device *dev, int suspend) { return; } | 898 | static inline void intel_opregion_free(struct drm_device *dev, int suspend) { return; } |
870 | static inline void opregion_asle_intr(struct drm_device *dev) { return; } | 899 | static inline void opregion_asle_intr(struct drm_device *dev) { return; } |
900 | static inline void ironlake_opregion_gse_intr(struct drm_device *dev) { return; } | ||
871 | static inline void opregion_enable_asle(struct drm_device *dev) { return; } | 901 | static inline void opregion_enable_asle(struct drm_device *dev) { return; } |
872 | #endif | 902 | #endif |
873 | 903 | ||
@@ -955,8 +985,8 @@ extern int i915_wait_ring(struct drm_device * dev, int n, const char *caller); | |||
955 | #define IS_I830(dev) ((dev)->pci_device == 0x3577) | 985 | #define IS_I830(dev) ((dev)->pci_device == 0x3577) |
956 | #define IS_845G(dev) ((dev)->pci_device == 0x2562) | 986 | #define IS_845G(dev) ((dev)->pci_device == 0x2562) |
957 | #define IS_I85X(dev) ((dev)->pci_device == 0x3582) | 987 | #define IS_I85X(dev) ((dev)->pci_device == 0x3582) |
958 | #define IS_I855(dev) ((dev)->pci_device == 0x3582) | ||
959 | #define IS_I865G(dev) ((dev)->pci_device == 0x2572) | 988 | #define IS_I865G(dev) ((dev)->pci_device == 0x2572) |
989 | #define IS_I8XX(dev) (IS_I830(dev) || IS_845G(dev) || IS_I85X(dev) || IS_I865G(dev)) | ||
960 | 990 | ||
961 | #define IS_I915G(dev) ((dev)->pci_device == 0x2582 || (dev)->pci_device == 0x258a) | 991 | #define IS_I915G(dev) ((dev)->pci_device == 0x2582 || (dev)->pci_device == 0x258a) |
962 | #define IS_I915GM(dev) ((dev)->pci_device == 0x2592) | 992 | #define IS_I915GM(dev) ((dev)->pci_device == 0x2592) |
@@ -990,47 +1020,51 @@ extern int i915_wait_ring(struct drm_device * dev, int n, const char *caller); | |||
990 | (dev)->pci_device == 0x2E42 || \ | 1020 | (dev)->pci_device == 0x2E42 || \ |
991 | IS_GM45(dev)) | 1021 | IS_GM45(dev)) |
992 | 1022 | ||
993 | #define IS_IGDG(dev) ((dev)->pci_device == 0xa001) | 1023 | #define IS_PINEVIEW_G(dev) ((dev)->pci_device == 0xa001) |
994 | #define IS_IGDGM(dev) ((dev)->pci_device == 0xa011) | 1024 | #define IS_PINEVIEW_M(dev) ((dev)->pci_device == 0xa011) |
995 | #define IS_IGD(dev) (IS_IGDG(dev) || IS_IGDGM(dev)) | 1025 | #define IS_PINEVIEW(dev) (IS_PINEVIEW_G(dev) || IS_PINEVIEW_M(dev)) |
996 | 1026 | ||
997 | #define IS_G33(dev) ((dev)->pci_device == 0x29C2 || \ | 1027 | #define IS_G33(dev) ((dev)->pci_device == 0x29C2 || \ |
998 | (dev)->pci_device == 0x29B2 || \ | 1028 | (dev)->pci_device == 0x29B2 || \ |
999 | (dev)->pci_device == 0x29D2 || \ | 1029 | (dev)->pci_device == 0x29D2 || \ |
1000 | (IS_IGD(dev))) | 1030 | (IS_PINEVIEW(dev))) |
1001 | 1031 | ||
1002 | #define IS_IGDNG_D(dev) ((dev)->pci_device == 0x0042) | 1032 | #define IS_IRONLAKE_D(dev) ((dev)->pci_device == 0x0042) |
1003 | #define IS_IGDNG_M(dev) ((dev)->pci_device == 0x0046) | 1033 | #define IS_IRONLAKE_M(dev) ((dev)->pci_device == 0x0046) |
1004 | #define IS_IGDNG(dev) (IS_IGDNG_D(dev) || IS_IGDNG_M(dev)) | 1034 | #define IS_IRONLAKE(dev) (IS_IRONLAKE_D(dev) || IS_IRONLAKE_M(dev)) |
1005 | 1035 | ||
1006 | #define IS_I9XX(dev) (IS_I915G(dev) || IS_I915GM(dev) || IS_I945G(dev) || \ | 1036 | #define IS_I9XX(dev) (IS_I915G(dev) || IS_I915GM(dev) || IS_I945G(dev) || \ |
1007 | IS_I945GM(dev) || IS_I965G(dev) || IS_G33(dev) || \ | 1037 | IS_I945GM(dev) || IS_I965G(dev) || IS_G33(dev) || \ |
1008 | IS_IGDNG(dev)) | 1038 | IS_IRONLAKE(dev)) |
1009 | 1039 | ||
1010 | #define IS_MOBILE(dev) (IS_I830(dev) || IS_I85X(dev) || IS_I915GM(dev) || \ | 1040 | #define IS_MOBILE(dev) (IS_I830(dev) || IS_I85X(dev) || IS_I915GM(dev) || \ |
1011 | IS_I945GM(dev) || IS_I965GM(dev) || IS_GM45(dev) || \ | 1041 | IS_I945GM(dev) || IS_I965GM(dev) || IS_GM45(dev) || \ |
1012 | IS_IGD(dev) || IS_IGDNG_M(dev)) | 1042 | IS_PINEVIEW(dev) || IS_IRONLAKE_M(dev)) |
1013 | 1043 | ||
1014 | #define I915_NEED_GFX_HWS(dev) (IS_G33(dev) || IS_GM45(dev) || IS_G4X(dev) || \ | 1044 | #define I915_NEED_GFX_HWS(dev) (IS_G33(dev) || IS_GM45(dev) || IS_G4X(dev) || \ |
1015 | IS_IGDNG(dev)) | 1045 | IS_IRONLAKE(dev)) |
1016 | /* With the 945 and later, Y tiling got adjusted so that it was 32 128-byte | 1046 | /* With the 945 and later, Y tiling got adjusted so that it was 32 128-byte |
1017 | * rows, which changed the alignment requirements and fence programming. | 1047 | * rows, which changed the alignment requirements and fence programming. |
1018 | */ | 1048 | */ |
1019 | #define HAS_128_BYTE_Y_TILING(dev) (IS_I9XX(dev) && !(IS_I915G(dev) || \ | 1049 | #define HAS_128_BYTE_Y_TILING(dev) (IS_I9XX(dev) && !(IS_I915G(dev) || \ |
1020 | IS_I915GM(dev))) | 1050 | IS_I915GM(dev))) |
1021 | #define SUPPORTS_INTEGRATED_HDMI(dev) (IS_G4X(dev) || IS_IGDNG(dev)) | 1051 | #define SUPPORTS_DIGITAL_OUTPUTS(dev) (IS_I9XX(dev) && !IS_PINEVIEW(dev)) |
1022 | #define SUPPORTS_INTEGRATED_DP(dev) (IS_G4X(dev) || IS_IGDNG(dev)) | 1052 | #define SUPPORTS_INTEGRATED_HDMI(dev) (IS_G4X(dev) || IS_IRONLAKE(dev)) |
1023 | #define SUPPORTS_EDP(dev) (IS_IGDNG_M(dev)) | 1053 | #define SUPPORTS_INTEGRATED_DP(dev) (IS_G4X(dev) || IS_IRONLAKE(dev)) |
1054 | #define SUPPORTS_EDP(dev) (IS_IRONLAKE_M(dev)) | ||
1055 | #define SUPPORTS_TV(dev) (IS_I9XX(dev) && IS_MOBILE(dev) && \ | ||
1056 | !IS_IRONLAKE(dev) && !IS_PINEVIEW(dev)) | ||
1024 | #define I915_HAS_HOTPLUG(dev) (IS_I945G(dev) || IS_I945GM(dev) || IS_G33(dev) || IS_I965G(dev)) | 1057 | #define I915_HAS_HOTPLUG(dev) (IS_I945G(dev) || IS_I945GM(dev) || IS_G33(dev) || IS_I965G(dev)) |
1025 | /* dsparb controlled by hw only */ | 1058 | /* dsparb controlled by hw only */ |
1026 | #define DSPARB_HWCONTROL(dev) (IS_G4X(dev) || IS_IGDNG(dev)) | 1059 | #define DSPARB_HWCONTROL(dev) (IS_G4X(dev) || IS_IRONLAKE(dev)) |
1027 | 1060 | ||
1028 | #define HAS_FW_BLC(dev) (IS_I9XX(dev) || IS_G4X(dev) || IS_IGDNG(dev)) | 1061 | #define HAS_FW_BLC(dev) (IS_I9XX(dev) || IS_G4X(dev) || IS_IRONLAKE(dev)) |
1029 | #define HAS_PIPE_CXSR(dev) (IS_G4X(dev) || IS_IGDNG(dev)) | 1062 | #define HAS_PIPE_CXSR(dev) (IS_G4X(dev) || IS_IRONLAKE(dev)) |
1030 | #define I915_HAS_FBC(dev) (IS_MOBILE(dev) && \ | 1063 | #define I915_HAS_FBC(dev) (IS_MOBILE(dev) && \ |
1031 | (IS_I9XX(dev) || IS_GM45(dev)) && \ | 1064 | (IS_I9XX(dev) || IS_GM45(dev)) && \ |
1032 | !IS_IGD(dev) && \ | 1065 | !IS_PINEVIEW(dev) && \ |
1033 | !IS_IGDNG(dev)) | 1066 | !IS_IRONLAKE(dev)) |
1067 | #define I915_HAS_RC6(dev) (IS_I965GM(dev) || IS_GM45(dev) || IS_IRONLAKE_M(dev)) | ||
1034 | 1068 | ||
1035 | #define PRIMARY_RINGBUFFER_SIZE (128*1024) | 1069 | #define PRIMARY_RINGBUFFER_SIZE (128*1024) |
1036 | 1070 | ||