Subversion Repositories Kolibri OS

Rev

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

Rev 5056 Rev 5270
Line 43... Line 43...
43
 
43
 
Line 44... Line 44...
44
struct ttm_bo_device;
44
struct ttm_bo_device;
Line 45... Line -...
45
 
-
 
46
struct drm_mm_node;
45
 
47
 
46
struct drm_mm_node;
48
 
47
 
49
/**
48
/**
50
 * struct ttm_placement
49
 * struct ttm_place
-
 
50
 *
-
 
51
 * @fpfn:	first valid page frame number to put the object
-
 
52
 * @lpfn:	last valid page frame number to put the object
-
 
53
 * @flags:	memory domain and caching flags for the object
-
 
54
 *
-
 
55
 * Structure indicating a possible place to put an object.
-
 
56
 */
-
 
57
struct ttm_place {
-
 
58
	unsigned	fpfn;
-
 
59
	unsigned	lpfn;
-
 
60
	uint32_t	flags;
-
 
61
};
-
 
62
 
51
 *
63
/**
52
 * @fpfn:		first valid page frame number to put the object
64
 * struct ttm_placement
53
 * @lpfn:		last valid page frame number to put the object
65
 *
54
 * @num_placement:	number of preferred placements
66
 * @num_placement:	number of preferred placements
55
 * @placement:		preferred placements
67
 * @placement:		preferred placements
56
 * @num_busy_placement:	number of preferred placements when need to evict buffer
68
 * @num_busy_placement:	number of preferred placements when need to evict buffer
57
 * @busy_placement:	preferred placements when need to evict buffer
69
 * @busy_placement:	preferred placements when need to evict buffer
58
 *
70
 *
59
 * Structure indicating the placement you request for an object.
-
 
60
 */
-
 
61
struct ttm_placement {
71
 * Structure indicating the placement you request for an object.
62
	unsigned	fpfn;
72
 */
63
	unsigned	lpfn;
73
struct ttm_placement {
64
	unsigned	num_placement;
74
	unsigned	num_placement;
65
	const uint32_t	*placement;
75
	const struct ttm_place	*placement;
Line 66... Line 76...
66
	unsigned	num_busy_placement;
76
	unsigned	num_busy_placement;
67
	const uint32_t	*busy_placement;
77
	const struct ttm_place	*busy_placement;
68
};
78
};
Line 161... Line 171...
161
 * @evicted: Whether the object was evicted without user-space knowing.
171
 * @evicted: Whether the object was evicted without user-space knowing.
162
 * @cpu_writes: For synchronization. Number of cpu writers.
172
 * @cpu_writes: For synchronization. Number of cpu writers.
163
 * @lru: List head for the lru list.
173
 * @lru: List head for the lru list.
164
 * @ddestroy: List head for the delayed destroy list.
174
 * @ddestroy: List head for the delayed destroy list.
165
 * @swap: List head for swap LRU list.
175
 * @swap: List head for swap LRU list.
166
 * @sync_obj: Pointer to a synchronization object.
-
 
167
 * @priv_flags: Flags describing buffer object internal state.
176
 * @priv_flags: Flags describing buffer object internal state.
168
 * @vma_node: Address space manager node.
177
 * @vma_node: Address space manager node.
169
 * @offset: The current GPU offset, which can have different meanings
178
 * @offset: The current GPU offset, which can have different meanings
170
 * depending on the memory type. For SYSTEM type memory, it should be 0.
179
 * depending on the memory type. For SYSTEM type memory, it should be 0.
171
 * @cur_placement: Hint of current placement.
180
 * @cur_placement: Hint of current placement.
Line 225... Line 234...
225
	struct list_head ddestroy;
234
	struct list_head ddestroy;
226
	struct list_head swap;
235
	struct list_head swap;
227
	struct list_head io_reserve_lru;
236
	struct list_head io_reserve_lru;
Line 228... Line 237...
228
 
237
 
229
	/**
238
	/**
230
	 * Members protected by struct buffer_object_device::fence_lock
-
 
231
	 * In addition, setting sync_obj to anything else
-
 
232
	 * than NULL requires bo::reserved to be held. This allows for
-
 
233
	 * checking NULL while reserved but not holding the mentioned lock.
239
	 * Members protected by a bo reservation.
Line 234... Line -...
234
	 */
-
 
235
 
240
	 */
Line 236... Line 241...
236
	void *sync_obj;
241
 
Line 237... Line 242...
237
	unsigned long priv_flags;
242
	unsigned long priv_flags;
Line 453... Line 458...
453
 * pinned in physical memory. If this behaviour is not desired, this member
458
 * pinned in physical memory. If this behaviour is not desired, this member
454
 * holds a pointer to a persistent shmem object. Typically, this would
459
 * holds a pointer to a persistent shmem object. Typically, this would
455
 * point to the shmem object backing a GEM object if TTM is used to back a
460
 * point to the shmem object backing a GEM object if TTM is used to back a
456
 * GEM user interface.
461
 * GEM user interface.
457
 * @acc_size: Accounted size for this object.
462
 * @acc_size: Accounted size for this object.
-
 
463
 * @resv: Pointer to a reservation_object, or NULL to let ttm allocate one.
458
 * @destroy: Destroy function. Use NULL for kfree().
464
 * @destroy: Destroy function. Use NULL for kfree().
459
 *
465
 *
460
 * This function initializes a pre-allocated struct ttm_buffer_object.
466
 * This function initializes a pre-allocated struct ttm_buffer_object.
461
 * As this object may be part of a larger structure, this function,
467
 * As this object may be part of a larger structure, this function,
462
 * together with the @destroy function,
468
 * together with the @destroy function,
Line 480... Line 486...
480
			uint32_t page_alignment,
486
			uint32_t page_alignment,
481
			bool interrubtible,
487
			bool interrubtible,
482
			struct file *persistent_swap_storage,
488
			struct file *persistent_swap_storage,
483
			size_t acc_size,
489
			size_t acc_size,
484
			struct sg_table *sg,
490
			struct sg_table *sg,
-
 
491
			struct reservation_object *resv,
485
			void (*destroy) (struct ttm_buffer_object *));
492
			void (*destroy) (struct ttm_buffer_object *));
Line 486... Line 493...
486
 
493
 
487
/**
494
/**
488
 * ttm_bo_create
495
 * ttm_bo_create
Line 517... Line 524...
517
				bool interruptible,
524
				bool interruptible,
518
				struct file *persistent_swap_storage,
525
				struct file *persistent_swap_storage,
519
				struct ttm_buffer_object **p_bo);
526
				struct ttm_buffer_object **p_bo);
Line 520... Line 527...
520
 
527
 
521
/**
-
 
522
 * ttm_bo_check_placement
-
 
523
 *
-
 
524
 * @bo:		the buffer object.
-
 
525
 * @placement:	placements
-
 
526
 *
-
 
527
 * Performs minimal validity checking on an intended change of
-
 
528
 * placement flags.
-
 
529
 * Returns
-
 
530
 * -EINVAL: Intended change is invalid or not allowed.
-
 
531
 */
-
 
532
extern int ttm_bo_check_placement(struct ttm_buffer_object *bo,
-
 
533
					struct ttm_placement *placement);
-
 
534
 
-
 
535
/**
528
/**
536
 * ttm_bo_init_mm
529
 * ttm_bo_init_mm
537
 *
530
 *
538
 * @bdev: Pointer to a ttm_bo_device struct.
531
 * @bdev: Pointer to a ttm_bo_device struct.
539
 * @mem_type: The memory type.
532
 * @mem_type: The memory type.