Lines Matching refs:mdl
25 void _cx18_mdl_swap(struct cx18_mdl *mdl) in _cx18_mdl_swap() argument
29 list_for_each_entry(buf, &mdl->buf_list, list) { in _cx18_mdl_swap()
43 struct cx18_queue *_cx18_enqueue(struct cx18_stream *s, struct cx18_mdl *mdl, in _cx18_enqueue() argument
48 mdl->bytesused = 0; in _cx18_enqueue()
49 mdl->readpos = 0; in _cx18_enqueue()
50 mdl->m_flags = 0; in _cx18_enqueue()
51 mdl->skipped = 0; in _cx18_enqueue()
52 mdl->curr_buf = NULL; in _cx18_enqueue()
63 list_add(&mdl->list, &q->list); /* LIFO */ in _cx18_enqueue()
65 list_add_tail(&mdl->list, &q->list); /* FIFO */ in _cx18_enqueue()
66 q->bytesused += mdl->bytesused - mdl->readpos; in _cx18_enqueue()
75 struct cx18_mdl *mdl = NULL; in cx18_dequeue() local
79 mdl = list_first_entry(&q->list, struct cx18_mdl, list); in cx18_dequeue()
80 list_del_init(&mdl->list); in cx18_dequeue()
81 q->bytesused -= mdl->bytesused - mdl->readpos; in cx18_dequeue()
82 mdl->skipped = 0; in cx18_dequeue()
86 return mdl; in cx18_dequeue()
90 struct cx18_mdl *mdl) in _cx18_mdl_update_bufs_for_cpu() argument
94 u32 bytesused = mdl->bytesused; in _cx18_mdl_update_bufs_for_cpu()
96 list_for_each_entry(buf, &mdl->buf_list, list) { in _cx18_mdl_update_bufs_for_cpu()
110 struct cx18_mdl *mdl) in cx18_mdl_update_bufs_for_cpu() argument
114 if (list_is_singular(&mdl->buf_list)) { in cx18_mdl_update_bufs_for_cpu()
115 buf = list_first_entry(&mdl->buf_list, struct cx18_buffer, in cx18_mdl_update_bufs_for_cpu()
117 buf->bytesused = mdl->bytesused; in cx18_mdl_update_bufs_for_cpu()
121 _cx18_mdl_update_bufs_for_cpu(s, mdl); in cx18_mdl_update_bufs_for_cpu()
129 struct cx18_mdl *mdl; in cx18_queue_get_mdl() local
141 list_for_each_entry_safe(mdl, tmp, &s->q_busy.list, list) { in cx18_queue_get_mdl()
149 if (mdl->id != id) { in cx18_queue_get_mdl()
150 mdl->skipped++; in cx18_queue_get_mdl()
151 if (mdl->skipped >= atomic_read(&s->q_busy.depth)-1) { in cx18_queue_get_mdl()
154 s->name, mdl->id, in cx18_queue_get_mdl()
155 mdl->skipped); in cx18_queue_get_mdl()
157 list_move_tail(&mdl->list, &sweep_up); in cx18_queue_get_mdl()
166 list_del_init(&mdl->list); in cx18_queue_get_mdl()
168 ret = mdl; in cx18_queue_get_mdl()
187 list_for_each_entry_safe(mdl, tmp, &sweep_up, list) { in cx18_queue_get_mdl()
188 list_del_init(&mdl->list); in cx18_queue_get_mdl()
189 cx18_enqueue(s, mdl, &s->q_free); in cx18_queue_get_mdl()
198 struct cx18_mdl *mdl; in cx18_queue_flush() local
207 mdl = list_first_entry(&q_src->list, struct cx18_mdl, list); in cx18_queue_flush()
208 list_move_tail(&mdl->list, &q_dst->list); in cx18_queue_flush()
209 mdl->bytesused = 0; in cx18_queue_flush()
210 mdl->readpos = 0; in cx18_queue_flush()
211 mdl->m_flags = 0; in cx18_queue_flush()
212 mdl->skipped = 0; in cx18_queue_flush()
213 mdl->curr_buf = NULL; in cx18_queue_flush()
234 struct cx18_mdl *mdl; in cx18_unload_queues() local
244 list_for_each_entry(mdl, &q_idle->list, list) { in cx18_unload_queues()
245 while (!list_empty(&mdl->buf_list)) { in cx18_unload_queues()
246 buf = list_first_entry(&mdl->buf_list, in cx18_unload_queues()
252 mdl->id = s->mdl_base_idx; /* reset id to a "safe" value */ in cx18_unload_queues()
265 struct cx18_mdl *mdl; in cx18_load_queues() local
277 for (mdl = cx18_dequeue(s, &s->q_idle), i = s->bufs_per_mdl; in cx18_load_queues()
278 mdl != NULL && i == s->bufs_per_mdl; in cx18_load_queues()
279 mdl = cx18_dequeue(s, &s->q_idle)) { in cx18_load_queues()
281 mdl->id = mdl_id; in cx18_load_queues()
289 list_move_tail(&buf->list, &mdl->buf_list); in cx18_load_queues()
311 cx18_enqueue(s, mdl, &s->q_free); in cx18_load_queues()
314 cx18_push(s, mdl, &s->q_idle); in cx18_load_queues()
320 void _cx18_mdl_sync_for_device(struct cx18_stream *s, struct cx18_mdl *mdl) in _cx18_mdl_sync_for_device() argument
327 list_for_each_entry(buf, &mdl->buf_list, list) in _cx18_mdl_sync_for_device()
360 struct cx18_mdl *mdl; in cx18_stream_alloc() local
364 mdl = kzalloc(sizeof(struct cx18_mdl), GFP_KERNEL|__GFP_NOWARN); in cx18_stream_alloc()
365 if (mdl == NULL) in cx18_stream_alloc()
371 kfree(mdl); in cx18_stream_alloc()
377 kfree(mdl); in cx18_stream_alloc()
382 INIT_LIST_HEAD(&mdl->list); in cx18_stream_alloc()
383 INIT_LIST_HEAD(&mdl->buf_list); in cx18_stream_alloc()
384 mdl->id = s->mdl_base_idx; /* a somewhat safe value */ in cx18_stream_alloc()
385 cx18_enqueue(s, mdl, &s->q_idle); in cx18_stream_alloc()
404 struct cx18_mdl *mdl; in cx18_stream_free() local
414 while ((mdl = cx18_dequeue(s, &s->q_idle))) in cx18_stream_free()
415 kfree(mdl); in cx18_stream_free()