Subversion Repositories Kolibri OS

Rev

Rev 3262 | Rev 4103 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3262 Rev 4065
Line 42... Line 42...
42
 
42
 
Line 43... Line 43...
43
struct ttm_bo_device;
43
struct ttm_bo_device;
Line -... Line 44...
-
 
44
 
-
 
45
struct drm_mm_node;
-
 
46
 
-
 
47
struct reservation_object {
Line 44... Line 48...
44
 
48
	struct mutex lock;
45
struct drm_mm_node;
49
}; 
46
 
50
 
47
 
51
 
Line 151... Line 155...
151
 * @list_kref: List reference count of this buffer object. This member is
155
 * @list_kref: List reference count of this buffer object. This member is
152
 * used to avoid destruction while the buffer object is still on a list.
156
 * used to avoid destruction while the buffer object is still on a list.
153
 * Lru lists may keep one refcount, the delayed delete list, and kref != 0
157
 * Lru lists may keep one refcount, the delayed delete list, and kref != 0
154
 * keeps one refcount. When this refcount reaches zero,
158
 * keeps one refcount. When this refcount reaches zero,
155
 * the object is destroyed.
159
 * the object is destroyed.
156
 * @event_queue: Queue for processes waiting on buffer object status change.
-
 
157
 * @mem: structure describing current placement.
160
 * @mem: structure describing current placement.
158
 * @persistent_swap_storage: Usually the swap storage is deleted for buffers
161
 * @persistent_swap_storage: Usually the swap storage is deleted for buffers
159
 * pinned in physical memory. If this behaviour is not desired, this member
162
 * pinned in physical memory. If this behaviour is not desired, this member
160
 * holds a pointer to a persistent shmem object.
163
 * holds a pointer to a persistent shmem object.
161
 * @ttm: TTM structure holding system pages.
164
 * @ttm: TTM structure holding system pages.
162
 * @evicted: Whether the object was evicted without user-space knowing.
165
 * @evicted: Whether the object was evicted without user-space knowing.
163
 * @cpu_writes: For synchronization. Number of cpu writers.
166
 * @cpu_writes: For synchronization. Number of cpu writers.
164
 * @lru: List head for the lru list.
167
 * @lru: List head for the lru list.
165
 * @ddestroy: List head for the delayed destroy list.
168
 * @ddestroy: List head for the delayed destroy list.
166
 * @swap: List head for swap LRU list.
169
 * @swap: List head for swap LRU list.
167
 * @val_seq: Sequence of the validation holding the @reserved lock.
-
 
168
 * Used to avoid starvation when many processes compete to validate the
-
 
169
 * buffer. This member is protected by the bo_device::lru_lock.
-
 
170
 * @seq_valid: The value of @val_seq is valid. This value is protected by
-
 
171
 * the bo_device::lru_lock.
-
 
172
 * @reserved: Deadlock-free lock used for synchronization state transitions.
-
 
173
 * @sync_obj: Pointer to a synchronization object.
170
 * @sync_obj: Pointer to a synchronization object.
174
 * @priv_flags: Flags describing buffer object internal state.
171
 * @priv_flags: Flags describing buffer object internal state.
175
 * @vm_rb: Rb node for the vm rb tree.
172
 * @vm_rb: Rb node for the vm rb tree.
176
 * @vm_node: Address space manager node.
173
 * @vm_node: Address space manager node.
177
 * @offset: The current GPU offset, which can have different meanings
174
 * @offset: The current GPU offset, which can have different meanings
Line 207... Line 204...
207
	* Members not needing protection.
204
	* Members not needing protection.
208
	*/
205
	*/
Line 209... Line 206...
209
 
206
 
210
	struct kref kref;
207
	struct kref kref;
211
	struct kref list_kref;
-
 
Line 212... Line 208...
212
	wait_queue_head_t event_queue;
208
	struct kref list_kref;
213
 
209
 
214
	/**
210
	/**
Line 215... Line 211...
215
	 * Members protected by the bo::reserved lock.
211
	 * Members protected by the bo::resv::reserved lock.
216
	 */
212
	 */
217
 
213
 
Line 232... Line 228...
232
 
228
 
233
	struct list_head lru;
229
	struct list_head lru;
234
	struct list_head ddestroy;
230
	struct list_head ddestroy;
235
	struct list_head swap;
231
	struct list_head swap;
236
	struct list_head io_reserve_lru;
-
 
237
	uint32_t val_seq;
-
 
238
	bool seq_valid;
-
 
239
 
-
 
240
	/**
-
 
241
	 * Members protected by the bdev::lru_lock
-
 
242
	 * only when written to.
-
 
243
	 */
-
 
244
 
-
 
Line 245... Line 232...
245
	atomic_t reserved;
232
	struct list_head io_reserve_lru;
246
 
233
 
247
	/**
234
	/**
248
	 * Members protected by struct buffer_object_device::fence_lock
235
	 * Members protected by struct buffer_object_device::fence_lock
Line 270... Line 257...
270
 
257
 
271
	unsigned long offset;
258
	unsigned long offset;
Line 272... Line 259...
272
	uint32_t cur_placement;
259
	uint32_t cur_placement;
-
 
260
 
-
 
261
	struct sg_table *sg;
-
 
262
 
273
 
263
	struct reservation_object *resv;
Line 274... Line 264...
274
	struct sg_table *sg;
264
	struct reservation_object ttm_resv;
275
};
265
};
276
 
266
 
Line 723... Line 713...
723
			 const char __user *wbuf, char __user *rbuf,
713
			 const char __user *wbuf, char __user *rbuf,
724
			 size_t count, loff_t *f_pos, bool write);
714
			 size_t count, loff_t *f_pos, bool write);
Line 725... Line 715...
725
 
715
 
Line 726... Line -...
726
extern void ttm_bo_swapout_all(struct ttm_bo_device *bdev);
-
 
727
 
-
 
728
/**
-
 
729
 * ttm_bo_is_reserved - return an indication if a ttm buffer object is reserved
-
 
730
 *
-
 
731
 * @bo:     The buffer object to check.
-
 
732
 *
-
 
733
 * This function returns an indication if a bo is reserved or not, and should
-
 
734
 * only be used to print an error when it is not from incorrect api usage, since
-
 
735
 * there's no guarantee that it is the caller that is holding the reservation.
-
 
736
 */
-
 
737
static inline bool ttm_bo_is_reserved(struct ttm_buffer_object *bo)
-
 
738
{
-
 
739
	return atomic_read(&bo->reserved);
-
 
740
}
716
extern void ttm_bo_swapout_all(struct ttm_bo_device *bdev);