Rev 5060 | Rev 6084 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 5060 | Rev 5354 | ||
---|---|---|---|
Line 32... | Line 32... | ||
32 | */ |
32 | */ |
Line 33... | Line 33... | ||
33 | 33 | ||
34 | #ifndef __I915_GEM_GTT_H__ |
34 | #ifndef __I915_GEM_GTT_H__ |
Line -... | Line 35... | ||
- | 35 | #define __I915_GEM_GTT_H__ |
|
- | 36 | ||
35 | #define __I915_GEM_GTT_H__ |
37 | struct drm_i915_file_private; |
36 | 38 | ||
37 | typedef uint32_t gen6_gtt_pte_t; |
39 | typedef uint32_t gen6_gtt_pte_t; |
Line 38... | Line 40... | ||
38 | typedef uint64_t gen8_gtt_pte_t; |
40 | typedef uint64_t gen8_gtt_pte_t; |
Line 119... | Line 121... | ||
119 | struct i915_vma { |
121 | struct i915_vma { |
120 | struct drm_mm_node node; |
122 | struct drm_mm_node node; |
121 | struct drm_i915_gem_object *obj; |
123 | struct drm_i915_gem_object *obj; |
122 | struct i915_address_space *vm; |
124 | struct i915_address_space *vm; |
Line -... | Line 125... | ||
- | 125 | ||
- | 126 | /** Flags and address space this VMA is bound to */ |
|
- | 127 | #define GLOBAL_BIND (1<<0) |
|
- | 128 | #define LOCAL_BIND (1<<1) |
|
- | 129 | #define PTE_READ_ONLY (1<<2) |
|
- | 130 | unsigned int bound : 4; |
|
123 | 131 | ||
124 | /** This object's place on the active/inactive lists */ |
132 | /** This object's place on the active/inactive lists */ |
Line 125... | Line 133... | ||
125 | struct list_head mm_list; |
133 | struct list_head mm_list; |
Line 151... | Line 159... | ||
151 | 159 | ||
152 | /** Unmap an object from an address space. This usually consists of |
160 | /** Unmap an object from an address space. This usually consists of |
153 | * setting the valid PTE entries to a reserved scratch page. */ |
161 | * setting the valid PTE entries to a reserved scratch page. */ |
154 | void (*unbind_vma)(struct i915_vma *vma); |
162 | void (*unbind_vma)(struct i915_vma *vma); |
155 | /* Map an object into an address space with the given cache flags. */ |
- | |
156 | #define GLOBAL_BIND (1<<0) |
- | |
157 | #define PTE_READ_ONLY (1<<1) |
163 | /* Map an object into an address space with the given cache flags. */ |
158 | void (*bind_vma)(struct i915_vma *vma, |
164 | void (*bind_vma)(struct i915_vma *vma, |
159 | enum i915_cache_level cache_level, |
165 | enum i915_cache_level cache_level, |
160 | u32 flags); |
166 | u32 flags); |
Line 256... | Line 262... | ||
256 | union { |
262 | union { |
257 | dma_addr_t *pt_dma_addr; |
263 | dma_addr_t *pt_dma_addr; |
258 | dma_addr_t *gen8_pt_dma_addr[4]; |
264 | dma_addr_t *gen8_pt_dma_addr[4]; |
259 | }; |
265 | }; |
Line 260... | Line 266... | ||
260 | 266 | ||
Line 261... | Line 267... | ||
261 | struct intel_context *ctx; |
267 | struct drm_i915_file_private *file_priv; |
262 | 268 | ||
263 | int (*enable)(struct i915_hw_ppgtt *ppgtt); |
269 | int (*enable)(struct i915_hw_ppgtt *ppgtt); |
264 | int (*switch_mm)(struct i915_hw_ppgtt *ppgtt, |
- | |
265 | struct intel_engine_cs *ring, |
270 | int (*switch_mm)(struct i915_hw_ppgtt *ppgtt, |
266 | bool synchronous); |
271 | struct intel_engine_cs *ring); |
Line 267... | Line 272... | ||
267 | // void (*debug_dump)(struct i915_hw_ppgtt *ppgtt, struct seq_file *m); |
272 | // void (*debug_dump)(struct i915_hw_ppgtt *ppgtt, struct seq_file *m); |
268 | }; |
273 | }; |
269 | 274 | ||
270 | int i915_gem_gtt_init(struct drm_device *dev); |
- | |
- | 275 | int i915_gem_gtt_init(struct drm_device *dev); |
|
Line -... | Line 276... | ||
- | 276 | void i915_gem_init_global_gtt(struct drm_device *dev); |
|
271 | void i915_gem_init_global_gtt(struct drm_device *dev); |
277 | void i915_global_gtt_cleanup(struct drm_device *dev); |
- | 278 | ||
- | 279 | ||
- | 280 | int i915_ppgtt_init(struct drm_device *dev, struct i915_hw_ppgtt *ppgtt); |
|
- | 281 | int i915_ppgtt_init_hw(struct drm_device *dev); |
|
- | 282 | void i915_ppgtt_release(struct kref *kref); |
|
- | 283 | struct i915_hw_ppgtt *i915_ppgtt_create(struct drm_device *dev, |
|
- | 284 | struct drm_i915_file_private *fpriv); |
|
- | 285 | static inline void i915_ppgtt_get(struct i915_hw_ppgtt *ppgtt) |
|
272 | void i915_gem_setup_global_gtt(struct drm_device *dev, unsigned long start, |
286 | { |
- | 287 | if (ppgtt) |
|
- | 288 | kref_get(&ppgtt->ref); |
|
- | 289 | } |
|
- | 290 | static inline void i915_ppgtt_put(struct i915_hw_ppgtt *ppgtt) |
|
Line 273... | Line 291... | ||
273 | unsigned long mappable_end, unsigned long end); |
291 | { |
274 | 292 | if (ppgtt) |
|
275 | bool intel_enable_ppgtt(struct drm_device *dev, bool full); |
293 | kref_put(&ppgtt->ref, i915_ppgtt_release); |