Rev 4568 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 4568 | Rev 5270 | ||
---|---|---|---|
Line 37... | Line 37... | ||
37 | /** |
37 | /** |
38 | * struct ttm_validate_buffer |
38 | * struct ttm_validate_buffer |
39 | * |
39 | * |
40 | * @head: list head for thread-private list. |
40 | * @head: list head for thread-private list. |
41 | * @bo: refcounted buffer object pointer. |
41 | * @bo: refcounted buffer object pointer. |
42 | * @reserved: Indicates whether @bo has been reserved for validation. |
42 | * @shared: should the fence be added shared? |
43 | * @removed: Indicates whether @bo has been removed from lru lists. |
- | |
44 | * @put_count: Number of outstanding references on bo::list_kref. |
- | |
45 | * @old_sync_obj: Pointer to a sync object about to be unreferenced |
- | |
46 | */ |
43 | */ |
Line 47... | Line 44... | ||
47 | 44 | ||
48 | struct ttm_validate_buffer { |
45 | struct ttm_validate_buffer { |
49 | struct list_head head; |
46 | struct list_head head; |
50 | struct ttm_buffer_object *bo; |
47 | struct ttm_buffer_object *bo; |
51 | bool reserved; |
- | |
52 | bool removed; |
- | |
53 | int put_count; |
- | |
54 | void *old_sync_obj; |
48 | bool shared; |
Line 55... | Line 49... | ||
55 | }; |
49 | }; |
56 | 50 | ||
57 | /** |
51 | /** |
Line 71... | Line 65... | ||
71 | * function ttm_eu_reserve_buffers |
65 | * function ttm_eu_reserve_buffers |
72 | * |
66 | * |
73 | * @ticket: [out] ww_acquire_ctx filled in by call, or NULL if only |
67 | * @ticket: [out] ww_acquire_ctx filled in by call, or NULL if only |
74 | * non-blocking reserves should be tried. |
68 | * non-blocking reserves should be tried. |
75 | * @list: thread private list of ttm_validate_buffer structs. |
69 | * @list: thread private list of ttm_validate_buffer structs. |
- | 70 | * @intr: should the wait be interruptible |
|
- | 71 | * @dups: [out] optional list of duplicates. |
|
76 | * |
72 | * |
77 | * Tries to reserve bos pointed to by the list entries for validation. |
73 | * Tries to reserve bos pointed to by the list entries for validation. |
78 | * If the function returns 0, all buffers are marked as "unfenced", |
74 | * If the function returns 0, all buffers are marked as "unfenced", |
79 | * taken off the lru lists and are not synced for write CPU usage. |
75 | * taken off the lru lists and are not synced for write CPU usage. |
80 | * |
76 | * |
Line 82... | Line 78... | ||
82 | * reserve the same buffers in reverse order, all threads except one will |
78 | * reserve the same buffers in reverse order, all threads except one will |
83 | * back off and retry. This function may sleep while waiting for |
79 | * back off and retry. This function may sleep while waiting for |
84 | * CPU write reservations to be cleared, and for other threads to |
80 | * CPU write reservations to be cleared, and for other threads to |
85 | * unreserve their buffers. |
81 | * unreserve their buffers. |
86 | * |
82 | * |
87 | * This function may return -ERESTART or -EAGAIN if the calling process |
83 | * If intr is set to true, this function may return -ERESTARTSYS if the |
88 | * receives a signal while waiting. In that case, no buffers on the list |
84 | * calling process receives a signal while waiting. In that case, no |
89 | * will be reserved upon return. |
85 | * buffers on the list will be reserved upon return. |
- | 86 | * |
|
- | 87 | * If dups is non NULL all buffers already reserved by the current thread |
|
- | 88 | * (e.g. duplicates) are added to this list, otherwise -EALREADY is returned |
|
- | 89 | * on the first already reserved buffer and all buffers from the list are |
|
- | 90 | * unreserved again. |
|
90 | * |
91 | * |
91 | * Buffers reserved by this function should be unreserved by |
92 | * Buffers reserved by this function should be unreserved by |
92 | * a call to either ttm_eu_backoff_reservation() or |
93 | * a call to either ttm_eu_backoff_reservation() or |
93 | * ttm_eu_fence_buffer_objects() when command submission is complete or |
94 | * ttm_eu_fence_buffer_objects() when command submission is complete or |
94 | * has failed. |
95 | * has failed. |
95 | */ |
96 | */ |
Line 96... | Line 97... | ||
96 | 97 | ||
- | 98 | extern int ttm_eu_reserve_buffers(struct ww_acquire_ctx *ticket, |
|
97 | extern int ttm_eu_reserve_buffers(struct ww_acquire_ctx *ticket, |
99 | struct list_head *list, bool intr, |
Line 98... | Line 100... | ||
98 | struct list_head *list); |
100 | struct list_head *dups); |
99 | 101 | ||
100 | /** |
102 | /** |
101 | * function ttm_eu_fence_buffer_objects. |
103 | * function ttm_eu_fence_buffer_objects. |
102 | * |
104 | * |
103 | * @ticket: ww_acquire_ctx from reserve call |
105 | * @ticket: ww_acquire_ctx from reserve call |
104 | * @list: thread private list of ttm_validate_buffer structs. |
106 | * @list: thread private list of ttm_validate_buffer structs. |
105 | * @sync_obj: The new sync object for the buffers. |
107 | * @fence: The new exclusive fence for the buffers. |
106 | * |
108 | * |
107 | * This function should be called when command submission is complete, and |
109 | * This function should be called when command submission is complete, and |
108 | * it will add a new sync object to bos pointed to by entries on @list. |
110 | * it will add a new sync object to bos pointed to by entries on @list. |
109 | * It also unreserves all buffers, putting them on lru lists. |
111 | * It also unreserves all buffers, putting them on lru lists. |
Line 110... | Line 112... | ||
110 | * |
112 | * |
111 | */ |
113 | */ |
- | 114 | ||
Line 112... | Line 115... | ||
112 | 115 | extern void ttm_eu_fence_buffer_objects(struct ww_acquire_ctx *ticket, |