Lines Matching full:urbs
95 * Need to ensure a channel is selected before submitting URBs
138 urb->transfer_buffer_length = udl->urbs.size; /* reset to actual */ in udl_urb_completion()
140 spin_lock_irqsave(&udl->urbs.lock, flags); in udl_urb_completion()
141 list_add_tail(&unode->entry, &udl->urbs.list); in udl_urb_completion()
142 udl->urbs.available++; in udl_urb_completion()
143 spin_unlock_irqrestore(&udl->urbs.lock, flags); in udl_urb_completion()
145 wake_up(&udl->urbs.sleep); in udl_urb_completion()
154 DRM_DEBUG("Waiting for completes and freeing all render urbs\n"); in udl_free_urb_list()
157 while (udl->urbs.count) { in udl_free_urb_list()
158 spin_lock_irq(&udl->urbs.lock); in udl_free_urb_list()
160 udl->urbs.count--; in udl_free_urb_list()
161 spin_unlock_irq(&udl->urbs.lock); in udl_free_urb_list()
166 usb_free_coherent(urb->dev, udl->urbs.size, in udl_free_urb_list()
172 wake_up_all(&udl->urbs.sleep); in udl_free_urb_list()
184 spin_lock_init(&udl->urbs.lock); in udl_alloc_urb_list()
185 INIT_LIST_HEAD(&udl->urbs.list); in udl_alloc_urb_list()
186 init_waitqueue_head(&udl->urbs.sleep); in udl_alloc_urb_list()
187 udl->urbs.count = 0; in udl_alloc_urb_list()
188 udl->urbs.available = 0; in udl_alloc_urb_list()
191 udl->urbs.size = size; in udl_alloc_urb_list()
193 while (udl->urbs.count * size < wanted_size) { in udl_alloc_urb_list()
224 list_add_tail(&unode->entry, &udl->urbs.list); in udl_alloc_urb_list()
226 udl->urbs.count++; in udl_alloc_urb_list()
227 udl->urbs.available++; in udl_alloc_urb_list()
230 DRM_DEBUG("allocated %d %d byte urbs\n", udl->urbs.count, (int) size); in udl_alloc_urb_list()
232 return udl->urbs.count; in udl_alloc_urb_list()
239 assert_spin_locked(&udl->urbs.lock); in udl_get_urb_locked()
242 if (!wait_event_lock_irq_timeout(udl->urbs.sleep, in udl_get_urb_locked()
243 !udl->urbs.count || in udl_get_urb_locked()
244 !list_empty(&udl->urbs.list), in udl_get_urb_locked()
245 udl->urbs.lock, timeout)) { in udl_get_urb_locked()
247 udl->urbs.available); in udl_get_urb_locked()
251 if (!udl->urbs.count) in udl_get_urb_locked()
254 unode = list_first_entry(&udl->urbs.list, struct urb_node, entry); in udl_get_urb_locked()
256 udl->urbs.available--; in udl_get_urb_locked()
267 spin_lock_irq(&udl->urbs.lock); in udl_get_urb()
269 spin_unlock_irq(&udl->urbs.lock); in udl_get_urb()
278 if (WARN_ON(len > udl->urbs.size)) { in udl_submit_urb()
292 /* wait until all pending URBs have been processed */
297 spin_lock_irq(&udl->urbs.lock); in udl_sync_pending_urbs()
299 if (!wait_event_lock_irq_timeout(udl->urbs.sleep, in udl_sync_pending_urbs()
300 udl->urbs.available == udl->urbs.count, in udl_sync_pending_urbs()
301 udl->urbs.lock, in udl_sync_pending_urbs()
303 drm_err(dev, "Timeout for syncing pending URBs\n"); in udl_sync_pending_urbs()
304 spin_unlock_irq(&udl->urbs.lock); in udl_sync_pending_urbs()
344 if (udl->urbs.count) in udl_init()