Rev 2326 | Rev 2330 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2326 | Rev 2327 | ||
---|---|---|---|
Line 29... | Line 29... | ||
29 | 29 | ||
30 | #ifndef _I915_DRV_H_ |
30 | #ifndef _I915_DRV_H_ |
Line 31... | Line 31... | ||
31 | #define _I915_DRV_H_ |
31 | #define _I915_DRV_H_ |
32 | 32 | ||
33 | #include "i915_reg.h" |
33 | #include "i915_reg.h" |
34 | //#include "intel_bios.h" |
34 | #include "intel_bios.h" |
35 | #include "intel_ringbuffer.h" |
35 | #include "intel_ringbuffer.h" |
36 | //#include |
36 | //#include |
37 | //#include |
37 | //#include |
Line 41... | Line 41... | ||
41 | #include |
41 | #include |
Line 42... | Line 42... | ||
42 | 42 | ||
43 | /* General customization: |
43 | /* General customization: |
Line -... | Line 44... | ||
- | 44 | */ |
|
- | 45 | ||
- | 46 | #define I915_TILING_NONE 0 |
|
44 | */ |
47 | |
Line 45... | Line 48... | ||
45 | 48 | ||
46 | #define DRIVER_AUTHOR "Tungsten Graphics, Inc." |
49 | #define DRIVER_AUTHOR "Tungsten Graphics, Inc." |
47 | 50 | ||
Line 330... | Line 333... | ||
330 | unsigned int cfb_fb; |
333 | unsigned int cfb_fb; |
331 | enum plane cfb_plane; |
334 | enum plane cfb_plane; |
332 | int cfb_y; |
335 | int cfb_y; |
333 | // struct intel_fbc_work *fbc_work; |
336 | // struct intel_fbc_work *fbc_work; |
Line 334... | Line 337... | ||
334 | 337 | ||
Line 335... | Line 338... | ||
335 | // struct intel_opregion opregion; |
338 | struct intel_opregion opregion; |
336 | 339 | ||
Line 337... | Line 340... | ||
337 | /* overlay */ |
340 | /* overlay */ |
Line 358... | Line 361... | ||
358 | int vswing; |
361 | int vswing; |
Line 359... | Line 362... | ||
359 | 362 | ||
360 | bool initialized; |
363 | bool initialized; |
361 | bool support; |
364 | bool support; |
362 | int bpp; |
365 | int bpp; |
363 | // struct edp_power_seq pps; |
366 | struct edp_power_seq pps; |
364 | } edp; |
367 | } edp; |
Line 365... | Line 368... | ||
365 | bool no_aux_handshake; |
368 | bool no_aux_handshake; |
Line 378... | Line 381... | ||
378 | // struct work_struct error_work; |
381 | // struct work_struct error_work; |
379 | // struct completion error_completion; |
382 | // struct completion error_completion; |
380 | // struct workqueue_struct *wq; |
383 | // struct workqueue_struct *wq; |
Line 381... | Line 384... | ||
381 | 384 | ||
382 | /* Display functions */ |
385 | /* Display functions */ |
Line 383... | Line 386... | ||
383 | // struct drm_i915_display_funcs display; |
386 | struct drm_i915_display_funcs display; |
384 | 387 | ||
Line 385... | Line 388... | ||
385 | /* PCH chipset type */ |
388 | /* PCH chipset type */ |
Line 658... | Line 661... | ||
658 | size_t gtt_total; |
661 | size_t gtt_total; |
659 | size_t mappable_gtt_total; |
662 | size_t mappable_gtt_total; |
660 | size_t object_memory; |
663 | size_t object_memory; |
661 | u32 object_count; |
664 | u32 object_count; |
662 | } mm; |
665 | } mm; |
663 | // struct sdvo_device_mapping sdvo_mappings[2]; |
666 | struct sdvo_device_mapping sdvo_mappings[2]; |
664 | /* indicate whether the LVDS_BORDER should be enabled or not */ |
667 | /* indicate whether the LVDS_BORDER should be enabled or not */ |
665 | unsigned int lvds_border_bits; |
668 | unsigned int lvds_border_bits; |
666 | /* Panel fitter placement and size for Ironlake+ */ |
669 | /* Panel fitter placement and size for Ironlake+ */ |
667 | u32 pch_pf_pos, pch_pf_size; |
670 | u32 pch_pf_pos, pch_pf_size; |
668 | int panel_t3, panel_t12; |
671 | int panel_t3, panel_t12; |
Line 680... | Line 683... | ||
680 | // struct work_struct idle_work; |
683 | // struct work_struct idle_work; |
681 | // struct timer_list idle_timer; |
684 | // struct timer_list idle_timer; |
682 | bool busy; |
685 | bool busy; |
683 | u16 orig_clock; |
686 | u16 orig_clock; |
684 | int child_dev_num; |
687 | int child_dev_num; |
685 | // struct child_device_config *child_dev; |
688 | struct child_device_config *child_dev; |
686 | // struct drm_connector *int_lvds_connector; |
689 | struct drm_connector *int_lvds_connector; |
687 | // struct drm_connector *int_edp_connector; |
690 | struct drm_connector *int_edp_connector; |
Line 688... | Line 691... | ||
688 | 691 | ||
Line 689... | Line 692... | ||
689 | bool mchbar_need_disable; |
692 | bool mchbar_need_disable; |
690 | 693 | ||
Line 730... | Line 733... | ||
730 | I915_CACHE_NONE, |
733 | I915_CACHE_NONE, |
731 | I915_CACHE_LLC, |
734 | I915_CACHE_LLC, |
732 | I915_CACHE_LLC_MLC, /* gen6+ */ |
735 | I915_CACHE_LLC_MLC, /* gen6+ */ |
733 | }; |
736 | }; |
Line -... | Line 737... | ||
- | 737 | ||
- | 738 | struct drm_i915_gem_object { |
|
- | 739 | struct drm_gem_object base; |
|
- | 740 | ||
- | 741 | /** Current space allocated to this object in the GTT, if any. */ |
|
- | 742 | struct drm_mm_node *gtt_space; |
|
- | 743 | struct list_head gtt_list; |
|
- | 744 | ||
- | 745 | /** This object's place on the active/flushing/inactive lists */ |
|
- | 746 | struct list_head ring_list; |
|
- | 747 | struct list_head mm_list; |
|
- | 748 | /** This object's place on GPU write list */ |
|
- | 749 | struct list_head gpu_write_list; |
|
- | 750 | /** This object's place in the batchbuffer or on the eviction list */ |
|
- | 751 | struct list_head exec_list; |
|
- | 752 | ||
- | 753 | /** |
|
- | 754 | * This is set if the object is on the active or flushing lists |
|
- | 755 | * (has pending rendering), and is not set if it's on inactive (ready |
|
- | 756 | * to be unbound). |
|
- | 757 | */ |
|
- | 758 | unsigned int active : 1; |
|
- | 759 | ||
- | 760 | /** |
|
- | 761 | * This is set if the object has been written to since last bound |
|
- | 762 | * to the GTT |
|
- | 763 | */ |
|
- | 764 | unsigned int dirty : 1; |
|
- | 765 | ||
- | 766 | /** |
|
- | 767 | * This is set if the object has been written to since the last |
|
- | 768 | * GPU flush. |
|
- | 769 | */ |
|
- | 770 | unsigned int pending_gpu_write : 1; |
|
- | 771 | ||
- | 772 | /** |
|
- | 773 | * Fence register bits (if any) for this object. Will be set |
|
- | 774 | * as needed when mapped into the GTT. |
|
- | 775 | * Protected by dev->struct_mutex. |
|
- | 776 | * |
|
- | 777 | * Size: 4 bits for 16 fences + sign (for FENCE_REG_NONE) |
|
- | 778 | */ |
|
- | 779 | signed int fence_reg : 5; |
|
- | 780 | ||
- | 781 | /** |
|
- | 782 | * Advice: are the backing pages purgeable? |
|
- | 783 | */ |
|
- | 784 | unsigned int madv : 2; |
|
- | 785 | ||
- | 786 | /** |
|
- | 787 | * Current tiling mode for the object. |
|
- | 788 | */ |
|
- | 789 | unsigned int tiling_mode : 2; |
|
- | 790 | unsigned int tiling_changed : 1; |
|
- | 791 | ||
- | 792 | /** How many users have pinned this object in GTT space. The following |
|
- | 793 | * users can each hold at most one reference: pwrite/pread, pin_ioctl |
|
- | 794 | * (via user_pin_count), execbuffer (objects are not allowed multiple |
|
- | 795 | * times for the same batchbuffer), and the framebuffer code. When |
|
- | 796 | * switching/pageflipping, the framebuffer code has at most two buffers |
|
- | 797 | * pinned per crtc. |
|
- | 798 | * |
|
- | 799 | * In the worst case this is 1 + 1 + 1 + 2*2 = 7. That would fit into 3 |
|
- | 800 | * bits with absolutely no headroom. So use 4 bits. */ |
|
- | 801 | unsigned int pin_count : 4; |
|
- | 802 | #define DRM_I915_GEM_OBJECT_MAX_PIN_COUNT 0xf |
|
- | 803 | ||
- | 804 | /** |
|
- | 805 | * Is the object at the current location in the gtt mappable and |
|
- | 806 | * fenceable? Used to avoid costly recalculations. |
|
- | 807 | */ |
|
- | 808 | unsigned int map_and_fenceable : 1; |
|
- | 809 | ||
- | 810 | /** |
|
- | 811 | * Whether the current gtt mapping needs to be mappable (and isn't just |
|
- | 812 | * mappable by accident). Track pin and fault separate for a more |
|
- | 813 | * accurate mappable working set. |
|
- | 814 | */ |
|
- | 815 | unsigned int fault_mappable : 1; |
|
- | 816 | unsigned int pin_mappable : 1; |
|
- | 817 | ||
- | 818 | /* |
|
- | 819 | * Is the GPU currently using a fence to access this buffer, |
|
- | 820 | */ |
|
- | 821 | unsigned int pending_fenced_gpu_access:1; |
|
- | 822 | unsigned int fenced_gpu_access:1; |
|
- | 823 | ||
- | 824 | unsigned int cache_level:2; |
|
- | 825 | ||
- | 826 | struct page **pages; |
|
- | 827 | ||
- | 828 | /** |
|
- | 829 | * DMAR support |
|
- | 830 | */ |
|
- | 831 | struct scatterlist *sg_list; |
|
- | 832 | int num_sg; |
|
- | 833 | ||
- | 834 | /** |
|
- | 835 | * Used for performing relocations during execbuffer insertion. |
|
- | 836 | */ |
|
- | 837 | struct hlist_node exec_node; |
|
- | 838 | unsigned long exec_handle; |
|
- | 839 | struct drm_i915_gem_exec_object2 *exec_entry; |
|
- | 840 | ||
- | 841 | /** |
|
- | 842 | * Current offset of the object in GTT space. |
|
- | 843 | * |
|
- | 844 | * This is the same as gtt_space->start |
|
- | 845 | */ |
|
- | 846 | uint32_t gtt_offset; |
|
- | 847 | ||
- | 848 | /** Breadcrumb of last rendering to the buffer. */ |
|
- | 849 | uint32_t last_rendering_seqno; |
|
- | 850 | struct intel_ring_buffer *ring; |
|
- | 851 | ||
- | 852 | /** Breadcrumb of last fenced GPU access to the buffer. */ |
|
- | 853 | uint32_t last_fenced_seqno; |
|
- | 854 | struct intel_ring_buffer *last_fenced_ring; |
|
- | 855 | ||
- | 856 | /** Current tiling stride for the object, if it's tiled. */ |
|
- | 857 | uint32_t stride; |
|
- | 858 | ||
- | 859 | /** Record of address bit 17 of each page at last unbind. */ |
|
- | 860 | unsigned long *bit_17; |
|
- | 861 | ||
- | 862 | ||
- | 863 | /** |
|
- | 864 | * If present, while GEM_DOMAIN_CPU is in the read domain this array |
|
- | 865 | * flags which individual pages are valid. |
|
- | 866 | */ |
|
- | 867 | uint8_t *page_cpu_valid; |
|
- | 868 | ||
- | 869 | /** User space pin count and filp owning the pin */ |
|
- | 870 | uint32_t user_pin_count; |
|
- | 871 | struct drm_file *pin_filp; |
|
- | 872 | ||
- | 873 | /** for phy allocated objects */ |
|
- | 874 | struct drm_i915_gem_phys_object *phys_obj; |
|
- | 875 | ||
- | 876 | /** |
|
- | 877 | * Number of crtcs where this object is currently the fb, but |
|
- | 878 | * will be page flipped away on the next vblank. When it |
|
- | 879 | * reaches 0, dev_priv->pending_flip_queue will be woken up. |
|
- | 880 | */ |
|
- | 881 | atomic_t pending_flip; |
|
- | 882 | }; |
|
Line 734... | Line 883... | ||
734 | 883 | ||
Line 735... | Line 884... | ||
735 | 884 | ||
736 | #define to_intel_bo(x) container_of(x, struct drm_i915_gem_object, base) |
885 | #define to_intel_bo(x) container_of(x, struct drm_i915_gem_object, base) |