Lines Matching refs:vc

18 	/* protected by vc.lock */
29 /* protected by vc.lock */
44 void vchan_dma_desc_free_list(struct virt_dma_chan *vc, struct list_head *head);
45 void vchan_init(struct virt_dma_chan *vc, struct dma_device *dmadev);
52 * @vc: virtual channel allocating this descriptor
56 static inline struct dma_async_tx_descriptor *vchan_tx_prep(struct virt_dma_chan *vc,
61 dma_async_tx_descriptor_init(&vd->tx, &vc->chan);
69 spin_lock_irqsave(&vc->lock, flags);
70 list_add_tail(&vd->node, &vc->desc_allocated);
71 spin_unlock_irqrestore(&vc->lock, flags);
78 * @vc: virtual channel to update
80 * vc.lock must be held by caller
82 static inline bool vchan_issue_pending(struct virt_dma_chan *vc)
84 list_splice_tail_init(&vc->desc_submitted, &vc->desc_issued);
85 return !list_empty(&vc->desc_issued);
92 * vc.lock must be held by caller
96 struct virt_dma_chan *vc = to_virt_chan(vd->tx.chan);
101 dev_vdbg(vc->chan.device->dev, "txd %p[%x]: marked complete\n",
103 list_add_tail(&vd->node, &vc->desc_completed);
105 tasklet_schedule(&vc->task);
114 struct virt_dma_chan *vc = to_virt_chan(vd->tx.chan);
119 spin_lock_irqsave(&vc->lock, flags);
120 list_add(&vd->node, &vc->desc_allocated);
121 spin_unlock_irqrestore(&vc->lock, flags);
123 vc->desc_free(vd);
133 struct virt_dma_chan *vc = to_virt_chan(vd->tx.chan);
135 vc->cyclic = vd;
136 tasklet_schedule(&vc->task);
143 * vc.lock must be held by caller
147 struct virt_dma_chan *vc = to_virt_chan(vd->tx.chan);
149 list_add_tail(&vd->node, &vc->desc_terminated);
151 if (vc->cyclic == vd)
152 vc->cyclic = NULL;
157 * @vc: virtual channel to obtain descriptor from
159 * vc.lock must be held by caller
161 static inline struct virt_dma_desc *vchan_next_desc(struct virt_dma_chan *vc)
163 return list_first_entry_or_null(&vc->desc_issued,
169 * @vc: virtual channel to get descriptors from
172 * vc.lock must be held by caller
177 static inline void vchan_get_all_descriptors(struct virt_dma_chan *vc,
180 list_splice_tail_init(&vc->desc_allocated, head);
181 list_splice_tail_init(&vc->desc_submitted, head);
182 list_splice_tail_init(&vc->desc_issued, head);
183 list_splice_tail_init(&vc->desc_completed, head);
184 list_splice_tail_init(&vc->desc_terminated, head);
187 static inline void vchan_free_chan_resources(struct virt_dma_chan *vc)
193 spin_lock_irqsave(&vc->lock, flags);
194 vchan_get_all_descriptors(vc, &head);
197 spin_unlock_irqrestore(&vc->lock, flags);
199 vchan_dma_desc_free_list(vc, &head);
204 * @vc: virtual channel to synchronize
211 static inline void vchan_synchronize(struct virt_dma_chan *vc)
216 tasklet_kill(&vc->task);
218 spin_lock_irqsave(&vc->lock, flags);
220 list_splice_tail_init(&vc->desc_terminated, &head);
222 spin_unlock_irqrestore(&vc->lock, flags);
224 vchan_dma_desc_free_list(vc, &head);