Lines Matching refs:queue
37 void vmw_marker_queue_init(struct vmw_marker_queue *queue)
39 INIT_LIST_HEAD(&queue->head);
40 queue->lag = ns_to_timespec(0);
41 getrawmonotonic(&queue->lag_time);
42 spin_lock_init(&queue->lock);
45 void vmw_marker_queue_takedown(struct vmw_marker_queue *queue)
49 spin_lock(&queue->lock);
50 list_for_each_entry_safe(marker, next, &queue->head, head) {
53 spin_unlock(&queue->lock);
56 int vmw_marker_push(struct vmw_marker_queue *queue,
66 spin_lock(&queue->lock);
67 list_add_tail(&marker->head, &queue->head);
68 spin_unlock(&queue->lock);
73 int vmw_marker_pull(struct vmw_marker_queue *queue,
80 spin_lock(&queue->lock);
83 if (list_empty(&queue->head)) {
84 queue->lag = ns_to_timespec(0);
85 queue->lag_time = now;
90 list_for_each_entry_safe(marker, next, &queue->head, head) {
94 queue->lag = timespec_sub(now, marker->submitted);
95 queue->lag_time = now;
102 spin_unlock(&queue->lock);
120 static struct timespec vmw_fifo_lag(struct vmw_marker_queue *queue)
124 spin_lock(&queue->lock);
126 queue->lag = vmw_timespec_add(queue->lag,
127 timespec_sub(now, queue->lag_time));
128 queue->lag_time = now;
129 spin_unlock(&queue->lock);
130 return queue->lag;
134 static bool vmw_lag_lt(struct vmw_marker_queue *queue,
140 lag = vmw_fifo_lag(queue);
145 struct vmw_marker_queue *queue, uint32_t us)
151 while (!vmw_lag_lt(queue, us)) {
152 spin_lock(&queue->lock);
153 if (list_empty(&queue->head))
156 marker = list_first_entry(&queue->head,
160 spin_unlock(&queue->lock);
168 (void) vmw_marker_pull(queue, seqno);