Lines Matching full:queue

37 void vmw_marker_queue_init(struct vmw_marker_queue *queue)  in vmw_marker_queue_init()  argument
39 INIT_LIST_HEAD(&queue->head); in vmw_marker_queue_init()
40 queue->lag = 0; in vmw_marker_queue_init()
41 queue->lag_time = ktime_get_raw_ns(); in vmw_marker_queue_init()
42 spin_lock_init(&queue->lock); in vmw_marker_queue_init()
45 void vmw_marker_queue_takedown(struct vmw_marker_queue *queue) in vmw_marker_queue_takedown() argument
49 spin_lock(&queue->lock); in vmw_marker_queue_takedown()
50 list_for_each_entry_safe(marker, next, &queue->head, head) { in vmw_marker_queue_takedown()
53 spin_unlock(&queue->lock); in vmw_marker_queue_takedown()
56 int vmw_marker_push(struct vmw_marker_queue *queue, in vmw_marker_push() argument
66 spin_lock(&queue->lock); in vmw_marker_push()
67 list_add_tail(&marker->head, &queue->head); in vmw_marker_push()
68 spin_unlock(&queue->lock); in vmw_marker_push()
73 int vmw_marker_pull(struct vmw_marker_queue *queue, in vmw_marker_pull() argument
80 spin_lock(&queue->lock); in vmw_marker_pull()
83 if (list_empty(&queue->head)) { in vmw_marker_pull()
84 queue->lag = 0; in vmw_marker_pull()
85 queue->lag_time = now; in vmw_marker_pull()
90 list_for_each_entry_safe(marker, next, &queue->head, head) { in vmw_marker_pull()
94 queue->lag = now - marker->submitted; in vmw_marker_pull()
95 queue->lag_time = now; in vmw_marker_pull()
102 spin_unlock(&queue->lock); in vmw_marker_pull()
107 static u64 vmw_fifo_lag(struct vmw_marker_queue *queue) in vmw_fifo_lag() argument
111 spin_lock(&queue->lock); in vmw_fifo_lag()
113 queue->lag += now - queue->lag_time; in vmw_fifo_lag()
114 queue->lag_time = now; in vmw_fifo_lag()
115 spin_unlock(&queue->lock); in vmw_fifo_lag()
116 return queue->lag; in vmw_fifo_lag()
120 static bool vmw_lag_lt(struct vmw_marker_queue *queue, in vmw_lag_lt() argument
125 return vmw_fifo_lag(queue) <= cond; in vmw_lag_lt()
129 struct vmw_marker_queue *queue, uint32_t us) in vmw_wait_lag() argument
135 while (!vmw_lag_lt(queue, us)) { in vmw_wait_lag()
136 spin_lock(&queue->lock); in vmw_wait_lag()
137 if (list_empty(&queue->head)) in vmw_wait_lag()
140 marker = list_first_entry(&queue->head, in vmw_wait_lag()
144 spin_unlock(&queue->lock); in vmw_wait_lag()
152 (void) vmw_marker_pull(queue, seqno); in vmw_wait_lag()