aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/i915_drv.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/i915/i915_drv.h')
-rw-r--r--drivers/gpu/drm/i915/i915_drv.h274
1 files changed, 193 insertions, 81 deletions
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index a725f6591192..6e4790065d9e 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -150,7 +150,27 @@ struct drm_i915_error_state {
150 u32 instps; 150 u32 instps;
151 u32 instdone1; 151 u32 instdone1;
152 u32 seqno; 152 u32 seqno;
153 u64 bbaddr;
153 struct timeval time; 154 struct timeval time;
155 struct drm_i915_error_object {
156 int page_count;
157 u32 gtt_offset;
158 u32 *pages[0];
159 } *ringbuffer, *batchbuffer[2];
160 struct drm_i915_error_buffer {
161 size_t size;
162 u32 name;
163 u32 seqno;
164 u32 gtt_offset;
165 u32 read_domains;
166 u32 write_domain;
167 u32 fence_reg;
168 s32 pinned:2;
169 u32 tiling:2;
170 u32 dirty:1;
171 u32 purgeable:1;
172 } *active_bo;
173 u32 active_bo_count;
154}; 174};
155 175
156struct drm_i915_display_funcs { 176struct drm_i915_display_funcs {
@@ -170,9 +190,43 @@ struct drm_i915_display_funcs {
170 /* clock gating init */ 190 /* clock gating init */
171}; 191};
172 192
193struct intel_overlay;
194
195struct intel_device_info {
196 u8 is_mobile : 1;
197 u8 is_i8xx : 1;
198 u8 is_i85x : 1;
199 u8 is_i915g : 1;
200 u8 is_i9xx : 1;
201 u8 is_i945gm : 1;
202 u8 is_i965g : 1;
203 u8 is_i965gm : 1;
204 u8 is_g33 : 1;
205 u8 need_gfx_hws : 1;
206 u8 is_g4x : 1;
207 u8 is_pineview : 1;
208 u8 is_ironlake : 1;
209 u8 is_gen6 : 1;
210 u8 has_fbc : 1;
211 u8 has_rc6 : 1;
212 u8 has_pipe_cxsr : 1;
213 u8 has_hotplug : 1;
214 u8 cursor_needs_physical : 1;
215};
216
217enum no_fbc_reason {
218 FBC_STOLEN_TOO_SMALL, /* not enough space to hold compressed buffers */
219 FBC_UNSUPPORTED_MODE, /* interlace or doublescanned mode */
220 FBC_MODE_TOO_LARGE, /* mode too large for compression */
221 FBC_BAD_PLANE, /* fbc not supported on plane */
222 FBC_NOT_TILED, /* buffer not tiled */
223};
224
173typedef struct drm_i915_private { 225typedef struct drm_i915_private {
174 struct drm_device *dev; 226 struct drm_device *dev;
175 227
228 const struct intel_device_info *info;
229
176 int has_gem; 230 int has_gem;
177 231
178 void __iomem *regs; 232 void __iomem *regs;
@@ -182,11 +236,15 @@ typedef struct drm_i915_private {
182 236
183 drm_dma_handle_t *status_page_dmah; 237 drm_dma_handle_t *status_page_dmah;
184 void *hw_status_page; 238 void *hw_status_page;
239 void *seqno_page;
185 dma_addr_t dma_status_page; 240 dma_addr_t dma_status_page;
186 uint32_t counter; 241 uint32_t counter;
187 unsigned int status_gfx_addr; 242 unsigned int status_gfx_addr;
243 unsigned int seqno_gfx_addr;
188 drm_local_map_t hws_map; 244 drm_local_map_t hws_map;
189 struct drm_gem_object *hws_obj; 245 struct drm_gem_object *hws_obj;
246 struct drm_gem_object *seqno_obj;
247 struct drm_gem_object *pwrctx;
190 248
191 struct resource mch_res; 249 struct resource mch_res;
192 250
@@ -206,11 +264,13 @@ typedef struct drm_i915_private {
206 /** Cached value of IMR to avoid reads in updating the bitfield */ 264 /** Cached value of IMR to avoid reads in updating the bitfield */
207 u32 irq_mask_reg; 265 u32 irq_mask_reg;
208 u32 pipestat[2]; 266 u32 pipestat[2];
209 /** splitted irq regs for graphics and display engine on IGDNG, 267 /** splitted irq regs for graphics and display engine on Ironlake,
210 irq_mask_reg is still used for display irq. */ 268 irq_mask_reg is still used for display irq. */
211 u32 gt_irq_mask_reg; 269 u32 gt_irq_mask_reg;
212 u32 gt_irq_enable_reg; 270 u32 gt_irq_enable_reg;
213 u32 de_irq_enable_reg; 271 u32 de_irq_enable_reg;
272 u32 pch_irq_mask_reg;
273 u32 pch_irq_enable_reg;
214 274
215 u32 hotplug_supported_mask; 275 u32 hotplug_supported_mask;
216 struct work_struct hotplug_work; 276 struct work_struct hotplug_work;
@@ -227,8 +287,6 @@ typedef struct drm_i915_private {
227 int hangcheck_count; 287 int hangcheck_count;
228 uint32_t last_acthd; 288 uint32_t last_acthd;
229 289
230 bool cursor_needs_physical;
231
232 struct drm_mm vram; 290 struct drm_mm vram;
233 291
234 unsigned long cfb_size; 292 unsigned long cfb_size;
@@ -240,6 +298,9 @@ typedef struct drm_i915_private {
240 298
241 struct intel_opregion opregion; 299 struct intel_opregion opregion;
242 300
301 /* overlay */
302 struct intel_overlay *overlay;
303
243 /* LVDS info */ 304 /* LVDS info */
244 int backlight_duty_cycle; /* restore backlight to this value */ 305 int backlight_duty_cycle; /* restore backlight to this value */
245 bool panel_wants_dither; 306 bool panel_wants_dither;
@@ -255,10 +316,11 @@ typedef struct drm_i915_private {
255 unsigned int lvds_use_ssc:1; 316 unsigned int lvds_use_ssc:1;
256 unsigned int edp_support:1; 317 unsigned int edp_support:1;
257 int lvds_ssc_freq; 318 int lvds_ssc_freq;
319 int edp_bpp;
258 320
259 struct notifier_block lid_notifier; 321 struct notifier_block lid_notifier;
260 322
261 int crt_ddc_bus; /* -1 = unknown, else GPIO to use for CRT DDC */ 323 int crt_ddc_bus; /* 0 = unknown, else GPIO to use for CRT DDC */
262 struct drm_i915_fence_reg fence_regs[16]; /* assume 965 */ 324 struct drm_i915_fence_reg fence_regs[16]; /* assume 965 */
263 int fence_reg_start; /* 4 if userland hasn't ioctl'd us yet */ 325 int fence_reg_start; /* 4 if userland hasn't ioctl'd us yet */
264 int num_fence_regs; /* 8 on pre-965, 16 otherwise */ 326 int num_fence_regs; /* 8 on pre-965, 16 otherwise */
@@ -279,7 +341,6 @@ typedef struct drm_i915_private {
279 u32 saveDSPACNTR; 341 u32 saveDSPACNTR;
280 u32 saveDSPBCNTR; 342 u32 saveDSPBCNTR;
281 u32 saveDSPARB; 343 u32 saveDSPARB;
282 u32 saveRENDERSTANDBY;
283 u32 saveHWS; 344 u32 saveHWS;
284 u32 savePIPEACONF; 345 u32 savePIPEACONF;
285 u32 savePIPEBCONF; 346 u32 savePIPEBCONF;
@@ -374,8 +435,6 @@ typedef struct drm_i915_private {
374 u32 saveFDI_RXA_IMR; 435 u32 saveFDI_RXA_IMR;
375 u32 saveFDI_RXB_IMR; 436 u32 saveFDI_RXB_IMR;
376 u32 saveCACHE_MODE_0; 437 u32 saveCACHE_MODE_0;
377 u32 saveD_STATE;
378 u32 saveDSPCLK_GATE_D;
379 u32 saveMI_ARB_STATE; 438 u32 saveMI_ARB_STATE;
380 u32 saveSWF0[16]; 439 u32 saveSWF0[16];
381 u32 saveSWF1[16]; 440 u32 saveSWF1[16];
@@ -426,6 +485,7 @@ typedef struct drm_i915_private {
426 u32 savePIPEB_DATA_N1; 485 u32 savePIPEB_DATA_N1;
427 u32 savePIPEB_LINK_M1; 486 u32 savePIPEB_LINK_M1;
428 u32 savePIPEB_LINK_N1; 487 u32 savePIPEB_LINK_N1;
488 u32 saveMCHBAR_RENDER_STANDBY;
429 489
430 struct { 490 struct {
431 struct drm_mm gtt_space; 491 struct drm_mm gtt_space;
@@ -467,6 +527,15 @@ typedef struct drm_i915_private {
467 struct list_head flushing_list; 527 struct list_head flushing_list;
468 528
469 /** 529 /**
530 * List of objects currently pending a GPU write flush.
531 *
532 * All elements on this list will belong to either the
533 * active_list or flushing_list, last_rendering_seqno can
534 * be used to differentiate between the two elements.
535 */
536 struct list_head gpu_write_list;
537
538 /**
470 * LRU list of objects which are not in the ringbuffer and 539 * LRU list of objects which are not in the ringbuffer and
471 * are ready to unbind, but are still in the GTT. 540 * are ready to unbind, but are still in the GTT.
472 * 541 *
@@ -539,13 +608,35 @@ typedef struct drm_i915_private {
539 /* indicate whether the LVDS_BORDER should be enabled or not */ 608 /* indicate whether the LVDS_BORDER should be enabled or not */
540 unsigned int lvds_border_bits; 609 unsigned int lvds_border_bits;
541 610
611 struct drm_crtc *plane_to_crtc_mapping[2];
612 struct drm_crtc *pipe_to_crtc_mapping[2];
613 wait_queue_head_t pending_flip_queue;
614
542 /* Reclocking support */ 615 /* Reclocking support */
543 bool render_reclock_avail; 616 bool render_reclock_avail;
544 bool lvds_downclock_avail; 617 bool lvds_downclock_avail;
618 /* indicate whether the LVDS EDID is OK */
619 bool lvds_edid_good;
620 /* indicates the reduced downclock for LVDS*/
621 int lvds_downclock;
545 struct work_struct idle_work; 622 struct work_struct idle_work;
546 struct timer_list idle_timer; 623 struct timer_list idle_timer;
547 bool busy; 624 bool busy;
548 u16 orig_clock; 625 u16 orig_clock;
626 int child_dev_num;
627 struct child_device_config *child_dev;
628 struct drm_connector *int_lvds_connector;
629
630 bool mchbar_need_disable;
631
632 u8 cur_delay;
633 u8 min_delay;
634 u8 max_delay;
635
636 enum no_fbc_reason no_fbc_reason;
637
638 struct drm_mm_node *compressed_fb;
639 struct drm_mm_node *compressed_llb;
549} drm_i915_private_t; 640} drm_i915_private_t;
550 641
551/** driver private structure attached to each drm_gem_object */ 642/** driver private structure attached to each drm_gem_object */
@@ -557,6 +648,8 @@ struct drm_i915_gem_object {
557 648
558 /** This object's place on the active/flushing/inactive lists */ 649 /** This object's place on the active/flushing/inactive lists */
559 struct list_head list; 650 struct list_head list;
651 /** This object's place on GPU write list */
652 struct list_head gpu_write_list;
560 653
561 /** This object's place on the fenced object LRU */ 654 /** This object's place on the fenced object LRU */
562 struct list_head fence_list; 655 struct list_head fence_list;
@@ -638,8 +731,17 @@ struct drm_i915_gem_object {
638 * Advice: are the backing pages purgeable? 731 * Advice: are the backing pages purgeable?
639 */ 732 */
640 int madv; 733 int madv;
734
735 /**
736 * Number of crtcs where this object is currently the fb, but
737 * will be page flipped away on the next vblank. When it
738 * reaches 0, dev_priv->pending_flip_queue will be woken up.
739 */
740 atomic_t pending_flip;
641}; 741};
642 742
743#define to_intel_bo(x) ((struct drm_i915_gem_object *) (x)->driver_private)
744
643/** 745/**
644 * Request queue structure. 746 * Request queue structure.
645 * 747 *
@@ -681,7 +783,10 @@ extern struct drm_ioctl_desc i915_ioctls[];
681extern int i915_max_ioctl; 783extern int i915_max_ioctl;
682extern unsigned int i915_fbpercrtc; 784extern unsigned int i915_fbpercrtc;
683extern unsigned int i915_powersave; 785extern unsigned int i915_powersave;
786extern unsigned int i915_lvds_downclock;
684 787
788extern int i915_suspend(struct drm_device *dev, pm_message_t state);
789extern int i915_resume(struct drm_device *dev);
685extern void i915_save_display(struct drm_device *dev); 790extern void i915_save_display(struct drm_device *dev);
686extern void i915_restore_display(struct drm_device *dev); 791extern void i915_restore_display(struct drm_device *dev);
687extern int i915_master_create(struct drm_device *dev, struct drm_master *master); 792extern int i915_master_create(struct drm_device *dev, struct drm_master *master);
@@ -707,6 +812,7 @@ extern int i965_reset(struct drm_device *dev, u8 flags);
707 812
708/* i915_irq.c */ 813/* i915_irq.c */
709void i915_hangcheck_elapsed(unsigned long data); 814void i915_hangcheck_elapsed(unsigned long data);
815void i915_destroy_error_state(struct drm_device *dev);
710extern int i915_irq_emit(struct drm_device *dev, void *data, 816extern int i915_irq_emit(struct drm_device *dev, void *data,
711 struct drm_file *file_priv); 817 struct drm_file *file_priv);
712extern int i915_irq_wait(struct drm_device *dev, void *data, 818extern int i915_irq_wait(struct drm_device *dev, void *data,
@@ -738,6 +844,8 @@ i915_enable_pipestat(drm_i915_private_t *dev_priv, int pipe, u32 mask);
738void 844void
739i915_disable_pipestat(drm_i915_private_t *dev_priv, int pipe, u32 mask); 845i915_disable_pipestat(drm_i915_private_t *dev_priv, int pipe, u32 mask);
740 846
847void intel_enable_asle (struct drm_device *dev);
848
741 849
742/* i915_mem.c */ 850/* i915_mem.c */
743extern int i915_mem_alloc(struct drm_device *dev, void *data, 851extern int i915_mem_alloc(struct drm_device *dev, void *data,
@@ -770,6 +878,8 @@ int i915_gem_sw_finish_ioctl(struct drm_device *dev, void *data,
770 struct drm_file *file_priv); 878 struct drm_file *file_priv);
771int i915_gem_execbuffer(struct drm_device *dev, void *data, 879int i915_gem_execbuffer(struct drm_device *dev, void *data,
772 struct drm_file *file_priv); 880 struct drm_file *file_priv);
881int i915_gem_execbuffer2(struct drm_device *dev, void *data,
882 struct drm_file *file_priv);
773int i915_gem_pin_ioctl(struct drm_device *dev, void *data, 883int i915_gem_pin_ioctl(struct drm_device *dev, void *data,
774 struct drm_file *file_priv); 884 struct drm_file *file_priv);
775int i915_gem_unpin_ioctl(struct drm_device *dev, void *data, 885int i915_gem_unpin_ioctl(struct drm_device *dev, void *data,
@@ -813,17 +923,22 @@ void i915_gem_cleanup_ringbuffer(struct drm_device *dev);
813int i915_gem_do_init(struct drm_device *dev, unsigned long start, 923int i915_gem_do_init(struct drm_device *dev, unsigned long start,
814 unsigned long end); 924 unsigned long end);
815int i915_gem_idle(struct drm_device *dev); 925int i915_gem_idle(struct drm_device *dev);
926uint32_t i915_add_request(struct drm_device *dev, struct drm_file *file_priv,
927 uint32_t flush_domains);
928int i915_do_wait_request(struct drm_device *dev, uint32_t seqno, int interruptible);
816int i915_gem_fault(struct vm_area_struct *vma, struct vm_fault *vmf); 929int i915_gem_fault(struct vm_area_struct *vma, struct vm_fault *vmf);
817int i915_gem_object_set_to_gtt_domain(struct drm_gem_object *obj, 930int i915_gem_object_set_to_gtt_domain(struct drm_gem_object *obj,
818 int write); 931 int write);
932int i915_gem_object_set_to_display_plane(struct drm_gem_object *obj);
819int i915_gem_attach_phys_object(struct drm_device *dev, 933int i915_gem_attach_phys_object(struct drm_device *dev,
820 struct drm_gem_object *obj, int id); 934 struct drm_gem_object *obj, int id);
821void i915_gem_detach_phys_object(struct drm_device *dev, 935void i915_gem_detach_phys_object(struct drm_device *dev,
822 struct drm_gem_object *obj); 936 struct drm_gem_object *obj);
823void i915_gem_free_all_phys_object(struct drm_device *dev); 937void i915_gem_free_all_phys_object(struct drm_device *dev);
824int i915_gem_object_get_pages(struct drm_gem_object *obj); 938int i915_gem_object_get_pages(struct drm_gem_object *obj, gfp_t gfpmask);
825void i915_gem_object_put_pages(struct drm_gem_object *obj); 939void i915_gem_object_put_pages(struct drm_gem_object *obj);
826void i915_gem_release(struct drm_device * dev, struct drm_file *file_priv); 940void i915_gem_release(struct drm_device * dev, struct drm_file *file_priv);
941void i915_gem_object_flush_write_domain(struct drm_gem_object *obj);
827 942
828void i915_gem_shrinker_init(void); 943void i915_gem_shrinker_init(void);
829void i915_gem_shrinker_exit(void); 944void i915_gem_shrinker_exit(void);
@@ -832,6 +947,10 @@ void i915_gem_shrinker_exit(void);
832void i915_gem_detect_bit_6_swizzle(struct drm_device *dev); 947void i915_gem_detect_bit_6_swizzle(struct drm_device *dev);
833void i915_gem_object_do_bit_17_swizzle(struct drm_gem_object *obj); 948void i915_gem_object_do_bit_17_swizzle(struct drm_gem_object *obj);
834void i915_gem_object_save_bit_17_swizzle(struct drm_gem_object *obj); 949void i915_gem_object_save_bit_17_swizzle(struct drm_gem_object *obj);
950bool i915_tiling_ok(struct drm_device *dev, int stride, int size,
951 int tiling_mode);
952bool i915_gem_object_fence_offset_ok(struct drm_gem_object *obj,
953 int tiling_mode);
835 954
836/* i915_gem_debug.c */ 955/* i915_gem_debug.c */
837void i915_gem_dump_object(struct drm_gem_object *obj, int len, 956void i915_gem_dump_object(struct drm_gem_object *obj, int len,
@@ -863,11 +982,13 @@ extern int i915_restore_state(struct drm_device *dev);
863extern int intel_opregion_init(struct drm_device *dev, int resume); 982extern int intel_opregion_init(struct drm_device *dev, int resume);
864extern void intel_opregion_free(struct drm_device *dev, int suspend); 983extern void intel_opregion_free(struct drm_device *dev, int suspend);
865extern void opregion_asle_intr(struct drm_device *dev); 984extern void opregion_asle_intr(struct drm_device *dev);
985extern void ironlake_opregion_gse_intr(struct drm_device *dev);
866extern void opregion_enable_asle(struct drm_device *dev); 986extern void opregion_enable_asle(struct drm_device *dev);
867#else 987#else
868static inline int intel_opregion_init(struct drm_device *dev, int resume) { return 0; } 988static inline int intel_opregion_init(struct drm_device *dev, int resume) { return 0; }
869static inline void intel_opregion_free(struct drm_device *dev, int suspend) { return; } 989static inline void intel_opregion_free(struct drm_device *dev, int suspend) { return; }
870static inline void opregion_asle_intr(struct drm_device *dev) { return; } 990static inline void opregion_asle_intr(struct drm_device *dev) { return; }
991static inline void ironlake_opregion_gse_intr(struct drm_device *dev) { return; }
871static inline void opregion_enable_asle(struct drm_device *dev) { return; } 992static inline void opregion_enable_asle(struct drm_device *dev) { return; }
872#endif 993#endif
873 994
@@ -952,85 +1073,76 @@ extern void g4x_disable_fbc(struct drm_device *dev);
952extern int i915_wrap_ring(struct drm_device * dev); 1073extern int i915_wrap_ring(struct drm_device * dev);
953extern int i915_wait_ring(struct drm_device * dev, int n, const char *caller); 1074extern int i915_wait_ring(struct drm_device * dev, int n, const char *caller);
954 1075
955#define IS_I830(dev) ((dev)->pci_device == 0x3577) 1076#define INTEL_INFO(dev) (((struct drm_i915_private *) (dev)->dev_private)->info)
956#define IS_845G(dev) ((dev)->pci_device == 0x2562) 1077
957#define IS_I85X(dev) ((dev)->pci_device == 0x3582) 1078#define IS_I830(dev) ((dev)->pci_device == 0x3577)
958#define IS_I855(dev) ((dev)->pci_device == 0x3582) 1079#define IS_845G(dev) ((dev)->pci_device == 0x2562)
959#define IS_I865G(dev) ((dev)->pci_device == 0x2572) 1080#define IS_I85X(dev) (INTEL_INFO(dev)->is_i85x)
960 1081#define IS_I865G(dev) ((dev)->pci_device == 0x2572)
961#define IS_I915G(dev) ((dev)->pci_device == 0x2582 || (dev)->pci_device == 0x258a) 1082#define IS_GEN2(dev) (INTEL_INFO(dev)->is_i8xx)
962#define IS_I915GM(dev) ((dev)->pci_device == 0x2592) 1083#define IS_I915G(dev) (INTEL_INFO(dev)->is_i915g)
963#define IS_I945G(dev) ((dev)->pci_device == 0x2772) 1084#define IS_I915GM(dev) ((dev)->pci_device == 0x2592)
964#define IS_I945GM(dev) ((dev)->pci_device == 0x27A2 ||\ 1085#define IS_I945G(dev) ((dev)->pci_device == 0x2772)
965 (dev)->pci_device == 0x27AE) 1086#define IS_I945GM(dev) (INTEL_INFO(dev)->is_i945gm)
966#define IS_I965G(dev) ((dev)->pci_device == 0x2972 || \ 1087#define IS_I965G(dev) (INTEL_INFO(dev)->is_i965g)
967 (dev)->pci_device == 0x2982 || \ 1088#define IS_I965GM(dev) (INTEL_INFO(dev)->is_i965gm)
968 (dev)->pci_device == 0x2992 || \ 1089#define IS_GM45(dev) ((dev)->pci_device == 0x2A42)
969 (dev)->pci_device == 0x29A2 || \ 1090#define IS_G4X(dev) (INTEL_INFO(dev)->is_g4x)
970 (dev)->pci_device == 0x2A02 || \ 1091#define IS_PINEVIEW_G(dev) ((dev)->pci_device == 0xa001)
971 (dev)->pci_device == 0x2A12 || \ 1092#define IS_PINEVIEW_M(dev) ((dev)->pci_device == 0xa011)
972 (dev)->pci_device == 0x2A42 || \ 1093#define IS_PINEVIEW(dev) (INTEL_INFO(dev)->is_pineview)
973 (dev)->pci_device == 0x2E02 || \ 1094#define IS_G33(dev) (INTEL_INFO(dev)->is_g33)
974 (dev)->pci_device == 0x2E12 || \ 1095#define IS_IRONLAKE_D(dev) ((dev)->pci_device == 0x0042)
975 (dev)->pci_device == 0x2E22 || \ 1096#define IS_IRONLAKE_M(dev) ((dev)->pci_device == 0x0046)
976 (dev)->pci_device == 0x2E32 || \ 1097#define IS_IRONLAKE(dev) (INTEL_INFO(dev)->is_ironlake)
977 (dev)->pci_device == 0x2E42 || \ 1098#define IS_I9XX(dev) (INTEL_INFO(dev)->is_i9xx)
978 (dev)->pci_device == 0x0042 || \ 1099#define IS_GEN6(dev) (INTEL_INFO(dev)->is_gen6)
979 (dev)->pci_device == 0x0046) 1100#define IS_MOBILE(dev) (INTEL_INFO(dev)->is_mobile)
980 1101
981#define IS_I965GM(dev) ((dev)->pci_device == 0x2A02 || \ 1102#define IS_GEN3(dev) (IS_I915G(dev) || \
982 (dev)->pci_device == 0x2A12) 1103 IS_I915GM(dev) || \
983 1104 IS_I945G(dev) || \
984#define IS_GM45(dev) ((dev)->pci_device == 0x2A42) 1105 IS_I945GM(dev) || \
985 1106 IS_G33(dev) || \
986#define IS_G4X(dev) ((dev)->pci_device == 0x2E02 || \ 1107 IS_PINEVIEW(dev))
987 (dev)->pci_device == 0x2E12 || \ 1108#define IS_GEN4(dev) ((dev)->pci_device == 0x2972 || \
988 (dev)->pci_device == 0x2E22 || \ 1109 (dev)->pci_device == 0x2982 || \
989 (dev)->pci_device == 0x2E32 || \ 1110 (dev)->pci_device == 0x2992 || \
990 (dev)->pci_device == 0x2E42 || \ 1111 (dev)->pci_device == 0x29A2 || \
991 IS_GM45(dev)) 1112 (dev)->pci_device == 0x2A02 || \
992 1113 (dev)->pci_device == 0x2A12 || \
993#define IS_IGDG(dev) ((dev)->pci_device == 0xa001) 1114 (dev)->pci_device == 0x2E02 || \
994#define IS_IGDGM(dev) ((dev)->pci_device == 0xa011) 1115 (dev)->pci_device == 0x2E12 || \
995#define IS_IGD(dev) (IS_IGDG(dev) || IS_IGDGM(dev)) 1116 (dev)->pci_device == 0x2E22 || \
996 1117 (dev)->pci_device == 0x2E32 || \
997#define IS_G33(dev) ((dev)->pci_device == 0x29C2 || \ 1118 (dev)->pci_device == 0x2A42 || \
998 (dev)->pci_device == 0x29B2 || \ 1119 (dev)->pci_device == 0x2E42)
999 (dev)->pci_device == 0x29D2 || \ 1120
1000 (IS_IGD(dev))) 1121#define I915_NEED_GFX_HWS(dev) (INTEL_INFO(dev)->need_gfx_hws)
1001 1122
1002#define IS_IGDNG_D(dev) ((dev)->pci_device == 0x0042)
1003#define IS_IGDNG_M(dev) ((dev)->pci_device == 0x0046)
1004#define IS_IGDNG(dev) (IS_IGDNG_D(dev) || IS_IGDNG_M(dev))
1005
1006#define IS_I9XX(dev) (IS_I915G(dev) || IS_I915GM(dev) || IS_I945G(dev) || \
1007 IS_I945GM(dev) || IS_I965G(dev) || IS_G33(dev) || \
1008 IS_IGDNG(dev))
1009
1010#define IS_MOBILE(dev) (IS_I830(dev) || IS_I85X(dev) || IS_I915GM(dev) || \
1011 IS_I945GM(dev) || IS_I965GM(dev) || IS_GM45(dev) || \
1012 IS_IGD(dev) || IS_IGDNG_M(dev))
1013
1014#define I915_NEED_GFX_HWS(dev) (IS_G33(dev) || IS_GM45(dev) || IS_G4X(dev) || \
1015 IS_IGDNG(dev))
1016/* With the 945 and later, Y tiling got adjusted so that it was 32 128-byte 1123/* 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. 1124 * rows, which changed the alignment requirements and fence programming.
1018 */ 1125 */
1019#define HAS_128_BYTE_Y_TILING(dev) (IS_I9XX(dev) && !(IS_I915G(dev) || \ 1126#define HAS_128_BYTE_Y_TILING(dev) (IS_I9XX(dev) && !(IS_I915G(dev) || \
1020 IS_I915GM(dev))) 1127 IS_I915GM(dev)))
1021#define SUPPORTS_INTEGRATED_HDMI(dev) (IS_G4X(dev) || IS_IGDNG(dev)) 1128#define SUPPORTS_DIGITAL_OUTPUTS(dev) (IS_I9XX(dev) && !IS_PINEVIEW(dev))
1022#define SUPPORTS_INTEGRATED_DP(dev) (IS_G4X(dev) || IS_IGDNG(dev)) 1129#define SUPPORTS_INTEGRATED_HDMI(dev) (IS_G4X(dev) || IS_IRONLAKE(dev))
1023#define SUPPORTS_EDP(dev) (IS_IGDNG_M(dev)) 1130#define SUPPORTS_INTEGRATED_DP(dev) (IS_G4X(dev) || IS_IRONLAKE(dev))
1024#define I915_HAS_HOTPLUG(dev) (IS_I945G(dev) || IS_I945GM(dev) || IS_G33(dev) || IS_I965G(dev)) 1131#define SUPPORTS_EDP(dev) (IS_IRONLAKE_M(dev))
1132#define SUPPORTS_TV(dev) (IS_I9XX(dev) && IS_MOBILE(dev) && \
1133 !IS_IRONLAKE(dev) && !IS_PINEVIEW(dev))
1134#define I915_HAS_HOTPLUG(dev) (INTEL_INFO(dev)->has_hotplug)
1025/* dsparb controlled by hw only */ 1135/* dsparb controlled by hw only */
1026#define DSPARB_HWCONTROL(dev) (IS_G4X(dev) || IS_IGDNG(dev)) 1136#define DSPARB_HWCONTROL(dev) (IS_G4X(dev) || IS_IRONLAKE(dev))
1027 1137
1028#define HAS_FW_BLC(dev) (IS_I9XX(dev) || IS_G4X(dev) || IS_IGDNG(dev)) 1138#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)) 1139#define HAS_PIPE_CXSR(dev) (INTEL_INFO(dev)->has_pipe_cxsr)
1030#define I915_HAS_FBC(dev) (IS_MOBILE(dev) && \ 1140#define I915_HAS_FBC(dev) (INTEL_INFO(dev)->has_fbc)
1031 (IS_I9XX(dev) || IS_GM45(dev)) && \ 1141#define I915_HAS_RC6(dev) (INTEL_INFO(dev)->has_rc6)
1032 !IS_IGD(dev) && \ 1142
1033 !IS_IGDNG(dev)) 1143#define HAS_PCH_SPLIT(dev) (IS_IRONLAKE(dev) || \
1144 IS_GEN6(dev))
1145#define HAS_PIPE_CONTROL(dev) (IS_IRONLAKE(dev) || IS_GEN6(dev))
1034 1146
1035#define PRIMARY_RINGBUFFER_SIZE (128*1024) 1147#define PRIMARY_RINGBUFFER_SIZE (128*1024)
1036 1148